#ifndef LLVM_BINARYFORMAT_MACHO_H
#define LLVM_BINARYFORMAT_MACHO_H
#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/SwapByteOrder.h"
namespace llvm {
class Triple;
namespace MachO {
enum : uint32_t { … };
enum HeaderFileType { … };
enum { … };
enum : uint32_t { … };
#define HANDLE_LOAD_COMMAND …
enum LoadCommandType : uint32_t { … };
#undef HANDLE_LOAD_COMMAND
enum : uint32_t { … };
enum SectionType : uint32_t { … };
enum : uint32_t { … };
enum DataRegionType { … };
enum RebaseType { … };
enum { … };
enum RebaseOpcode { … };
enum BindType { … };
enum BindSpecialDylib { … };
enum { … };
enum BindOpcode { … };
enum { … };
enum ExportSymbolKind { … };
enum { … };
enum NListType : uint8_t { … };
enum SectionOrdinal { … };
enum { … };
enum StabType { … };
enum : uint32_t { … };
enum RelocationInfoType { … };
enum { … };
enum PlatformType { … };
enum { … };
struct mach_header { … };
struct mach_header_64 { … };
struct load_command { … };
struct segment_command { … };
struct segment_command_64 { … };
struct section { … };
struct section_64 { … };
inline bool isVirtualSection(uint8_t type) { … }
struct fvmlib { … };
struct fvmlib_command { … };
struct dylib { … };
struct dylib_command { … };
struct sub_framework_command { … };
struct sub_client_command { … };
struct sub_umbrella_command { … };
struct sub_library_command { … };
struct prebound_dylib_command { … };
struct dylinker_command { … };
struct thread_command { … };
struct routines_command { … };
struct routines_command_64 { … };
struct symtab_command { … };
struct dysymtab_command { … };
struct dylib_table_of_contents { … };
struct dylib_module { … };
struct dylib_module_64 { … };
struct dylib_reference { … };
struct twolevel_hints_command { … };
struct twolevel_hint { … };
struct prebind_cksum_command { … };
struct uuid_command { … };
struct rpath_command { … };
struct linkedit_data_command { … };
struct data_in_code_entry { … };
struct source_version_command { … };
struct encryption_info_command { … };
struct encryption_info_command_64 { … };
struct version_min_command { … };
struct note_command { … };
struct build_tool_version { … };
struct build_version_command { … };
struct dyld_env_command { … };
struct dyld_info_command { … };
struct linker_option_command { … };
lc_str;
struct fileset_entry_command { … };
struct symseg_command { … };
struct ident_command { … };
struct fvmfile_command { … };
struct tlv_descriptor_32 { … };
struct tlv_descriptor_64 { … };
struct tlv_descriptor { … };
struct entry_point_command { … };
struct fat_header { … };
struct fat_arch { … };
struct fat_arch_64 { … };
struct relocation_info { … };
struct scattered_relocation_info { … };
struct any_relocation_info { … };
struct nlist_base { … };
struct nlist { … };
struct nlist_64 { … };
enum ChainedImportFormat { … };
enum { … };
enum { … };
enum { … };
struct dyld_chained_fixups_header { … };
struct dyld_chained_starts_in_image { … };
struct dyld_chained_starts_in_segment { … };
struct dyld_chained_import { … };
struct dyld_chained_import_addend { … };
struct dyld_chained_import_addend64 { … };
struct dyld_chained_ptr_64_bind { … };
struct dyld_chained_ptr_64_rebase { … };
inline void swapStruct(fat_header &mh) { … }
inline void swapStruct(fat_arch &mh) { … }
inline void swapStruct(fat_arch_64 &mh) { … }
inline void swapStruct(mach_header &mh) { … }
inline void swapStruct(mach_header_64 &H) { … }
inline void swapStruct(load_command &lc) { … }
inline void swapStruct(symtab_command &lc) { … }
inline void swapStruct(segment_command_64 &seg) { … }
inline void swapStruct(segment_command &seg) { … }
inline void swapStruct(section_64 §) { … }
inline void swapStruct(section §) { … }
inline void swapStruct(dyld_info_command &info) { … }
inline void swapStruct(dylib_command &d) { … }
inline void swapStruct(sub_framework_command &s) { … }
inline void swapStruct(sub_umbrella_command &s) { … }
inline void swapStruct(sub_library_command &s) { … }
inline void swapStruct(sub_client_command &s) { … }
inline void swapStruct(routines_command &r) { … }
inline void swapStruct(routines_command_64 &r) { … }
inline void swapStruct(thread_command &t) { … }
inline void swapStruct(dylinker_command &d) { … }
inline void swapStruct(uuid_command &u) { … }
inline void swapStruct(rpath_command &r) { … }
inline void swapStruct(source_version_command &s) { … }
inline void swapStruct(entry_point_command &e) { … }
inline void swapStruct(encryption_info_command &e) { … }
inline void swapStruct(encryption_info_command_64 &e) { … }
inline void swapStruct(dysymtab_command &dst) { … }
inline void swapStruct(any_relocation_info &reloc) { … }
inline void swapStruct(nlist_base &S) { … }
inline void swapStruct(nlist &sym) { … }
inline void swapStruct(nlist_64 &sym) { … }
inline void swapStruct(linkedit_data_command &C) { … }
inline void swapStruct(linker_option_command &C) { … }
inline void swapStruct(fileset_entry_command &C) { … }
inline void swapStruct(version_min_command &C) { … }
inline void swapStruct(note_command &C) { … }
inline void swapStruct(build_version_command &C) { … }
inline void swapStruct(build_tool_version &C) { … }
inline void swapStruct(data_in_code_entry &C) { … }
inline void swapStruct(uint32_t &C) { … }
inline void swapStruct(prebind_cksum_command &C) { … }
inline void swapStruct(twolevel_hints_command &C) { … }
inline void swapStruct(prebound_dylib_command &C) { … }
inline void swapStruct(fvmfile_command &C) { … }
inline void swapStruct(symseg_command &C) { … }
inline void swapStruct(ident_command &C) { … }
inline void swapStruct(fvmlib &C) { … }
inline void swapStruct(fvmlib_command &C) { … }
inline uint16_t GET_LIBRARY_ORDINAL(uint16_t n_desc) { … }
inline void SET_LIBRARY_ORDINAL(uint16_t &n_desc, uint8_t ordinal) { … }
inline uint8_t GET_COMM_ALIGN(uint16_t n_desc) { … }
inline void SET_COMM_ALIGN(uint16_t &n_desc, uint8_t align) { … }
enum : uint32_t { … };
enum CPUType { … };
enum : uint32_t { … };
enum CPUSubTypeX86 { … };
inline int CPU_SUBTYPE_INTEL(int Family, int Model) { … }
inline int CPU_SUBTYPE_INTEL_FAMILY(CPUSubTypeX86 ST) { … }
inline int CPU_SUBTYPE_INTEL_MODEL(CPUSubTypeX86 ST) { … }
enum { … };
enum CPUSubTypeARM { … };
enum CPUSubTypeARM64 : uint32_t { … };
inline unsigned CPU_SUBTYPE_ARM64E_PTRAUTH_VERSION(uint32_t ST) { … }
inline uint32_t
CPU_SUBTYPE_ARM64E_WITH_PTRAUTH_VERSION(unsigned PtrAuthABIVersion,
bool PtrAuthKernelABIVersion) { … }
inline bool CPU_SUBTYPE_ARM64E_IS_VERSIONED_PTRAUTH_ABI(uint32_t ST) { … }
inline bool CPU_SUBTYPE_ARM64E_IS_KERNEL_PTRAUTH_ABI(uint32_t ST) { … }
enum CPUSubTypeARM64_32 { … };
enum CPUSubTypeSPARC { … };
enum CPUSubTypePowerPC { … };
Expected<uint32_t> getCPUType(const Triple &T);
Expected<uint32_t> getCPUSubType(const Triple &T);
Expected<uint32_t> getCPUSubType(const Triple &T, unsigned PtrAuthABIVersion,
bool PtrAuthKernelABIVersion);
struct x86_thread_state32_t { … };
struct x86_thread_state64_t { … };
enum x86_fp_control_precis { … };
enum x86_fp_control_rc { … };
struct fp_control_t { … };
struct fp_status_t { … };
struct mmst_reg_t { … };
struct xmm_reg_t { … };
struct x86_float_state64_t { … };
struct x86_exception_state64_t { … };
inline void swapStruct(x86_thread_state32_t &x) { … }
inline void swapStruct(x86_thread_state64_t &x) { … }
inline void swapStruct(x86_float_state64_t &x) { … }
inline void swapStruct(x86_exception_state64_t &x) { … }
struct x86_state_hdr_t { … };
struct x86_thread_state_t { … };
struct x86_float_state_t { … };
struct x86_exception_state_t { … };
inline void swapStruct(x86_state_hdr_t &x) { … }
enum X86ThreadFlavors { … };
inline void swapStruct(x86_thread_state_t &x) { … }
inline void swapStruct(x86_float_state_t &x) { … }
inline void swapStruct(x86_exception_state_t &x) { … }
const uint32_t x86_THREAD_STATE32_COUNT = …;
const uint32_t x86_THREAD_STATE64_COUNT = …;
const uint32_t x86_FLOAT_STATE64_COUNT = …;
const uint32_t x86_EXCEPTION_STATE64_COUNT = …;
const uint32_t x86_THREAD_STATE_COUNT = …;
const uint32_t x86_FLOAT_STATE_COUNT = …;
const uint32_t x86_EXCEPTION_STATE_COUNT = …;
struct arm_thread_state32_t { … };
inline void swapStruct(arm_thread_state32_t &x) { … }
struct arm_thread_state64_t { … };
inline void swapStruct(arm_thread_state64_t &x) { … }
struct arm_state_hdr_t { … };
struct arm_thread_state_t { … };
inline void swapStruct(arm_state_hdr_t &x) { … }
enum ARMThreadFlavors { … };
inline void swapStruct(arm_thread_state_t &x) { … }
const uint32_t ARM_THREAD_STATE_COUNT = …;
const uint32_t ARM_THREAD_STATE64_COUNT = …;
struct ppc_thread_state32_t { … };
inline void swapStruct(ppc_thread_state32_t &x) { … }
struct ppc_state_hdr_t { … };
struct ppc_thread_state_t { … };
inline void swapStruct(ppc_state_hdr_t &x) { … }
enum PPCThreadFlavors { … };
inline void swapStruct(ppc_thread_state_t &x) { … }
const uint32_t PPC_THREAD_STATE_COUNT = …;
#define LOAD_COMMAND_STRUCT …
LLVM_PACKED_START
macho_load_command;
LLVM_PACKED_END
inline void swapStruct(dyld_chained_fixups_header &C) { … }
inline void swapStruct(dyld_chained_starts_in_image &C) { … }
inline void swapStruct(dyld_chained_starts_in_segment &C) { … }
enum CodeSignAttrs { … };
enum CodeSignExecSegFlags { … };
enum CodeSignMagic { … };
struct CS_CodeDirectory { … };
static_assert …;
struct CS_BlobIndex { … };
struct CS_SuperBlob { … };
enum SecCSDigestAlgorithm { … };
enum LinkerOptimizationHintKind { … };
}
}
#endif