diff options
Diffstat (limited to 'libexec/rtld-elf/i386/reloc.c')
-rw-r--r-- | libexec/rtld-elf/i386/reloc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index 9efebb3..c9a6e53 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -213,9 +213,11 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, RtldLockState *lockstate) break; case R_386_TLS_TPOFF: + case R_386_TLS_TPOFF32: { const Elf_Sym *def; const Obj_Entry *defobj; + Elf_Addr add; def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, false, cache, lockstate); @@ -237,8 +239,11 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, RtldLockState *lockstate) goto done; } } - - *where += (Elf_Addr) (def->st_value - defobj->tlsoffset); + add = (Elf_Addr) (def->st_value - defobj->tlsoffset); + if (ELF_R_TYPE(rel->r_info) == R_386_TLS_TPOFF) + *where += add; + else + *where -= add; } break; |