summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/rtld.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/rtld-elf/rtld.c')
-rw-r--r--libexec/rtld-elf/rtld.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index c4607b2..828b8b4 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -2618,6 +2618,7 @@ do_dlsym(void *handle, const char *name, void *retaddr, const Ver_Entry *ve,
const Elf_Sym *def;
SymLook req;
RtldLockState lockstate;
+ tls_index ti;
int res;
def = NULL;
@@ -2732,7 +2733,11 @@ do_dlsym(void *handle, const char *name, void *retaddr, const Ver_Entry *ve,
return (make_function_pointer(def, defobj));
else if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC)
return (rtld_resolve_ifunc(defobj, def));
- else
+ else if (ELF_ST_TYPE(def->st_info) == STT_TLS) {
+ ti.ti_module = defobj->tlsindex;
+ ti.ti_offset = def->st_value;
+ return (__tls_get_addr(&ti));
+ } else
return (defobj->relocbase + def->st_value);
}
OpenPOWER on IntegriCloud