Index: llvm/tools/llvm-objcopy/MachO/MachOReader.cpp =================================================================== --- llvm/tools/llvm-objcopy/MachO/MachOReader.cpp +++ llvm/tools/llvm-objcopy/MachO/MachOReader.cpp @@ -93,7 +93,7 @@ StringRef(reinterpret_cast(E->data()), E->size()); else reportError(MachOObj.getFileName(), E.takeError()); - + S.Relocations.reserve(S.NReloc); for (auto RI = MachOObj.section_rel_begin(SecRef->getRawDataRefImpl()), RE = MachOObj.section_rel_end(SecRef->getRawDataRefImpl()); @@ -101,9 +101,7 @@ RelocationInfo R; R.Symbol = nullptr; // We'll fill this field later. R.Info = MachOObj.getRelocation(RI->getRawDataRefImpl()); - R.Scattered = - reinterpret_cast(&R.Info) - ->r_scattered; + R.Scattered = MachOObj.isRelocationScattered(R.Info); S.Relocations.push_back(R); }