[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
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index ac2e454..c7c6ca7 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -490,8 +490,10 @@
const Twine &Group, unsigned UniqueID,
const char *BeginSymName) {
MCSymbolWasm *GroupSym = nullptr;
- if (!Group.isTriviallyEmpty() && !Group.str().empty())
+ if (!Group.isTriviallyEmpty() && !Group.str().empty()) {
GroupSym = cast<MCSymbolWasm>(getOrCreateSymbol(Group));
+ GroupSym->setComdat(true);
+ }
return getWasmSection(Section, K, GroupSym, UniqueID, BeginSymName);
}