From a78e5979a92c7985eadad7246740f3874271303f Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 17 May 2021 09:59:14 +0200 Subject: nptl: Move __nptl_initial_report_events into ld.so/startup code The initialization of the report_events TCB field is now performed in __tls_init_tp instead of __pthread_initialize_minimal_internal (in libpthread). The events interface is difficult to test because GDB stopped using it in 2015. The td_thr_get_info change to ignore lookup issues is enough to support GDB with this change. Reviewed-by: Adhemerval Zanella --- sysdeps/nptl/dl-tls_init_tp.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sysdeps/nptl/dl-tls_init_tp.c') diff --git a/sysdeps/nptl/dl-tls_init_tp.c b/sysdeps/nptl/dl-tls_init_tp.c index f1aaa5aa9d..1f7790297f 100644 --- a/sysdeps/nptl/dl-tls_init_tp.c +++ b/sysdeps/nptl/dl-tls_init_tp.c @@ -27,6 +27,9 @@ bool __nptl_set_robust_list_avail __attribute__ ((nocommon)); rtld_hidden_data_def (__nptl_set_robust_list_avail) #endif +bool __nptl_initial_report_events __attribute__ ((nocommon)); +rtld_hidden_def (__nptl_initial_report_events) + #ifdef SHARED /* Dummy implementation. See __rtld_mutex_init. */ static int @@ -63,6 +66,11 @@ __tls_init_tp (void) THREAD_SETMEM (pd, specific[0], &pd->specific_1stblock[0]); THREAD_SETMEM (pd, user_stack, true); + /* Before initializing GL (dl_stack_user), the debugger could not + find us and had to set __nptl_initial_report_events. Propagate + its setting. */ + THREAD_SETMEM (pd, report_events, __nptl_initial_report_events); + /* Initialize the robust mutex data. */ { #if __PTHREAD_MUTEX_HAVE_PREV -- cgit v1.2.3