From be007cb78b1c10c4803fbf1e4f09d0633aceb8f7 Mon Sep 17 00:00:00 2001 From: mmel Date: Sun, 2 Dec 2018 07:45:22 +0000 Subject: [PATCH] MFC r338317: Fix wrong offset calculation for R_ARM_TLS_TPOFF32 relocations. TLS_TCB_SIZE is already accounted in defobj-> tlsoffset so all these symbols were incorrectly relocated by +8. --- libexec/rtld-elf/arm/reloc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c index c34c9538a0f..ceb5a8c8c3f 100644 --- a/libexec/rtld-elf/arm/reloc.c +++ b/libexec/rtld-elf/arm/reloc.c @@ -327,9 +327,7 @@ reloc_nonplt_object(Obj_Entry *obj, const Elf_Rel *rel, SymCache *cache, if (!defobj->tls_done && allocate_tls_offset(obj)) return -1; - /* XXX: FIXME */ - tmp = (Elf_Addr)def->st_value + defobj->tlsoffset + - TLS_TCB_SIZE; + tmp = (Elf_Addr)def->st_value + defobj->tlsoffset; if (__predict_true(RELOC_ALIGNED_P(where))) *where = tmp; else -- 2.45.0