Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible need for CRelocate (CREL? CRLC? CRELOC?) #424

Open
jrtc27 opened this issue Oct 16, 2024 · 0 comments
Open

Possible need for CRelocate (CREL? CRLC? CRELOC?) #424

jrtc27 opened this issue Oct 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jrtc27
Copy link
Collaborator

jrtc27 commented Oct 16, 2024

One area that is currently awkward is handling the CHERI equivalent of R_RISCV_RELATIVE relocations. On non-CHERI that means adding the library load base address to the integer pointers in question. On CHERI we need to build a full capability with both base and address increased by the library load base address. It is believed that a sensible scheme to make this work is to have the run-time linker emit the raw (without tag) bits of the capability as if the library were linked at address 0, mirroring how addresses are already handled for non-CHERI, and adding a new CRelocate instruction in order to "slide" up the address and bounds together before a CBuildCap (CBLD). See CTSRD-CHERI/sail-cheri-riscv#62 for a proposed implementation against the old capability format. Currently we instead have a rather inefficient __cap_relocs table which requires manual capability derivation. Morello packs this data down, but cannot represent all possible bounds combinations as a result (in particular, whole-address-space capabilities), and still requires the same manual derivation code once the fields are extracted out.

@arichardson arichardson added the enhancement New feature or request label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants