diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-04-21 19:49:51 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-04-21 19:49:51 +0200 |
commit | 442e8a40da9dfa24aeebf4f1a163f0a58b12cf7e (patch) | |
tree | 4f425bffad25e4232f2ad8b22bc0835a1d5d7a69 /nptl/pthreadP.h | |
parent | 90d7e7e5bd3b0683a27c658388b6515ce950c78e (diff) | |
download | glibc-442e8a40da9dfa24aeebf4f1a163f0a58b12cf7e.tar.gz glibc-442e8a40da9dfa24aeebf4f1a163f0a58b12cf7e.tar.xz glibc-442e8a40da9dfa24aeebf4f1a163f0a58b12cf7e.zip |
nptl: Move part of TCB initialization from libpthread to __tls_init_tp
This initalization should only happen once for the main thread's TCB. At present, auditors can achieve this by not linking against libpthread. If libpthread becomes part of libc, doing this initialization in libc would happen for every audit namespace, or too late (if it happens from the main libc only). That's why moving this code into ld.so seems the right thing to do, right after the TCB initialization. For !__ASSUME_SET_ROBUST_LIST ports, this also moves the symbol __set_robust_list_avail into ld.so, as __nptl_set_robust_list_avail. It also turned into a proper boolean flag. Inline the __pthread_initialize_pids function because it seems no longer useful as a separate function. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl/pthreadP.h')
-rw-r--r-- | nptl/pthreadP.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 7a3906e2de..b61fda8942 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -224,8 +224,10 @@ extern unsigned int __nptl_nthreads; libc_hidden_proto (__nptl_nthreads) #ifndef __ASSUME_SET_ROBUST_LIST -/* Negative if we do not have the system call and we can use it. */ -extern int __set_robust_list_avail attribute_hidden; +/* True if the set_robust_list system call works. Initialized in + __tls_init_tp. */ +extern bool __nptl_set_robust_list_avail; +rtld_hidden_proto (__nptl_set_robust_list_avail) #endif /* Thread Priority Protection. */ |