diff options
Diffstat (limited to 'lld/ELF/SymbolTable.cpp')
-rw-r--r-- | lld/ELF/SymbolTable.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index 0aacb04aa95..e99e5077d7e 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -326,7 +326,6 @@ static int compareDefined(Symbol *S, bool WasInserted, uint8_t Binding) { // We have a new non-common defined symbol with the specified binding. Return 1 // if the new symbol should win, -1 if the new symbol should lose, or 0 if there // is a conflict. If the new symbol wins, also update the binding. -template <class ELFT> static int compareDefinedNonCommon(Symbol *S, bool WasInserted, uint8_t Binding) { if (int Cmp = compareDefined(S, WasInserted, Binding)) { @@ -334,7 +333,7 @@ static int compareDefinedNonCommon(Symbol *S, bool WasInserted, S->Binding = Binding; return Cmp; } - if (isa<DefinedCommon<ELFT>>(S->body())) { + if (isa<DefinedCommon>(S->body())) { // Non-common symbols take precedence over common symbols. if (Config->WarnCommon) warning("common " + S->body()->getName() + " is overridden"); @@ -356,10 +355,9 @@ Symbol *SymbolTable<ELFT>::addCommon(StringRef N, uint64_t Size, int Cmp = compareDefined(S, WasInserted, Binding); if (Cmp > 0) { S->Binding = Binding; - replaceBody<DefinedCommon<ELFT>>(S, N, Size, Alignment, StOther, Type, - File); + replaceBody<DefinedCommon>(S, N, Size, Alignment, StOther, Type, File); } else if (Cmp == 0) { - auto *C = dyn_cast<DefinedCommon<ELFT>>(S->body()); + auto *C = dyn_cast<DefinedCommon>(S->body()); if (!C) { // Non-common symbols take precedence over common symbols. if (Config->WarnCommon) @@ -395,7 +393,7 @@ Symbol *SymbolTable<ELFT>::addRegular(StringRef Name, const Elf_Sym &Sym, Name, Sym.getType(), Sym.getVisibility(), /*CanOmitFromDynSym*/ false, /*HasUnnamedAddr*/ false, /*IsUsedInRegularObj*/ true, Section ? Section->getFile() : nullptr); - int Cmp = compareDefinedNonCommon<ELFT>(S, WasInserted, Sym.getBinding()); + int Cmp = compareDefinedNonCommon(S, WasInserted, Sym.getBinding()); if (Cmp > 0) replaceBody<DefinedRegular<ELFT>>(S, Name, Sym, Section); else if (Cmp == 0) @@ -411,7 +409,7 @@ Symbol *SymbolTable<ELFT>::addRegular(StringRef Name, uint8_t Binding, std::tie(S, WasInserted) = insert(Name, STT_NOTYPE, StOther & 3, /*CanOmitFromDynSym*/ false, /*HasUnnamedAddr*/ false, /*IsUsedInRegularObj*/ true, nullptr); - int Cmp = compareDefinedNonCommon<ELFT>(S, WasInserted, Binding); + int Cmp = compareDefinedNonCommon(S, WasInserted, Binding); if (Cmp > 0) replaceBody<DefinedRegular<ELFT>>(S, Name, StOther); else if (Cmp == 0) @@ -429,7 +427,7 @@ Symbol *SymbolTable<ELFT>::addSynthetic(StringRef N, /*CanOmitFromDynSym*/ false, /*HasUnnamedAddr*/ false, /*IsUsedInRegularObj*/ true, nullptr); - int Cmp = compareDefinedNonCommon<ELFT>(S, WasInserted, STB_GLOBAL); + int Cmp = compareDefinedNonCommon(S, WasInserted, STB_GLOBAL); if (Cmp > 0) replaceBody<DefinedSynthetic<ELFT>>(S, N, Value, Section); else if (Cmp == 0) @@ -469,7 +467,7 @@ Symbol *SymbolTable<ELFT>::addBitcode(StringRef Name, uint8_t Binding, std::tie(S, WasInserted) = insert(Name, Type, StOther & 3, CanOmitFromDynSym, HasUnnamedAddr, /*IsUsedInRegularObj*/ false, F); - int Cmp = compareDefinedNonCommon<ELFT>(S, WasInserted, Binding); + int Cmp = compareDefinedNonCommon(S, WasInserted, Binding); if (Cmp > 0) replaceBody<DefinedRegular<ELFT>>(S, Name, StOther, Type, F); else if (Cmp == 0) |