summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/WasmObjectWriter.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-01-11 20:35:17 +0000
committerSam Clegg <sbc@chromium.org>2018-01-11 20:35:17 +0000
commitd423f0d290576fa8e015cca8cb017540473a2761 (patch)
treea3e58fa6d54b03ef13292e6bb1f3c519fcfa85a1 /llvm/lib/MC/WasmObjectWriter.cpp
parent2aac3ee5bcf0c82d450bf26537d29516c78aaf2b (diff)
downloadbcm5719-llvm-d423f0d290576fa8e015cca8cb017540473a2761.tar.gz
bcm5719-llvm-d423f0d290576fa8e015cca8cb017540473a2761.zip
[WebAssemlby] MC: Don't write COMDAT symbols as global imports
This was causing undefined references at link time in lld. Differential Revision: https://reviews.llvm.org/D41959 llvm-svn: 322309
Diffstat (limited to 'llvm/lib/MC/WasmObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index e5099a83b6f..ff000733999 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -1122,7 +1122,8 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
continue;
// If the symbol is not defined in this translation unit, import it.
- if (!WS.isDefined(/*SetUsed=*/false) || WS.isVariable()) {
+ if ((!WS.isDefined(/*SetUsed=*/false) && !WS.isComdat()) ||
+ WS.isVariable()) {
WasmImport Import;
Import.ModuleName = WS.getModuleName();
Import.FieldName = WS.getName();
OpenPOWER on IntegriCloud