Index: lld/trunk/ELF/LinkerScript.cpp =================================================================== --- lld/trunk/ELF/LinkerScript.cpp +++ lld/trunk/ELF/LinkerScript.cpp @@ -636,7 +636,6 @@ // Add sections that didn't match any sections command. void LinkerScript::addOrphanSections() { - unsigned End = SectionCommands.size(); StringMap Map; std::vector V; @@ -651,8 +650,7 @@ else if (Config->OrphanHandling == OrphanHandlingPolicy::Warn) warn(toString(S) + " is being placed in '" + Name + "'"); - if (OutputSection *Sec = - findByName(makeArrayRef(SectionCommands).slice(0, End), Name)) { + if (OutputSection *Sec = findByName(SectionCommands, Name)) { Sec->addSection(cast(S)); return; }