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
This commit is contained in:
Rafael Espindola
2013-04-24 19:47:55 +00:00
parent d4ee3920c9
commit 802fe9340d
4 changed files with 92 additions and 84 deletions

View File

@ -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);