diff options
| author | Sam Clegg <sbc@chromium.org> | 2018-01-11 20:35:17 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2018-01-11 20:35:17 +0000 |
| commit | d423f0d290576fa8e015cca8cb017540473a2761 (patch) | |
| tree | a3e58fa6d54b03ef13292e6bb1f3c519fcfa85a1 /llvm/lib/MC/WasmObjectWriter.cpp | |
| parent | 2aac3ee5bcf0c82d450bf26537d29516c78aaf2b (diff) | |
| download | bcm5719-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.cpp | 3 |
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(); |

