summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-10-03 20:45:09 +0000
committerRui Ueyama <ruiu@google.com>2017-10-03 20:45:09 +0000
commita215e7cbe82c5ea10c6e87b3129670b0bcae6172 (patch)
tree7c7116b18f1f5dc51c0ed981c99867d026a35879
parentfa105f8debfb207f9bd2de7d1ca50cdb5f01bfef (diff)
downloadbcm5719-llvm-a215e7cbe82c5ea10c6e87b3129670b0bcae6172.tar.gz
bcm5719-llvm-a215e7cbe82c5ea10c6e87b3129670b0bcae6172.zip
Move fetchIfLazy up so that the following comment makes sense.
We have this comment in LinkerDriver::link After this, no new names except a few linker-synthesized ones will be added to the symbol table. but that was not true because new symbols could be added by processing the -u option. llvm-svn: 314842
-rw-r--r--lld/ELF/Driver.cpp8
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>();
OpenPOWER on IntegriCloud