diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 232b1d3fa891..b8aa4bf9175a 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -1041,7 +1041,8 @@ template void LinkerDriver::link(opt::InputArgList &Args) { return; // Handle the `--undefined ` options. - Symtab->scanUndefinedFlags(); + for (StringRef S : Config->Undefined) + Symtab->fetchIfLazy(S); // Handle undefined symbols in DSOs. Symtab->scanShlibUndefined(); diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index 0b9ee5d9fb09..c538e2dc1d8c 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -593,12 +593,6 @@ template void SymbolTable::fetchIfLazy(StringRef Name) { } } -// Process undefined (-u) flags by loading lazy symbols named by those flags. -template void SymbolTable::scanUndefinedFlags() { - for (StringRef S : Config->Undefined) - fetchIfLazy(S); -} - // This function takes care of the case in which shared libraries depend on // the user program (not the other way, which is usual). Shared libraries // may have undefined symbols, expecting that the user program provides @@ -884,11 +878,6 @@ template void SymbolTable::fetchIfLazy(StringRef); template void SymbolTable::fetchIfLazy(StringRef); template void SymbolTable::fetchIfLazy(StringRef); -template void SymbolTable::scanUndefinedFlags(); -template void SymbolTable::scanUndefinedFlags(); -template void SymbolTable::scanUndefinedFlags(); -template void SymbolTable::scanUndefinedFlags(); - template void SymbolTable::scanShlibUndefined(); template void SymbolTable::scanShlibUndefined(); template void SymbolTable::scanShlibUndefined(); diff --git a/lld/ELF/SymbolTable.h b/lld/ELF/SymbolTable.h index 6506a9242371..7d28dd04c27e 100644 --- a/lld/ELF/SymbolTable.h +++ b/lld/ELF/SymbolTable.h @@ -85,7 +85,6 @@ public: InputFile *File); template void fetchIfLazy(StringRef Name); - template void scanUndefinedFlags(); template void scanShlibUndefined(); void scanVersionScript();