Libcinfo tsd tls refactor#10
Draft
dalehamel wants to merge 6 commits into
Draft
Conversation
df049e5 to
0ee2d73
Compare
dalehamel
commented
Nov 4, 2025
dalehamel
commented
Nov 4, 2025
Co-authored-by: Mackenzie <mackenzie.jomard@datadoghq.com> Co-authored-by: Florian Lehner <florianl@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…n-telemetry#950) Co-authored-by: Timo Teräs <timo.teras@iki.fi>
The DTV variables read from extracted __tls_get_addr can be used to read TLS variables. If this symbol is missing, empty introspection data is returned.
08a54d2 to
23da4c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moving my upstreaming efforts from #7 here, to avoid adding the ruby stuff since that gets complicated.
What
Refactor's
tpbaseto belibcpackage, as it provides additional info about libc.In particular, this adds DTV introspection information and bundles this with the TSD info into a new
LibcInfo.Why
We need the DTV information to look up TLS variables when TLS descriptors are not available.
How
This adds disassembler code for extracting the DTV information from
__tls_get_addrif it is present in the libc.It should be supported for musl and glibc, on both x86_64 and aarch64, and test cases from different libc versions and architectures are added to validate that this is the case.
The
tpbasepackage is renamed tolibc, and related functions are renamed to be more generic, but otherwise the functionality is unchanged.Nothing actually uses the new DTV data yet, another PR will follow up to add that for Ruby which reads the execution context from a TLS variable.