summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2011-03-06 15:20:11 +0000
committermarius <marius@FreeBSD.org>2011-03-06 15:20:11 +0000
commit2830ede5b875db3f539d9e9aa68e8dd1a0538626 (patch)
tree5ae03a572be72e3fd0d851acb0f567c8119d6b93 /libexec
parent3e53ebd5768237e6c9c0763894f1dc7a4ee78ef5 (diff)
downloadFreeBSD-src-2830ede5b875db3f539d9e9aa68e8dd1a0538626.zip
FreeBSD-src-2830ede5b875db3f539d9e9aa68e8dd1a0538626.tar.gz
- With the addition of TLS support binutils started to make the addend
values for resolved symbols relative to relocbase instead of sections so detect this case and handle as appropriate, which allows using kernel modules linked with affected versions of binutils. Actually I think this is a bug in binutils but given that apparently nobody complained for nearly six years and powerpc has basically the same workaround I decided to put it in for the sparc64 kernel, too. - Fix R_SPARC_HIX22 relocations. Apparently these are hardly ever used.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/sparc64/reloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libexec/rtld-elf/sparc64/reloc.c b/libexec/rtld-elf/sparc64/reloc.c
index 6249fb0..b58e3e5 100644
--- a/libexec/rtld-elf/sparc64/reloc.c
+++ b/libexec/rtld-elf/sparc64/reloc.c
@@ -355,6 +355,9 @@ reloc_nonplt_object(Obj_Entry *obj, const Elf_Rela *rela, SymCache *cache,
if (type == R_SPARC_OLO10)
value = (value & 0x3ff) + ELF64_R_TYPE_DATA(rela->r_info);
+ if (type == R_SPARC_HIX22)
+ value ^= 0xffffffffffffffff;
+
if (RELOC_PC_RELATIVE(type))
value -= (Elf_Addr)where;
OpenPOWER on IntegriCloud