1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

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
This commit is contained in:
Alexandre Oliva
2017-02-03 20:35:16 -05:00
committed by Carlos O'Donell
parent 33d7e138ca
commit d675eaf7d9
3 changed files with 9 additions and 11 deletions

View File

@ -1191,11 +1191,6 @@ init_one_static_tls (struct pthread *curp, 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 = GET_DTV (TLS_TPADJ (curp));
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);