Message ID | 9f464e7bf0f0b5616ab3d8a2c107e89eb9cf732b.1620838411.git.fweimer@redhat.com |
---|---|
State | New |
Headers | show |
Series | nptl: Move almost all remaining functions into libc | expand |
On 12/05/2021 13:57, Florian Weimer via Libc-alpha wrote: > In libthread_db, use the exported GLIBC_PRIVATE symbols directly > instead of relying on _thread_db_* variables in libpthread > (which used to be created by the DB_FUNCTION macros). LGTM, thanks. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> > --- > nptl/Makefile | 2 +- > nptl/Versions | 2 ++ > nptl/events.c | 4 ++-- > nptl/pthreadP.h | 4 ++-- > nptl_db/db-symbols.awk | 1 + > nptl_db/structs.def | 11 +++++++---- > 6 files changed, 15 insertions(+), 9 deletions(-) > > diff --git a/nptl/Makefile b/nptl/Makefile > index 37a762d530..b57b010779 100644 > --- a/nptl/Makefile > +++ b/nptl/Makefile > @@ -41,6 +41,7 @@ routines = \ > elision-timed \ > elision-trylock \ > elision-unlock \ > + events \ > futex-internal \ > libc-cleanup \ > libc_multiple_threads \ Ok. > @@ -200,7 +201,6 @@ shared-only-routines = forward > static-only-routines = pthread_atfork > > libpthread-routines = \ > - events \ > libpthread-compat \ > nptl-init \ > pt-interp \ Ok. > diff --git a/nptl/Versions b/nptl/Versions > index fb3379b788..6e2def1b4c 100644 > --- a/nptl/Versions > +++ b/nptl/Versions > @@ -351,6 +351,8 @@ libc { > tss_set; > } > GLIBC_PRIVATE { > + __nptl_create_event; > + __nptl_death_event; > __default_pthread_attr; > __default_pthread_attr_lock; > __futex_abstimed_wait64; Ok. > diff --git a/nptl/events.c b/nptl/events.c > index 5a07e58402..ab57fefd48 100644 > --- a/nptl/events.c > +++ b/nptl/events.c > @@ -24,10 +24,10 @@ void > __nptl_create_event (void) > { > } > -hidden_def (__nptl_create_event) > +libc_hidden_def (__nptl_create_event) > > void > __nptl_death_event (void) > { > } > -hidden_def (__nptl_death_event) > +libc_hidden_def (__nptl_death_event) Ok. > diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h > index dc2aece37e..a4a87cb549 100644 > --- a/nptl/pthreadP.h > +++ b/nptl/pthreadP.h > @@ -337,8 +337,8 @@ rtld_hidden_proto (__nptl_initial_report_events) > /* Event handlers for libthread_db interface. */ > extern void __nptl_create_event (void); > extern void __nptl_death_event (void); > -hidden_proto (__nptl_create_event) > -hidden_proto (__nptl_death_event) > +libc_hidden_proto (__nptl_create_event) > +libc_hidden_proto (__nptl_death_event) > > /* The fork generation counter, defined in libpthread. */ > extern unsigned long int __fork_generation attribute_hidden; Ok. > diff --git a/nptl_db/db-symbols.awk b/nptl_db/db-symbols.awk > index 9e981537c8..6f326cf379 100644 > --- a/nptl_db/db-symbols.awk > +++ b/nptl_db/db-symbols.awk > @@ -4,6 +4,7 @@ > BEGIN { > %define DB_RTLD_VARIABLE(name) /* Nothing. */ > %define DB_MAIN_VARIABLE(name) /* Nothing. */ > +%define DB_MAIN_SYMBOL(name) /* Nothing. */ > %define DB_MAIN_ARRAY_VARIABLE(name) /* Nothing. */ > %define DB_LOOKUP_NAME(idx, name) required[STRINGIFY (name)] = 1; > %define DB_LOOKUP_NAME_TH_UNIQUE(idx, name) th_unique[STRINGIFY (name)] = 1; Ok. > diff --git a/nptl_db/structs.def b/nptl_db/structs.def > index 275c12bc7a..71c9f7bfc2 100644 > --- a/nptl_db/structs.def > +++ b/nptl_db/structs.def > @@ -26,11 +26,14 @@ > # define DB_RTLD_VARIABLE(name) DB_VARIABLE (name) > #endif > > -/* DB_MAIN_VARIABLE and DB_MAIN_ARRAY_VARIABLE are not covered by the > - libpthread symbol check in db-symbols.awk. */ > +/* DB_MAIN_VARIABLE, DB_MAIN_SYMBOL, DB_MAIN_ARRAY_VARIABLE are not > + covered by the libpthread symbol check in db-symbols.awk. */ > #ifndef DB_MAIN_VARIABLE > # define DB_MAIN_VARIABLE(name) DB_VARIABLE (name) > #endif > +#ifndef DB_MAIN_SYMBOL > +# define DB_MAIN_SYMBOL(name) DB_SYMBOL (name) > +#endif > #ifndef DB_MAIN_ARRAY_VARIABLE > # define DB_MAIN_ARRAY_VARIABLE(name) DB_ARRAY_VARIABLE (name) > #endif Ok. > @@ -75,8 +78,8 @@ DB_STRUCT_FIELD (td_eventbuf_t, eventnum) > DB_STRUCT_FIELD (td_eventbuf_t, eventdata) > > DB_SYMBOL (nptl_version) > -DB_FUNCTION (__nptl_create_event) > -DB_FUNCTION (__nptl_death_event) > +DB_MAIN_SYMBOL (__nptl_create_event) > +DB_MAIN_SYMBOL (__nptl_death_event) > DB_SYMBOL (__nptl_threads_events) > DB_MAIN_VARIABLE (__nptl_nthreads) > DB_VARIABLE (__nptl_last_event) > OK.
diff --git a/nptl/Makefile b/nptl/Makefile index 37a762d530..b57b010779 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -41,6 +41,7 @@ routines = \ elision-timed \ elision-trylock \ elision-unlock \ + events \ futex-internal \ libc-cleanup \ libc_multiple_threads \ @@ -200,7 +201,6 @@ shared-only-routines = forward static-only-routines = pthread_atfork libpthread-routines = \ - events \ libpthread-compat \ nptl-init \ pt-interp \ diff --git a/nptl/Versions b/nptl/Versions index fb3379b788..6e2def1b4c 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -351,6 +351,8 @@ libc { tss_set; } GLIBC_PRIVATE { + __nptl_create_event; + __nptl_death_event; __default_pthread_attr; __default_pthread_attr_lock; __futex_abstimed_wait64; diff --git a/nptl/events.c b/nptl/events.c index 5a07e58402..ab57fefd48 100644 --- a/nptl/events.c +++ b/nptl/events.c @@ -24,10 +24,10 @@ void __nptl_create_event (void) { } -hidden_def (__nptl_create_event) +libc_hidden_def (__nptl_create_event) void __nptl_death_event (void) { } -hidden_def (__nptl_death_event) +libc_hidden_def (__nptl_death_event) diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index dc2aece37e..a4a87cb549 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -337,8 +337,8 @@ rtld_hidden_proto (__nptl_initial_report_events) /* Event handlers for libthread_db interface. */ extern void __nptl_create_event (void); extern void __nptl_death_event (void); -hidden_proto (__nptl_create_event) -hidden_proto (__nptl_death_event) +libc_hidden_proto (__nptl_create_event) +libc_hidden_proto (__nptl_death_event) /* The fork generation counter, defined in libpthread. */ extern unsigned long int __fork_generation attribute_hidden; diff --git a/nptl_db/db-symbols.awk b/nptl_db/db-symbols.awk index 9e981537c8..6f326cf379 100644 --- a/nptl_db/db-symbols.awk +++ b/nptl_db/db-symbols.awk @@ -4,6 +4,7 @@ BEGIN { %define DB_RTLD_VARIABLE(name) /* Nothing. */ %define DB_MAIN_VARIABLE(name) /* Nothing. */ +%define DB_MAIN_SYMBOL(name) /* Nothing. */ %define DB_MAIN_ARRAY_VARIABLE(name) /* Nothing. */ %define DB_LOOKUP_NAME(idx, name) required[STRINGIFY (name)] = 1; %define DB_LOOKUP_NAME_TH_UNIQUE(idx, name) th_unique[STRINGIFY (name)] = 1; diff --git a/nptl_db/structs.def b/nptl_db/structs.def index 275c12bc7a..71c9f7bfc2 100644 --- a/nptl_db/structs.def +++ b/nptl_db/structs.def @@ -26,11 +26,14 @@ # define DB_RTLD_VARIABLE(name) DB_VARIABLE (name) #endif -/* DB_MAIN_VARIABLE and DB_MAIN_ARRAY_VARIABLE are not covered by the - libpthread symbol check in db-symbols.awk. */ +/* DB_MAIN_VARIABLE, DB_MAIN_SYMBOL, DB_MAIN_ARRAY_VARIABLE are not + covered by the libpthread symbol check in db-symbols.awk. */ #ifndef DB_MAIN_VARIABLE # define DB_MAIN_VARIABLE(name) DB_VARIABLE (name) #endif +#ifndef DB_MAIN_SYMBOL +# define DB_MAIN_SYMBOL(name) DB_SYMBOL (name) +#endif #ifndef DB_MAIN_ARRAY_VARIABLE # define DB_MAIN_ARRAY_VARIABLE(name) DB_ARRAY_VARIABLE (name) #endif @@ -75,8 +78,8 @@ DB_STRUCT_FIELD (td_eventbuf_t, eventnum) DB_STRUCT_FIELD (td_eventbuf_t, eventdata) DB_SYMBOL (nptl_version) -DB_FUNCTION (__nptl_create_event) -DB_FUNCTION (__nptl_death_event) +DB_MAIN_SYMBOL (__nptl_create_event) +DB_MAIN_SYMBOL (__nptl_death_event) DB_SYMBOL (__nptl_threads_events) DB_MAIN_VARIABLE (__nptl_nthreads) DB_VARIABLE (__nptl_last_event)