summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-05-10 01:52:08 +0000
committerSam Clegg <sbc@chromium.org>2019-05-10 01:52:08 +0000
commitea38ac5ba3148e72dc1a260910ef65d2f623e0b5 (patch)
treeb5472fd8e2136c519abf59c8871b257706977234 /llvm/lib
parent2147365484f1b16d945a45890e9b2d75d14e55e1 (diff)
downloadbcm5719-llvm-ea38ac5ba3148e72dc1a260910ef65d2f623e0b5.tar.gz
bcm5719-llvm-ea38ac5ba3148e72dc1a260910ef65d2f623e0b5.zip
[WebAssembly] Don't assume that strongly defined symbols are DSO-local
The current PIC model for WebAssembly is more like ELF in that it allows symbol interposition. This means that more functions end up being addressed via the GOT and fewer directly added to the wasm table. One effect is a reduction in the number of wasm table entries similar to the previous attempt in https://reviews.llvm.org/D61539 which was reverted. Differential Revision: https://reviews.llvm.org/D61772 llvm-svn: 360402
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/TargetMachine.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index 5b2bdc37af8..fd70b836421 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -167,13 +167,13 @@ bool TargetMachine::shouldAssumeDSOLocal(const Module &M,
if (GV && !GV->hasDefaultVisibility())
return true;
- if (TT.isOSBinFormatMachO() || TT.isOSBinFormatWasm()) {
+ if (TT.isOSBinFormatMachO()) {
if (RM == Reloc::Static)
return true;
return GV && GV->isStrongDefinitionForLinker();
}
- assert(TT.isOSBinFormatELF());
+ assert(TT.isOSBinFormatELF() || TT.isOSBinFormatWasm());
assert(RM != Reloc::DynamicNoPIC);
bool IsExecutable =
@@ -201,7 +201,7 @@ bool TargetMachine::shouldAssumeDSOLocal(const Module &M,
return true;
}
- // ELF supports preemption of other symbols.
+ // ELF & wasm support preemption of other symbols.
return false;
}
OpenPOWER on IntegriCloud