Repository navigation
Conversation
… the pointer it derives from its own address
phix33
force-pushed
the
fix/xref-ppc32-got-pointer
branch
from
December 5, 2026 03:57
1ff58b7 to
a6b9cc7
Compare
This branch has not been deployed
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.
kuna xrefslists no data reference from a position-independent PPC32 function. The function derives a pointer from its own address and reads every GOT slot through it, so no instruction holds a slot's address.bumpdoesbcl 20,31,$+4; mflr r30; addis r30,r30,2; addi r30,r30,0x7db4and thenlwz r9,-0x8000(r30), which reads the slot. With this change:Fix
bcl 20,31,$+4(orbl $+4), or at a call to theblrlGNU ld keeps before the GOT. It is followed through register copies, added constants and the read-only word Clang adds (lwz r3,-24(r30); add r30,r3,r30).Tests
xrefs_got_slots(CLI):gotslot.cbuilt by Clang and three ways by GCC (-fPIC,-fpic,-fpic -mbss-plt), and an assembled file of 24 cases. They fail without the change; unit tests cover each rule.xrefsexecutes 4.1 to 4.9% more instructions on those builds.Model:
anthropic/claude-mythos-5-2