diff options
Diffstat (limited to 'lld/ELF/Driver.cpp')
| -rw-r--r-- | lld/ELF/Driver.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index b8aa4bf9175..2dccbcb16ec 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -1031,6 +1031,10 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) { for (StringRef Sym : Script->Opt.ReferencedSymbols) Symtab->addUndefined<ELFT>(Sym); + // Handle the `--undefined <sym>` options. + for (StringRef S : Config->Undefined) + Symtab->fetchIfLazy<ELFT>(S); + // If an entry symbol is in a static archive, pull out that file now // to complete the symbol table. After this, no new names except a // few linker-synthesized ones will be added to the symbol table. @@ -1040,10 +1044,6 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) { if (ErrorCount) return; - // Handle the `--undefined <sym>` options. - for (StringRef S : Config->Undefined) - Symtab->fetchIfLazy<ELFT>(S); - // Handle undefined symbols in DSOs. Symtab->scanShlibUndefined<ELFT>(); |

