diff mbox series

[1/3] nptl_db: Clean up main/rtld variable handling

Message ID cd11e45467f47c8d12bb5c0d6e6a8638eb041032.1624871226.git.fweimer@redhat.com
State Committed
Commit d22705e7de9ee153508681a1c8842dcd17c490da
Headers show
Series ntpl: Export libthread_db-used symbols (v2) | expand

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Florian Weimer June 28, 2021, 9:09 a.m. UTC
Most symbols are now in libc.so.6.  The "main" (exempted from
coverage checks) status is therefore not necessary.  Use
DB_MAIN_VARIABLE for the remaining separate symbol,
__nptl_initial_report_events.  DB_RTLD_VARIABLE is now unused, so
remove it.
---
 nptl_db/db-symbols.awk |  1 -
 nptl_db/structs.def    | 14 +++++---------
 2 files changed, 5 insertions(+), 10 deletions(-)

Comments

Carlos O'Donell June 28, 2021, 12:31 p.m. UTC | #1
On 6/28/21 5:09 AM, Florian Weimer via Libc-alpha wrote:
> Most symbols are now in libc.so.6.  The "main" (exempted from
> coverage checks) status is therefore not necessary.  Use
> DB_MAIN_VARIABLE for the remaining separate symbol,
> __nptl_initial_report_events.  DB_RTLD_VARIABLE is now unused, so
> remove it.

This looks good to me.

Tested on x86_64 without regression.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  nptl_db/db-symbols.awk |  1 -
>  nptl_db/structs.def    | 14 +++++---------
>  2 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/nptl_db/db-symbols.awk b/nptl_db/db-symbols.awk
> index 6f326cf379..ef1d91b167 100644
> --- a/nptl_db/db-symbols.awk
> +++ b/nptl_db/db-symbols.awk
> @@ -2,7 +2,6 @@
>  # we've just built.  It checks for all the symbols used in td_symbol_list.
>  
>  BEGIN {
> -%define DB_RTLD_VARIABLE(name) /* Nothing. */

OK. Remove.

>  %define DB_MAIN_VARIABLE(name) /* Nothing. */
>  %define DB_MAIN_SYMBOL(name) /* Nothing. */
>  %define DB_MAIN_ARRAY_VARIABLE(name) /* Nothing. */
> diff --git a/nptl_db/structs.def b/nptl_db/structs.def
> index 6a726f207e..fb7bb9367d 100644
> --- a/nptl_db/structs.def
> +++ b/nptl_db/structs.def
> @@ -22,10 +22,6 @@
>  # define STRUCTS_DEF_DEFAULTS 1
>  #endif
>  
> -#ifndef DB_RTLD_VARIABLE
> -# define DB_RTLD_VARIABLE(name) DB_VARIABLE (name)
> -#endif
> -

OK. Remove.

>  /* DB_MAIN_VARIABLE, DB_MAIN_SYMBOL, DB_MAIN_ARRAY_VARIABLE are not
>     covered by the libc symbol check in db-symbols.awk.  */
>  #ifndef DB_MAIN_VARIABLE
> @@ -78,14 +74,14 @@ DB_STRUCT_FIELD (td_eventbuf_t, eventnum)
>  DB_STRUCT_FIELD (td_eventbuf_t, eventdata)
>  
>  DB_SYMBOL (nptl_version)
> -DB_MAIN_SYMBOL (__nptl_create_event)
> -DB_MAIN_SYMBOL (__nptl_death_event)
> +DB_SYMBOL (__nptl_create_event)
> +DB_SYMBOL (__nptl_death_event)

OK.

>  DB_SYMBOL (__nptl_threads_events)
> -DB_MAIN_VARIABLE (__nptl_nthreads)
> +DB_VARIABLE (__nptl_nthreads)

OK. Adds __nptl_nthreads to checking.

>  DB_VARIABLE (__nptl_last_event)
> -DB_RTLD_VARIABLE (__nptl_initial_report_events)
> +DB_MAIN_VARIABLE (__nptl_initial_report_events)

OK. Becomes DB_MAIN_VARIABLE, defined in ld.so.

>  
> -DB_MAIN_ARRAY_VARIABLE (__pthread_keys)
> +DB_ARRAY_VARIABLE (__pthread_keys)

OK. Add __pthread_keys to checking.

>  DB_STRUCT (pthread_key_struct)
>  DB_STRUCT_FIELD (pthread_key_struct, seq)
>  DB_STRUCT_FIELD (pthread_key_struct, destr)
>
diff mbox series

Patch

diff --git a/nptl_db/db-symbols.awk b/nptl_db/db-symbols.awk
index 6f326cf379..ef1d91b167 100644
--- a/nptl_db/db-symbols.awk
+++ b/nptl_db/db-symbols.awk
@@ -2,7 +2,6 @@ 
 # we've just built.  It checks for all the symbols used in td_symbol_list.
 
 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. */
diff --git a/nptl_db/structs.def b/nptl_db/structs.def
index 6a726f207e..fb7bb9367d 100644
--- a/nptl_db/structs.def
+++ b/nptl_db/structs.def
@@ -22,10 +22,6 @@ 
 # define STRUCTS_DEF_DEFAULTS 1
 #endif
 
-#ifndef DB_RTLD_VARIABLE
-# define DB_RTLD_VARIABLE(name) DB_VARIABLE (name)
-#endif
-
 /* DB_MAIN_VARIABLE, DB_MAIN_SYMBOL, DB_MAIN_ARRAY_VARIABLE are not
    covered by the libc symbol check in db-symbols.awk.  */
 #ifndef DB_MAIN_VARIABLE
@@ -78,14 +74,14 @@  DB_STRUCT_FIELD (td_eventbuf_t, eventnum)
 DB_STRUCT_FIELD (td_eventbuf_t, eventdata)
 
 DB_SYMBOL (nptl_version)
-DB_MAIN_SYMBOL (__nptl_create_event)
-DB_MAIN_SYMBOL (__nptl_death_event)
+DB_SYMBOL (__nptl_create_event)
+DB_SYMBOL (__nptl_death_event)
 DB_SYMBOL (__nptl_threads_events)
-DB_MAIN_VARIABLE (__nptl_nthreads)
+DB_VARIABLE (__nptl_nthreads)
 DB_VARIABLE (__nptl_last_event)
-DB_RTLD_VARIABLE (__nptl_initial_report_events)
+DB_MAIN_VARIABLE (__nptl_initial_report_events)
 
-DB_MAIN_ARRAY_VARIABLE (__pthread_keys)
+DB_ARRAY_VARIABLE (__pthread_keys)
 DB_STRUCT (pthread_key_struct)
 DB_STRUCT_FIELD (pthread_key_struct, seq)
 DB_STRUCT_FIELD (pthread_key_struct, destr)