diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp --- a/lld/wasm/Driver.cpp +++ b/lld/wasm/Driver.cpp @@ -596,8 +596,7 @@ static GlobalSymbol *createOptionalGlobal(StringRef name, bool isMutable) { InputGlobal *g = createGlobal(name, isMutable); - return symtab->addOptionalGlobalSymbols(name, WASM_SYMBOL_VISIBILITY_HIDDEN, - g); + return symtab->addOptionalGlobalSymbol(name, g); } // Create ABI-defined synthetic symbols diff --git a/lld/wasm/SymbolTable.h b/lld/wasm/SymbolTable.h --- a/lld/wasm/SymbolTable.h +++ b/lld/wasm/SymbolTable.h @@ -91,8 +91,7 @@ DefinedFunction *addSyntheticFunction(StringRef name, uint32_t flags, InputFunction *function); DefinedData *addOptionalDataSymbol(StringRef name, uint64_t value = 0); - DefinedGlobal *addOptionalGlobalSymbols(StringRef name, uint32_t flags, - InputGlobal *global); + DefinedGlobal *addOptionalGlobalSymbol(StringRef name, InputGlobal *global); DefinedTable *addSyntheticTable(StringRef name, uint32_t flags, InputTable *global); diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp --- a/lld/wasm/SymbolTable.cpp +++ b/lld/wasm/SymbolTable.cpp @@ -258,16 +258,16 @@ nullptr, global); } -DefinedGlobal *SymbolTable::addOptionalGlobalSymbols(StringRef name, - uint32_t flags, - InputGlobal *global) { - LLVM_DEBUG(dbgs() << "addOptionalGlobalSymbols: " << name << " -> " << global +DefinedGlobal *SymbolTable::addOptionalGlobalSymbol(StringRef name, + InputGlobal *global) { + LLVM_DEBUG(dbgs() << "addOptionalGlobalSymbol: " << name << " -> " << global << "\n"); Symbol *s = find(name); if (!s || s->isDefined()) return nullptr; syntheticGlobals.emplace_back(global); - return replaceSymbol(s, name, flags, nullptr, global); + return replaceSymbol(s, name, WASM_SYMBOL_VISIBILITY_HIDDEN, + nullptr, global); } DefinedTable *SymbolTable::addSyntheticTable(StringRef name, uint32_t flags,