aboutsummaryrefslogtreecommitdiff
path: root/csu
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-04-21 19:49:51 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-04-21 19:49:51 +0200
commit90d7e7e5bd3b0683a27c658388b6515ce950c78e (patch)
treee0de4856de1b728a33cd778d1b05a3a169953cd7 /csu
parent90e97b37201c9b33ee79296b6eb034d5d5db925c (diff)
downloadglibc-90d7e7e5bd3b0683a27c658388b6515ce950c78e.zip
glibc-90d7e7e5bd3b0683a27c658388b6515ce950c78e.tar.gz
glibc-90d7e7e5bd3b0683a27c658388b6515ce950c78e.tar.bz2
elf: Introduce __tls_init_tp for second-phase TCB initialization
TLS_INIT_TP is processor-specific, so it is not a good place to put thread library initialization code (it would have to be repeated for all CPUs). Introduce __tls_init_tp as a separate function, to be called immediately after TLS_INIT_TP. Move the existing stack list setup code for NPTL to this function. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'csu')
-rw-r--r--csu/libc-tls.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/csu/libc-tls.c b/csu/libc-tls.c
index f3a6a6a..22f8e48 100644
--- a/csu/libc-tls.c
+++ b/csu/libc-tls.c
@@ -24,7 +24,6 @@
#include <stdio.h>
#include <sys/param.h>
#include <array_length.h>
-#include <list.h>
#ifdef SHARED
#error makefile bug, this file is for static only
@@ -193,12 +192,7 @@ __libc_setup_tls (void)
#endif
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
+ __tls_init_tp ();
/* Update the executable's link map with enough information to make
the TLS routines happy. */