Skip to content

Add MOVZ+MOVK address symbolization for ARM64 (non-PIE)#91

Open
boppitybop wants to merge 1 commit intoGrammaTech:mainfrom
boppitybop:fix/arm64-movz-movk-symbolization
Open

Add MOVZ+MOVK address symbolization for ARM64 (non-PIE)#91
boppitybop wants to merge 1 commit intoGrammaTech:mainfrom
boppitybop:fix/arm64-movz-movk-symbolization

Conversation

@boppitybop
Copy link

@boppitybop boppitybop commented Feb 18, 2026

Add MOVZ+MOVK address symbolization for ARM64 (non-PIE)

Fixes #90

ARM64 non-PIE executables construct absolute addresses using
MOVZ+MOVK chains (2-4 instructions, each carrying a 16-bit slice
with LSL #0/GrammaTech#16/GrammaTech#32/GrammaTech#48).  ddisasm had no rules for this pattern,
causing the instructions to retain raw immediates.  The reassembled
binary then contained wrong addresses.

Changes:
- Arm64Loader: record op_shifted facts for IMM operands with LSL
- arm64_symbolization.dl: add movz_movk_chain rules (2/3/4 deep),
  emit symbolic_operand_candidate with G0-G3 attributes for EXEC
  binaries when the reconstructed value matches code or data_segment
- Disassembler: add G2/G3 to AttributeMap
- Add ex_movz_movk regression test
@junghee
Copy link
Collaborator

junghee commented Feb 19, 2026

@boppitybop Thank you for your contribution!

Before we can move forward with this MR, please sign our Contributor License Agreement (CLA) to grant GrammaTech license to the work: As mentioned in https://github.com/GrammaTech/ddisasm/blob/main/CONTRIBUTING.md#contributor-license-agreement

CLA form: https://github.com/GrammaTech/ddisasm/blob/main/GrammaTech-CLA-ddisasm.pdf
Email: [email protected]

Please let me know once it's done or if you have any questions.

Thank you!

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.

ARM64: MOVZ+MOVK address construction not symbolized in non-PIE binaries

2 participants

Comments