diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp --- a/lld/wasm/SymbolTable.cpp +++ b/lld/wasm/SymbolTable.cpp @@ -113,6 +113,7 @@ sym->isUsedInRegularObj = false; sym->canInline = true; sym->traced = trace; + sym->forceExport = false; symVector.emplace_back(sym); return {sym, true}; } @@ -598,6 +599,11 @@ // Create a new variant; LLVM_DEBUG(dbgs() << "added new variant\n"); variant = reinterpret_cast(make()); + variant->isUsedInRegularObj = + !file || file->kind() == InputFile::ObjectKind; + variant->canInline = true; + variant->traced = false; + variant->forceExport = false; variants.push_back(variant); } else { LLVM_DEBUG(dbgs() << "variant already exists: " << toString(*variant) << "\n");