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(a)gmail.com>
---
ldso/ldso/xtensa/elfinterp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ldso/ldso/xtensa/elfinterp.c b/ldso/ldso/xtensa/elfinterp.c
index 4c83ab65e668..e38a02666477 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
--
2.1.4