diff options
author | marcel <marcel@FreeBSD.org> | 2004-06-20 22:32:19 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2004-06-20 22:32:19 +0000 |
commit | d7e5b117c40a64820465a4c4cfc34ba57fbf955f (patch) | |
tree | 6c0e13747deb38610eb40059e7874e7af554cc89 /sys/conf | |
parent | 26d7dd0b9aa02d3be9a728188219fea6344781ac (diff) | |
download | FreeBSD-src-d7e5b117c40a64820465a4c4cfc34ba57fbf955f.zip FreeBSD-src-d7e5b117c40a64820465a4c4cfc34ba57fbf955f.tar.gz |
Fix the following error:
ld: locore.o: non-pic code with imm relocation against dynamic
symbol `__gp'
With binutils 2.15, ld(1) defines the implicit/automatic symbol __gp
as a dynamic symbol and thus will now complain when used in a non-PIC
fashion (the immediate relocation used to set the GP register). Resolve
this by defining __gp in the linker script. Make sure __gp is aligned
on a 16-byte boundary.
Note: the 0x200000 magic offset is due to having a 22-bit GP-relative
relocation. The GOT will be accessed with negative offsets from GP.
Diffstat (limited to 'sys/conf')
-rw-r--r-- | sys/conf/ldscript.ia64 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/conf/ldscript.ia64 b/sys/conf/ldscript.ia64 index a06798b..cc78ee1 100644 --- a/sys/conf/ldscript.ia64 +++ b/sys/conf/ldscript.ia64 @@ -74,6 +74,8 @@ SECTIONS *(.dtors) *(SORT(.dtors.*)) } + . = ALIGN(16); + __gp = . + 0x200000; .got : { *(.got.plt) *(.got) } .IA_64.pltoff : { *(.IA_64.pltoff) } /* We want the small data sections together, so single-instruction offsets |