This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GAS: changing name of default sections .text/.data/.rodata


  Hi Nick,

 As I said at end of my E-mail, the Linux Makefile is a bit
complex and just has a list of file to compile:

 For instance, part of the Linux patch (WEB link I gave) in
arch/i386/kernel/Makefile:
 obj-y	:= process.o semaphore.o signal.o entry.o traps.o irq.o \
     ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
     pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \
-    quirks.o i8237.o i8253.o tsc.o
+    quirks.o i8237.o i8253.o tsc.o realmode.o

 Sometimes, you also want to compile all the files with the
same compiler options, even if they just share typedef's
and structures (aligment and packed problems).
 Moreover, in this case, the file realmode.o is pre-linked
in "arch/i386/kernel/built-in.o" so the Makefile rule to obtain
realmode.o from realmode.c has to be special involving an added
objcopy, and so another file extension for the intermediate file.
 And the process to obtain built-in.o is common to all
subdirectory so I cannot add a test for just a file.
 It is not possible to refer to this file in the final linker
file with realmode.o(.text) due to the intermediate link which
has compacted all the ".text" together.

 In short (as described around "#define CONST " in the
WEB Linux patch link) it would be a lot easier to change those
default section names - maybe only when ".code16gcc" is used
have the default mapped to ".text16", ".data16", ".rodata16"
and ".bss16"? I also tried macro names beginning with ".",
like ".macro .code ...", and it does not work.

  Cheers,
  Etienne.

--- Nick Clifton <nickc@redhat.com> wrote:
> Hi Etienne,
> 
> >  Is it possible to add a way to tell GAS to change those
> > default section names for current file? Here is my problem:
> 
> Have you considered using objcopy instead ?  You can use the 
> "--rename-section <old>=<new>" switch to rename sections in
> the object file generated by GAS...
> 
> Cheers
>    Nick
> 



	

	
		
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]