about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2017-02-03 20:35:16 -0500
committerCarlos O'Donell <carlos@systemhalted.org>2017-02-03 21:34:14 -0500
commitd675eaf7d99096a952c1d140abfed82c939fb259 (patch)
treeaa4d46c8e5d704b3a8dfa8b38765e2710adccff2 /elf
parent33d7e138ca63b4091bba840c609a95cdcc56c10e (diff)
downloadglibc-d675eaf7d99096a952c1d140abfed82c939fb259.tar.gz
glibc-d675eaf7d99096a952c1d140abfed82c939fb259.tar.xz
glibc-d675eaf7d99096a952c1d140abfed82c939fb259.zip
Bug 20915: Do not initialize DTV of other threads.
In _dl_nothread_init_static_tls() and init_one_static_tls() we must not
touch the DTV of other threads since we do not have ownership of them.
The DTV need not be initialized at this point anyway since only LD/GD
accesses will use them. If LD/GD accesses occur they will take care to
initialize their own thread's DTV.

Concurrency comments were removed from the patch since they need to be
reworked along with a full description of DTV ownership and when it is
or is not safe to modify these structures.

Alexandre Oliva's original patch and discussion:
https://sourceware.org/ml/libc-alpha/2016-09/msg00512.html
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-reloc.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 52311f0278..4ac558df52 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -137,12 +137,6 @@ _dl_nothread_init_static_tls (struct link_map *map)
 # error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
 #endif
 
-  /* Fill in the DTV slot so that a later LD/GD access will find it.  */
-  dtv_t *dtv = THREAD_DTV ();
-  assert (map->l_tls_modid <= dtv[-1].counter);
-  dtv[map->l_tls_modid].pointer.to_free = NULL;
-  dtv[map->l_tls_modid].pointer.val = dest;
-
   /* Initialize the memory.  */
   memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),
 	  '\0', map->l_tls_blocksize - map->l_tls_initimage_size);