Skip to content

Fix X86 tls handling (for custom labels)#63

Merged
umanwizard merged 7 commits into
mainfrom
x86_tls
Apr 9, 2025
Merged

Fix X86 tls handling (for custom labels)#63
umanwizard merged 7 commits into
mainfrom
x86_tls

Conversation

@umanwizard
Copy link
Copy Markdown
Collaborator

See the comment for more details -- we were not accounting for the fact that the pointer to the end of the TLS segment might be aligned. Which is strange, because alignment normally affects the beginning of things, not the end of things, but apparently this is how things work.

Also, greatly simplify how we calculate the TLS offset on x86. We don't need to look at the individual sections and deduce how they'll be combined into a segment at runtime; we can just get the information about the segment from the program header directly.

@umanwizard umanwizard requested a review from gnurizen April 8, 2025 23:28
Comment thread interpreter/customlabels/customlabels.go
Comment thread libpf/pfelf/file_test.go Outdated
Comment thread libpf/pfelf/testdata/Makefile Outdated
Copy link
Copy Markdown
Collaborator

@gnurizen gnurizen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good modulo some CI issues, nice test!

@umanwizard umanwizard merged commit f20d100 into main Apr 9, 2025
26 checks passed
@brancz brancz deleted the x86_tls branch April 10, 2025 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants