diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index a1cc6f98e8f2..244679da769c 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -518,7 +518,6 @@ template void LinkerScript::process(BaseCommand &Base) { } } -template static OutputSection * findSection(StringRef Name, const std::vector &Sections) { auto End = Sections.end(); @@ -571,7 +570,7 @@ MemoryRegion *LinkerScript::findMemoryRegion(OutputSectionCommand *Cmd, // for a single sections command (e.g. ".text { *(.text); }"). template void LinkerScript::assignOffsets(OutputSectionCommand *Cmd) { - OutputSection *Sec = findSection(Cmd->Name, *OutputSections); + OutputSection *Sec = findSection(Cmd->Name, *OutputSections); if (!Sec) return; @@ -618,7 +617,7 @@ template void LinkerScript::removeEmptyCommands() { Opt.Commands.begin(), Opt.Commands.end(), [&](const std::unique_ptr &Base) { if (auto *Cmd = dyn_cast(Base.get())) - return !findSection(Cmd->Name, *OutputSections); + return !findSection(Cmd->Name, *OutputSections); return false; }); Opt.Commands.erase(Pos, Opt.Commands.end()); @@ -642,7 +641,7 @@ template void LinkerScript::adjustSectionsBeforeSorting() { auto *Cmd = dyn_cast(Base.get()); if (!Cmd) continue; - if (OutputSection *Sec = findSection(Cmd->Name, *OutputSections)) { + if (OutputSection *Sec = findSection(Cmd->Name, *OutputSections)) { Flags = Sec->Flags; Type = Sec->Type; continue;