aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/XCOFFObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/XCOFFObjectFile.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index f2f6d70..d9ecb0a 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -615,6 +615,16 @@ Expected<uint32_t> XCOFFObjectFile::getSymbolFlags(DataRefImpl Symb) const {
if (XCOFFSym.getSectionNumber() == XCOFF::N_UNDEF)
Result |= SymbolRef::SF_Undefined;
+ // There is no visibility in old 32 bit XCOFF object file interpret.
+ if (is64Bit() || (auxiliaryHeader32() && (auxiliaryHeader32()->getVersion() ==
+ NEW_XCOFF_INTERPRET))) {
+ uint16_t SymType = XCOFFSym.getSymbolType();
+ if ((SymType & VISIBILITY_MASK) == SYM_V_HIDDEN)
+ Result |= SymbolRef::SF_Hidden;
+
+ if ((SymType & VISIBILITY_MASK) == SYM_V_EXPORTED)
+ Result |= SymbolRef::SF_Exported;
+ }
return Result;
}