diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index 5bda2870ac96..54f5f5505295 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -240,7 +240,7 @@ template void SymbolTable::resolve(SymbolBody *New) { // compare() returns -1, 0, or 1 if the lhs symbol is less preferable, // equivalent (conflicting), or more preferable, respectively. - int Comp = Existing->compare(New); + int Comp = Existing->compare(New); if (Comp == 0) { std::string S = "duplicate symbol: " + conflictMsg(Existing, New); if (Config->AllowMultipleDefinition) diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp index 9136b90bca41..cdf99791ac53 100644 --- a/lld/ELF/Symbols.cpp +++ b/lld/ELF/Symbols.cpp @@ -184,7 +184,7 @@ static int compareCommons(DefinedCommon *A, DefinedCommon *B) { // Returns 1, 0 or -1 if this symbol should take precedence // over the Other, tie or lose, respectively. -template int SymbolBody::compare(SymbolBody *Other) { +int SymbolBody::compare(SymbolBody *Other) { assert(!isLazy() && !Other->isLazy()); std::tuple L(isDefined(), !isShared(), !isWeak()); std::tuple R(Other->isDefined(), !Other->isShared(), @@ -192,7 +192,7 @@ template int SymbolBody::compare(SymbolBody *Other) { // Normalize if (L > R) - return -Other->compare(this); + return -Other->compare(this); uint8_t V = getMinVisibility(getVisibility(), Other->getVisibility()); setVisibility(V); @@ -347,11 +347,6 @@ template uint32_t SymbolBody::template getThunkVA() const; template uint64_t SymbolBody::template getThunkVA() const; template uint64_t SymbolBody::template getThunkVA() const; -template int SymbolBody::compare(SymbolBody *Other); -template int SymbolBody::compare(SymbolBody *Other); -template int SymbolBody::compare(SymbolBody *Other); -template int SymbolBody::compare(SymbolBody *Other); - template class elf::UndefinedElf; template class elf::UndefinedElf; template class elf::UndefinedElf; diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h index 9edeb47bdf1f..5327b8c0d610 100644 --- a/lld/ELF/Symbols.h +++ b/lld/ELF/Symbols.h @@ -121,7 +121,7 @@ public: // Decides which symbol should "win" in the symbol table, this or // the Other. Returns 1 if this wins, -1 if the Other wins, or 0 if // they are duplicate (conflicting) symbols. - template int compare(SymbolBody *Other); + int compare(SymbolBody *Other); protected: SymbolBody(Kind K, StringRef Name, uint8_t Binding, uint8_t StOther,