diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 67dda41a6d65..a1cc6f98e8f2 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -229,7 +229,6 @@ getComparator(SortSectionPolicy K) { } } -template static bool matchConstraints(ArrayRef Sections, ConstraintKind Kind) { if (Kind == ConstraintKind::NoConstraint) @@ -375,7 +374,7 @@ void LinkerScript::processCommands(OutputSectionFactory &Factory) { // // Because we'll iterate over Commands many more times, the easiest // way to "make it as if it wasn't present" is to just remove it. - if (!matchConstraints(V, Cmd->Constraint)) { + if (!matchConstraints(V, Cmd->Constraint)) { for (InputSectionBase *S : V) S->Assigned = false; Opt.Commands.erase(Iter); @@ -414,14 +413,14 @@ void LinkerScript::addOrphanSections(OutputSectionFactory &Factory) { Factory.addInputSec(S, getOutputSectionName(S->Name)); } -template static bool isTbss(OutputSection *Sec) { +static bool isTbss(OutputSection *Sec) { return (Sec->Flags & SHF_TLS) && Sec->Type == SHT_NOBITS; } template void LinkerScript::output(InputSection *S) { if (!AlreadyOutputIS.insert(S).second) return; - bool IsTbss = isTbss(CurOutSec); + bool IsTbss = isTbss(CurOutSec); uint64_t Pos = IsTbss ? Dot + ThreadBssOffset : Dot; Pos = alignTo(Pos, S->Alignment); @@ -469,7 +468,7 @@ template void LinkerScript::switchTo(OutputSection *Sec) { CurOutSec = Sec; Dot = alignTo(Dot, CurOutSec->Alignment); - CurOutSec->Addr = isTbss(CurOutSec) ? Dot + ThreadBssOffset : Dot; + CurOutSec->Addr = isTbss(CurOutSec) ? Dot + ThreadBssOffset : Dot; // If neither AT nor AT> is specified for an allocatable section, the linker // will set the LMA such that the difference between VMA and LMA for the