summaryrefslogtreecommitdiffstats
path: root/tools/llvm-readobj
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-24 19:47:55 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-24 19:47:55 +0000
commit802fe9340d032d20195b00334356cf63b303386c (patch)
treef8539af116260597f3f92336947b711300c7eb64 /tools/llvm-readobj
parentd4ee3920c928f51e4c4d70b4fae97f4d99be2583 (diff)
downloadexternal_llvm-802fe9340d032d20195b00334356cf63b303386c.zip
external_llvm-802fe9340d032d20195b00334356cf63b303386c.tar.gz
external_llvm-802fe9340d032d20195b00334356cf63b303386c.tar.bz2
Use pointers to iterate over symbols.
While here, don't report a dummy symbol for relocations that don't have symbols. We used to says such relocations were for the first defined symbol, but now we return end_symbols(). The llvm-readobj output change agrees with otool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180214 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-readobj')
-rw-r--r--tools/llvm-readobj/MachODumper.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/llvm-readobj/MachODumper.cpp b/tools/llvm-readobj/MachODumper.cpp
index 10e53d9..31dc5ce 100644
--- a/tools/llvm-readobj/MachODumper.cpp
+++ b/tools/llvm-readobj/MachODumper.cpp
@@ -345,7 +345,9 @@ void MachODumper::printRelocation(const MachOObjectFile *Obj,
if (error(RelI->getOffset(Offset))) return;
if (error(RelI->getTypeName(RelocName))) return;
if (error(RelI->getSymbol(Symbol))) return;
- if (error(Symbol.getName(SymbolName))) return;
+ if (symbol_iterator(Symbol) != Obj->end_symbols() &&
+ error(Symbol.getName(SymbolName)))
+ return;
DataRefImpl DR = RelI->getRawDataRefImpl();
macho::RelocationEntry RE = Obj->getRelocation(DR);