From fef400a2f976d1fd6a4639e6980f6c50ee13fbf5 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 28 Jun 2021 14:33:53 +0200 Subject: nptl: Export libthread_db-used symbols under GLIBC_PRIVATE This allows distributions to strip debugging information from libc.so.6 without impacting the debugging experience. Reviewed-by: Carlos O'Donell --- nptl_db/Makefile | 2 +- nptl_db/db-symbols.awk | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'nptl_db') diff --git a/nptl_db/Makefile b/nptl_db/Makefile index 1f79c018a1..c04aa6140a 100644 --- a/nptl_db/Makefile +++ b/nptl_db/Makefile @@ -55,7 +55,7 @@ include ../Rules $(objpfx)db-symbols.out: $(objpfx)db-symbols.v.i \ $(common-objpfx)libc.so - LC_ALL=C $(READELF) -W -s $(filter %.so,$^) | $(AWK) -f $< > $@; \ + LC_ALL=C $(READELF) -W -D -s $(filter %.so,$^) | $(AWK) -f $< > $@; \ $(evaluate-test) $(objpfx)db-symbols.v.i: db-symbols.awk diff --git a/nptl_db/db-symbols.awk b/nptl_db/db-symbols.awk index ef1d91b167..fe90d3b435 100644 --- a/nptl_db/db-symbols.awk +++ b/nptl_db/db-symbols.awk @@ -1,4 +1,4 @@ -# This script processes the output of 'readelf -W -s' on the libpthread.so +# This script processes the output of 'readelf -W -D -s' on the libc.so # we've just built. It checks for all the symbols used in td_symbol_list. BEGIN { @@ -12,7 +12,7 @@ BEGIN { in_symtab = 0; } -/Symbol table '.symtab'/ { in_symtab=1; next } +/Symbol table for image/ { in_symtab=1; next } NF == 0 { in_symtab=0; next } !in_symtab { next } @@ -23,6 +23,7 @@ END { status = 0; for (s in required) { + s = s "@@GLIBC_PRIVATE" if (s in seen) print s, "ok"; else { status = 1; @@ -32,6 +33,7 @@ END { any = ""; for (s in th_unique) { + s = s "@@GLIBC_PRIVATE" if (s in seen) { any = s; break; -- cgit 1.4.1