about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-09-06 16:03:32 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-09-06 16:03:32 -0700
commitb80af2f40631871cf53a5e39d08d5d5516473b96 (patch)
treea008a72697dfb8ee9aa3daae03c97fe326bb8067 /elf
parent2abe9f1507f971d1513a2d75a865ec4615d2d6b8 (diff)
downloadglibc-b80af2f40631871cf53a5e39d08d5d5516473b96.tar.gz
glibc-b80af2f40631871cf53a5e39d08d5d5516473b96.tar.xz
glibc-b80af2f40631871cf53a5e39d08d5d5516473b96.zip
Remove _dl_initial_dtv
	* csu/libc-tls.c (static_dtv): Renamed to ...
	(_dl_static_dtv): This.  Make it global.
	(_dl_initial_dtv): Removed.
	(__libc_setup_tls): Updated.
	* elf/dl-tls.c (DL_INITIAL_DTV): New macro.
	(_dl_deallocate_tls): Replace GL(dl_initial_dtv) with
	DL_INITIAL_DTV.
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-tls.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index ff59e9e773..9d896b7bdd 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -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)