13#ifndef LLVM_BINARYFORMAT_MACHO_H
14#define LLVM_BINARYFORMAT_MACHO_H
96#define HANDLE_LOAD_COMMAND(LCName, LCValue, LCStruct) LCName = LCValue,
99#include "llvm/BinaryFormat/MachO.def"
102#undef HANDLE_LOAD_COMMAND
501#define PLATFORM(platform, id, name, build_name, target, tapi_target, \
503 PLATFORM_##platform = id,
986#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)
1538 return (((n_desc) >> 8u) & 0xffu);
1542 n_desc = (((n_desc)&0x00ff) | (((ordinal)&0xff) << 8));
1546 return (n_desc >> 8u) & 0x0fu;
1550 n_desc = ((n_desc & 0xf0ffu) | ((align & 0x0fu) << 8u));
1616 return Family | (Model << 4);
1619 return ((
int)ST) & 0x0f;
1660 bool PtrAuthKernelABIVersion) {
1661 assert((PtrAuthABIVersion <= 0xF) &&
1662 "ptrauth abi version must fit in 4 bits");
1664 (PtrAuthKernelABIVersion
1667 (PtrAuthABIVersion << 24);
1704 bool PtrAuthKernelABIVersion);
1990 for (
int i = 0; i < 13; i++)
2009 for (
int i = 0; i < 29; i++)
2180#define LOAD_COMMAND_STRUCT(LCStruct) LCStruct LCStruct##_data;
2184#include "llvm/BinaryFormat/MachO.def"
#define LLVM_PACKED_START
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Tagged union holding either a T or a Error.
Triple - Helper class for working with autoconf configuration names.
@ C
The default llvm calling convention, compatible with C.
const uint32_t x86_FLOAT_STATE_COUNT
@ DYLD_CHAINED_IMPORT_ADDEND
@ DYLD_CHAINED_IMPORT_ADDEND64
const uint32_t ARM_THREAD_STATE64_COUNT
@ EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE
@ EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL
@ EXPORT_SYMBOL_FLAGS_KIND_REGULAR
@ BIND_TYPE_TEXT_ABSOLUTE32
@ CS_EXECSEG_ALLOW_UNSIGNED
@ CS_EXECSEG_CAN_LOAD_CDHASH
@ CS_EXECSEG_CAN_EXEC_CDHASH
@ S_ATTR_SOME_INSTRUCTIONS
S_ATTR_SOME_INSTRUCTIONS - Section contains some machine instructions.
@ S_ATTR_EXT_RELOC
S_ATTR_EXT_RELOC - Section has external relocation entries.
@ S_ATTR_DEBUG
S_ATTR_DEBUG - A debug section.
@ S_ATTR_NO_DEAD_STRIP
S_ATTR_NO_DEAD_STRIP - No dead stripping.
@ S_ATTR_LOC_RELOC
S_ATTR_LOC_RELOC - Section has local relocation entries.
@ S_ATTR_NO_TOC
S_ATTR_NO_TOC - Section contains coalesced symbols that are not to be in a ranlib table of contents.
@ S_ATTR_LIVE_SUPPORT
S_ATTR_LIVE_SUPPORT - Blocks are live if they reference live blocks.
@ S_ATTR_PURE_INSTRUCTIONS
S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
@ S_ATTR_SELF_MODIFYING_CODE
S_ATTR_SELF_MODIFYING_CODE - Used with i386 code stubs written on by dyld.
@ S_ATTR_STRIP_STATIC_SYMS
S_ATTR_STRIP_STATIC_SYMS - Ok to strip static symbols in this section in files with the MY_DYLDLINK f...
const uint32_t x86_EXCEPTION_STATE_COUNT
@ REBASE_TYPE_TEXT_ABSOLUTE32
@ REBASE_TYPE_TEXT_PCREL32
int CPU_SUBTYPE_INTEL_MODEL(CPUSubTypeX86 ST)
bool isVirtualSection(uint8_t type)
const uint32_t x86_FLOAT_STATE64_COUNT
Expected< uint32_t > getCPUSubType(const Triple &T)
SectionType
These are the section type and attributes fields.
@ S_THREAD_LOCAL_VARIABLE_POINTERS
S_THREAD_LOCAL_VARIABLE_POINTERS - Section with pointers to thread local structures.
@ S_INTERPOSING
S_INTERPOSING - Section with only pairs of function pointers for interposing.
@ S_GB_ZEROFILL
S_GB_ZEROFILL - Zero fill on demand section (that can be larger than 4 gigabytes).
@ S_16BYTE_LITERALS
S_16BYTE_LITERALS - Section with only 16 byte literals.
@ S_THREAD_LOCAL_INIT_FUNCTION_POINTERS
S_THREAD_LOCAL_INIT_FUNCTION_POINTERS - Section with thread local variable initialization pointers to...
@ S_COALESCED
S_COALESCED - Section contains symbols that are to be coalesced.
@ S_THREAD_LOCAL_ZEROFILL
S_THREAD_LOCAL_ZEROFILL - Thread local zerofill section.
@ S_LAZY_SYMBOL_POINTERS
S_LAZY_SYMBOL_POINTERS - Section with lazy symbol pointers.
@ S_INIT_FUNC_OFFSETS
S_INIT_FUNC_OFFSETS - Section with 32-bit offsets to initializer functions.
@ S_MOD_TERM_FUNC_POINTERS
S_MOD_TERM_FUNC_POINTERS - Section with only function pointers for termination.
@ S_MOD_INIT_FUNC_POINTERS
S_MOD_INIT_FUNC_POINTERS - Section with only function pointers for initialization.
@ S_CSTRING_LITERALS
S_CSTRING_LITERALS - Section with literal C strings.
@ S_THREAD_LOCAL_REGULAR
S_THREAD_LOCAL_REGULAR - Thread local data section.
@ S_DTRACE_DOF
S_DTRACE_DOF - Section contains DTrace Object Format.
@ S_ZEROFILL
S_ZEROFILL - Zero fill on demand section.
@ S_NON_LAZY_SYMBOL_POINTERS
S_NON_LAZY_SYMBOL_POINTERS - Section with non-lazy symbol pointers.
@ S_4BYTE_LITERALS
S_4BYTE_LITERALS - Section with 4 byte literals.
@ LAST_KNOWN_SECTION_TYPE
@ S_LITERAL_POINTERS
S_LITERAL_POINTERS - Section with pointers to literals.
@ S_8BYTE_LITERALS
S_8BYTE_LITERALS - Section with 8 byte literals.
@ S_LAZY_DYLIB_SYMBOL_POINTERS
S_LAZY_DYLIB_SYMBOL_POINTERS - Section with lazy symbol pointers to lazy loaded dylibs.
@ S_THREAD_LOCAL_VARIABLES
S_THREAD_LOCAL_VARIABLES - Section with thread local variable structure data.
@ S_SYMBOL_STUBS
S_SYMBOL_STUBS - Section with symbol stubs, byte size of stub in the Reserved2 field.
@ S_REGULAR
S_REGULAR - Regular section.
@ BIND_SPECIAL_DYLIB_SELF
@ BIND_SPECIAL_DYLIB_WEAK_LOOKUP
@ BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE
@ BIND_SPECIAL_DYLIB_FLAT_LOOKUP
@ DYLD_CHAINED_PTR_START_LAST
@ DYLD_CHAINED_PTR_START_NONE
@ DYLD_CHAINED_PTR_START_MULTI
@ CSMAGIC_EMBEDDED_ENTITLEMENTS
@ CS_SIGNER_TYPE_LEGACYVPN
@ CSMAGIC_DETACHED_SIGNATURE
@ CS_SIGNER_TYPE_MAC_APP_STORE
@ CSTYPE_INDEX_ENTITLEMENTS
@ CSMAGIC_EMBEDDED_SIGNATURE
@ CS_SUPPL_SIGNER_TYPE_TRUSTCACHE
@ CSSLOT_ALTERNATE_CODEDIRECTORIES
@ CSSLOT_IDENTIFICATIONSLOT
@ CS_SHA256_TRUNCATED_LEN
@ CSMAGIC_EMBEDDED_SIGNATURE_OLD
@ CSTYPE_INDEX_REQUIREMENTS
@ CSSLOT_ALTERNATE_CODEDIRECTORY_MAX
@ CS_SUPPL_SIGNER_TYPE_LOCAL
@ CS_HASHTYPE_SHA256_TRUNCATED
@ CSSLOT_ALTERNATE_CODEDIRECTORY_LIMIT
@ CS_SUPPL_SIGNER_TYPE_UNKNOWN
void SET_LIBRARY_ORDINAL(uint16_t &n_desc, uint8_t ordinal)
int CPU_SUBTYPE_INTEL(int Family, int Model)
@ kSecCodeSignatureHashSHA1
@ kSecCodeSignatureHashSHA256
@ kSecCodeSignatureHashSHA384
@ kSecCodeSignatureHashSHA256Truncated
@ kSecCodeSignatureNoHash
@ kSecCodeSignatureHashSHA512
uint8_t GET_COMM_ALIGN(uint16_t n_desc)
void swapStruct(fat_header &mh)
const uint32_t x86_THREAD_STATE32_COUNT
@ EXPORT_SYMBOL_FLAGS_REEXPORT
@ EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION
@ EXPORT_SYMBOL_FLAGS_KIND_MASK
@ EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER
@ DYLD_CHAINED_SYMBOL_ZLIB
@ DYLD_CHAINED_SYMBOL_UNCOMPRESSED
bool CPU_SUBTYPE_ARM64E_IS_KERNEL_PTRAUTH_ABI(uint32_t ST)
@ CPU_SUBTYPE_POWERPC_970
@ CPU_SUBTYPE_POWERPC_604e
@ CPU_SUBTYPE_POWERPC_603e
@ CPU_SUBTYPE_POWERPC_7400
@ CPU_SUBTYPE_POWERPC_604
@ CPU_SUBTYPE_MC980000_ALL
@ CPU_SUBTYPE_POWERPC_750
@ CPU_SUBTYPE_POWERPC_601
@ CPU_SUBTYPE_POWERPC_620
@ CPU_SUBTYPE_POWERPC_603ev
@ CPU_SUBTYPE_POWERPC_ALL
@ CPU_SUBTYPE_POWERPC_603
@ CPU_SUBTYPE_POWERPC_7450
@ CPU_SUBTYPE_POWERPC_602
@ BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB
@ BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB
@ BIND_OPCODE_SET_ADDEND_SLEB
@ BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB
@ BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@ BIND_OPCODE_ADD_ADDR_ULEB
@ BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED
@ BIND_OPCODE_SET_DYLIB_SPECIAL_IMM
@ BIND_OPCODE_SET_TYPE_IMM
@ BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
@ BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
const uint32_t PPC_THREAD_STATE_COUNT
unsigned CPU_SUBTYPE_ARM64E_PTRAUTH_VERSION(uint32_t ST)
const uint32_t ARM_THREAD_STATE_COUNT
@ REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
@ REBASE_OPCODE_DO_REBASE_IMM_TIMES
@ REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB
@ REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB
@ REBASE_OPCODE_DO_REBASE_ULEB_TIMES
@ REBASE_OPCODE_ADD_ADDR_ULEB
@ REBASE_OPCODE_SET_TYPE_IMM
@ REBASE_OPCODE_ADD_ADDR_IMM_SCALED
bool CPU_SUBTYPE_ARM64E_IS_VERSIONED_PTRAUTH_ABI(uint32_t ST)
int CPU_SUBTYPE_INTEL_FAMILY(CPUSubTypeX86 ST)
LinkerOptimizationHintKind
@ LOH_ARM64_ADRP_LDR_GOT_LDR
@ LOH_ARM64_ADRP_LDR_GOT_STR
void SET_COMM_ALIGN(uint16_t &n_desc, uint8_t align)
@ CPU_SUBTYPE_ARM64E_VERSIONED_PTRAUTH_ABI_MASK
@ CPU_SUBTYPE_ARM64E_KERNEL_PTRAUTH_ABI_MASK
@ CPU_SUBTYPE_ARM64E_PTRAUTH_MASK
const uint32_t x86_THREAD_STATE_COUNT
@ CPU_SUBTYPE_ARM64_32_V8
@ CS_DATAVAULT_CONTROLLER
@ CS_EXEC_SET_ENFORCEMENT
@ CS_ENTITLEMENTS_VALIDATED
@ DICE_KIND_ABS_JUMP_TABLE32
@ CPU_SUBTYPE_INTEL_FAMILY_MAX
@ CPU_SUBTYPE_INTEL_MODEL_ALL
@ GENERIC_RELOC_LOCAL_SECTDIFF
@ PPC_RELOC_HA16_SECTDIFF
@ ARM_RELOC_LOCAL_SECTDIFF
@ ARM64_RELOC_POINTER_TO_GOT
@ ARM64_RELOC_AUTHENTICATED_POINTER
@ GENERIC_RELOC_PB_LA_PTR
@ PPC_RELOC_LOCAL_SECTDIFF
@ ARM_RELOC_HALF_SECTDIFF
@ PPC_RELOC_LO14_SECTDIFF
@ PPC_RELOC_LO16_SECTDIFF
@ ARM64_RELOC_GOT_LOAD_PAGE21
@ X86_64_RELOC_SUBTRACTOR
@ ARM64_RELOC_TLVP_LOAD_PAGEOFF12
@ PPC_RELOC_HI16_SECTDIFF
@ ARM64_RELOC_GOT_LOAD_PAGEOFF12
@ ARM64_RELOC_TLVP_LOAD_PAGE21
uint32_t CPU_SUBTYPE_ARM64E_WITH_PTRAUTH_VERSION(unsigned PtrAuthABIVersion, bool PtrAuthKernelABIVersion)
uint16_t GET_LIBRARY_ORDINAL(uint16_t n_desc)
@ DYLD_CHAINED_PTR_ARM64E_USERLAND
@ DYLD_CHAINED_PTR_ARM64E_USERLAND24
@ DYLD_CHAINED_PTR_64_KERNEL_CACHE
@ DYLD_CHAINED_PTR_32_CACHE
@ DYLD_CHAINED_PTR_X86_64_KERNEL_CACHE
@ DYLD_CHAINED_PTR_64_OFFSET
@ DYLD_CHAINED_PTR_ARM64E_FIRMWARE
@ DYLD_CHAINED_PTR_ARM64E_KERNEL
@ DYLD_CHAINED_PTR_32_FIRMWARE
@ DYLD_CHAINED_PTR_ARM64E
Expected< uint32_t > getCPUType(const Triple &T)
const uint32_t x86_EXCEPTION_STATE64_COUNT
@ CPU_SUBTYPE_CELERON_MOBILE
@ CPU_SUBTYPE_PENTIUM_3_XEON
@ CPU_SUBTYPE_PENTIUM_3_M
@ CPU_SUBTYPE_PENTIUM_4_M
@ REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY
@ REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY
@ REFERENCE_FLAG_UNDEFINED_LAZY
@ REFERENCE_FLAG_UNDEFINED_NON_LAZY
@ REFERENCE_FLAG_PRIVATE_DEFINED
const uint32_t x86_THREAD_STATE64_COUNT
@ MH_ALLOW_STACK_EXECUTION
@ MH_DEAD_STRIPPABLE_DYLIB
@ MH_NO_REEXPORTED_DYLIBS
@ MH_SUBSECTIONS_VIA_SYMBOLS
@ MH_NLIST_OUTOFSYNC_WITH_DYLDINFO
@ BIND_SYMBOL_FLAGS_WEAK_IMPORT
@ BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION
void swapByteOrder(T &Value)
This is an optimization pass for GlobalISel generic memory operations.
arm_thread_state32_t ts32
union llvm::MachO::arm_thread_state_t::@165 uts
dyld_chained_starts_in_image is embedded in LC_DYLD_CHAINED_FIXUPS payload.
uint32_t seg_info_offset[1]
uint16_t page_count
Length of the page_start array.
uint16_t page_size
Page size in bytes (0x1000 or 0x4000)
uint16_t pointer_format
DYLD_CHAINED_PTR*.
uint32_t max_valid_pointer
Values beyond this are not pointers on 32-bit.
uint64_t segment_offset
VM offset from the __TEXT segment.
uint32_t size
Size of this, including chain_starts entries.
uint16_t page_start[1]
Page offset of first fixup on each page, or DYLD_CHAINED_PTR_START_NONE if no fixups.
uint64_t objc_module_info_addr
uint32_t objc_module_info_size
uint32_t objc_module_info_size
uint32_t objc_module_info_addr
uint32_t compatibility_version
ppc_thread_state32_t ts32
union llvm::MachO::ppc_thread_state_t::@166 uts
union llvm::MachO::x86_exception_state_t::@164 ues
x86_exception_state64_t es64
union llvm::MachO::x86_float_state_t::@163 ufs
x86_thread_state64_t ts64
x86_thread_state32_t ts32
union llvm::MachO::x86_thread_state_t::@162 uts