summaryrefslogtreecommitdiffstats
path: root/lld/ELF/OutputSections.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-02-01 19:30:15 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-02-01 19:30:15 +0000
commit27b2990d11eccdc2cbb723db02ecd5bd4463bd9d (patch)
treeb7a462206ff98fa47e25975f617f5baee75d1f45 /lld/ELF/OutputSections.cpp
parentd14dc49dff9f2b772fadb6f28e3a0ab3eab914a7 (diff)
downloadbcm5719-llvm-27b2990d11eccdc2cbb723db02ecd5bd4463bd9d.tar.gz
bcm5719-llvm-27b2990d11eccdc2cbb723db02ecd5bd4463bd9d.zip
Sort each InputSectionDescription individually.
This fixes pr36190. Thanks to James Henderson for the testcase and for pointing out how to fix this. llvm-svn: 323993
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
-rw-r--r--lld/ELF/OutputSections.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 75df1c254f9..59fc5bd4bd3 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -160,9 +160,9 @@ bool OutputSection::classof(const BaseCommand *C) {
void OutputSection::sort(std::function<int(InputSectionBase *S)> Order) {
assert(Live);
- assert(SectionCommands.size() == 1);
- sortByOrder(cast<InputSectionDescription>(SectionCommands[0])->Sections,
- Order);
+ for (BaseCommand *B : SectionCommands)
+ if (auto *ISD = dyn_cast<InputSectionDescription>(B))
+ sortByOrder(ISD->Sections, Order);
}
// Fill [Buf, Buf + Size) with Filler.
OpenPOWER on IntegriCloud