diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-05-10 10:31:41 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-05-10 10:31:41 +0200 |
commit | d6163dfd3831cf48b69f430f37b4c099059a9db5 (patch) | |
tree | fb37627d311887c530307ea5325121f6a4732cc2 /nptl | |
parent | a64af8c9b6598f6d2685227f64f5ccb9b48c663c (diff) | |
download | glibc-d6163dfd3831cf48b69f430f37b4c099059a9db5.tar.gz glibc-d6163dfd3831cf48b69f430f37b4c099059a9db5.tar.xz glibc-d6163dfd3831cf48b69f430f37b4c099059a9db5.zip |
elf, nptl: Resolve recursive lock implementation early
If libpthread is included in libc, it is not necessary to delay initialization of the lock/unlock function pointers until libpthread is loaded. This eliminates two unprotected function pointers from _rtld_global and removes some initialization code from libpthread. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/nptl-init.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c index fcab5a0904..2724770533 100644 --- a/nptl/nptl-init.c +++ b/nptl/nptl-init.c @@ -179,15 +179,6 @@ __pthread_initialize_minimal_internal (void) lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE); #ifdef SHARED - /* Make __rtld_lock_{,un}lock_recursive use pthread_mutex_{,un}lock, - keep the lock count from the ld.so implementation. */ - GL(dl_rtld_lock_recursive) = (void *) __pthread_mutex_lock; - GL(dl_rtld_unlock_recursive) = (void *) __pthread_mutex_unlock; - unsigned int rtld_lock_count = GL(dl_load_lock).mutex.__data.__count; - GL(dl_load_lock).mutex.__data.__count = 0; - while (rtld_lock_count-- > 0) - __pthread_mutex_lock (&GL(dl_load_lock).mutex); - GL(dl_make_stack_executable_hook) = &__make_stacks_executable; #endif |