summaryrefslogtreecommitdiffstats
path: root/lld/wasm/LTO.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-06-28 17:04:58 +0000
committerSam Clegg <sbc@chromium.org>2018-06-28 17:04:58 +0000
commitce004bfe35c20d227865605427a11ff90ccb23b3 (patch)
tree3860ac0f4012651820b01211552863326a4e5968 /lld/wasm/LTO.cpp
parentda5e7e11d1072ea13460f0b4ca77b7de35bf2bb8 (diff)
downloadbcm5719-llvm-ce004bfe35c20d227865605427a11ff90ccb23b3.tar.gz
bcm5719-llvm-ce004bfe35c20d227865605427a11ff90ccb23b3.zip
[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
Diffstat (limited to 'lld/wasm/LTO.cpp')
-rw-r--r--lld/wasm/LTO.cpp3
1 files changed, 2 insertions, 1 deletions
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);
}
OpenPOWER on IntegriCloud