Add "-format darwin" to llvm-nm to be like darwin's nm(1) -m output.
authorKevin Enderby <enderby@apple.com>
Thu, 5 Jun 2014 21:21:57 +0000 (21:21 +0000)
committerKevin Enderby <enderby@apple.com>
Thu, 5 Jun 2014 21:21:57 +0000 (21:21 +0000)
commit980b25840f8904934a4fb86f6af0a249e3373862
treefcab8497379fb530ae62e3f1235c0e2e6b34a09e
parent8f4f1cf7785e1707706824b9f2127c939791e736
Add "-format darwin" to llvm-nm to be like darwin's nm(1) -m output.

This is a first step in seeing if it is possible to make llvm-nm produce
the same output as darwin's nm(1).  Darwin's default format is bsd but its
-m output prints the longer Mach-O specific details.  For now I added the
"-format darwin" to do this (whos name may need to change in the future).
As there are other Mach-O specific flags to nm(1) which I'm hoping to add some
how in the future.  But I wanted to see if I could get the correct output for
-m flag using llvm-nm and the libObject interfaces.

I got this working but would love to hear what others think about this approach
to getting object/format specific details printed with llvm-nm.

llvm-svn: 210285
llvm/include/llvm/Object/MachO.h
llvm/include/llvm/Object/SymbolicFile.h
llvm/include/llvm/Support/MachO.h
llvm/lib/Object/MachOObjectFile.cpp
llvm/test/Object/Inputs/darwin-m-test1.mach0-armv7 [new file with mode: 0644]
llvm/test/Object/Inputs/darwin-m-test2.macho-i386 [new file with mode: 0644]
llvm/test/Object/Inputs/darwin-m-test3.macho-x86-64 [new file with mode: 0755]
llvm/test/Object/nm-darwin-m.test [new file with mode: 0644]
llvm/tools/llvm-nm/llvm-nm.cpp