Revision | a9a752b0cede664f641502c2ab87a6735fe8d889 (tree) |
---|---|
Time | 2018-01-21 20:48:00 |
Author | Max Filippov <jcmvbkbc@gmai...> |
Commiter | Waldemar Brodkorb |
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>
@@ -244,10 +244,11 @@ _dl_do_reloc (struct elf_resolve *tpnt, struct r_scope_elem *scope, | ||
244 | 244 | if (!TRY_STATIC_TLS ((struct link_map *) tls_tpnt)) |
245 | 245 | *reloc_addr = (ElfW(Addr)) |
246 | 246 | _dl_make_tlsdesc_dynamic((struct link_map *) tls_tpnt, |
247 | - symbol_addr + *reloc_addr); | |
247 | + symbol_addr + rpnt->r_addend); | |
248 | 248 | else |
249 | 249 | #endif |
250 | - *reloc_addr += symbol_addr + tls_tpnt->l_tls_offset; | |
250 | + *reloc_addr = symbol_addr + rpnt->r_addend + | |
251 | + tls_tpnt->l_tls_offset; | |
251 | 252 | break; |
252 | 253 | #endif |
253 | 254 |