From ce004bfe35c20d227865605427a11ff90ccb23b3 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 28 Jun 2018 17:04:58 +0000 Subject: [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 --- lld/wasm/LTO.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lld/wasm/LTO.cpp') diff --git a/lld/wasm/LTO.cpp b/lld/wasm/LTO.cpp index 58f32aaf244..dd66c67e39f 100644 --- a/lld/wasm/LTO.cpp +++ b/lld/wasm/LTO.cpp @@ -95,7 +95,8 @@ void BitcodeCompiler::add(BitcodeFile &F) { // Once IRObjectFile is fixed to report only one symbol this hack can // be removed. R.Prevailing = !ObjSym.isUndefined() && Sym->getFile() == &F; - R.VisibleToRegularObj = Config->Relocatable || Sym->IsUsedInRegularObj; + R.VisibleToRegularObj = Config->Relocatable || Sym->IsUsedInRegularObj || + (R.Prevailing && Sym->isExported()); if (R.Prevailing) undefine(Sym); } -- cgit v1.2.3