Skip to content

Commit

Permalink
Object: Set SF_Indirect in ModuleSymbolTable.
Browse files Browse the repository at this point in the history
This lets us remove the last use of IRObjectFile::getSymbolGV() in llvm-nm.

Differential Revision: https://reviews.llvm.org/D27076

llvm-svn: 288321
  • Loading branch information
pcc committed Dec 1, 2016
1 parent e2f1b4a commit d64ecf2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 2 additions & 0 deletions llvm/lib/Object/ModuleSymbolTable.cpp
Expand Up @@ -166,6 +166,8 @@ uint32_t ModuleSymbolTable::getSymbolFlags(Symbol S) const {
}
if (dyn_cast_or_null<Function>(GV->getBaseObject()))
Res |= BasicSymbolRef::SF_Executable;
if (isa<GlobalAlias>(GV))
Res |= BasicSymbolRef::SF_Indirect;
if (GV->hasPrivateLinkage())
Res |= BasicSymbolRef::SF_FormatSpecific;
if (!GV->hasLocalLinkage())
Expand Down
9 changes: 2 additions & 7 deletions llvm/tools/llvm-nm/llvm-nm.cpp
Expand Up @@ -998,13 +998,8 @@ dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName,
uint32_t SymFlags = Sym.getFlags();
if (!DebugSyms && (SymFlags & SymbolRef::SF_FormatSpecific))
continue;
if (WithoutAliases) {
if (IRObjectFile *IR = dyn_cast<IRObjectFile>(&Obj)) {
const GlobalValue *GV = IR->getSymbolGV(Sym.getRawDataRefImpl());
if (GV && isa<GlobalAlias>(GV))
continue;
}
}
if (WithoutAliases && (SymFlags & SymbolRef::SF_Indirect))
continue;
// If a "-s segname sectname" option was specified and this is a Mach-O
// file and this section appears in this file, Nsect will be non-zero then
// see if this symbol is a symbol from that section and if not skip it.
Expand Down

0 comments on commit d64ecf2

Please sign in to comment.