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]
Other format: [Raw text]

LD script bug


Hi,

On executing:
gcc -Xlinker reorder.lds -Xlinker -M --verbose k.o t.o -o reordered

The system is an Intel P-IV. 
ld version: 2.13.90.0.18 20030206 on a vanilla RH 9 system. 
gcc version: 3.2.2 20030222 (Red Hat Linux 3.2.2-5). No patches.

I am getting this weird behaviour(relevant excerpt from the
linker map):
 0x08048527                value = ((. + 0x20) - 0x1)
 0x08048518                . = (value & 0xffffffe0)
 *fill*         0x08048508       0x10 00
 				^^^^^^
Fill value should be 0x18 or I am going crazy. Please tell 
me which :). Or if there is any sane reason then please
correct me. 

The above excerpt in context from the linker map:

>>>
 0x08048480                __libc_csu_init
 .text          0x080484e4       0x24 /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/crtend.o
 *(.gnu.warning)
 0x08048527                value = ((. + 0x20) - 0x1)
 0x08048518                . = (value & 0xffffffe0)
 *fill*         0x08048508       0x10 00
 *.o(.text.pmain)
 *.o(.text.s)
 0x08048537                value = ((. + 0x20) - 0x1)
 0x08048518                . = (value & 0xffffffe0)
 *.o(.text.t)
 *.o(.text.v)
<<<

The linker script is:

>>>
SECTIONS {
 .text : {
/*  . = (. + 32 - 1) & ~(32 - 1);*/
/*  . = . + 0x100;*/
 value = (. + 32 - 1);
 . = (value & ~(32-1));
 *.o(.text.pmain)
 *.o(.text.s)
 value = (. + 32 - 1);
 . = (value & ~(32-1));
 *.o(.text.t)
 *.o(.text.v)
 *.o(.text.u)
 }
}
<<<

In case any more information is required I will be happy
to provide it.

Thanks,
ankur

-- 


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