Implemented the code to make llvm-nm’s -g option work.

While llvm-nm parses the -g option and has help that describes it as:

  -extern-only            - Show only external symbols

There is no code in the program to use the boolean valve it sets from the
command line.

rdar://23261095

llvm-svn: 251718
This commit is contained in:
Kevin Enderby 2015-10-30 19:55:32 +00:00
parent 5b1a50aeaa
commit 25abebf82b
4 changed files with 9 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,4 @@
# RUN: llvm-nm -g %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
# CHECK-NOT: EH_frame0
# CHECK: _main

View File

@ -0,0 +1,2 @@
if not 'X86' in config.root.targets:
config.unsupported = True

View File

@ -529,6 +529,9 @@ static void sortAndPrintSymbolList(SymbolicFile &Obj, bool printName,
continue;
if (Undefined && DefinedOnly)
continue;
bool Global = SymFlags & SymbolRef::SF_Global;
if (!Global && ExternalOnly)
continue;
if (SizeSort && !PrintAddress)
continue;
if (PrintFileName) {