Skip to content

Conversation

@resistor
Copy link
Collaborator

This is needed because Cheriot uses 11-bit shifts on AUIPCC (differing from normal RISC-V CHERI), and requires that the HI and LO relocs offset the target in the same direction. This is meant to be handled for all of Cheriot via R_RISCV_CHERIOT_COMPARTMENT_HI and R_RISCV_CHERIOT_COMPARTMENT_LO_I, but that is complicated by the simultaneous need to relax calls in (almost) all situations, which requires using R_RISCV_CHERI_CCALL. The solution is to add a new reloc that relaxes like R_RISCV_CHERI_CCALL, but relocates via R_RISCV_CHERIOT_COMPARTMENT_HI / R_RISCV_CHERIOT_COMPARTMENT_LO_I.

@resistor
Copy link
Collaborator Author

Supersedes #114

@resistor
Copy link
Collaborator Author

Fixes #106

@davidchisnall
Copy link

This also needs documenting in the cheriot-sail repo (where the ABI spec lives).

@resistor
Copy link
Collaborator Author

This also needs documenting in the cheriot-sail repo (where the ABI spec lives).

Way ahead of you: CHERIoT-Platform/cheriot-sail#97

This is needed because Cheriot uses 11-bit shifts on AUIPCC (differing from normal RISC-V CHERI), and requires that the HI and LO relocs offset the target in the same direction. This is meant to be handled for all of Cheriot via R_RISCV_CHERIOT_COMPARTMENT_HI and R_RISCV_CHERIOT_COMPARTMENT_LO_I, but that is complicated by the simultaneous need to relax calls in (almost) all situations, which requires using R_RISCV_CHERI_CCALL. The solution is to add a new reloc that relaxes like R_RISCV_CHERI_CCALL, but relocates via R_RISCV_CHERIOT_COMPARTMENT_HI / R_RISCV_CHERIOT_COMPARTMENT_LO_I.
@resistor resistor enabled auto-merge (rebase) February 18, 2025 11:41
@resistor resistor merged commit 4feeffb into CHERIoT-Platform:cheriot Feb 18, 2025
2 checks passed
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