diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-05-05 06:20:31 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-05-05 06:20:31 +0200 |
commit | 7cbf1c8416b04c65dc3d253061d8a674ee3c616e (patch) | |
tree | e931adb0174f9f4ce64f4dfa97c6fcd489f0fc12 /elf/rtld.c | |
parent | 2c71177309cc59788c2288c6033c9dbbd23f02c3 (diff) | |
download | glibc-7cbf1c8416b04c65dc3d253061d8a674ee3c616e.tar.gz |
elf, nptl: Initialize static TLS directly in ld.so
The stack list is available in ld.so since commit
1daccf403b1bd86370eb94edca794dc106d02039 ("nptl: Move stack list
variables into _rtld_global"), so it's possible to walk the stack
list directly in ld.so and perform the initialization there.
This eliminates an unprotected function pointer from _rtld_global
and reduces the libpthread initialization code.
Diffstat (limited to 'elf/rtld.c')
-rw-r--r-- | elf/rtld.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/elf/rtld.c b/elf/rtld.c index 34879016ad..ad325d4c10 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -1139,7 +1139,9 @@ dl_main (const ElfW(Phdr) *phdr, struct dl_main_state state; dl_main_state_init (&state); +#if !THREAD_GSCOPE_IN_TCB GL(dl_init_static_tls) = &_dl_nothread_init_static_tls; +#endif #if defined SHARED && defined _LIBC_REENTRANT \ && defined __rtld_lock_default_lock_recursive |