Skip to content

fix: Clear opcode and immediate fields before rewriting MOVZ/MOVN relocations in AArch64 - #1794

Merged
lapla-cogito merged 1 commit into
wild-linker:mainfrom
lapla-cogito:aarch_imm
Apr 4, 2026
Merged

lapla-cogito merged 1 commit into
wild-linker:mainfrom
lapla-cogito:aarch_imm

Conversation

@lapla-cogito

Copy link
Copy Markdown
Member

context: #1791 (comment)

The Movnz variant of write_to_value() selects between MOVZ (bit 30 = 1) and MOVN (bit 30 = 0) at link time depending on the sign of the resolved value. Since it used only or_from_slice(), bit 30 could never be cleared, so a MOVZ placeholder in the object file could not be rewritten to MOVN. The immediate field was also corrupted by leftover bits.

@lapla-cogito lapla-cogito changed the title Clear opcode and immediate fields before rewriting MOVZ/MOVN relocations in AArch64 fix: Clear opcode and immediate fields before rewriting MOVZ/MOVN relocations in AArch64 Apr 3, 2026
@lapla-cogito
lapla-cogito merged commit a142e28 into wild-linker:main Apr 4, 2026
24 checks passed
@lapla-cogito
lapla-cogito deleted the aarch_imm branch April 4, 2026 05:00
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.

2 participants