Commit Graph

8 Commits

Author SHA1 Message Date
Florian Weimer
3640654575 nptl_db: Re-use the ELF-to-abilist converter for ABI checking
The previous approach uses readelf -DWs, which does not produce
a stable output format (older binutils versions do not include
symbol version information).  This commit re-uses scripts/abilist.awk
with a tweak to include GLIBC_PRIVATE symbols.  This awk script
is based on objdump -T output, which appears to be stable over time.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
2021-06-29 22:17:08 +02:00
Florian Weimer
fef400a2f9 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 <carlos@redhat.com>
2021-06-28 15:05:42 +02:00
Florian Weimer
d22705e7de nptl_db: Clean up main/rtld variable handling
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.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-06-28 14:34:32 +02:00
Florian Weimer
23ce1cf35a nptl: Move __nptl_create_event, __nptl_death_event into libc
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).

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-17 10:06:44 +02:00
Florian Weimer
7a7229de1d nptl_db: Introduce DB_MAIN_ARRAY_VARIABLE
And document the reason for DB_ARRAY_VARIABLE.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Alexandre Oliva
f8aeae3473 Fix DTV race, assert, DTV_SURPLUS Static TLS limit, and nptl_db garbage
for  ChangeLog

	[BZ #17090]
	[BZ #17620]
	[BZ #17621]
	[BZ #17628]
	* NEWS: Update.
	* elf/dl-tls.c (_dl_update_slotinfo): Clean up outdated DTV
	entries with Static TLS too.  Skip entries past the end of the
	allocated DTV, from Alan Modra.
	(tls_get_addr_tail): Update to glibc_likely/unlikely.  Move
	Static TLS DTV entry set up from...
	 (_dl_allocate_tls_init): ... here (fix modid assertion), ...
	* elf/dl-reloc.c (_dl_nothread_init_static_tls): ... here...
	* nptl/allocatestack.c (init_one_static_tls): ... and here...
	* elf/dlopen.c (dl_open_worker): Drop l_tls_modid upper bound
	for Static TLS.
	* elf/tlsdeschtab.h (map_generation): Return size_t.  Check
	that the slot we find is associated with the given map before
	using its generation count.
	* nptl_db/db_info.c: Include ldsodefs.h.
	(rtld_global, dtv_slotinfo_list, dtv_slotinfo): New typedefs.
	* nptl_db/structs.def (DB_RTLD_VARIABLE): New macro.
	(DB_MAIN_VARIABLE, DB_RTLD_GLOBAL_FIELD): Likewise.
	(link_map::l_tls_offset): New struct field.
	(dtv_t::counter): Likewise.
	(rtld_global): New struct.
	(_rtld_global): New rtld variable.
	(dl_tls_dtv_slotinfo_list): New rtld global field.
	(dtv_slotinfo_list): New struct.
	(dtv_slotinfo): Likewise.
	* nptl_db/td_symbol_list.c: Drop gnu/lib-names.h include.
	(td_lookup): Rename to...
	(td_mod_lookup): ... this.  Use new mod parameter instead of
	LIBPTHREAD_SO.
	* nptl_db/td_thr_tlsbase.c: Include link.h.
	(dtv_slotinfo_list, dtv_slotinfo): New functions.
	(td_thr_tlsbase): Check DTV generation.  Compute Static TLS
	addresses even if the DTV is out of date or missing them.
	* nptl_db/fetch-value.c (_td_locate_field): Do not refuse to
	index zero-length arrays.
	* nptl_db/thread_dbP.h: Include gnu/lib-names.h.
	(td_lookup): Make it a macro implemented in terms of...
	(td_mod_lookup): ... this declaration.
	* nptl_db/db-symbols.awk (DB_RTLD_VARIABLE): Override.
	(DB_MAIN_VARIABLE): Likewise.
2015-03-17 00:31:49 -03:00
Aurelien Jarno
8ee84bd01f [BZ #10200]
* db-symbols.awk: Use the last field for the symbol name instead
of the 8th one.
2009-05-27 16:41:00 -07:00
Roland McGrath
e965d5147e * Makeconfig (%.v.i): Depend on Makeconfig.
Exclude % lines from initial #-comment removal.
2009-02-28 02:26:51 +00:00