This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Strange additional data in text section of arm-coff object files
- To: "David Lin" <graylag at iii dot org dot tw>
- Subject: Re: Strange additional data in text section of arm-coff object files
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- Date: 29 May 2001 10:14:15 +0100
- Cc: <binutils at sources dot redhat dot com>
- References: <002501c0e7e0$260f4780$7f0c5c8c@trd.iii.org.tw>
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