Fix llvm-nm(1) printing of llvm-bitcode files for -format darwin to match darwin’s nm(1).

Also a small fix to match printing of Mach-O objects with -format posix.

llvm-svn: 252567
This commit is contained in:
Kevin Enderby
2015-11-10 00:31:08 +00:00
parent ffa143ce81
commit dc0dbe1f69
6 changed files with 138 additions and 45 deletions

View File

@@ -219,6 +219,12 @@ uint32_t IRObjectFile::getSymbolFlags(DataRefImpl Symb) const {
uint32_t Res = BasicSymbolRef::SF_None;
if (GV->isDeclarationForLinker())
Res |= BasicSymbolRef::SF_Undefined;
else if (GV->hasHiddenVisibility() && !GV->hasLocalLinkage())
Res |= BasicSymbolRef::SF_Hidden;
if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) {
if (GVar->isConstant())
Res |= BasicSymbolRef::SF_Const;
}
if (GV->hasPrivateLinkage())
Res |= BasicSymbolRef::SF_FormatSpecific;
if (!GV->hasLocalLinkage())