This is the mail archive of the binutils@sources.redhat.com 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]

Re: Strange additional data in text section of arm-coff object files


David Lin wrote:

> Hi, everybody
> 
> There is something strange about the COFF file generated by arm-coff tools
> 
> I built an environment for building COFF files on target machine with
> ARM processor
> 
> As the manual of ld descriped, executable object codes could be generated
> 
> and relocatable object files could also be created with additional
> flag '-r'
> 
> for example:
> 
> arm-coff-gcc -c init.c
> 
> arm-coff-gcc -c hello.c
> 
> arm-coff-ld -e _hello -o hello_cof.o hello.o init.o
> 
> arm-coff-ld -r -e _hello -o hello_rel.o hello.o init.o
> 
> By observing the executable COFF file hello_cof.o and relocatable file
> hello_rel.o,
> 
> there is surely something different
> 
> Concerning the text section only,
> 
> I found size of text in hello_cof.o is 16-byte more than size in
> hello_rel.o
> 
> content of these 16 bytes of data is "FFFFFFFF 00000000 FFFFFFFF 00000000"
> 
> On the experience of prevous work, it is similiar to the m68k case,
> the cross-platform tools for Motorola 68k processors
> 
> size of text section in executable object files is also 16 byte more
> than in relocatable ones
> 
> content of these 16 bytes of data, however, is "00000000 00000000
> 00000000 00000000"
> 
> does this circumstance imply something?
> 
> I am interested in it :)
> 
It's the constructor/destructor lists. For arm-coff they start
with -1 and end with 0, so both lists are empty. For the m68k the
tables start with the number of entries and are terminated by 0.

Relocateable links do not generate constructor tables, but you
can force it with the -Ur linker option.

Regards,
Anders


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