]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - elf/dl-tls.c
Remove _dl_initial_dtv
[thirdparty/glibc.git] / elf / dl-tls.c
index ff59e9e7733e94d26cb884980a5277d657a4e1d9..9d896b7bdd891dd6db2102b9055b9037244874f3 100644 (file)
@@ -464,6 +464,13 @@ _dl_allocate_tls (void *mem)
 rtld_hidden_def (_dl_allocate_tls)
 
 
+#ifndef SHARED
+extern dtv_t _dl_static_dtv[];
+# define DL_INITIAL_DTV        (&_dl_static_dtv[1])
+#else
+# define DL_INITIAL_DTV        GL(dl_initial_dtv)
+#endif
+
 void
 internal_function
 _dl_deallocate_tls (void *tcb, bool dealloc_tcb)
@@ -477,7 +484,7 @@ _dl_deallocate_tls (void *tcb, bool dealloc_tcb)
       free (dtv[1 + cnt].pointer.val);
 
   /* The array starts with dtv[-1].  */
-  if (dtv != GL(dl_initial_dtv))
+  if (dtv != DL_INITIAL_DTV)
     free (dtv - 1);
 
   if (dealloc_tcb)