Skip to content

Conversation

@no1wudi
Copy link
Collaborator

@no1wudi no1wudi commented Jan 2, 2026

…hing

Implement proper R_RISCV_PCREL_HI20/R_RISCV_PCREL_LO12_{I,S} pairing mechanism for RISC-V AOT relocation processing.

Changes:

  • Add PCREL cache to match HI20 relocations with their corresponding LO12 entries, ensuring correct PC-relative offset computation
  • Export aot_reloc_reset_cache() to clear cache state
  • Implement proper LO12 relocation handling that uses cached HI20 offset
  • Add overflow detection for PCREL cache to fail gracefully with error
  • Add RV64 immediate validation for HI20 relocations

This enhances the RISC-V relocation system to correctly handle PC-relative relocations used by LLVM for position-independent code generation.

…hing

Implement proper R_RISCV_PCREL_HI20/R_RISCV_PCREL_LO12_{I,S} pairing
mechanism for RISC-V AOT relocation processing.

Changes:
- Add PCREL cache to match HI20 relocations with their corresponding LO12
  entries, ensuring correct PC-relative offset computation
- Export aot_reloc_reset_cache() to clear cache state
- Implement proper LO12 relocation handling that uses cached HI20 offset
- Add overflow detection for PCREL cache to fail gracefully with error
- Add RV64 immediate validation for HI20 relocations

This enhances the RISC-V relocation system to correctly handle PC-relative
relocations used by LLVM for position-independent code generation.
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.

1 participant