[PATCH 0/2] Add debug logging and documentation for TLS management
Frédéric Bérat
fberat@redhat.com
Wed Oct 15 14:23:04 GMT 2025
Hello,
This patch series introduces debugging capabilities for Thread-Local
Storage (TLS) management within the dynamic linker and documents the
relevant environment variables.
The first patch adds the `DL_DEBUG_TLS` debug mask, which can be enabled
via the `tls` keyword in the `LD_DEBUG` environment variable. This
provides detailed logging for TCB allocation, deallocation, and reuse,
as well as thread startup events. A new test is included to validate
this functionality.
The second patch adds a new section to the dynamic linker manual,
documenting the `LD_DEBUG` and `LD_DEBUG_OUTPUT` environment variables.
This includes documentation for the newly added `tls` keyword.
These changes enhance the dynamic linker's debuggability for TLS-related
issues and improve the documentation for users. This is a first step,
and the intent is to extend this logging in the future to cover more
aspects of TLS management.
Fred.
---
Frédéric Bérat (2):
tls: Add debug logging for TLS and TCB management
docs: Add dynamic linker environment variable docs
elf/dl-tls.c | 6 ++++
elf/rtld.c | 4 ++-
manual/dynlink.texi | 66 ++++++++++++++++++++++++++++++++++++
nptl/Makefile | 7 ++++
nptl/allocatestack.c | 14 ++++++++
nptl/nptl-stack.c | 19 +++++++++--
nptl/pthread_create.c | 4 +++
nptl/tst-dl-debug-tid.c | 56 +++++++++++++++++++++++++++++++
nptl/tst-dl-debug-tid.sh | 68 ++++++++++++++++++++++++++++++++++++++
sysdeps/generic/ldsodefs.h | 3 +-
10 files changed, 243 insertions(+), 4 deletions(-)
create mode 100644 nptl/tst-dl-debug-tid.c
create mode 100644 nptl/tst-dl-debug-tid.sh
--
2.51.0
More information about the Libc-alpha
mailing list