Open
Conversation
For each SHF_MERGE section not assigned to an explicit compartment, leave the original section in the default compartment but create duplicate sections with the same content for each compartment. For each symbol defined in the original merge section, a duplicate symbol is created for each compartment's copy. InputFile::getRelocTargetSym now accepts a compartment reference. If the symbol index names a symbol from a merge section, the corresponding symbol from the compartment's copy of the merge section is returned. Note that without --gc-sections, each compartment is allocated an entire copy of each merge section, even if a compartment does not use any symbols from that section.
In particular, this forces decompression only once.
Contributor
Author
|
So the .rodata.one/two alignment is from PCC alignment, and it's not applied to .rodata as .text is empty so we don't do a PT_CHERI_PCC. |
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
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.
The first three commits here are small fixups to the base c18n commit that that I think could be squashed down into that first. The last commit I am unsure if it is better or worse. (Can you even have SHF_COMPRESS on a SHF_MERGE section?)
I was able to boot CheriBSD on both RISC-V and Morello when built with this, and all the cheribsdtest tests still pass (including my simple non-ACL c18n tests still pending in a CheriBSD PR).
One odd thing I haven't tracked down is that the per-compartment output sections (e.g. .rodata.one and .rodata.two) have higher alignment than .rodata (8 vs 4) for, e.g. the shared_merge_sections.so.