//===- MachOObjectFile.cpp - Mach-O object file binding ---------*- C++ -*-===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file defines the MachOObjectFile class, which binds the MachOObject// class to the generic ObjectFile wrapper.////===----------------------------------------------------------------------===//#include"llvm/Object/MachO.h"#include"llvm/ADT/Triple.h"#include"llvm/Object/MachOFormat.h"#include"llvm/Support/DataExtractor.h"#include"llvm/Support/Format.h"#include"llvm/Support/Host.h"#include"llvm/Support/MemoryBuffer.h"#include<cctype>#include<cstring>#include<limits>usingnamespacellvm;usingnamespaceobject;namespacellvm{namespaceobject{structSymbolTableEntryBase{uint32_tStringIndex;uint8_tType;uint8_tSectionIndex;uint16_tFlags;};structSectionBase{charName[16];charSegmentName[16];};template<typenameT>staticvoidSwapValue(T&Value){Value=sys::SwapByteOrder(Value);}template<typenameT>staticvoidSwapStruct(T&Value);template<>voidSwapStruct(macho::RelocationEntry&H){SwapValue(H.Word0);SwapValue(H.Word1);}template<>voidSwapStruct(macho::