[ELF2] Implement --allow-shlib-undefined as default behavior.
We ignore --{no,}allow-shlib-undefined options and always allow undefined
symbols if we are building a DSO.
llvm-svn: 249036
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 1d602a0..4500041 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -271,6 +271,9 @@
typedef typename ELFFile<ELFT>::Elf_Sym Elf_Sym;
typedef typename ELFFile<ELFT>::Elf_Sym_Range Elf_Sym_Range;
+ if (Config->Shared)
+ return;
+
const Elf_Sym &SymE = cast<ELFSymbolBody<ELFT>>(Sym).Sym;
ELFFileBase *SymFile = nullptr;