diff options
| author | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
|---|---|---|
| committer | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
| commit | 38500d63e14ce340236840f60d356cdefb56a52c (patch) | |
| tree | 17edbec446ce9b50d2f215a483b83afb293a635d /lld/ELF/OutputSections.cpp | |
| parent | 1a3d5daaef7a6a63448a497da3eff7fc9e23df26 (diff) | |
| parent | 27f30029741ecf023baece7b3dde1ff9011ffefc (diff) | |
Merge branch 'main' into users/meinersbur/flang_runtime_split-headersusers/meinersbur/flang_runtime_split-headers
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
| -rw-r--r-- | lld/ELF/OutputSections.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 546dc58b4bc8..a2da5543d586 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -253,8 +253,20 @@ void OutputSection::finalizeInputSections() { for (InputSection *s : isd->sections) commitSection(s); } - for (auto *ms : mergeSections) + for (auto *ms : mergeSections) { + // Merging may have increased the alignment of a spillable section. Update + // the alignment of potential spill sections and their containing output + // sections. + if (auto it = script->potentialSpillLists.find(ms); + it != script->potentialSpillLists.end()) { + for (PotentialSpillSection *s = it->second.head; s; s = s->next) { + s->addralign = std::max(s->addralign, ms->addralign); + s->parent->addralign = std::max(s->parent->addralign, s->addralign); + } + } + ms->finalizeContents(); + } } static void sortByOrder(MutableArrayRef<InputSection *> in, |
