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


Hi David,

> 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"

The answer becomes obvious once you use disassemble the two text
sections.  In the fully linked executable you will find this at the
end of the .text section:

  00008028 <__CTOR_LIST__>:
    8028:	ffffffff 	swinv	0x00ffffff
    802c:	00000000 	andeq	r0, r0, r0

  00008030 <__DTOR_LIST__>:
    8030:	ffffffff 	swinv	0x00ffffff
    8034:	00000000 	andeq	r0, r0, r0

These words are inserted by the linker script.  (Run ld --verbose to
see the default script that the linker will use).  If this is a
problem for you, you can create your own linker script that does not
add these words.  (Always assuming that you Ir not using any C++ in
your program, since these words are used to build the static
constructor and destructor lists).

Cheers
        Nick


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