diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-02-01 19:30:15 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-02-01 19:30:15 +0000 |
| commit | 27b2990d11eccdc2cbb723db02ecd5bd4463bd9d (patch) | |
| tree | b7a462206ff98fa47e25975f617f5baee75d1f45 /lld/ELF/OutputSections.cpp | |
| parent | d14dc49dff9f2b772fadb6f28e3a0ab3eab914a7 (diff) | |
| download | bcm5719-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.cpp | 6 |
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. |

