summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpthread/nptl/sysdeps/generic/dl-tls.c5
-rw-r--r--libpthread/nptl/sysdeps/generic/libc-tls.c5
2 files changed, 9 insertions, 1 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);
diff --git a/libpthread/nptl/sysdeps/generic/libc-tls.c b/libpthread/nptl/sysdeps/generic/libc-tls.c
index a6df4cdc4..d746c9a38 100644
--- a/libpthread/nptl/sysdeps/generic/libc-tls.c
+++ b/libpthread/nptl/sysdeps/generic/libc-tls.c
@@ -42,7 +42,10 @@ extern size_t _dl_phnum;
extern int __tdata_start;
#endif
-static dtv_t static_dtv[2 + TLS_SLOTINFO_SURPLUS];
+#ifdef SHARED
+static
+#endif
+dtv_t static_dtv[2 + TLS_SLOTINFO_SURPLUS];
static struct