This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
ia64 kernel __gp location problem w/ 2.14.90.0.4
- From: Greg Edwards <edwardsg at sgi dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 20 Jan 2004 13:11:34 -0600
- Subject: ia64 kernel __gp location problem w/ 2.14.90.0.4
Hi all,
For recent 2.4.x kernels, the arch/ia64/vmlinux.lds.S looks like:
.data : AT(ADDR(.data) - PAGE_OFFSET)
{ *(.data) *(.gnu.linkonce.d*) CONSTRUCTORS }
. = ALIGN(16);
__gp = . + 0x200000; /* gp must be 16-byte aligned for exc. table */
.got : AT(ADDR(.got) - PAGE_OFFSET)
{ *(.got.plt) *(.got) }
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata : AT(ADDR(.sdata) - PAGE_OFFSET)
{ *(.sdata) }
_edata = .;
_bss = .;
.sbss : AT(ADDR(.sbss) - PAGE_OFFSET)
{ *(.sbss) *(.scommon) }
With binutils-2.11.90.0.8 this results in __gp being at .got + 0x200000.
With a kernel compiled with gcc-3.2.3 and linked with
binutils-2.14.90.0.4, __gp looks like it's located at .data + 0x200000:
# fgrep __gp System.map
e000000005087180 A __gp
# objdump -h vmlinux | fgrep -B2 -A7 .got
18 .data 000b4360 e000000004e87180 0000000004e87180 00a97180 2**7
CONTENTS, ALLOC, LOAD, DATA
19 .got 00015e00 e000000004f3b4e0 0000000004f3b4e0 00b4b4e0 2**3
CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA
20 .sdata 00000d74 e000000004f512e0 0000000004f512e0 00b612e0 2**3
CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA
21 .sbss 000012b8 e000000004f52058 0000000004f52058 00b62058 2**3
ALLOC, SMALL_DATA
22 .bss 00887110 e000000004f53400 0000000004f53400 00b62148 2**9
ALLOC
This has caused problems during the final link stage when there are large
structures in .data, resulting in __gp not covering all of the short data
section. Does this look like a bug with the linker?
Greg