[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/MarkLive.cpp b/lld/wasm/MarkLive.cpp
index 018b325..dfaa712 100644
--- a/lld/wasm/MarkLive.cpp
+++ b/lld/wasm/MarkLive.cpp
@@ -54,9 +54,9 @@
Enqueue(Symtab->find(Config->Entry));
Enqueue(WasmSym::CallCtors);
- // We export all defined, non-hidden symbols so they are all gc roots too
+ // We need to preserve any exported symbol
for (Symbol *Sym : Symtab->getSymbols())
- if (Sym->isDefined() && !Sym->isHidden())
+ if (Sym->isExported())
Enqueue(Sym);
// The ctor functions are all used in the synthetic __wasm_call_ctors