From 1daccf403b1bd86370eb94edca794dc106d02039 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 16 Nov 2020 19:33:30 +0100 Subject: nptl: Move stack list variables into _rtld_global Now __thread_gscope_wait (the function behind THREAD_GSCOPE_WAIT, formerly __wait_lookup_done) can be implemented directly in ld.so, eliminating the unprotected GL (dl_wait_lookup_done) function pointer. Reviewed-by: Adhemerval Zanella --- csu/libc-tls.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'csu') diff --git a/csu/libc-tls.c b/csu/libc-tls.c index 06e76bd395..c3589f0a7d 100644 --- a/csu/libc-tls.c +++ b/csu/libc-tls.c @@ -24,6 +24,7 @@ #include #include #include +#include #ifdef SHARED #error makefile bug, this file is for static only @@ -193,6 +194,12 @@ __libc_setup_tls (void) if (__builtin_expect (lossage != NULL, 0)) _startup_fatal (lossage); +#if THREAD_GSCOPE_IN_TCB + INIT_LIST_HEAD (&_dl_stack_used); + INIT_LIST_HEAD (&_dl_stack_user); + list_add (&THREAD_SELF->list, &_dl_stack_user); +#endif + /* Update the executable's link map with enough information to make the TLS routines happy. */ main_map->l_tls_align = align; -- cgit 1.4.1