From: Rich Felker Date: Tue, 17 Jun 2014 18:32:43 +0000 (-0400) Subject: fix powerpc dynamic linker thread-pointer-relative relocations X-Git-Tag: v1.1.3~26 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=94cf991bf4b18bb87a15a96e7b5e7d92fab787ba;p=oweals%2Fmusl.git fix powerpc dynamic linker thread-pointer-relative relocations processing of R_PPC_TPREL32 was ignoring the addend provided by the RELA-style relocation and instead using the inline value as the addend. this presumably broke dynamic-linked access to initial TLS in cases where the addend was nonzero. --- diff --git a/arch/powerpc/reloc.h b/arch/powerpc/reloc.h index d5ba74a7..1563450d 100644 --- a/arch/powerpc/reloc.h +++ b/arch/powerpc/reloc.h @@ -32,9 +32,9 @@ static inline int do_single_reloc( *reloc_addr = def.sym->st_value + addend; break; case R_PPC_TPREL32: - *reloc_addr += def.sym - ? def.sym->st_value + def.dso->tls_offset - 0x7000 - : self->tls_offset - 0x7000; + *reloc_addr = (def.sym + ? def.sym->st_value + def.dso->tls_offset + : self->tls_offset) - 0x7000 + addend; break; } return 0;