Skip to content

Conversation

@resistor
Copy link
Collaborator

@resistor resistor commented Nov 5, 2025

  • [ELF][CHERI] Remove obsolete code for preemptible and non-relative caprelocs
  • [NFC][ELF][CHERI] De-template various capability functions
  • [ELF][CHERI] Remove --local-caprelocs=cbuildcap
  • [NFCI][ELF][CHERI] Restructure addCapabilityRelocation for clarity
  • [NFC][ELF][CHERI] Swap CapRelocsMode enum for bool
  • [ELF][Mips] Remove --building-freebsd-rtld
  • [ELF][CHERI] Delete various unnecessary error messages and asserts
  • [ELF][CHERI] Delete an obsolete check
  • [ELF][CHERI] Tweak error message to be clearer and have better style
  • [NFC][clang] Add test showing getSizeOfUnwindException is wrong for purecap
  • [clang][CodeGen] Fix getSizeOfUnwindException for purecap
  • [ELF][CHERI][RISCV] Drop opt-in -z cheri-riscv-jump-slot

jrtc27 added 12 commits November 5, 2025 22:48
…prelocs

Both were only ever for CHERI-MIPS and were long obsolete even when
CHERI-MIPS was still around. This will also allow further cleanups, but
this commit only performs the immediate constant propagation and dead
code removal possible.
With a bunch of legacy code gone that was using the provided ELFT we can
stop making these functions templated and remove the need for invokeELFT
in various callers. The MIPS ABI flag is a wart here but CHERI-MIPS
isn't really a thing any more so the slightly gross (and inefficient)
invokeELFT, rather than putting it somewhere in config like Morello LLD
does for its ABI variations, is fine.
This is what --local-caprelocs=elf will be, we don't need two ways of
saying the same thing. Note that Morello uses --local-caprelocs=elf
downstream already for its R_MORELLO_RELATIVE, which serves the same
purpose as a real CBuildCap-based encoding.
All we care about is whether we're using caprelocs or relative
relocations. Note the option name remains the same as it's implemented
downstream in Morello LLD and actually passed by CheriBSD.
This is MIPS-specific as a downstream hack.
Some of these error messages should really have been asserts. Many of
these are now so clearly impossible due to the surrounding code that
they serve no point, and in general this is way more paranoid than LLD
typically is, in ways that make it harder to actually follow the code.
Delete this clutter.
This dates back to 2021; such object files are long past their support
window.
The exception_cleanup and private_1/private_2 members are all
capabilities in purecap ABIs rather than uint64_t (or uint32_t followed
by padding in the case of 32-bit) and so the size of the struct is
larger. On a hypothetical 128-bit architecture they would also be
128-bit integers, so generalise this code to just look at the pointer
size rather than be CHERI-specific.

Fixes: CTSRD-CHERI#680
This opt-in was just to allow building CheriBSD that did not yet support
this. Now that all of dev, main and releng/25.03 support it we can
enable it by default and drop the old config. No opt-out option is
provided.
@resistor resistor merged commit 455d1c2 into CHERIoT-Platform:cheriot Nov 6, 2025
7 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