[WebAssembly] Add support for bitcode archive members
This change effects the behavior of --export-all. Previously
--export-all would only effect symbols that survived GC. Now
--export-all will prevent any non-local symbols from being GCed.
Differential Revision: https://reviews.llvm.org/D48673
llvm-svn: 335878
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index 41562e3..37ad324 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -740,11 +740,7 @@
unsigned FakeGlobalIndex = NumImportedGlobals + InputGlobals.size();
for (Symbol *Sym : Symtab->getSymbols()) {
- if (!Sym->isDefined())
- continue;
- if (Sym->isHidden() && !Config->ExportAll)
- continue;
- if (Sym->isLocal())
+ if (!Sym->isExported())
continue;
if (!Sym->isLive())
continue;