llvm-readobj: fix MachO relocatoin printing a bit.
authorTim Northover <tnorthover@apple.com>
Fri, 4 Jul 2014 10:57:56 +0000 (10:57 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 4 Jul 2014 10:57:56 +0000 (10:57 +0000)
commit5b003bb869bb79cbec59f76c2ffe6461c8a8efea
treeb679012d93104d988ab7ec394666e8ba9d2146cd
parent9c1df9164c53fc2693e35253d97b273f9496467d
llvm-readobj: fix MachO relocatoin printing a bit.

There were two issues here:
1. At the very least, scattered relocations cannot use the same code to
   determine the corresponding symbol being referred to. For some reason we
   pretend there is no symbol, even when one actually exists in the symtab, so to
   match this behaviour getRelocationSymbol should simply return symbols_end for
   scattered relocations.
2. Printing "-" when we can't get a symbol (including the scattered case, but
   not exclusively), isn't that helpful. In both cases there *is* interesting
   information in that field, so we should print it. As hex will do.

Small part of rdar://problem/17553104

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212332 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Object/MachOObjectFile.cpp
test/CodeGen/PowerPC/hello-reloc.s
test/MC/AArch64/arm64-leaf-compact-unwind.s
test/MC/MachO/eh-frame-reloc.s
test/tools/llvm-readobj/relocations.test
test/tools/llvm-readobj/sections-ext.test
tools/llvm-readobj/MachODumper.cpp