summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/generic/dl-tls.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl/sysdeps/generic/dl-tls.c')
-rw-r--r--libpthread/nptl/sysdeps/generic/dl-tls.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpthread/nptl/sysdeps/generic/dl-tls.c b/libpthread/nptl/sysdeps/generic/dl-tls.c
index 989e587a2..7d25e4706 100644
--- a/libpthread/nptl/sysdeps/generic/dl-tls.c
+++ b/libpthread/nptl/sysdeps/generic/dl-tls.c
@@ -48,6 +48,9 @@
/* Value used for dtv entries for which the allocation is delayed. */
# define TLS_DTV_UNALLOCATED ((void *) -1l)
+#ifndef SHARED
+extern dtv_t static_dtv;
+#endif
/* Out-of-memory handler. */
# ifdef SHARED
@@ -584,6 +587,8 @@ _dl_deallocate_tls (void *tcb, bool dealloc_tcb)
/* The array starts with dtv[-1]. */
#ifdef SHARED
if (dtv != GL(dl_initial_dtv))
+#else
+ if ((dtv - 1) != &static_dtv)
#endif
free (dtv - 1);