diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 82e0fdb0421a..31b2a148e4c1 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -1011,10 +1011,10 @@ static void addRelativeReloc(InputSectionBase *isec, uint64_t offsetInSec, expr, type); } -template +template static void addPltEntry(PltSection *plt, GotPltSection *gotPlt, RelocationBaseSection *rel, RelType type, Symbol &sym) { - plt->addEntry(sym); + plt->addEntry(sym); gotPlt->addEntry(sym); rel->addReloc( {type, gotPlt, sym.getGotPltOffset(), !sym.isPreemptible, &sym, 0}); @@ -1190,7 +1190,7 @@ static void processRelocAux(InputSectionBase &sec, RelExpr expr, RelType type, "' cannot be preempted; recompile with -fPIE" + getLocation(sec, sym, offset)); if (!sym.isInPlt()) - addPltEntry(in.plt, in.gotPlt, in.relaPlt, target->pltRel, sym); + addPltEntry(in.plt, in.gotPlt, in.relaPlt, target->pltRel, sym); if (!sym.isDefined()) replaceWithDefined( sym, in.plt, @@ -1331,7 +1331,7 @@ static void scanReloc(InputSectionBase &sec, OffsetGetter &getOffset, RelTy *&i, if (!sym.isGnuIFunc() || sym.isPreemptible) { // If a relocation needs PLT, we create PLT and GOTPLT slots for the symbol. if (needsPlt(expr) && !sym.isInPlt()) - addPltEntry(in.plt, in.gotPlt, in.relaPlt, target->pltRel, sym); + addPltEntry(in.plt, in.gotPlt, in.relaPlt, target->pltRel, sym); // Create a GOT slot if a relocation needs GOT. if (needsGot(expr)) { @@ -1401,8 +1401,8 @@ static void scanReloc(InputSectionBase &sec, OffsetGetter &getOffset, RelTy *&i, // that's really needed to create the IRELATIVE is the section and value, // so ideally we should just need to copy those. auto *directSym = make(cast(sym)); - addPltEntry(in.iplt, in.igotPlt, in.relaIplt, target->iRelativeRel, - *directSym); + addPltEntry(in.iplt, in.igotPlt, in.relaIplt, target->iRelativeRel, + *directSym); sym.pltIndex = directSym->pltIndex; } if (needsGot(expr)) { diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index d014da220817..d5b45c8373b3 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2486,7 +2486,7 @@ void PltSection::writeTo(uint8_t *buf) { } } -template void PltSection::addEntry(Symbol &sym) { +void PltSection::addEntry(Symbol &sym) { sym.pltIndex = entries.size(); entries.push_back(&sym); } @@ -3621,11 +3621,6 @@ template void splitSections(); template void splitSections(); template void splitSections(); -template void PltSection::addEntry(Symbol &Sym); -template void PltSection::addEntry(Symbol &Sym); -template void PltSection::addEntry(Symbol &Sym); -template void PltSection::addEntry(Symbol &Sym); - template class MipsAbiFlagsSection; template class MipsAbiFlagsSection; template class MipsAbiFlagsSection; diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h index dee21f319980..601f66057b62 100644 --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -673,7 +673,7 @@ public: size_t getSize() const override; bool isNeeded() const override { return !entries.empty(); } void addSymbols(); - template void addEntry(Symbol &sym); + void addEntry(Symbol &sym); size_t headerSize;