// by "readelf --string-dump .comment <file>".
// The returned object is a mergeable string section.
MergeInputSection *elf::createCommentSection() {
- return make<MergeInputSection>(SHF_MERGE | SHF_STRINGS, SHT_PROGBITS, 1,
- getVersion(), ".comment");
+ auto *sec = make<MergeInputSection>(SHF_MERGE | SHF_STRINGS, SHT_PROGBITS, 1,
+ getVersion(), ".comment");
+ sec->splitIntoPieces();
+ return sec;
}
// .MIPS.abiflags section.
llvm::TimeTraceScope timeScope("Split sections");
// splitIntoPieces needs to be called on each MergeInputSection
// before calling finalizeContents().
- parallelForEach(inputSections, [](InputSectionBase *sec) {
- if (auto *s = dyn_cast<MergeInputSection>(sec))
- s->splitIntoPieces();
- else if (auto *eh = dyn_cast<EhInputSection>(sec))
- eh->split<ELFT>();
+ parallelForEach(objectFiles, [](ELFFileBase *file) {
+ for (InputSectionBase *sec : file->getSections()) {
+ if (!sec)
+ continue;
+ if (auto *s = dyn_cast<MergeInputSection>(sec))
+ s->splitIntoPieces();
+ else if (auto *eh = dyn_cast<EhInputSection>(sec))
+ eh->split<ELFT>();
+ }
});
}