summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-11-30 22:34:58 +0000
committerSam Clegg <sbc@chromium.org>2017-11-30 22:34:58 +0000
commit9138b7b0059521d6dabbc26362e00eaa69a6aec8 (patch)
tree70e2f8184231bfa0d4d3666b382f6307355c5c0e /llvm/lib/Object
parentf71964a1847427d1f89562de81a05b4a01939905 (diff)
downloadbcm5719-llvm-9138b7b0059521d6dabbc26362e00eaa69a6aec8.tar.gz
bcm5719-llvm-9138b7b0059521d6dabbc26362e00eaa69a6aec8.zip
Add visibility flag to Wasm symbol flags
The LLVM "hidden" flag needs to be passed through the Wasm intermediate objects in order for the linker to apply it to the final Wasm object. The corresponding change in LLD is here: https://github.com/WebAssembly/lld/pull/14 Patch by Nicholas Wilson Differential Revision: https://reviews.llvm.org/D40442 llvm-svn: 319488
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r--llvm/lib/Object/WasmObjectFile.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index 86ce9c2209c..70ac598b897 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -378,7 +378,7 @@ Error WasmObjectFile::parseLinkingSection(const uint8_t *Ptr,
Symbols[SymIndex].Flags = Flags;
DEBUG(dbgs() << "Set symbol flags index:"
<< SymIndex << " name:"
- << Symbols[SymIndex].Name << " exptected:"
+ << Symbols[SymIndex].Name << " expected:"
<< Symbol << " flags: " << Flags << "\n");
}
break;
@@ -766,6 +766,8 @@ uint32_t WasmObjectFile::getSymbolFlags(DataRefImpl Symb) const {
Result |= SymbolRef::SF_Weak;
if (!Sym.isLocal())
Result |= SymbolRef::SF_Global;
+ if (Sym.isHidden())
+ Result |= SymbolRef::SF_Hidden;
switch (Sym.Type) {
case WasmSymbol::SymbolType::FUNCTION_IMPORT:
OpenPOWER on IntegriCloud