[lld] [ELF] Support relocatable files using CREL (PR #98115)
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 26 09:02:54 PDT 2024
================
@@ -470,6 +481,11 @@ void OutputSection::writeTo(uint8_t *buf, parallel::TaskGroup &tg) {
llvm::TimeTraceScope timeScope("Write sections", name);
if (type == SHT_NOBITS)
return;
+ if (type == SHT_CREL && !(flags & SHF_ALLOC)) {
----------------
smithp35 wrote:
Are we expecting to encounter SHF_ALLOC SHT_CREL? If not then we probably ought to add an assertion.
I can see `SHF_ALLOC` `SHT_CREL` could be problematic if the size of the `SHT_CREL` section is sensitive to the contents of the relocations. This might need an encoding per pass of finalizeAddressDependent content.
I can only think of dynamic relocations rela.plt and rela.dyn that are supposed to be `SHF_ALLOC` at the moment.
https://github.com/llvm/llvm-project/pull/98115
More information about the llvm-commits
mailing list