fix: ifunc address equality for GOT-relative relocations#1446
Merged
Conversation
baca8a5 to
e5b7f9f
Compare
davidlattimore
approved these changes
Jan 13, 2026
Member
davidlattimore
left a comment
There was a problem hiding this comment.
Nice fix! This now shows no change in performance. I only benchmarked zed, but I expect that's sufficient.
f32c635 to
7e6facd
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.
When code takes the address of an ifunc symbol via a GOT-relative relocation (e.g.,
R_X86_64_REX_GOTPCRELX), it should return the same address as direct references to the ifunc, which is the PLT stub address. Previously, wild used a single GOT entry for both the PLT stub (withR_IRELATIVE) and GOT-relative references. This caused address inequality: direct references returned the PLT stub address, while GOT-relative references returned the resolver result (the actual function address). For non-PIE executables, we now allocate a separate GOT entry for address equality that contains the PLT stub address statically. This ensures all references to an ifunc return the same address.