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 | 9d124d81f09d2097bfde444b2a6228a725a00efd (patch) | |
tree | 6fce1246c4242f911826f81ba827f29374b70031 /sysdeps | |
parent | d017b0ab5a181dce4145f3a1b3b27e3341abd201 (diff) | |
download | glibc-9d124d81f09d2097bfde444b2a6228a725a00efd.tar glibc-9d124d81f09d2097bfde444b2a6228a725a00efd.tar.gz glibc-9d124d81f09d2097bfde444b2a6228a725a00efd.tar.bz2 glibc-9d124d81f09d2097bfde444b2a6228a725a00efd.zip |
nptl: Move more stack management variables into _rtld_global
Permissions of the cached stacks may have to be updated if an object
is loaded that requires executable stacks, so the dynamic loader
needs to know about these cached stacks.
The move of in_flight_stack and stack_cache_actsize is a requirement for
merging __reclaim_stacks into the fork implementation in libc.
Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/ldsodefs.h | 11 | ||||
-rw-r--r-- | sysdeps/nptl/dl-tls_init_tp.c | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index ee851ac789..81cce2e4d5 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -481,6 +481,17 @@ struct rtld_global /* List of thread stacks that were allocated by the application. */ EXTERN list_t _dl_stack_user; + /* List of queued thread stacks. */ + EXTERN list_t _dl_stack_cache; + + /* Total size of all stacks in the cache (sum over stackblock_size). */ + EXTERN size_t _dl_stack_cache_actsize; + + /* We need to record what list operations we are going to do so + that, in case of an asynchronous interruption due to a fork() + call, we can correct for the work. */ + EXTERN uintptr_t _dl_in_flight_stack; + /* Mutex protecting the stack lists. */ EXTERN int _dl_stack_cache_lock; #else diff --git a/sysdeps/nptl/dl-tls_init_tp.c b/sysdeps/nptl/dl-tls_init_tp.c index cb29222727..f1aaa5aa9d 100644 --- a/sysdeps/nptl/dl-tls_init_tp.c +++ b/sysdeps/nptl/dl-tls_init_tp.c @@ -43,6 +43,7 @@ __tls_pre_init_tp (void) initialized. */ INIT_LIST_HEAD (&GL (dl_stack_used)); INIT_LIST_HEAD (&GL (dl_stack_user)); + INIT_LIST_HEAD (&GL (dl_stack_cache)); #ifdef SHARED ___rtld_mutex_lock = rtld_mutex_dummy; |