diff options
author | Rich Felker <dalias@aerifal.cx> | 2014-06-17 14:32:43 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2014-07-28 00:27:58 -0400 |
commit | f70401eae5c5ca3db2fbf8c7bf758eca40ab5bc3 (patch) | |
tree | 88f5247f2592cca83794fd0b0cf6f9a943b62a9c | |
parent | af9e1752cd77179353249ec7aeac8bafd979efce (diff) | |
download | musl-f70401eae5c5ca3db2fbf8c7bf758eca40ab5bc3.tar.gz musl-f70401eae5c5ca3db2fbf8c7bf758eca40ab5bc3.tar.bz2 musl-f70401eae5c5ca3db2fbf8c7bf758eca40ab5bc3.tar.xz musl-f70401eae5c5ca3db2fbf8c7bf758eca40ab5bc3.zip |
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.
(cherry picked from commit 94cf991bf4b18bb87a15a96e7b5e7d92fab787ba)
-rw-r--r-- | arch/powerpc/reloc.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/reloc.h b/arch/powerpc/reloc.h index 38034c56..6b98a7ca 100644 --- a/arch/powerpc/reloc.h +++ b/arch/powerpc/reloc.h @@ -32,9 +32,9 @@ static inline void 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; } } |