diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 76a29b0341463..9a2b52cf568d5 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -268,7 +268,6 @@ InputSection *InputSectionBase::getLinkOrderDep() const { } // Find a function symbol that encloses a given location. -template Defined *InputSectionBase::getEnclosingFunction(uint64_t offset) { for (Symbol *b : file->getSymbols()) if (Defined *d = dyn_cast(b)) @@ -289,7 +288,7 @@ std::string InputSectionBase::getLocation(uint64_t offset) { return (config->outputFile + ":(" + secAndOffset).str(); std::string file = toString(getFile()); - if (Defined *d = getEnclosingFunction(offset)) + if (Defined *d = getEnclosingFunction(offset)) return file + ":(function " + toString(*d) + ": " + secAndOffset; return file + ":(" + secAndOffset; @@ -1203,7 +1202,7 @@ void InputSectionBase::adjustSplitStackFunctionPrologues(uint8_t *buf, if (enclosingPrologueAttempted(rel.offset, prologues)) continue; - if (Defined *f = getEnclosingFunction(rel.offset)) { + if (Defined *f = getEnclosingFunction(rel.offset)) { prologues.insert(f); if (target->adjustPrologueForCrossSplitStack(buf + f->value, end, f->stOther)) diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index cbb060fd27409..3bd180be7d43e 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -178,7 +178,6 @@ class InputSectionBase : public SectionBase { // Get the function symbol that encloses this offset from within the // section. - template Defined *getEnclosingFunction(uint64_t offset); // Returns a source location string. Used to construct an error message.