llvm-readobj: fix MachO relocatoin printing a bit.
[oota-llvm.git] / lib / Object / MachOObjectFile.cpp
index 50e7f63a9307917cd68e302e6c59792399e5063b..4919114d2349752607514bc2fbe5c070ee31de3d 100644 (file)
@@ -868,6 +868,9 @@ std::error_code MachOObjectFile::getRelocationOffset(DataRefImpl Rel,
 symbol_iterator
 MachOObjectFile::getRelocationSymbol(DataRefImpl Rel) const {
   MachO::any_relocation_info RE = getRelocation(Rel);
+  if (isRelocationScattered(RE))
+    return symbol_end();
+
   uint32_t SymbolIdx = getPlainRelocationSymbolNum(RE);
   bool isExtern = getPlainRelocationExternal(RE);
   if (!isExtern)