From 79cd5d0080b8173b80c7161a420b800b51f93e86 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 20 Sep 2017 23:39:44 +0000 Subject: [WebAssembly] Weak symbols should be defined in SF_Global Summary: This manifested itself in lld since it meant that weak symbols were not appearing in archive symbol tables. Subscribers: jfb, dschuff, jgravelle-google, aheejin Differential Revision: https://reviews.llvm.org/D38111 llvm-svn: 313838 --- llvm/lib/Object/WasmObjectFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Object/WasmObjectFile.cpp') diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp index 3b62ccf..77fcac5 100644 --- a/llvm/lib/Object/WasmObjectFile.cpp +++ b/llvm/lib/Object/WasmObjectFile.cpp @@ -769,7 +769,7 @@ uint32_t WasmObjectFile::getSymbolFlags(DataRefImpl Symb) const { DEBUG(dbgs() << "getSymbolFlags: ptr=" << &Sym << " " << Sym << "\n"); if (Sym.isWeak()) Result |= SymbolRef::SF_Weak; - else if (Sym.isGlobal()) + if (!Sym.isLocal()) Result |= SymbolRef::SF_Global; switch (Sym.Type) { -- cgit v1.1