summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2018-01-17 13:52:54 (GMT)
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2018-01-21 11:48:00 (GMT)
commita9a752b0cede664f641502c2ab87a6735fe8d889 (patch)
treed7f768bf1230a907d04c8ba5fa7a18612895e4de
parent4020e24ba18e66eb8a29a0cf81d599104dfd7aa2 (diff)
xtensa: fix R_XTENSA_TLSDESC_ARG handling in _dl_do_reloc
R_XTENSA_TLSDESC_ARG is a true RELA relocation, the addend is in the relocation record itself, not in place. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
-rw-r--r--ldso/ldso/xtensa/elfinterp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ldso/ldso/xtensa/elfinterp.c b/ldso/ldso/xtensa/elfinterp.c
index 4c83ab6..e38a026 100644
--- a/ldso/ldso/xtensa/elfinterp.c
+++ b/ldso/ldso/xtensa/elfinterp.c
@@ -244,10 +244,11 @@ _dl_do_reloc (struct elf_resolve *tpnt, struct r_scope_elem *scope,
if (!TRY_STATIC_TLS ((struct link_map *) tls_tpnt))
*reloc_addr = (ElfW(Addr))
_dl_make_tlsdesc_dynamic((struct link_map *) tls_tpnt,
- symbol_addr + *reloc_addr);
+ symbol_addr + rpnt->r_addend);
else
#endif
- *reloc_addr += symbol_addr + tls_tpnt->l_tls_offset;
+ *reloc_addr = symbol_addr + rpnt->r_addend +
+ tls_tpnt->l_tls_offset;
break;
#endif