forked from CTSRD-CHERI/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 10
Merge changes from CTSRD main up to aff0a7c2ca04209ea8eaaa31b10e92e029aee1e8 #266
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
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
…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.
1a58299 to
c1567dd
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.