Index: lld/trunk/wasm/Driver.cpp =================================================================== --- lld/trunk/wasm/Driver.cpp +++ lld/trunk/wasm/Driver.cpp @@ -134,14 +134,6 @@ return None; } -// Inject a new undefined symbol into the link. This will cause the link to -// fail unless this symbol can be found. -static void addSyntheticUndefinedFunction(StringRef Name, - const WasmSignature *Type) { - log("injecting undefined func: " + Name); - Symtab->addUndefinedFunction(Name, Type); -} - static void printHelp(const char *Argv0) { WasmOptTable().PrintHelp(outs(), Argv0, "LLVM Linker", false); } @@ -293,11 +285,11 @@ if (!Config->Relocatable) { static WasmSignature Signature = {{}, WASM_TYPE_NORESULT}; if (!Config->Entry.empty()) - addSyntheticUndefinedFunction(Config->Entry, &Signature); + Symtab->addUndefinedFunction(Config->Entry, &Signature); // Handle the `--undefined ` options. for (auto* Arg : Args.filtered(OPT_undefined)) - addSyntheticUndefinedFunction(Arg->getValue(), nullptr); + Symtab->addUndefinedFunction(Arg->getValue(), nullptr); // Create linker-synthetic symbols // __wasm_call_ctors: Index: lld/trunk/wasm/SymbolTable.cpp =================================================================== --- lld/trunk/wasm/SymbolTable.cpp +++ lld/trunk/wasm/SymbolTable.cpp @@ -187,6 +187,7 @@ Symbol *SymbolTable::addUndefinedFunction(StringRef Name, const WasmSignature *Type) { + DEBUG(dbgs() << "addUndefinedFunction: " << Name << "\n"); Symbol *S; bool WasInserted; std::tie(S, WasInserted) = insert(Name);