public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2.6.6] Workaround linker bug
@ 2004-05-27  5:39 Keith Owens
  2004-05-27  7:08 ` H. J. Lu
  2004-06-05  4:18 ` David Mosberger
  0 siblings, 2 replies; 3+ messages in thread
From: Keith Owens @ 2004-05-27  5:39 UTC (permalink / raw)
  To: linux-ia64

Building 2.6.6-ia64-040521, using GNU ld version 2.14.90.0.4 20030523.
__gp is sometimes set incorrectly.  Instead of being .got + 0x2000000,
it is set to .data + 0x2000000, which breaks some LTOFF22 and GPREL22
entries.

This is non-deterministic, changing the path name to the kernel tree
which changes the size of some messages in .data is enough to make the
linker get it right.  Force __gp to be based on .got.

Index: linux/arch/ia64/kernel/vmlinux.lds.S
=================================--- linux.orig/arch/ia64/kernel/vmlinux.lds.S	Thu May 27 15:08:02 2004
+++ linux/arch/ia64/kernel/vmlinux.lds.S	Thu May 27 15:16:11 2004
@@ -202,11 +202,10 @@ SECTIONS
   .data : AT(ADDR(.data) - LOAD_OFFSET)
 	{ *(.data) *(.data1) *(.gnu.linkonce.d*) CONSTRUCTORS }
 
-  . = ALIGN(16);
-  __gp = . + 0x200000;	/* gp must be 16-byte aligned for exc. table */
-
+  . = ALIGN(16);	/* gp must be 16-byte aligned for exc. table */
   .got : AT(ADDR(.got) - LOAD_OFFSET)
 	{ *(.got.plt) *(.got) }
+  __gp = ADDR(.got) + 0x200000;
   /* 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.  */


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-06-05  4:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-27  5:39 [patch 2.6.6] Workaround linker bug Keith Owens
2004-05-27  7:08 ` H. J. Lu
2004-06-05  4:18 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox