[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
This commit is contained in:
Sam Clegg
2017-09-20 23:39:44 +00:00
parent 2bf5cd9e76
commit 79cd5d0080
2 changed files with 15 additions and 2 deletions

View File

@@ -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) {