forked from CTSRD-CHERI/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 10
Merge another batch of CHERI changes from CTSRD #262
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
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
Oct 31, 2025
- [RISCV][MC] Keep .Lpcrel_hi symbols for CHERI AUIPCC pseudos in assembly
- [ELF][NFC] Fix mismerge in CheriCapTableSection
- [ELF][NFC] Add name constructor argument for CheriCapRelocsSection
- [ELF] Calculate config->isCheriAbi prior to constructing TargetInfo
- [ELF][RISCV] Set correct gotEntrySize for purecap objects
- [InstSimplify] Add a test for current get/set intrinsic folding
- [InstSimplify] Simplify getoffset/getaddr folding. NFC
- [InstSimplify] Simplify @llvm.cheri.cap.high.get
- [RISCV] Enable a test that works these days
- [RISCV] Fix a RUN line causing the test not to be run
- [ELF][RISCV] Use .got rather than .captable for CHERI-RISC-V
- [ELF][NFC] Drop unwarranted XXX comments
Commit 1e3f487 ("Fix build after merge") removed the CanBeUnnamed parameter since it no longer existed, but this is because users that set it to false were supposed to migrate to createNamedTempSymbol, as was done upstream in d9a0c40 ("[MC] Split MCContext::createTempSymbol, default AlwaysAddSuffix to true, and add comments") for AUIPC pseudos.
This comment should have been dropped when rebasing the LLVM 17 merge to avoid this hack. Fixes: fb02ad7 ("[ELF] Add InputSectionBase::{addRelocs,relocs} and GotSection::addConstant to add/access relocations")
This mirrors RelocationBaseSection (and deriving classes) and will allow additional caprelocs sections to be added.
This allows the constructor to check config->isCheriAbi just as it can check config->is64. This also centralises the file compatibility checks, making them follow upstream's.
This is currently not used but will be in future commits.
Now that we depend on C++14, we can use switches in constexpr functions and no longer need to pass two template parameters.
As part of this refactor some of the CHERI get intrinsics folding code. This refactoring introduces a minor change to getoffset folding as well: we no longer fold arbitrary getoffset(setoffset(A, B)) -> B since the setoffset could have changed the bounds interpretation and therefore also the result. This optimization is unlikely to make a difference in practice and is somewhat incorrect so I believe dropping it makes sense.
Fixes: 1949a19 ("[MachineOutliner][CHERI-RISC-V] Use capability jumps for purecap")
RELRO sections are SHF_WRITE, so there's nothing wrong with the code here. This is how it's meant to work, and how things like GotSection are constructed.
d89c37a to
f9ec9dc
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.