[llvm-objcopy][MachO] Correctly identify object file endianness.
The header magic value is held in the native endianness, so the method used in
cc0ec3fdb9d. Use MachOReader / MachOWriter's existing endianness tests instead.
diff --git a/llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp b/llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp
index a08d54d..db31ef5 100644
--- a/llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp
+++ b/llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp
@@ -242,7 +242,7 @@
auto RelocInfo = Sec->Relocations[Index];
if (!RelocInfo.Scattered)
RelocInfo.setPlainRelocationSymbolNum(RelocInfo.Symbol->Index,
- O.isLittleEndian());
+ IsLittleEndian);
if (IsLittleEndian != sys::IsLittleEndianHost)
MachO::swapStruct(