summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/generic/libc-tls.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl/sysdeps/generic/libc-tls.c')
-rw-r--r--libpthread/nptl/sysdeps/generic/libc-tls.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpthread/nptl/sysdeps/generic/libc-tls.c b/libpthread/nptl/sysdeps/generic/libc-tls.c
index d746c9a38..0c8c558d0 100644
--- a/libpthread/nptl/sysdeps/generic/libc-tls.c
+++ b/libpthread/nptl/sysdeps/generic/libc-tls.c
@@ -142,6 +142,10 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
initimage = (void *) &__tdata_start;
#else
initimage = (void *) phdr->p_vaddr;
+#if !defined(SHARED) && defined(STATIC_PIE)
+ extern ElfW(Addr) _dl_load_base;
+ initimage += _dl_load_base;
+#endif
#endif
align = phdr->p_align;
if (phdr->p_align > max_align)