diff options
-rw-r--r-- | lld/ELF/Writer.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index b3d9f2c..1c03033 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -956,8 +956,6 @@ findOrphanPos(SmallVectorImpl<SectionCommand *>::iterator b, if (i == e) return e; - auto isOutputSec = [](SectionCommand *cmd) { return isa<OutputDesc>(cmd); }; - // Then, scan backward or forward through the script for a suitable insertion // point. If i's rank is larger, the orphan section can be placed before i. // @@ -969,7 +967,7 @@ findOrphanPos(SmallVectorImpl<SectionCommand *>::iterator b, bool mustAfter = script->hasPhdrsCommands() || !script->memoryRegions.empty(); if (cast<OutputDesc>(*i)->osec.sortRank <= sec->sortRank || mustAfter) { for (auto j = ++i; j != e; ++j) { - if (!isOutputSec(*j)) + if (!isa<OutputDesc>(*j)) continue; if (getRankProximity(sec, *j) != maxP) break; @@ -977,7 +975,7 @@ findOrphanPos(SmallVectorImpl<SectionCommand *>::iterator b, } } else { for (; i != b; --i) - if (isOutputSec(i[-1])) + if (isa<OutputDesc>(i[-1])) break; } @@ -986,7 +984,8 @@ findOrphanPos(SmallVectorImpl<SectionCommand *>::iterator b, // This matches bfd's behavior and is convenient when the linker script fully // specifies the start of the file, but doesn't care about the end (the non // alloc sections for example). - if (std::find_if(i, e, isOutputSec) == e) + if (std::find_if( + i, e, [](SectionCommand *cmd) { return isa<OutputDesc>(cmd); }) == e) return e; while (i != e && shouldSkip(*i)) |