OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
AppleMachoImage.h File Reference

Go to the source code of this file.

Data Structures

union  MACH_LOAD_COMMAND_STRING
 
struct  MACH_FIXED_VM_LIB
 
struct  MACH_DYLIB
 
struct  MACH_LOAD_COMMAND
 
struct  MACH_SECTION
 
struct  MACH_SECTION_64
 
union  MACH_SECTION_ANY
 
struct  MACH_SEGMENT_COMMAND
 
struct  MACH_SEGMENT_COMMAND_64
 
union  MACH_SEGMENT_COMMAND_ANY
 
struct  MACH_FIXED_VM_LIB_COMMAND
 
struct  MACH_DYLIB_COMMAND
 
struct  MACH_SUB_FRAMEWORK_COMMAND
 
struct  MACH_SUB_CLIENT_COMMAND
 
struct  MACH_SUB_UMBRELLA_COMMAND
 
struct  MACH_SUB_LIBRARY_COMMAND
 
struct  MACH_PREBOUND_DYLIB_COMMAND
 
struct  MACH_DYLINKER_COMMAND
 
struct  MACH_X86_THREAD_STATE32
 
struct  MACH_X86_THREAD_STATE64
 
union  MACH_X86_THREAD_STATE
 
struct  MACH_THREAD_COMMAND
 
struct  MACH_ROUTINES_COMMAND
 
struct  MACH_ROUTINES_COMMAND_64
 
struct  MACH_SYMTAB_COMMAND
 
struct  MACH_DYSYMTAB_COMMAND
 
struct  TWOLEVEL_HINT
 
struct  MACH_TWO_LEVEL_HINTS_COMMAND
 
struct  MACH_PREBIND_CHECKSUM_COMMAND
 
struct  MACH_UUID_COMMAND
 
struct  MACH_RUN_PATH_COMMAND
 
struct  MACH_LINKEDIT_DATA_COMMAND
 
struct  MACH_ENCRYPTION_INFO_COMMAND
 
struct  MACH_ENCRYPTION_INFO_COMMAND_64
 
struct  MACH_VERSION_MIN_COMMAND
 
struct  MACH_BUILD_VERSION_TOOL
 
struct  MACH_BUILD_VERSION_COMMAND
 
struct  MACH_DYLD_INFO_COMMAND
 
struct  MACH_LINKER_OPTION_COMMAND
 
struct  MACH_SYMBOL_SEGMENT_COMMAND
 
struct  MACH_IDENTIFICATION_COMMAND
 
struct  MACH_FIXED_VM_FILE_COMMAND
 
struct  MACH_FILESET_ENTRY_COMMAND
 
struct  MACH_DYLD_CHAINED_PTR_64_KERNEL_CACHE_REBASE
 
struct  MACHO_DYLD_CHAINED_FIXUPS_HEADER
 
struct  MACH_DYLD_CHAINED_STARTS_IN_IMAGE
 
struct  MACH_DYLD_CHAINED_STARTS_IN_SEGMENT
 
struct  MACH_ENTRY_POINT_COMMAND
 
struct  MACH_SOURCE_VERSION_COMMAND
 
union  MACH_LOAD_COMMAND_PTR
 
struct  MACH_HEADER
 
struct  MACH_HEADER_64
 
union  MACH_HEADER_ANY
 
struct  MACH_NLIST
 
struct  MACH_NLIST_64
 
union  MACH_NLIST_ANY
 
struct  MACH_RELOCATION_INFO
 
struct  MACH_SCATTERED_RELOCATION_INFO
 

Macros

#define MACH_CPU_ARCH_ABI64   BIT24
 
#define MACH_CPU_ARCH_ABI64_32   BIT25
 
#define MACH_CPU_SUBTYPE_MASK   0xFF000000U
 mask for feature flags
 
#define MACH_CPU_SUBTYPE_LIB64   BIT17
 64 bit libraries
 
#define MACH_CPU_SUBTYPE_INTEL_MODEL_SHIFT   4U
 
#define MACH_CPU_SUBTYPE_INTEL_FAMILY_MAX   0x0FU
 
#define MACH_CPU_SUBTYPE_INTEL_MODEL_ALL   0U
 
#define MACH_CPU_SUBTYPE_INTEL(f, Model)
 
#define MACH_CPU_SUBTYPE_INTEL_FAMILY(Identifier)
 
#define MACH_CPU_SUBTYPE_INTEL_MODEL(Identifier)
 
#define FORMALIZE_CPU_SUBTYPE(CpuSubtype)
 
#define MACH_CPU_TYPE_64(CpuType)
 
#define MACH_CPU_TYPE_64_32(CpuType)
 
#define MACH_LC_REQUIRE_DYLD   BIT31
 
#define MACH_LOAD_COMMAND_SEGMENT   1U
 
#define MACH_LOAD_COMMAND_SYMTAB   2U
 
#define MACH_LOAD_COMMAND_SYMSEG   3U
 
#define MACH_LOAD_COMMAND_THREAD   4U
 
#define MACH_LOAD_COMMAND_UNIX_THREAD   5U
 
#define MACH_LOAD_COMMAND_LOAD_FIXED_VM_LIB   6U
 
#define MACH_LOAD_COMMAND_IDENTIFICATION_VM_LIB   7U
 
#define MACH_LOAD_COMMAND_IDENTIFICATION   8U
 
#define MACH_LOAD_COMMAND_FIXED_VM_FILE   9U
 
#define MACH_LOAD_COMMAND_PRE_PAGE   10U
 
#define MACH_LOAD_COMMAND_DYSYMTAB   11U
 
#define MACH_LOAD_COMMAND_LOAD_DYLIB   12U
 
#define MACH_LOAD_COMMAND_IDENTITY_DYLIB   13U
 
#define MACH_LOAD_COMMAND_LOAD_DYLD   14U
 
#define MACH_LOAD_COMMAND_IDENTIFICATION_DYLD   15U
 
#define MACH_LOAD_COMMAND_PREBOUNT_SYLIB   16U
 
#define MACH_LOAD_COMMAND_ROUTINES   17U
 
#define MACH_LOAD_COMMAND_SUB_FRAMEWORK   18U
 
#define MACH_LOAD_COMMAND_SUB_UMBRELLA   19U
 
#define MACH_LOAD_COMMAND_SUB_CLIENT   20U
 
#define MACH_LOAD_COMMAND_SUB_LIBRARY   21U
 
#define MACH_LOAD_COMMAND_TWO_LEVEL_HINTS   22U
 
#define MACH_LOAD_COMMAND_PREBIND_CHECKSUM   23U
 
#define MACH_LOAD_COMMAND_LLOAD_WEAK_DYLIB   (24U | MACH_LC_REQUIRE_DYLD)
 
#define MACH_LOAD_COMMAND_SEGMENT_64   25U
 
#define MACH_LOAD_COMMAND_ROUTINES_64   26U
 
#define MACH_LOAD_COMMAND_UUID   27U
 
#define MACH_LOAD_COMMAND_RUN_PATH   (28U | MACH_LC_REQUIRE_DYLD)
 
#define MACH_LOAD_COMMAND_CODE_SIGNATURE   29U
 
#define MACH_LOAD_COMMAND_SEGMENT_SPLIT_INFO   30U
 
#define MACH_LOAD_COMMAND_REEXPORT_DYLIB   (31U | MACH_LC_REQUIRE_DYLD)
 
#define MACH_LOAD_COMMAND_LAZY_LOAD_DYLIB   32U
 
#define MACH_LOAD_COMMAND_ENCRYPTION_INFO   33U
 
#define MACH_LOAD_COMMAND_DYLD_INFO   34U
 
#define MACH_LOAD_COMMAND_DYLD_INFO_ONLY   (34U | MACH_LC_REQUIRE_DYLD)
 
#define MACH_LOAD_COMMAND_LOAD_UPWARD_DYLIB   (35U | MACH_LC_REQUIRE_DYLD)
 
#define MACH_LOAD_COMMAND_VERSION_MIN_MAC_OS_X   36U
 
#define MACH_LOAD_COMMAND_VERSION_MIN_IPHONE_OS   37U
 
#define MACH_LOAD_COMMAND_FUNCTION_STARTS   38U
 
#define MACH_LOAD_COMMAND_DYLD_ENVIRONMENT   39U
 
#define MACH_LOAD_COMMAND_MAIN   (40U | MACH_LC_REQUIRE_DYLD)
 
#define MACH_LOAD_COMMAND_DATA_IN_CODE   41U
 
#define MACH_LOAD_COMMAND_SOURCE_VERSION   42U
 
#define MACH_LOAD_COMMAND_DYLIB_CODE_SIGN_DRS   43U
 
#define MACH_LOAD_COMMAND_ENCRYPTION_INFO_64   44U
 
#define MACH_LOAD_COMMAND_LINKER_OPTION   45U
 
#define MACH_LOAD_COMMAND_LINKER_OPTIMIZATION_HINT   46U
 
#define MACH_LOAD_COMMAND_VERSION_MIN_TV_OS   47U
 
#define MACH_LOAD_COMMAND_VERSION_MIN_WATCH_OS   48U
 
#define MACH_LOAD_COMMAND_NOTE   49U
 
#define MACH_LOAD_COMMAND_BUILD_VERSION   50U
 
#define MACH_LOAD_COMMAND_DYLD_EXPORTS_TRIE   (51U | MACH_LC_REQUIRE_DYLD)
 
#define MACH_LOAD_COMMAND_DYLD_CHAINED_FIXUPS   (52U | MACH_LC_REQUIRE_DYLD)
 
#define MACH_LOAD_COMMAND_FILESET_ENTRY   (53U | MACH_LC_REQUIRE_DYLD)
 
#define MACH_LOAD_COMMAND_HDR_
 
#define NEXT_MACH_LOAD_COMMAND(Command)
 
#define MACH_SEGMENT_FLAG_HIGH_VIRTUAL_MEMORY   BIT0
 
#define MACH_SEGMENT_FLAG_FIXED_VM_LIB   BIT1
 
#define MACH_SEGMENT_FLAG_NO_RELOCATION   BIT2
 
#define MACH_SEGMENT_FLAG_PROTECTED_VERSION_1   BIT3
 
#define MACH_SEGMENT_VM_PROT_NONE   0U
 
#define MACH_SEGMENT_VM_PROT_READ   BIT0
 
#define MACH_SEGMENT_VM_PROT_WRITE   BIT1
 
#define MACH_SEGMENT_VM_PROT_EXECUTE   BIT2
 
#define MACH_SECTION_ATTRIBUTES_SYSYTEM   0x00FFFF00U
 
#define MACH_SECTION_ATTRIBUTES_USER   0xFF000000U
 
#define MACH_SECTION_ATTRIBUTE_LOCAL_RELOCATION   BIT8
 
#define MACH_SECTION_ATTRIBUTE_EXTERNAL_RELOCATION   BIT9
 
#define MACH_SECTION_ATTRIBUTE_SOME_INSTRUCTIONS   BIT10
 
#define MACH_SECTION_TYPE_MASK   0x000000FFU
 256 section types
 
#define MACH_SECTION_ATTRIBUTES_MASK   0xFFFFFF00U
 24 section attributes
 
#define MACH_SECTION_ATTRIBUTE_DEBUG   BIT25
 
#define MACH_SECTION_ATTRIBUTE_SELF_MODIFYING_CODE   BIT26
 
#define MACH_SECTION_ATTRIBUTE_LIVE_SUPPORT   BIT27
 
#define MACH_SECTION_ATTRIBUTE_NO_DEAD_STRIP   BIT28
 
#define MACH_SECTION_ATTRIBUTE_STRIP_STATIC_SYMBOLS   BIT29
 
#define MACH_SECTION_ATTRIBUTE_NO_TOC   BIT30
 
#define MACH_SECTION_ATTRIBUTE_PURE_INSTRUCTIONS   BIT31
 
#define NEXT_MACH_SEGMENT(Segment)
 
#define NEXT_MACH_SEGMENT_64(Segment)
 
#define MACH_X86_THREAD_STATE_MAX   614
 
#define MACH_VALID_THREAD_STATE_FLAVOR(Flavor)
 
#define MACH_INDIRECT_SYMBOL_LOCAL   0x80000000U
 
#define MACH_INDIRECT_SYMBOL_ABS   0x40000000U
 
#define MACH_PLATFORM_MACOS   1U
 
#define MACH_PLATFORM_IOS   2U
 
#define MACH_PLATFORM_TVOS   3U
 
#define MACH_PLATFORM_WATCHOS   4U
 
#define MACH_PLATFORM_BRIDGEOS   5U
 
#define MACH_PLATFORM_MACCATALYST   6U
 
#define MACH_PLATFORM_IOSSIMULATOR   7U
 
#define MACH_PLATFORM_TVOSSIMULATOR   8U
 
#define MACH_PLATFORM_WATCHOSSIMULATOR   9U
 
#define MACH_PLATFORM_DRIVERKIT   10U
 
#define MACH_TOOL_CLANG   1U
 
#define MACH_TOOL_SWIFT   2U
 
#define MACH_TOOL_LD   3U
 
#define MACH_SOURCE_VERSION_A_MASK   0xFFFFFF0000000000U
 
#define MACH_SOURCE_VERSION_B_MASK   0x000000FFC0000000U
 
#define MACH_SOURCE_VERSION_V_MASK   0x000000003FF00000U
 
#define MACH_SOURCE_VERSION_D_MASK   0x00000000000FFC00U
 
#define MACH_SOURCE_VERSION_E_MASK   0x00000000000003FFU
 
#define MACH_SOURCE_VERSION_A(Version)
 
#define MACH_SOURCE_VERSION_B(Version)
 
#define MACH_SOURCE_VERSION_C(Version)
 
#define MACH_SOURCE_VERSION_D(Version)
 
#define MACH_SOURCE_VERSION_E(Version)
 
#define MACH_HEADER_FLAG_NO_UNDEFINED_REFERENCES   BIT0
 
#define MACH_HEADER_FLAG_INCREMENTAL_LINK   BIT1
 
#define MACH_HEADER_FLAG_DYNAMIC_LINKER_LINK   BIT2
 
#define MACH_HEADER_FLAG_BINARY_DATA_LOAD   BIT3
 
#define MACH_HEADER_FLAG_PREBOUND   BIT4
 
#define MACH_HEADER_FLAG_SPLIT_SEGMENTS   BIT5
 
#define MACH_HEADER_FLAG_LAZY_INITIALIZATION   BIT6
 
#define MACH_HEADER_FLAG_TWO_LEVEL   BIT7
 
#define MACH_HEADER_FLAG_FORCE_FLAT   BIT8
 
#define MACH_HEADER_FLAG_NO_MULTIPLE_DEFINITIONS   BIT9
 
#define MACH_HEADER_FLAG_NO_FIX_PREBINDING   BIT10
 
#define MACH_HEADER_FLAG_PREBINDABLE   BIT11
 
#define MACH_HEADER_FLAG_ALL_MODULES_BOUND   BIT12
 
#define MACH_HEADER_FLAG_SUBSECTIONS_VIA_SYNBOLS   BIT13
 
#define MACH_HEADER_FLAG_CANONICAL   BIT14
 
#define MACH_HEADER_FLAG_WEAK_DEFINES   BIT15
 
#define MACH_HEADER_FLAG_BINDS_TO_WEAK   BIT16
 
#define MACH_HEADER_FLAG_ALLOW_STACK_EXECUTION   BIT17
 
#define MACH_HEADER_FLAG_ROOT_SAFE   BIT18
 
#define MACH_HEADER_FLAG_SET_UID_SAFE   BIT19
 
#define MACH_HEADER_FLAG_NO_REEXPORTED_DYLIBS   BIT20
 
#define MACH_HEADER_FLAG_POSITION_INDEPENDENT_EXECUTABLE   BIT21
 
#define MACH_HEADER_FLAG_DEAD_STRIPPABLE_DYLIB   BIT22
 
#define MACH_HEADER_FLAG_HAS_TLV_DESCRIPTORS   BIT23
 
#define MACH_HEADER_FLAG_NO_HEAP_EXECUTION   BIT24
 
#define MACH_HEADER_FLAG_APP_EXTENSION_SAFE   BIT25
 
#define MACH_HEADER_FLAG_NLIST_OUTOFSYNC_WITH_DYLDINFO   BIT26
 
#define MACH_HEADER_FLAG_SIM_SUPPORT   BIT27
 
#define MACH_HEADER_FLAG_DYLIB_IN_CACHE   BIT31
 
#define MACH_HEADER_SIGNATURE   0xFEEDFACE
 the mach magic number
 
#define MACH_HEADER_INVERT_SIGNATURE   0xCEFAEDFE
 the mach magic number (byte swapped)
 
#define MACH_HEADER_64_SIGNATURE   0xFEEDFACF
 the 64-bit mach magic number
 
#define MACH_HEADER_64_INVERT_SIGNATURE   0xCFFAEDFE
 the 64-bit mach magic number (byte swapped)
 
#define MACH_N_TYPE_STAB   0xE0U
 
#define MACH_N_TYPE_PEXT   0x10U
 private external symbol bit
 
#define MACH_N_TYPE_TYPE   0x0EU
 mask for the type bit
 
#define MACH_N_TYPE_EXT   0x01U
 
#define MACH_N_TYPE_UNDF   0x0U
 undefined, n_sect == NO_SECT
 
#define MACH_N_TYPE_ABS   0x2U
 absolute, n_sect == NO_SECT
 
#define MACH_N_TYPE_SECT   0xEU
 defined in section number n_sect
 
#define MACH_N_TYPE_PBUD   0xCU
 prebound undefined (defined in a dylib)
 
#define MACH_N_TYPE_INDR   0xAU
 indirect
 
#define NO_SECT   0
 symbol is not in any section
 
#define MAX_SECT   255
 1 thru 255 inclusive
 
#define MACH_N_GSYM   0x20U
 global symbol: name,,NO_SECT,type,0
 
#define MACH_N_FNAME   0x22U
 procedure name (f77 kludge): name,,NO_SECT,0,0
 
#define MACH_N_FUN   0x24U
 procedure: name,,n_sect,linenumber,address
 
#define MACH_N_STSYM   0x26U
 static symbol: name,,n_sect,type,address
 
#define MACH_N_LCSYM   0x28U
 .lcomm symbol: name,,n_sect,type,address
 
#define MACH_N_BNSYM   0x2EU
 begin nsect sym: 0,,n_sect,0,address
 
#define MACH_N_AST   0x32U
 AST file path: name,,NO_SECT,0,0.
 
#define MACH_N_OPT   0x3CU
 emitted with gcc2_compiled and in gcc source
 
#define MACH_N_RSYM   0x40U
 register sym: name,,NO_SECT,type,register
 
#define MACH_N_SLINE   0x44U
 src line: 0,,n_sect,linenumber,address
 
#define MACH_N_ENSYM   0x4EU
 end nsect sym: 0,,n_sect,0,address
 
#define MACH_N_SSYM   0x60U
 structure elt: name,,NO_SECT,type,struct_offset
 
#define MACH_N_SO   0x64U
 source file name: name,,n_sect,0,address
 
#define MACH_N_OSO   0x66U
 object file name: name,,0,0,st_mtime
 
#define MACH_N_LSYM   0x80U
 local sym: name,,NO_SECT,type,offset
 
#define MACH_N_BINCL   0x82U
 include file beginning: name,,NO_SECT,0,sum
 
#define MACH_N_SOL   0x84U
 #included file name: name,,n_sect,0,address
 
#define MACH_N_PARAMS   0x86U
 compiler parameters: name,,NO_SECT,0,0
 
#define MACH_N_VERSION   0x88U
 compiler version: name,,NO_SECT,0,0
 
#define MACH_N_OLEVEL   0x8AU
 compiler -O level: name,,NO_SECT,0,0
 
#define MACH_N_PSYM   0xA0U
 parameter: name,,NO_SECT,type,offset
 
#define MACH_N_EINCL   0xA2U
 include file end: name,,NO_SECT,0,0
 
#define MACH_N_ENTRY   0xA4U
 alternate entry: name,,n_sect,linenumber,address
 
#define MACH_N_LBRAC   0xC0U
 left bracket: 0,,NO_SECT,nesting level,address
 
#define MACH_N_EXCL   0xC2U
 deleted include file: name,,NO_SECT,0,sum
 
#define MACH_N_RBRAC   0xE0U
 right bracket: 0,,NO_SECT,nesting level,address
 
#define MACH_N_BCOMM   0xE2U
 begin common: name,,NO_SECT,0,0
 
#define MACH_N_ECOMM   0xE4U
 end common: name,,n_sect,0,0
 
#define MACH_N_ECOML   0xE8U
 end common (local name): 0,,n_sect,0,address
 
#define MACH_N_LENG   0xFEU
 second stab entry with length information
 
#define MACH_N_NO_DEAD_STRIP   0x0020U
 
#define MACH_N_DESC_DISCARDED   0x0020U
 
#define MACH_N_WEAK_REF   0x0040U
 
#define MACH_N_WEAK_DEF   0x0080U
 
#define MACH_N_REF_TO_WEAK   0x0080U
 
#define MACH_N_ARM_THUMB_DEF   0x0008U
 
#define MACH_N_SYMBOL_RESOLVER   0x0100U
 
#define MACH_N_ALT_ENTRY   0x0200U
 
#define MACH_N_PC   0x30U
 
#define MACH_RELOC_ABSOLUTE   0U
 absolute relocation type for Mach-O files
 
#define MACH_RELOC_SCATTERED   0x80000000U
 

Typedefs

typedef INT32 MACH_CPU_TYPE
 
typedef INT32 MACH_CPU_SUBTYPE
 
typedef UINT32 MACH_CPU_FAMILY
 
typedef INT32 MACH_CPU_THREADTYPE
 
typedef INT32 MACH_VM_PROTECTION
 
typedef UINT32 MACH_LOAD_COMMAND_TYPE
 
typedef UINT32 MACH_SEGMENT_FLAGS
 
typedef UINT32 MACH_HEADER_FILE_TYPE
 
typedef UINT32 MACH_HEADER_FLAGS
 

Enumerations

enum  {
  MachCpuTypeAny = -1 , MachCpuTypeVax = 1 , MachCpuTypeMc680x0 = 6 , MachCpuTypeX86 = 7 ,
  MachCpuTypeI386 = MachCpuTypeX86 , MachCpuTypeX8664 = MACH_CPU_TYPE_64 (MachCpuTypeX86) , MachCpuTypeMc98000 = 10 , MachCpuTypeHppa = 11 ,
  MachCpuTypeArm = 12 , MachCpuTypeArm64 = MACH_CPU_TYPE_64 (MachCpuTypeArm) , MachCpuTypeArm6432 = MACH_CPU_TYPE_64_32 (MachCpuTypeArm) , MachCpuTypeMc88000 = 13 ,
  MachCpuTypeSparc = 14 , MachCpuTypeI860 = 15 , MachCpuTypePowerPc = 18 , MachCpuTypePowerPc64 = MACH_CPU_TYPE_64 (MachCpuTypePowerPc) ,
  MachCpuTypeVeo = 255
}
 < !defined(MACH_LITTLE_ENDIAN) && !defined(MACH_BIG_ENDIAN) More...
 
enum  {
  MachCpuSubtypeInvalid = -1 , MachCpuSubtypeMultiple = -1 , MachCpuSubtypeLittleEndian = 0 , MachCpuSubtypeBigEndian = 1 ,
  MachCpuSubtypeVaxAll = 0 , MachCpuSubtypeVax780 = 1 , MachCpuSubtypeVax785 = 2 , MachCpuSubtypeVax750 = 3 ,
  MachCpuSubtypeVax730 = 4 , MachCpuSubtypeUVax1 = 5 , MachCpuSubtypeUVax2 = 6 , MachCpuSubtypeVax8200 = 7 ,
  MachCpuSubtypeVax8500 = 8 , MachCpuSubtypeVax8600 = 9 , MachCpuSubtypeVax8650 = 10 , MachCpuSubtypeVax8800 = 11 ,
  MachCpuSubtypeUVax3 = 12 , MachCpuSubtypeMc680All = 1 , MachCpuSubtypeMc68030 = MachCpuSubtypeMc680All , MachCpuSubtypeMc68040 = 2 ,
  MachCpuSubtypeMc68030Only = 3 , MachCpuSubtypeX86All = MACH_CPU_SUBTYPE_INTEL (3, 0) , MachCpuSubtypeX86Arch1 = MACH_CPU_SUBTYPE_INTEL (4, 0) , MachCpuSubtypeX8664All = MachCpuSubtypeX86All ,
  MachCpuSubtypeX8664H = MACH_CPU_SUBTYPE_INTEL (8, 0) , MachCpuSubtypeI386All = MachCpuSubtypeX86All , MachCpuSubtype386 = MachCpuSubtypeI386All , MachCpuSubtype486 = MachCpuSubtypeX86Arch1 ,
  MachCpuSubtype486Sx = MACH_CPU_SUBTYPE_INTEL (4, 8) , MachCpuSubtype586 = MACH_CPU_SUBTYPE_INTEL (5, 0) , MachCpuSubtypePentium = MachCpuSubtype586 , MachCpuSubtypePentiumPro = MACH_CPU_SUBTYPE_INTEL (6, 1) ,
  MachCpuSubtypePentium3M3 = MACH_CPU_SUBTYPE_INTEL (6, 3) , MachCpuSubtypePentium3M5 = MACH_CPU_SUBTYPE_INTEL (6, 5) , MachCpuSubtypeCeleron = MACH_CPU_SUBTYPE_INTEL (7, 6) , MachCpuSubtypeCeleronMobile = MACH_CPU_SUBTYPE_INTEL (7, 7) ,
  MachCpuSubtypePentium3 = MACH_CPU_SUBTYPE_INTEL (8, 0) , MachCpuSubtypePentium3M = MACH_CPU_SUBTYPE_INTEL (8, 1) , MachCpuSubtypePentium3Xeon = MACH_CPU_SUBTYPE_INTEL (8, 2) , MachCpuSubtypePentiumM = MACH_CPU_SUBTYPE_INTEL (9, 0) ,
  MachCpuSubtypePentium4 = MACH_CPU_SUBTYPE_INTEL (10, 0) , MachCpuSubtypePentium4M = MACH_CPU_SUBTYPE_INTEL (10, 1) , MachCpuSubtypeItanium = MACH_CPU_SUBTYPE_INTEL (11, 0) , MachCpuSubtypeItanium2 = MACH_CPU_SUBTYPE_INTEL (11, 1) ,
  MachCpuSubtypeXeon = MACH_CPU_SUBTYPE_INTEL (12, 0) , MachCpuSubtypeXeonMp = MACH_CPU_SUBTYPE_INTEL (12, 1) , MachCpuSubtypeMipsAll = 0 , MachCpuSubtypeMipsR2300 = 1 ,
  MachCpuSubtypeMipsR2600 = 2 , MachCpuSubtypeMipsR2800 = 3 , MachCpuSubtypeMipsR2000a = 4 , MachCpuSubtypeMipsR2000 = 5 ,
  MachCpuSubtypeMipsR3000a = 6 , MachCpuSubtypeMipsR3000 = 7 , MachCpuSubtypeMc98000All = 0 , MachCpuSubtypeMc98601 = 1 ,
  MachCpuSubtypeHppaAll = 0 , MachCpuSubtypeHppa7100 = MachCpuSubtypeHppaAll , MachCpuSubtypeHppa7100Lc = 1 , MachCpuSubtypeArmAll = 0 ,
  MachCpuSubtypeArmV4T = 5 , MachCpuSubtypeArmV6 = 6 , MachCpuSubtypeArmV5Tej = 7 , MachCpuSubtypeArmXscale = 8 ,
  MachCpuSubtypeArmV7 = 9 , MachCpuSubtypeArmV7F = 10 , MachCpuSubtypeArmV7S = 11 , MachCpuSubtypeArmV7K = 12 ,
  MachCpuSubtypeArmV8 = 13 , MachCpuSubtypeArmV6M = 14 , MachCpuSubtypeArmV7M = 15 , MachCpuSubtypeArmV7Em = 16 ,
  MachCpuSubtypeArm64All = 0 , MachCpuSubtypeArm64V8 = 1 , MachCpuSubtypeArm6432All = 0 , MachCpuSubtypeArm6432V8 = 1 ,
  MachCpuSubtypeMc88000All = 0 , MachCpuSubtypeMc88100 = 1 , MachCpuSubtypeMc88110 = 2 , MachCpuSubtypeSparcAll = 0 ,
  MachCpuSubtypeI860All = 0 , MachCpuSubtypeI860860 = 1 , MachCpuSubtypePowerPcAll = 0 , MachCpuSubtypePowerPc601 = 1 ,
  MachCpuSubtypePowerPc602 = 2 , MachCpuSubtypePowerPc603 = 3 , MachCpuSubtypePowerPc603e = 4 , MachCpuSubtypePowerPc603ev = 5 ,
  MachCpuSubtypePowerPc604 = 6 , MachCpuSubtypePowerPc604e = 7 , MachCpuSubtypePowerPc620 = 8 , MachCpuSubtypePowerPc750 = 9 ,
  MachCpuSubtypePowerPc7400 = 10 , MachCpuSubtypePowerPc7450 = 11 , MachCpuSubtypePowerPc970 = 100 , MachCpuSubtypeVeo1 = 1 ,
  MachCpuSubtypeVeo2 = 2 , MachCpuSubtypeVeo3 = 3 , MachCpuSubtypeVeo4 = 4 , MachCpuSubtypeVeoAll = MachCpuSubtypeVeo2
}
 
enum  {
  MachCpuFamilyUnknown = 0 , MachCpuFamilyPowerPcG3 = 0xCEE41549 , MachCpuFamilyPowerPcG4 = 0x77C184AE , MachCpuFamilyPowerPcG5 = 0xED76D8AA ,
  MachCpuFamilyIntel613 = 0xAA33392B , MachCpuFamilyIntelYonah = 0x73D67300 , MachCpuFamilyIntelMerom = 0x426F69EF , MachCpuFamilyIntelPenryn = 0x78EA4FBC ,
  MachCpuFamilyIntelNehalem = 0x6B5A4CD2 , MachCpuFamilyIntelWestmere = 0x573B5EEC , MachCpuFamilyIntelSandyBridge = 0x5490B78C , MachCpuFamilyIntelIvyBridge = 0x1F65E835 ,
  MachCpuFamilyIntelHaswell = 0x10B282DC , MachCpuFamilyIntelBroadwell = 0x582ED09C , MachCpuFamilyIntelSkylake = 0x37FC219F , MachCpuFamilyIntelKabyLake = 0x0F817246 ,
  MachCpuFamilyIntelCoffeeLake = MachCpuFamilyIntelKabyLake , MachCpuFamilyIntelIceLake = 0x38435547 , MachCpuFamilyIntelCometLake = 0x1CF8A03E , MachCpuFamilyIntel614 = MachCpuFamilyIntelYonah ,
  MachCpuFamilyIntel615 = MachCpuFamilyIntelMerom , MachCpuFamilyIntel623 = MachCpuFamilyIntelPenryn , MachCpuFamilyIntel626 = MachCpuFamilyIntelNehalem , MachCpuFamilyIntelCore = MachCpuFamilyIntelYonah ,
  MachCpuFamilyIntelCore2 = MachCpuFamilyIntelMerom , MachCpuFamilyArm9 = 0xE73283AE , MachCpuFamilyArm11 = 0x8FF620D8 , MachCpuFamilyArmXscale = 0x53B005F5 ,
  MachCpuFamilyArm12 = 0xBD1B0AE9 , MachCpuFamilyArm13 = 0x0CC90E64 , MachCpuFamilyArm14 = 0x96077EF1 , MachCpuFamilyArm15 = 0xA8511BCA ,
  MachCpuFamilyArmSwift = 0x1E2D6381 , MachCpuFamilyArmCyclone = 0x37A09642 , MachCpuFamilyArmTyphoon = 0x2C91A47E , MachCpuFamilyArmTwister = 0x92FB37C8 ,
  MachCpuFamilyArmHurricane = 0x67CEEE93 , MachCpuFamilyArmMonsoonMistral = 0xE81E7EF6 , MachCpuFamilyArmVortexTempest = 0x07D34B9F , MachCpuFamilyArmLightningThunder = 0x462504D2
}
 
enum  {
  MachSectionTypeRegular = 0 , MachSectionTypeZeroFill = 1 , MachSectionTypeCStringLiterals = 2 , MachSectionType4ByteLiterals = 3 ,
  MachSectionType8ByteLiterals = 4 , MachSectionTypeLiteralPointers = 5 , MachSectionTypeNonLazySymbolPointers = 6 , MachSectionTypeLazySymbolPointers = 7 ,
  MachSectionTypeSymbolStubs = 8 , MachSectionTypeModInitalizeFunctionPointers = 9 , MachSectionTypeModTerminateFunctionPointers = 10 , MachSectionTypeCoalesced = 11 ,
  MachSectionTypeGigabyteZeroFill = 12 , MachSectionTypeInterposing = 13 , MachSectionType16ByteLiterals = 14 , MachSectionTypeDtraceObjectFormat = 15 ,
  MachSectionTypeLazyDylibSymbolPointers = 16 , MachSectionTypeThreadLocalRegular = 17 , MachSectionTypeThreadLocalZeroFill = 18 , MachSectionTypeThreadLocalVariables = 19 ,
  MachSectionTypeThreadVariablePointers = 20 , MachSectionTypeThreadLocalInitializeFunctionPointers = 21 , MachSectionTypeThreadLocalInitializeFunctionOffsets = 22
}
 
enum  {
  MachX86ThreadState32 = 1 , MachX86FloatState32 = 2 , MachX86ExceptionState32 = 3 , MachX86ThreadState64 = 4 ,
  MachX86FloatState64 = 5 , MachX86ExceptionState64 = 6 , MachX86ThreadState = 7 , MachX86FloatState = 8 ,
  MachX86ExceptionState = 9 , MachX86DebugState32 = 10 , MachX86DebugState64 = 11 , MachX86DebugState = 12 ,
  MachThreadStateNone = 13 , MachX86AvxState32 = 16 , MachX86AvxState64 = 17 , MachX86AvxState = 18 ,
  MachX86Avx512State32 = 19 , MachX86Avx512State64 = 20 , MachX86Avx512State = 21
}
 
enum  {
  MACH_DYLD_CHAINED_PTR_ARM64E = 1 , MACH_DYLD_CHAINED_PTR_64 = 2 , MACH_DYLD_CHAINED_PTR_32 = 3 , MACH_DYLD_CHAINED_PTR_32_CACHE = 4 ,
  MACH_DYLD_CHAINED_PTR_32_FIRMWARE = 5 , MACH_DYLD_CHAINED_PTR_64_OFFSET = 6 , MACH_DYLD_CHAINED_PTR_ARM64E_OFFSET = 7 , MACH_DYLD_CHAINED_PTR_ARM64E_KERNEL = 7 ,
  MACH_DYLD_CHAINED_PTR_64_KERNEL_CACHE = 8 , MACH_DYLD_CHAINED_PTR_ARM64E_USERLAND = 9 , MACH_DYLD_CHAINED_PTR_ARM64E_FIRMWARE = 10 , MACH_DYLD_CHAINED_PTR_X86_64_KERNEL_CACHE = 11 ,
  MACH_DYLD_CHAINED_PTR_ARM64E_USERLAND24 = 12
}
 
enum  { MACH_DYLD_CHAINED_PTR_START_NONE = 0xFFFF , MACH_DYLD_CHAINED_PTR_START_MULTI = 0x8000 , MACH_DYLD_CHAINED_PTR_START_LAST = 0x8000 }
 
enum  {
  MachHeaderFileTypeObject = 1 , MachHeaderFileTypeExecute = 2 , MachHeaderFileTypeFixedVmLib = 3 , MachHeaderFileTypeCore = 4 ,
  MachHeaderFileTypePreload = 5 , MachHeaderFileTypeDylib = 6 , MachHeaderFileTypeDynamicLinker = 7 , MachHeaderFileTypeBundle = 8 ,
  MachHeaderFileTypeDynamicLinkerStub = 9 , MachHeaderFileTypeDsym = 10 , MachHeaderFileTypeKextBundle = 11 , MachHeaderFileTypeFileSet = 12
}
 
enum  {
  MachGenericRelocVanilla , MachGenericRelocPair , MachGenericRelocSectDiff , MachGenericRelocPreboundLazyPointer ,
  MachGenericRelocLocalSectDiff , MachGenericRelocThreadLocalVariables
}
 
enum  {
  MachX8664RelocUnsigned , MachX8664RelocSigned , MachX8664RelocBranch , MachX8664RelocGotLoad ,
  MachX8664RelocGot , MachX8664RelocSubtractor , MachX8664RelocSigned1 , MachX8664RelocSigned2 ,
  MachX8664RelocSigned4 , MachX8664RelocThreadLocalVariable
}
 

Detailed Description

Copyright (c) 2016 - 2018, Download-Fritz. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file AppleMachoImage.h.

Macro Definition Documentation

◆ FORMALIZE_CPU_SUBTYPE

#define FORMALIZE_CPU_SUBTYPE ( CpuSubtype)
Value:
((CpuSubtype) & ~CPU_SUBTYPE_MASK)

Definition at line 38 of file AppleMachoImage.h.

◆ MACH_CPU_ARCH_ABI64

#define MACH_CPU_ARCH_ABI64   BIT24

Definition at line 16 of file AppleMachoImage.h.

◆ MACH_CPU_ARCH_ABI64_32

#define MACH_CPU_ARCH_ABI64_32   BIT25

Definition at line 17 of file AppleMachoImage.h.

◆ MACH_CPU_SUBTYPE_INTEL

#define MACH_CPU_SUBTYPE_INTEL ( f,
Model )
Value:
#define MACH_CPU_SUBTYPE_INTEL_MODEL_SHIFT

Definition at line 29 of file AppleMachoImage.h.

◆ MACH_CPU_SUBTYPE_INTEL_FAMILY

#define MACH_CPU_SUBTYPE_INTEL_FAMILY ( Identifier)
Value:
#define MACH_CPU_SUBTYPE_INTEL_FAMILY_MAX

Definition at line 32 of file AppleMachoImage.h.

◆ MACH_CPU_SUBTYPE_INTEL_FAMILY_MAX

#define MACH_CPU_SUBTYPE_INTEL_FAMILY_MAX   0x0FU

Definition at line 26 of file AppleMachoImage.h.

◆ MACH_CPU_SUBTYPE_INTEL_MODEL

#define MACH_CPU_SUBTYPE_INTEL_MODEL ( Identifier)
Value:

Definition at line 35 of file AppleMachoImage.h.

◆ MACH_CPU_SUBTYPE_INTEL_MODEL_ALL

#define MACH_CPU_SUBTYPE_INTEL_MODEL_ALL   0U

Definition at line 27 of file AppleMachoImage.h.

◆ MACH_CPU_SUBTYPE_INTEL_MODEL_SHIFT

#define MACH_CPU_SUBTYPE_INTEL_MODEL_SHIFT   4U

Definition at line 25 of file AppleMachoImage.h.

◆ MACH_CPU_SUBTYPE_LIB64

#define MACH_CPU_SUBTYPE_LIB64   BIT17

64 bit libraries

Definition at line 23 of file AppleMachoImage.h.

◆ MACH_CPU_SUBTYPE_MASK

#define MACH_CPU_SUBTYPE_MASK   0xFF000000U

mask for feature flags

Definition at line 22 of file AppleMachoImage.h.

◆ MACH_CPU_TYPE_64

#define MACH_CPU_TYPE_64 ( CpuType)
Value:
((CpuType) | MACH_CPU_ARCH_ABI64)
#define MACH_CPU_ARCH_ABI64

Definition at line 40 of file AppleMachoImage.h.

◆ MACH_CPU_TYPE_64_32

#define MACH_CPU_TYPE_64_32 ( CpuType)
Value:
#define MACH_CPU_ARCH_ABI64_32

Definition at line 42 of file AppleMachoImage.h.

◆ MACH_HEADER_64_INVERT_SIGNATURE

#define MACH_HEADER_64_INVERT_SIGNATURE   0xCFFAEDFE

the 64-bit mach magic number (byte swapped)

Definition at line 2058 of file AppleMachoImage.h.

◆ MACH_HEADER_64_SIGNATURE

#define MACH_HEADER_64_SIGNATURE   0xFEEDFACF

the 64-bit mach magic number

Definition at line 2057 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_ALL_MODULES_BOUND

#define MACH_HEADER_FLAG_ALL_MODULES_BOUND   BIT12

Definition at line 2013 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_ALLOW_STACK_EXECUTION

#define MACH_HEADER_FLAG_ALLOW_STACK_EXECUTION   BIT17

Definition at line 2018 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_APP_EXTENSION_SAFE

#define MACH_HEADER_FLAG_APP_EXTENSION_SAFE   BIT25

Definition at line 2026 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_BINARY_DATA_LOAD

#define MACH_HEADER_FLAG_BINARY_DATA_LOAD   BIT3

Definition at line 2004 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_BINDS_TO_WEAK

#define MACH_HEADER_FLAG_BINDS_TO_WEAK   BIT16

Definition at line 2017 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_CANONICAL

#define MACH_HEADER_FLAG_CANONICAL   BIT14

Definition at line 2015 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_DEAD_STRIPPABLE_DYLIB

#define MACH_HEADER_FLAG_DEAD_STRIPPABLE_DYLIB   BIT22

Definition at line 2023 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_DYLIB_IN_CACHE

#define MACH_HEADER_FLAG_DYLIB_IN_CACHE   BIT31

Definition at line 2029 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_DYNAMIC_LINKER_LINK

#define MACH_HEADER_FLAG_DYNAMIC_LINKER_LINK   BIT2

Definition at line 2003 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_FORCE_FLAT

#define MACH_HEADER_FLAG_FORCE_FLAT   BIT8

Definition at line 2009 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_HAS_TLV_DESCRIPTORS

#define MACH_HEADER_FLAG_HAS_TLV_DESCRIPTORS   BIT23

Definition at line 2024 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_INCREMENTAL_LINK

#define MACH_HEADER_FLAG_INCREMENTAL_LINK   BIT1

Definition at line 2002 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_LAZY_INITIALIZATION

#define MACH_HEADER_FLAG_LAZY_INITIALIZATION   BIT6

Definition at line 2007 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_NLIST_OUTOFSYNC_WITH_DYLDINFO

#define MACH_HEADER_FLAG_NLIST_OUTOFSYNC_WITH_DYLDINFO   BIT26

Definition at line 2027 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_NO_FIX_PREBINDING

#define MACH_HEADER_FLAG_NO_FIX_PREBINDING   BIT10

Definition at line 2011 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_NO_HEAP_EXECUTION

#define MACH_HEADER_FLAG_NO_HEAP_EXECUTION   BIT24

Definition at line 2025 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_NO_MULTIPLE_DEFINITIONS

#define MACH_HEADER_FLAG_NO_MULTIPLE_DEFINITIONS   BIT9

Definition at line 2010 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_NO_REEXPORTED_DYLIBS

#define MACH_HEADER_FLAG_NO_REEXPORTED_DYLIBS   BIT20

Definition at line 2021 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_NO_UNDEFINED_REFERENCES

#define MACH_HEADER_FLAG_NO_UNDEFINED_REFERENCES   BIT0

Definition at line 2001 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_POSITION_INDEPENDENT_EXECUTABLE

#define MACH_HEADER_FLAG_POSITION_INDEPENDENT_EXECUTABLE   BIT21

Definition at line 2022 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_PREBINDABLE

#define MACH_HEADER_FLAG_PREBINDABLE   BIT11

Definition at line 2012 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_PREBOUND

#define MACH_HEADER_FLAG_PREBOUND   BIT4

Definition at line 2005 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_ROOT_SAFE

#define MACH_HEADER_FLAG_ROOT_SAFE   BIT18

Definition at line 2019 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_SET_UID_SAFE

#define MACH_HEADER_FLAG_SET_UID_SAFE   BIT19

Definition at line 2020 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_SIM_SUPPORT

#define MACH_HEADER_FLAG_SIM_SUPPORT   BIT27

Definition at line 2028 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_SPLIT_SEGMENTS

#define MACH_HEADER_FLAG_SPLIT_SEGMENTS   BIT5

Definition at line 2006 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_SUBSECTIONS_VIA_SYNBOLS

#define MACH_HEADER_FLAG_SUBSECTIONS_VIA_SYNBOLS   BIT13

Definition at line 2014 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_TWO_LEVEL

#define MACH_HEADER_FLAG_TWO_LEVEL   BIT7

Definition at line 2008 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAG_WEAK_DEFINES

#define MACH_HEADER_FLAG_WEAK_DEFINES   BIT15

Definition at line 2016 of file AppleMachoImage.h.

◆ MACH_HEADER_INVERT_SIGNATURE

#define MACH_HEADER_INVERT_SIGNATURE   0xCEFAEDFE

the mach magic number (byte swapped)

Definition at line 2037 of file AppleMachoImage.h.

◆ MACH_HEADER_SIGNATURE

#define MACH_HEADER_SIGNATURE   0xFEEDFACE

the mach magic number

Definition at line 2036 of file AppleMachoImage.h.

◆ MACH_INDIRECT_SYMBOL_ABS

#define MACH_INDIRECT_SYMBOL_ABS   0x40000000U

Definition at line 1462 of file AppleMachoImage.h.

◆ MACH_INDIRECT_SYMBOL_LOCAL

#define MACH_INDIRECT_SYMBOL_LOCAL   0x80000000U

Definition at line 1461 of file AppleMachoImage.h.

◆ MACH_LC_REQUIRE_DYLD

#define MACH_LC_REQUIRE_DYLD   BIT31

After MacOS X 10.1 when a new load command is added that is required to be understood by the dynamic linker for the image to execute properly the MACH_LC_REQUIRE_DYLD bit will be or 'ed into the load command constant. If the dynamic linker sees such a load command it it does not understand will issue a "unknown load command required for execution" error and refuse to use the image. Other load commands without this bit that are not understood will simply be ignored.

Definition at line 366 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_BUILD_VERSION

#define MACH_LOAD_COMMAND_BUILD_VERSION   50U

build for platform min OS version

Definition at line 571 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_CODE_SIGNATURE

#define MACH_LOAD_COMMAND_CODE_SIGNATURE   29U

local of code signature

Definition at line 483 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_DATA_IN_CODE

#define MACH_LOAD_COMMAND_DATA_IN_CODE   41U

table of non-in structions in __text

Definition at line 535 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_DYLD_CHAINED_FIXUPS

#define MACH_LOAD_COMMAND_DYLD_CHAINED_FIXUPS   (52U | MACH_LC_REQUIRE_DYLD)

used with linkedit_data_command

Definition at line 579 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_DYLD_ENVIRONMENT

#define MACH_LOAD_COMMAND_DYLD_ENVIRONMENT   39U

string for dyld to treat like environment variable

Definition at line 527 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_DYLD_EXPORTS_TRIE

#define MACH_LOAD_COMMAND_DYLD_EXPORTS_TRIE   (51U | MACH_LC_REQUIRE_DYLD)

used with linkedit_data_command, payload is trie

Definition at line 575 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_DYLD_INFO

#define MACH_LOAD_COMMAND_DYLD_INFO   34U

compressed dyld information

Definition at line 503 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_DYLD_INFO_ONLY

#define MACH_LOAD_COMMAND_DYLD_INFO_ONLY   (34U | MACH_LC_REQUIRE_DYLD)

compressed dyld information only

Definition at line 507 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_DYLIB_CODE_SIGN_DRS

#define MACH_LOAD_COMMAND_DYLIB_CODE_SIGN_DRS   43U

Code signing DRs copied from linked dylibs

Definition at line 543 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_DYSYMTAB

#define MACH_LOAD_COMMAND_DYSYMTAB   11U

dynamic link-edit symbol table info

Definition at line 410 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_ENCRYPTION_INFO

#define MACH_LOAD_COMMAND_ENCRYPTION_INFO   33U

encrypted segment information

Definition at line 499 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_ENCRYPTION_INFO_64

#define MACH_LOAD_COMMAND_ENCRYPTION_INFO_64   44U

64-bit encrypted segment information

Definition at line 547 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_FILESET_ENTRY

#define MACH_LOAD_COMMAND_FILESET_ENTRY   (53U | MACH_LC_REQUIRE_DYLD)

used with fileset_entry_command

Definition at line 583 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_FIXED_VM_FILE

#define MACH_LOAD_COMMAND_FIXED_VM_FILE   9U

fixed VM file inclusion (internal use)

Definition at line 402 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_FUNCTION_STARTS

#define MACH_LOAD_COMMAND_FUNCTION_STARTS   38U

compressed table of function start addresses

Definition at line 523 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_HDR_

#define MACH_LOAD_COMMAND_HDR_
Value:
MACH_LOAD_COMMAND_TYPE CommandType; /* type of load command */ \
UINT32 CommandSize; /* total size of command in bytes
(includes sizeof section structs) */
UINT32 MACH_LOAD_COMMAND_TYPE

Definition at line 587 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_IDENTIFICATION

#define MACH_LOAD_COMMAND_IDENTIFICATION   8U

object identification info (obsolete)

Definition at line 398 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_IDENTIFICATION_DYLD

#define MACH_LOAD_COMMAND_IDENTIFICATION_DYLD   15U

dynamic linker identification

Definition at line 426 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_IDENTIFICATION_VM_LIB

#define MACH_LOAD_COMMAND_IDENTIFICATION_VM_LIB   7U

fixed VM shared library identification

Definition at line 394 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_IDENTITY_DYLIB

#define MACH_LOAD_COMMAND_IDENTITY_DYLIB   13U

dynamically linked shared lib ident

Definition at line 418 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_LAZY_LOAD_DYLIB

#define MACH_LOAD_COMMAND_LAZY_LOAD_DYLIB   32U

delay load of dylib until first use

Definition at line 495 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_LINKER_OPTIMIZATION_HINT

#define MACH_LOAD_COMMAND_LINKER_OPTIMIZATION_HINT   46U

optimization hints in MH_OBJECT files

Definition at line 555 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_LINKER_OPTION

#define MACH_LOAD_COMMAND_LINKER_OPTION   45U

linker options in MH_OBJECT files

Definition at line 551 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_LLOAD_WEAK_DYLIB

#define MACH_LOAD_COMMAND_LLOAD_WEAK_DYLIB   (24U | MACH_LC_REQUIRE_DYLD)

load a dynamically linked shared library that is allowed to be missing (all symbols are weak imported).

Definition at line 463 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_LOAD_DYLD

#define MACH_LOAD_COMMAND_LOAD_DYLD   14U

load a dynamic linker

Definition at line 422 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_LOAD_DYLIB

#define MACH_LOAD_COMMAND_LOAD_DYLIB   12U

load a dynamically linked shared library

Definition at line 414 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_LOAD_FIXED_VM_LIB

#define MACH_LOAD_COMMAND_LOAD_FIXED_VM_LIB   6U

load a specified fixed VM shared library

Definition at line 390 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_LOAD_UPWARD_DYLIB

#define MACH_LOAD_COMMAND_LOAD_UPWARD_DYLIB   (35U | MACH_LC_REQUIRE_DYLD)

load upward dylib

Definition at line 511 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_MAIN

#define MACH_LOAD_COMMAND_MAIN   (40U | MACH_LC_REQUIRE_DYLD)

replacement for MachLoadCommandUnixThread

Definition at line 531 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_NOTE

#define MACH_LOAD_COMMAND_NOTE   49U

arbitrary data included within a Mach-O file

Definition at line 567 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_PRE_PAGE

#define MACH_LOAD_COMMAND_PRE_PAGE   10U

prepage command (internal use)

Definition at line 406 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_PREBIND_CHECKSUM

#define MACH_LOAD_COMMAND_PREBIND_CHECKSUM   23U

prebind checksum

Definition at line 458 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_PREBOUNT_SYLIB

#define MACH_LOAD_COMMAND_PREBOUNT_SYLIB   16U

modules prebound for a dynamically

Definition at line 430 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_REEXPORT_DYLIB

#define MACH_LOAD_COMMAND_REEXPORT_DYLIB   (31U | MACH_LC_REQUIRE_DYLD)

load and re-export dylib

Definition at line 491 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_ROUTINES

#define MACH_LOAD_COMMAND_ROUTINES   17U

image routines

Definition at line 434 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_ROUTINES_64

#define MACH_LOAD_COMMAND_ROUTINES_64   26U

64-bit image routines

Definition at line 471 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_RUN_PATH

#define MACH_LOAD_COMMAND_RUN_PATH   (28U | MACH_LC_REQUIRE_DYLD)

runpath additions

Definition at line 479 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_SEGMENT

#define MACH_LOAD_COMMAND_SEGMENT   1U

segment of this file to be mapped

Definition at line 370 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_SEGMENT_64

#define MACH_LOAD_COMMAND_SEGMENT_64   25U

64-bit segment of this file to be mapped

Definition at line 467 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_SEGMENT_SPLIT_INFO

#define MACH_LOAD_COMMAND_SEGMENT_SPLIT_INFO   30U

local of info to split segments

Definition at line 487 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_SOURCE_VERSION

#define MACH_LOAD_COMMAND_SOURCE_VERSION   42U

source version used to build binary

Definition at line 539 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_SUB_CLIENT

#define MACH_LOAD_COMMAND_SUB_CLIENT   20U

sub clien

Definition at line 446 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_SUB_FRAMEWORK

#define MACH_LOAD_COMMAND_SUB_FRAMEWORK   18U

sub framework

Definition at line 438 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_SUB_LIBRARY

#define MACH_LOAD_COMMAND_SUB_LIBRARY   21U

sub library

Definition at line 450 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_SUB_UMBRELLA

#define MACH_LOAD_COMMAND_SUB_UMBRELLA   19U

sub umbrella

Definition at line 442 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_SYMSEG

#define MACH_LOAD_COMMAND_SYMSEG   3U

link-edit gdb symbol table info (obsolete)

Definition at line 378 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_SYMTAB

#define MACH_LOAD_COMMAND_SYMTAB   2U

link-edit stab symbol table info

Definition at line 374 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_THREAD

#define MACH_LOAD_COMMAND_THREAD   4U

thread

Definition at line 382 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_TWO_LEVEL_HINTS

#define MACH_LOAD_COMMAND_TWO_LEVEL_HINTS   22U

two-level namespace lookup hints

Definition at line 454 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_UNIX_THREAD

#define MACH_LOAD_COMMAND_UNIX_THREAD   5U

unix thread (includes a stack)

Definition at line 386 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_UUID

#define MACH_LOAD_COMMAND_UUID   27U

the uuid

Definition at line 475 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_VERSION_MIN_IPHONE_OS

#define MACH_LOAD_COMMAND_VERSION_MIN_IPHONE_OS   37U

build for iPhoneOS min OS version

Definition at line 519 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_VERSION_MIN_MAC_OS_X

#define MACH_LOAD_COMMAND_VERSION_MIN_MAC_OS_X   36U

build for MacOSX min OS version

Definition at line 515 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_VERSION_MIN_TV_OS

#define MACH_LOAD_COMMAND_VERSION_MIN_TV_OS   47U

build for AppleTV min OS version

Definition at line 559 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_VERSION_MIN_WATCH_OS

#define MACH_LOAD_COMMAND_VERSION_MIN_WATCH_OS   48U

build for Watch min OS version

Definition at line 563 of file AppleMachoImage.h.

◆ MACH_N_ALT_ENTRY

#define MACH_N_ALT_ENTRY   0x0200U

The N_ALT_ENTRY bit of the n_desc field indicates that the symbol is pinned to the previous content.

Definition at line 2282 of file AppleMachoImage.h.

◆ MACH_N_ARM_THUMB_DEF

#define MACH_N_ARM_THUMB_DEF   0x0008U

The N_ARM_THUMB_DEF bit of the n_desc field indicates that the symbol is a definition of a Thumb function.

Definition at line 2270 of file AppleMachoImage.h.

◆ MACH_N_AST

#define MACH_N_AST   0x32U

AST file path: name,,NO_SECT,0,0.

Definition at line 2205 of file AppleMachoImage.h.

◆ MACH_N_BCOMM

#define MACH_N_BCOMM   0xE2U

begin common: name,,NO_SECT,0,0

Definition at line 2225 of file AppleMachoImage.h.

◆ MACH_N_BINCL

#define MACH_N_BINCL   0x82U

include file beginning: name,,NO_SECT,0,sum

Definition at line 2214 of file AppleMachoImage.h.

◆ MACH_N_BNSYM

#define MACH_N_BNSYM   0x2EU

begin nsect sym: 0,,n_sect,0,address

Definition at line 2204 of file AppleMachoImage.h.

◆ MACH_N_DESC_DISCARDED

#define MACH_N_DESC_DISCARDED   0x0020U

The N_DESC_DISCARDED bit of the n_desc field never appears in linked image. But is used in very rare cases by the dynamic link editor to mark an in memory symbol as discared and longer used for linking.

Definition at line 2246 of file AppleMachoImage.h.

◆ MACH_N_ECOML

#define MACH_N_ECOML   0xE8U

end common (local name): 0,,n_sect,0,address

Definition at line 2227 of file AppleMachoImage.h.

◆ MACH_N_ECOMM

#define MACH_N_ECOMM   0xE4U

end common: name,,n_sect,0,0

Definition at line 2226 of file AppleMachoImage.h.

◆ MACH_N_EINCL

#define MACH_N_EINCL   0xA2U

include file end: name,,NO_SECT,0,0

Definition at line 2220 of file AppleMachoImage.h.

◆ MACH_N_ENSYM

#define MACH_N_ENSYM   0x4EU

end nsect sym: 0,,n_sect,0,address

Definition at line 2209 of file AppleMachoImage.h.

◆ MACH_N_ENTRY

#define MACH_N_ENTRY   0xA4U

alternate entry: name,,n_sect,linenumber,address

Definition at line 2221 of file AppleMachoImage.h.

◆ MACH_N_EXCL

#define MACH_N_EXCL   0xC2U

deleted include file: name,,NO_SECT,0,sum

Definition at line 2223 of file AppleMachoImage.h.

◆ MACH_N_FNAME

#define MACH_N_FNAME   0x22U

procedure name (f77 kludge): name,,NO_SECT,0,0

Definition at line 2200 of file AppleMachoImage.h.

◆ MACH_N_FUN

#define MACH_N_FUN   0x24U

procedure: name,,n_sect,linenumber,address

Definition at line 2201 of file AppleMachoImage.h.

◆ MACH_N_GSYM

#define MACH_N_GSYM   0x20U

global symbol: name,,NO_SECT,type,0

Definition at line 2199 of file AppleMachoImage.h.

◆ MACH_N_LBRAC

#define MACH_N_LBRAC   0xC0U

left bracket: 0,,NO_SECT,nesting level,address

Definition at line 2222 of file AppleMachoImage.h.

◆ MACH_N_LCSYM

#define MACH_N_LCSYM   0x28U

.lcomm symbol: name,,n_sect,type,address

Definition at line 2203 of file AppleMachoImage.h.

◆ MACH_N_LENG

#define MACH_N_LENG   0xFEU

second stab entry with length information

Definition at line 2228 of file AppleMachoImage.h.

◆ MACH_N_LSYM

#define MACH_N_LSYM   0x80U

local sym: name,,NO_SECT,type,offset

Definition at line 2213 of file AppleMachoImage.h.

◆ MACH_N_NO_DEAD_STRIP

#define MACH_N_NO_DEAD_STRIP   0x0020U

The N_NO_DEAD_STRIP bit of the n_desc field only ever appears in a relocatable .o file (MH_OBJECT filetype). And is used to indicate to the static link editor it is never to dead strip the symbol. symbol is not to be dead stripped

Definition at line 2240 of file AppleMachoImage.h.

◆ MACH_N_OLEVEL

#define MACH_N_OLEVEL   0x8AU

compiler -O level: name,,NO_SECT,0,0

Definition at line 2218 of file AppleMachoImage.h.

◆ MACH_N_OPT

#define MACH_N_OPT   0x3CU

emitted with gcc2_compiled and in gcc source

Definition at line 2206 of file AppleMachoImage.h.

◆ MACH_N_OSO

#define MACH_N_OSO   0x66U

object file name: name,,0,0,st_mtime

Definition at line 2212 of file AppleMachoImage.h.

◆ MACH_N_PARAMS

#define MACH_N_PARAMS   0x86U

compiler parameters: name,,NO_SECT,0,0

Definition at line 2216 of file AppleMachoImage.h.

◆ MACH_N_PC

#define MACH_N_PC   0x30U

for the berkeley pascal compiler, pc(1): global pascal symbol: name,,NO_SECT,subtype,line

Definition at line 2287 of file AppleMachoImage.h.

◆ MACH_N_PSYM

#define MACH_N_PSYM   0xA0U

parameter: name,,NO_SECT,type,offset

Definition at line 2219 of file AppleMachoImage.h.

◆ MACH_N_RBRAC

#define MACH_N_RBRAC   0xE0U

right bracket: 0,,NO_SECT,nesting level,address

Definition at line 2224 of file AppleMachoImage.h.

◆ MACH_N_REF_TO_WEAK

#define MACH_N_REF_TO_WEAK   0x0080U

The N_REF_TO_WEAK bit of the n_desc field indicates to the dynamic linker that the undefined symbol should be resolved using flat namespace searching.

Definition at line 2265 of file AppleMachoImage.h.

◆ MACH_N_RSYM

#define MACH_N_RSYM   0x40U

register sym: name,,NO_SECT,type,register

Definition at line 2207 of file AppleMachoImage.h.

◆ MACH_N_SLINE

#define MACH_N_SLINE   0x44U

src line: 0,,n_sect,linenumber,address

Definition at line 2208 of file AppleMachoImage.h.

◆ MACH_N_SO

#define MACH_N_SO   0x64U

source file name: name,,n_sect,0,address

Definition at line 2211 of file AppleMachoImage.h.

◆ MACH_N_SOL

#define MACH_N_SOL   0x84U

#included file name: name,,n_sect,0,address

Definition at line 2215 of file AppleMachoImage.h.

◆ MACH_N_SSYM

#define MACH_N_SSYM   0x60U

structure elt: name,,NO_SECT,type,struct_offset

Definition at line 2210 of file AppleMachoImage.h.

◆ MACH_N_STSYM

#define MACH_N_STSYM   0x26U

static symbol: name,,n_sect,type,address

Definition at line 2202 of file AppleMachoImage.h.

◆ MACH_N_SYMBOL_RESOLVER

#define MACH_N_SYMBOL_RESOLVER   0x0100U

The N_SYMBOL_RESOLVER bit of the n_desc field indicates that the that the function is actually a resolver function and should be called to get the address of the real function to use. This bit is only available in .o files (MH_OBJECT filetype)

Definition at line 2277 of file AppleMachoImage.h.

◆ MACH_N_TYPE_ABS

#define MACH_N_TYPE_ABS   0x2U

absolute, n_sect == NO_SECT

Definition at line 2159 of file AppleMachoImage.h.

◆ MACH_N_TYPE_EXT

#define MACH_N_TYPE_EXT   0x01U

external symbol bit, set for external symbols

Definition at line 2145 of file AppleMachoImage.h.

◆ MACH_N_TYPE_INDR

#define MACH_N_TYPE_INDR   0xAU

indirect

Definition at line 2162 of file AppleMachoImage.h.

◆ MACH_N_TYPE_PBUD

#define MACH_N_TYPE_PBUD   0xCU

prebound undefined (defined in a dylib)

Definition at line 2161 of file AppleMachoImage.h.

◆ MACH_N_TYPE_PEXT

#define MACH_N_TYPE_PEXT   0x10U

private external symbol bit

Definition at line 2143 of file AppleMachoImage.h.

◆ MACH_N_TYPE_SECT

#define MACH_N_TYPE_SECT   0xEU

defined in section number n_sect

Definition at line 2160 of file AppleMachoImage.h.

◆ MACH_N_TYPE_STAB

#define MACH_N_TYPE_STAB   0xE0U

if any of these bits set, a symbolic debugging entry

Definition at line 2141 of file AppleMachoImage.h.

◆ MACH_N_TYPE_TYPE

#define MACH_N_TYPE_TYPE   0x0EU

mask for the type bit

Definition at line 2144 of file AppleMachoImage.h.

◆ MACH_N_TYPE_UNDF

#define MACH_N_TYPE_UNDF   0x0U

undefined, n_sect == NO_SECT

Definition at line 2158 of file AppleMachoImage.h.

◆ MACH_N_VERSION

#define MACH_N_VERSION   0x88U

compiler version: name,,NO_SECT,0,0

Definition at line 2217 of file AppleMachoImage.h.

◆ MACH_N_WEAK_DEF

#define MACH_N_WEAK_DEF   0x0080U

The N_WEAK_DEF bit of the n_desc field indicates to the static and dynamic linkers that the symbol definition is weak, allowing a non-weak symbol to also be used which causes the weak definition to be discared. Currently this is only supported for symbols in coalesed sections.

Definition at line 2259 of file AppleMachoImage.h.

◆ MACH_N_WEAK_REF

#define MACH_N_WEAK_REF   0x0040U

The N_WEAK_REF bit of the n_desc field indicates to the dynamic linker that the undefined symbol is allowed to be missing and is to have the address of zero when missing.

Definition at line 2252 of file AppleMachoImage.h.

◆ MACH_PLATFORM_BRIDGEOS

#define MACH_PLATFORM_BRIDGEOS   5U

Definition at line 1622 of file AppleMachoImage.h.

◆ MACH_PLATFORM_DRIVERKIT

#define MACH_PLATFORM_DRIVERKIT   10U

Definition at line 1627 of file AppleMachoImage.h.

◆ MACH_PLATFORM_IOS

#define MACH_PLATFORM_IOS   2U

Definition at line 1619 of file AppleMachoImage.h.

◆ MACH_PLATFORM_IOSSIMULATOR

#define MACH_PLATFORM_IOSSIMULATOR   7U

Definition at line 1624 of file AppleMachoImage.h.

◆ MACH_PLATFORM_MACCATALYST

#define MACH_PLATFORM_MACCATALYST   6U

Definition at line 1623 of file AppleMachoImage.h.

◆ MACH_PLATFORM_MACOS

#define MACH_PLATFORM_MACOS   1U

Known values for the platform field above.

Definition at line 1618 of file AppleMachoImage.h.

◆ MACH_PLATFORM_TVOS

#define MACH_PLATFORM_TVOS   3U

Definition at line 1620 of file AppleMachoImage.h.

◆ MACH_PLATFORM_TVOSSIMULATOR

#define MACH_PLATFORM_TVOSSIMULATOR   8U

Definition at line 1625 of file AppleMachoImage.h.

◆ MACH_PLATFORM_WATCHOS

#define MACH_PLATFORM_WATCHOS   4U

Definition at line 1621 of file AppleMachoImage.h.

◆ MACH_PLATFORM_WATCHOSSIMULATOR

#define MACH_PLATFORM_WATCHOSSIMULATOR   9U

Definition at line 1626 of file AppleMachoImage.h.

◆ MACH_RELOC_ABSOLUTE

#define MACH_RELOC_ABSOLUTE   0U

absolute relocation type for Mach-O files

Definition at line 2312 of file AppleMachoImage.h.

◆ MACH_RELOC_SCATTERED

#define MACH_RELOC_SCATTERED   0x80000000U

mask to be applied to the r_address field of a relocation_info structure to tell that is is really a scattered_relocation_info stucture

To make scattered loading by the link editor work correctly "local" relocation entries can't be used when the item to be relocated is the value of a symbol plus an offset (where the resulting expresion is outside the block the link editor is moving, a blocks are divided at symbol addresses). In this case. where the item is a symbol value plus offset, the link editor needs to know more than just the section the symbol was defined. What is needed is the actual value of the symbol without the offset so it can do the relocation correctly based on where the value of the symbol got relocated to not the value of the expression (with the offset added to the symbol value). So for the NeXT 2.0 release no "local" relocation entries are ever used when there is a non-zero offset added to a symbol. The "external" and "local" relocation entries remain unchanged.

The implemention is quite messy given the compatibility with the existing relocation entry format. The ASSUMPTION is that a section will never be bigger than 2**24 - 1 (0x00ffffff or 16,777,215) bytes. This assumption allows the r_address (which is really an offset) to fit in 24 bits and high bit of the r_address field in the relocation_info structure to indicate it is really a scattered_relocation_info structure. Since these are only used in places where "local" relocation entries are used and not where "external" relocation entries are used the r_extern field has been removed.

For scattered loading to work on a RISC machine where some of the references are split across two instructions the link editor needs to be assured that each reference has a unique 32 bit reference (that more than one reference is NOT sharing the same high 16 bits for example) so it move each referenced item independent of each other. Some compilers guarantees this but the compilers don't so scattered loading can be done on those that do guarantee this.

Definition at line 2379 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTE_DEBUG

#define MACH_SECTION_ATTRIBUTE_DEBUG   BIT25

If a segment contains any sections marked with MACH_SECTION_ATTRIBUTE_DEBUG then all sections in that segment must have this attribute. No section other than a section marked with this attribute may reference the contents of this section. A section with this attribute may contain no symbols and must have a section type S_REGULAR. The static linker will not copy section contents from sections with this attribute into its output file. These sections generally contain DWARF debugging info.

Definition at line 795 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTE_EXTERNAL_RELOCATION

#define MACH_SECTION_ATTRIBUTE_EXTERNAL_RELOCATION   BIT9

section has external relocation entries

Definition at line 770 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTE_LIVE_SUPPORT

#define MACH_SECTION_ATTRIBUTE_LIVE_SUPPORT   BIT27

blocks are live if they reference live blocks

Definition at line 803 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTE_LOCAL_RELOCATION

#define MACH_SECTION_ATTRIBUTE_LOCAL_RELOCATION   BIT8

section has local relocation entries

Definition at line 766 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTE_NO_DEAD_STRIP

#define MACH_SECTION_ATTRIBUTE_NO_DEAD_STRIP   BIT28

no dead stripping

Definition at line 807 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTE_NO_TOC

#define MACH_SECTION_ATTRIBUTE_NO_TOC   BIT30

section contains coalesced symbols that are not to be in a ranlib table of contents

Definition at line 817 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTE_PURE_INSTRUCTIONS

#define MACH_SECTION_ATTRIBUTE_PURE_INSTRUCTIONS   BIT31

section contains only true machine instructions

Definition at line 821 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTE_SELF_MODIFYING_CODE

#define MACH_SECTION_ATTRIBUTE_SELF_MODIFYING_CODE   BIT26

Used with i386 code stubs written on by dyld

Definition at line 799 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTE_SOME_INSTRUCTIONS

#define MACH_SECTION_ATTRIBUTE_SOME_INSTRUCTIONS   BIT10

section contains some machine instructions

Definition at line 774 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTE_STRIP_STATIC_SYMBOLS

#define MACH_SECTION_ATTRIBUTE_STRIP_STATIC_SYMBOLS   BIT29

ok to strip static symbols in this section in files with the MACH_HEADER_FLAG_DYNAMIC_LINKER_LINK flag

Definition at line 812 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTES_MASK

#define MACH_SECTION_ATTRIBUTES_MASK   0xFFFFFF00U

24 section attributes

Definition at line 783 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTES_SYSYTEM

#define MACH_SECTION_ATTRIBUTES_SYSYTEM   0x00FFFF00U

system setable attributes

Definition at line 758 of file AppleMachoImage.h.

◆ MACH_SECTION_ATTRIBUTES_USER

#define MACH_SECTION_ATTRIBUTES_USER   0xFF000000U

User setable attributes

Definition at line 762 of file AppleMachoImage.h.

◆ MACH_SECTION_TYPE_MASK

#define MACH_SECTION_TYPE_MASK   0x000000FFU

256 section types

Definition at line 782 of file AppleMachoImage.h.

◆ MACH_SEGMENT_FLAG_FIXED_VM_LIB

#define MACH_SEGMENT_FLAG_FIXED_VM_LIB   BIT1

this segment is the VM that is allocated by a fixed VM library, for overlap checking in the link editor

Definition at line 611 of file AppleMachoImage.h.

◆ MACH_SEGMENT_FLAG_HIGH_VIRTUAL_MEMORY

#define MACH_SEGMENT_FLAG_HIGH_VIRTUAL_MEMORY   BIT0

the file contents for this segment is for the high part of the VM space, the low part is zero filled (for stacks in core files)

Definition at line 606 of file AppleMachoImage.h.

◆ MACH_SEGMENT_FLAG_NO_RELOCATION

#define MACH_SEGMENT_FLAG_NO_RELOCATION   BIT2

this segment has nothing that was relocated in it and nothing relocated to it, that is it maybe safely replaced without relocation

Definition at line 616 of file AppleMachoImage.h.

◆ MACH_SEGMENT_FLAG_PROTECTED_VERSION_1

#define MACH_SEGMENT_FLAG_PROTECTED_VERSION_1   BIT3

This segment is protected. If the segment starts at file offset 0, the first page of the segment is not protected. All other pages of the segment are protected.

Definition at line 622 of file AppleMachoImage.h.

◆ MACH_SEGMENT_VM_PROT_EXECUTE

#define MACH_SEGMENT_VM_PROT_EXECUTE   BIT2

Definition at line 628 of file AppleMachoImage.h.

◆ MACH_SEGMENT_VM_PROT_NONE

#define MACH_SEGMENT_VM_PROT_NONE   0U

Definition at line 624 of file AppleMachoImage.h.

◆ MACH_SEGMENT_VM_PROT_READ

#define MACH_SEGMENT_VM_PROT_READ   BIT0

Definition at line 626 of file AppleMachoImage.h.

◆ MACH_SEGMENT_VM_PROT_WRITE

#define MACH_SEGMENT_VM_PROT_WRITE   BIT1

Definition at line 627 of file AppleMachoImage.h.

◆ MACH_SOURCE_VERSION_A

#define MACH_SOURCE_VERSION_A ( Version)
Value:
#define MACH_SOURCE_VERSION_A_MASK
UINT32 Version

Definition at line 1899 of file AppleMachoImage.h.

◆ MACH_SOURCE_VERSION_A_MASK

#define MACH_SOURCE_VERSION_A_MASK   0xFFFFFF0000000000U

Definition at line 1893 of file AppleMachoImage.h.

◆ MACH_SOURCE_VERSION_B

#define MACH_SOURCE_VERSION_B ( Version)
Value:
#define MACH_SOURCE_VERSION_B_MASK

Definition at line 1900 of file AppleMachoImage.h.

◆ MACH_SOURCE_VERSION_B_MASK

#define MACH_SOURCE_VERSION_B_MASK   0x000000FFC0000000U

Definition at line 1894 of file AppleMachoImage.h.

◆ MACH_SOURCE_VERSION_C

#define MACH_SOURCE_VERSION_C ( Version)
Value:
#define MACH_SOURCE_VERSION_V_MASK

Definition at line 1901 of file AppleMachoImage.h.

◆ MACH_SOURCE_VERSION_D

#define MACH_SOURCE_VERSION_D ( Version)
Value:
#define MACH_SOURCE_VERSION_D_MASK

Definition at line 1902 of file AppleMachoImage.h.

◆ MACH_SOURCE_VERSION_D_MASK

#define MACH_SOURCE_VERSION_D_MASK   0x00000000000FFC00U

Definition at line 1896 of file AppleMachoImage.h.

◆ MACH_SOURCE_VERSION_E

#define MACH_SOURCE_VERSION_E ( Version)
Value:
#define MACH_SOURCE_VERSION_E_MASK

Definition at line 1903 of file AppleMachoImage.h.

◆ MACH_SOURCE_VERSION_E_MASK

#define MACH_SOURCE_VERSION_E_MASK   0x00000000000003FFU

Definition at line 1897 of file AppleMachoImage.h.

◆ MACH_SOURCE_VERSION_V_MASK

#define MACH_SOURCE_VERSION_V_MASK   0x000000003FF00000U

Definition at line 1895 of file AppleMachoImage.h.

◆ MACH_TOOL_CLANG

#define MACH_TOOL_CLANG   1U

Known values for the tool field above.

Definition at line 1632 of file AppleMachoImage.h.

◆ MACH_TOOL_LD

#define MACH_TOOL_LD   3U

Definition at line 1634 of file AppleMachoImage.h.

◆ MACH_TOOL_SWIFT

#define MACH_TOOL_SWIFT   2U

Definition at line 1633 of file AppleMachoImage.h.

◆ MACH_VALID_THREAD_STATE_FLAVOR

#define MACH_VALID_THREAD_STATE_FLAVOR ( Flavor)
Value:
(((Flavor) == MachX86ThreadState32) \
|| ((Flavor) == MachX86FloatState32) \
|| ((Flavor) == MachX86ExceptionState32) \
|| ((Flavor) == MachX86DebugState32) \
|| ((Flavor) == MachX86ThreadState64) \
|| ((Flavor) == MachX86FloatState64) \
|| ((Flavor) == MachX86ExceptionState64) \
|| ((Flavor) == MachX86DebugState64) \
|| ((Flavor) == MachX86ThreadState) \
|| ((Flavor) == MachX86FloatState) \
|| ((Flavor) == MachX86ExceptionState) \
|| ((Flavor) == MachX86DebugState) \
|| ((Flavor) == MachX86AvxState32) \
|| ((Flavor) == MachX86AvxState64) \
|| ((Flavor) == MachX86AvxState) \
|| ((Flavor) == MachX86Avx512State32) \
|| ((Flavor) == MachX86Avx512State64) \
|| ((Flavor) == MachX86Avx512State) \
|| ((Flavor) == MachThreadStateNone))
@ MachX86ExceptionState
@ MachX86AvxState64
@ MachX86FloatState64
@ MachX86DebugState
@ MachX86Avx512State
@ MachX86FloatState32
@ MachThreadStateNone
@ MachX86Avx512State64
@ MachX86AvxState32
@ MachX86ExceptionState32
@ MachX86Avx512State32
@ MachX86ExceptionState64
@ MachX86FloatState
@ MachX86ThreadState
@ MachX86ThreadState64
@ MachX86ThreadState32
@ MachX86AvxState
@ MachX86DebugState32
@ MachX86DebugState64

MACH_VALID_THREAD_STATE_FLAVOR is a platform specific macro that when passed an exception flavor will return if that is a defined flavor for that platform. The macro must be manually updated to include all of the valid exception flavors as defined above.

Definition at line 1158 of file AppleMachoImage.h.

◆ MACH_X86_THREAD_STATE_MAX

#define MACH_X86_THREAD_STATE_MAX   614

Size of maximum exported thread state in words

Definition at line 1102 of file AppleMachoImage.h.

◆ MAX_SECT

#define MAX_SECT   255

1 thru 255 inclusive

Definition at line 2184 of file AppleMachoImage.h.

◆ NEXT_MACH_LOAD_COMMAND

#define NEXT_MACH_LOAD_COMMAND ( Command)
Value:
((MACH_LOAD_COMMAND *)((UINTN)(Command) + (Command)->CommandSize))
UINT8 Command[7]
Actual command for the Command Page.
Definition AppleNec.h:74

Definition at line 591 of file AppleMachoImage.h.

◆ NEXT_MACH_SEGMENT

#define NEXT_MACH_SEGMENT ( Segment)
Value:
(MACH_SEGMENT_COMMAND *)((UINTN)(Segment) + (Segment)->Command.Size)

Definition at line 891 of file AppleMachoImage.h.

◆ NEXT_MACH_SEGMENT_64

#define NEXT_MACH_SEGMENT_64 ( Segment)
Value:
(MACH_SEGMENT_COMMAND_64 *)((UINTN)(Segment) + (Segment)->Hdr.Size)
SMBIOS_STRUCTURE Hdr
Definition AppleSmBios.h:51

Definition at line 922 of file AppleMachoImage.h.

◆ NO_SECT

#define NO_SECT   0

symbol is not in any section

Definition at line 2183 of file AppleMachoImage.h.

Typedef Documentation

◆ MACH_CPU_FAMILY

typedef UINT32 MACH_CPU_FAMILY

Definition at line 295 of file AppleMachoImage.h.

◆ MACH_CPU_SUBTYPE

typedef INT32 MACH_CPU_SUBTYPE

Definition at line 235 of file AppleMachoImage.h.

◆ MACH_CPU_THREADTYPE

typedef INT32 MACH_CPU_THREADTYPE

Definition at line 296 of file AppleMachoImage.h.

◆ MACH_CPU_TYPE

typedef INT32 MACH_CPU_TYPE

Definition at line 79 of file AppleMachoImage.h.

◆ MACH_HEADER_FILE_TYPE

typedef UINT32 MACH_HEADER_FILE_TYPE

Definition at line 1996 of file AppleMachoImage.h.

◆ MACH_HEADER_FLAGS

typedef UINT32 MACH_HEADER_FLAGS

Definition at line 2031 of file AppleMachoImage.h.

◆ MACH_LOAD_COMMAND_TYPE

typedef UINT32 MACH_LOAD_COMMAND_TYPE

Definition at line 585 of file AppleMachoImage.h.

◆ MACH_SEGMENT_FLAGS

typedef UINT32 MACH_SEGMENT_FLAGS

Definition at line 630 of file AppleMachoImage.h.

◆ MACH_VM_PROTECTION

typedef INT32 MACH_VM_PROTECTION

Definition at line 297 of file AppleMachoImage.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

< !defined(MACH_LITTLE_ENDIAN) && !defined(MACH_BIG_ENDIAN)

There is no standard way to detect endianness in EDK2 (yet). Provide MACH_LITTLE_ENDIAN on IA32 and X64 platforms by default, as they are strictly little endian. < defined (MDE_CPU_IA32) || defined(MDE_CPU_X64) CPU Type definitions

Enumerator
MachCpuTypeAny 
MachCpuTypeVax 
MachCpuTypeMc680x0 
MachCpuTypeX86 
MachCpuTypeI386 
MachCpuTypeX8664 
MachCpuTypeMc98000 
MachCpuTypeHppa 
MachCpuTypeArm 
MachCpuTypeArm64 
MachCpuTypeArm6432 
MachCpuTypeMc88000 
MachCpuTypeSparc 
MachCpuTypeI860 
MachCpuTypePowerPc 
MachCpuTypePowerPc64 
MachCpuTypeVeo 

Definition at line 58 of file AppleMachoImage.h.

◆ anonymous enum

anonymous enum
Enumerator
MachCpuSubtypeInvalid 
MachCpuSubtypeMultiple 
MachCpuSubtypeLittleEndian 
MachCpuSubtypeBigEndian 
MachCpuSubtypeVaxAll 
MachCpuSubtypeVax780 
MachCpuSubtypeVax785 
MachCpuSubtypeVax750 
MachCpuSubtypeVax730 
MachCpuSubtypeUVax1 
MachCpuSubtypeUVax2 
MachCpuSubtypeVax8200 
MachCpuSubtypeVax8500 
MachCpuSubtypeVax8600 
MachCpuSubtypeVax8650 
MachCpuSubtypeVax8800 
MachCpuSubtypeUVax3 
MachCpuSubtypeMc680All 
MachCpuSubtypeMc68030 
MachCpuSubtypeMc68040 
MachCpuSubtypeMc68030Only 
MachCpuSubtypeX86All 
MachCpuSubtypeX86Arch1 
MachCpuSubtypeX8664All 
MachCpuSubtypeX8664H 
MachCpuSubtypeI386All 
MachCpuSubtype386 
MachCpuSubtype486 
MachCpuSubtype486Sx 
MachCpuSubtype586 
MachCpuSubtypePentium 
MachCpuSubtypePentiumPro 
MachCpuSubtypePentium3M3 
MachCpuSubtypePentium3M5 
MachCpuSubtypeCeleron 
MachCpuSubtypeCeleronMobile 
MachCpuSubtypePentium3 
MachCpuSubtypePentium3M 
MachCpuSubtypePentium3Xeon 
MachCpuSubtypePentiumM 
MachCpuSubtypePentium4 
MachCpuSubtypePentium4M 
MachCpuSubtypeItanium 
MachCpuSubtypeItanium2 
MachCpuSubtypeXeon 
MachCpuSubtypeXeonMp 
MachCpuSubtypeMipsAll 
MachCpuSubtypeMipsR2300 
MachCpuSubtypeMipsR2600 
MachCpuSubtypeMipsR2800 
MachCpuSubtypeMipsR2000a 
MachCpuSubtypeMipsR2000 
MachCpuSubtypeMipsR3000a 
MachCpuSubtypeMipsR3000 
MachCpuSubtypeMc98000All 
MachCpuSubtypeMc98601 
MachCpuSubtypeHppaAll 
MachCpuSubtypeHppa7100 
MachCpuSubtypeHppa7100Lc 
MachCpuSubtypeArmAll 
MachCpuSubtypeArmV4T 
MachCpuSubtypeArmV6 
MachCpuSubtypeArmV5Tej 
MachCpuSubtypeArmXscale 
MachCpuSubtypeArmV7 
MachCpuSubtypeArmV7F 
MachCpuSubtypeArmV7S 
MachCpuSubtypeArmV7K 
MachCpuSubtypeArmV8 
MachCpuSubtypeArmV6M 
MachCpuSubtypeArmV7M 
MachCpuSubtypeArmV7Em 
MachCpuSubtypeArm64All 
MachCpuSubtypeArm64V8 
MachCpuSubtypeArm6432All 
MachCpuSubtypeArm6432V8 
MachCpuSubtypeMc88000All 
MachCpuSubtypeMc88100 
MachCpuSubtypeMc88110 
MachCpuSubtypeSparcAll 
MachCpuSubtypeI860All 
MachCpuSubtypeI860860 
MachCpuSubtypePowerPcAll 
MachCpuSubtypePowerPc601 
MachCpuSubtypePowerPc602 
MachCpuSubtypePowerPc603 
MachCpuSubtypePowerPc603e 
MachCpuSubtypePowerPc603ev 
MachCpuSubtypePowerPc604 
MachCpuSubtypePowerPc604e 
MachCpuSubtypePowerPc620 
MachCpuSubtypePowerPc750 
MachCpuSubtypePowerPc7400 
MachCpuSubtypePowerPc7450 
MachCpuSubtypePowerPc970 
MachCpuSubtypeVeo1 
MachCpuSubtypeVeo2 
MachCpuSubtypeVeo3 
MachCpuSubtypeVeo4 
MachCpuSubtypeVeoAll 

Definition at line 81 of file AppleMachoImage.h.

◆ anonymous enum

anonymous enum

CPU Family definitions

Enumerator
MachCpuFamilyUnknown 
MachCpuFamilyPowerPcG3 
MachCpuFamilyPowerPcG4 
MachCpuFamilyPowerPcG5 
MachCpuFamilyIntel613 
MachCpuFamilyIntelYonah 
MachCpuFamilyIntelMerom 
MachCpuFamilyIntelPenryn 
MachCpuFamilyIntelNehalem 
MachCpuFamilyIntelWestmere 
MachCpuFamilyIntelSandyBridge 
MachCpuFamilyIntelIvyBridge 
MachCpuFamilyIntelHaswell 
MachCpuFamilyIntelBroadwell 
MachCpuFamilyIntelSkylake 
MachCpuFamilyIntelKabyLake 
MachCpuFamilyIntelCoffeeLake 
MachCpuFamilyIntelIceLake 
MachCpuFamilyIntelCometLake 
MachCpuFamilyIntel614 
MachCpuFamilyIntel615 
MachCpuFamilyIntel623 
MachCpuFamilyIntel626 
MachCpuFamilyIntelCore 
MachCpuFamilyIntelCore2 
MachCpuFamilyArm9 
MachCpuFamilyArm11 
MachCpuFamilyArmXscale 
MachCpuFamilyArm12 
MachCpuFamilyArm13 
MachCpuFamilyArm14 
MachCpuFamilyArm15 
MachCpuFamilyArmSwift 
MachCpuFamilyArmCyclone 
MachCpuFamilyArmTyphoon 
MachCpuFamilyArmTwister 
MachCpuFamilyArmHurricane 
MachCpuFamilyArmMonsoonMistral 
MachCpuFamilyArmVortexTempest 
MachCpuFamilyArmLightningThunder 

Definition at line 240 of file AppleMachoImage.h.

◆ anonymous enum

anonymous enum

Constants for the type of a section

Enumerator
MachSectionTypeRegular 

regular section

MachSectionTypeZeroFill 

zero fill on demand section

MachSectionTypeCStringLiterals 

section with only literal C strings

MachSectionType4ByteLiterals 

section with only 4 byte literals

MachSectionType8ByteLiterals 

section with only 8 byte literals

MachSectionTypeLiteralPointers 

section with only pointers to literals

MachSectionTypeNonLazySymbolPointers 

section with only non-lazy symbol pointers

MachSectionTypeLazySymbolPointers 

section with only lazy symbol pointers

MachSectionTypeSymbolStubs 

section with only symbol stubs, byte size of stub in the reserved2 field

MachSectionTypeModInitalizeFunctionPointers 

section with only function pointers for initialization

MachSectionTypeModTerminateFunctionPointers 

section with only function pointers for termination

MachSectionTypeCoalesced 

section contains symbols that are to be coalesced

MachSectionTypeGigabyteZeroFill 

zero fill on demand section (that can be larger than 4 gigabytes)

MachSectionTypeInterposing 

section with only pairs of function pointers for interposing

MachSectionType16ByteLiterals 

section with only 16 byte literals

MachSectionTypeDtraceObjectFormat 

section contains DTrace Object Format

MachSectionTypeLazyDylibSymbolPointers 

section with only lazy symbol pointers to lazy loaded dylibs

MachSectionTypeThreadLocalRegular 

template of initial values for TLVs

MachSectionTypeThreadLocalZeroFill 

template of initial values for TLVs

MachSectionTypeThreadLocalVariables 

TLV descriptors

MachSectionTypeThreadVariablePointers 

pointers to TLV descriptors

MachSectionTypeThreadLocalInitializeFunctionPointers 

functions to call to initialize TLV values

MachSectionTypeThreadLocalInitializeFunctionOffsets 

32-bit offsets to initializers

Definition at line 635 of file AppleMachoImage.h.

◆ anonymous enum

anonymous enum
Enumerator
MachX86ThreadState32 
MachX86FloatState32 
MachX86ExceptionState32 
MachX86ThreadState64 
MachX86FloatState64 
MachX86ExceptionState64 
MachX86ThreadState 
MachX86FloatState 
MachX86ExceptionState 
MachX86DebugState32 
MachX86DebugState64 
MachX86DebugState 
MachThreadStateNone 
MachX86AvxState32 
MachX86AvxState64 
MachX86AvxState 
MachX86Avx512State32 
MachX86Avx512State64 
MachX86Avx512State 

Definition at line 1074 of file AppleMachoImage.h.

◆ anonymous enum

anonymous enum

Values for MACH_DYLD_CHAINED_STARTS_IN_SEGMENT.PointerFormat.

Enumerator
MACH_DYLD_CHAINED_PTR_ARM64E 

stride 8, unauth target is vmaddr

MACH_DYLD_CHAINED_PTR_64 

target is vmaddr

MACH_DYLD_CHAINED_PTR_32 
MACH_DYLD_CHAINED_PTR_32_CACHE 
MACH_DYLD_CHAINED_PTR_32_FIRMWARE 
MACH_DYLD_CHAINED_PTR_64_OFFSET 

target is vm offset

MACH_DYLD_CHAINED_PTR_ARM64E_OFFSET 

old name

MACH_DYLD_CHAINED_PTR_ARM64E_KERNEL 

stride 4, unauth target is vm offset

MACH_DYLD_CHAINED_PTR_64_KERNEL_CACHE 
MACH_DYLD_CHAINED_PTR_ARM64E_USERLAND 

stride 8, unauth target is vm offset

MACH_DYLD_CHAINED_PTR_ARM64E_FIRMWARE 

stride 4, unauth target is vmaddr

MACH_DYLD_CHAINED_PTR_X86_64_KERNEL_CACHE 

stride 1, x86_64 kernel caches

MACH_DYLD_CHAINED_PTR_ARM64E_USERLAND24 

stride 8, unauth target is vm offset, 24-bit bind

Definition at line 1859 of file AppleMachoImage.h.

◆ anonymous enum

anonymous enum
Enumerator
MACH_DYLD_CHAINED_PTR_START_NONE 

used in page_start[] to denote a page with no fixups

MACH_DYLD_CHAINED_PTR_START_MULTI 

used in page_start[] to denote a page which has multiple starts

MACH_DYLD_CHAINED_PTR_START_LAST 

used in chain_starts[] to denote last start in list for page

Definition at line 1875 of file AppleMachoImage.h.

◆ anonymous enum

anonymous enum

The layout of the file depends on the filetype. For all but the MH_OBJECT file type the segments are padded out and aligned on a segment alignment boundary for efficient demand pageing. The MH_EXECUTE, MH_FVMLIB, MH_DYLIB, MH_DYLINKER and MH_BUNDLE file types also have the headers included as part of their first segment.

The file type MH_OBJECT is a compact format intended as output of the assembler and input (and possibly output) of the link editor (the .o format). All sections are in one unnamed segment with no segment padding. This format is used as an executable format when the file is so small the segment padding greatly increases its size.

The file type MH_PRELOAD is an executable format intended for things that are not executed under the kernel (proms, stand alones, kernels, etc). The format can be executed under the kernel but may demand paged it and not preload it before execution.

A core file is in MH_CORE format and can be any in an arbritray legal Mach-O file.

Constants for the filetype field of the mach_header

Enumerator
MachHeaderFileTypeObject 
MachHeaderFileTypeExecute 
MachHeaderFileTypeFixedVmLib 
MachHeaderFileTypeCore 
MachHeaderFileTypePreload 
MachHeaderFileTypeDylib 
MachHeaderFileTypeDynamicLinker 
MachHeaderFileTypeBundle 
MachHeaderFileTypeDynamicLinkerStub 
MachHeaderFileTypeDsym 
MachHeaderFileTypeKextBundle 
MachHeaderFileTypeFileSet 

Definition at line 1977 of file AppleMachoImage.h.

◆ anonymous enum

anonymous enum

Relocation types used in a generic implementation. Relocation entries for normal things use the generic relocation as discribed above and their r_type is GENERIC_RELOC_VANILLA (a value of zero).

Another type of generic relocation, GENERIC_RELOC_SECTDIFF, is to support the difference of two symbols defined in different sections. That is the expression "symbol1 - symbol2 + constant" is a relocatable expression when both symbols are defined in some section. For this type of relocation the both relocations entries are scattered relocation entries. The value of symbol1 is stored in the first relocation entry's r_value field and the value of symbol2 is stored in the pair's r_value field.

A special case for a prebound lazy pointer is needed to beable to set the value of the lazy pointer back to its non-prebound state. This is done using the GENERIC_RELOC_PB_LA_PTR r_type. This is a scattered relocation entry where the r_value feild is the value of the lazy pointer not prebound.

Enumerator
MachGenericRelocVanilla 

generic relocation as discribed above

MachGenericRelocPair 

Only follows a MachGenericRelocLocalSectDiff

MachGenericRelocSectDiff 
MachGenericRelocPreboundLazyPointer 

prebound lazy pointer

MachGenericRelocLocalSectDiff 
MachGenericRelocThreadLocalVariables 

thread local variables

Definition at line 2431 of file AppleMachoImage.h.

◆ anonymous enum

anonymous enum

Relocations for x86_64 are a bit different than for other architectures in Mach-O: Scattered relocations are not used. Almost all relocations produced by the compiler are external relocations. An external relocation has the r_extern bit set to 1 and the r_symbolnum field contains the symbol table index of the target label.

When the assembler is generating relocations, if the target label is a local label (begins with 'L'), then the previous non-local label in the same section is used as the target of the external relocation. An addend is used with the distance from that non-local label to the target label. Only when there is no previous non-local label in the section is an internal relocation used.

The addend (i.e. the 4 in _foo+4) is encoded in the instruction (Mach-O does not have RELA relocations). For PC-relative relocations, the addend is stored directly in the instruction. This is different from other Mach-O architectures, which encode the addend minus the current section offset.

The relocation types are:

X86_64_RELOC_UNSIGNED // for absolute addresses X86_64_RELOC_SIGNED // for signed 32-bit displacement X86_64_RELOC_BRANCH // a CALL/JMP instruction with 32-bit displacement X86_64_RELOC_GOT_LOAD // a MOVQ load of a GOT entry X86_64_RELOC_GOT // other GOT references X86_64_RELOC_SUBTRACTOR // must be followed by a X86_64_RELOC_UNSIGNED

The following are sample assembly instructions, followed by the relocation and section content they generate in an object file:

call _foo r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo E8 00 00 00 00

call _foo+4 r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo E8 04 00 00 00

movq _foo@GOTPCREL(rip), rax r_type=X86_64_RELOC_GOT_LOAD, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo 48 8B 05 00 00 00 00

pushq _foo@GOTPCREL(rip) r_type=X86_64_RELOC_GOT, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo FF 35 00 00 00 00

movl _foo(rip), eax r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo 8B 05 00 00 00 00

movl _foo+4(rip), eax r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo 8B 05 04 00 00 00

movb $0x12, _foo(rip) r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo C6 05 FF FF FF FF 12

movl $0x12345678, _foo(rip) r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo C7 05 FC FF FF FF 78 56 34 12

.quad _foo r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo 00 00 00 00 00 00 00 00

.quad _foo+4 r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo 04 00 00 00 00 00 00 00

.quad _foo - _bar r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo 00 00 00 00 00 00 00 00

.quad _foo - _bar + 4 r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo 04 00 00 00 00 00 00 00

.long _foo - _bar r_type=X86_64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_bar r_type=X86_64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo 00 00 00 00

lea L1(rip), rax r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_prev 48 8d 05 12 00 00 00 // assumes _prev is the first non-local label 0x12 bytes before L1

lea L0(rip), rax r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=0, r_pcrel=1, r_symbolnum=3 48 8d 05 56 00 00 00 // assumes L0 is in third section and there is no previous non-local label. // The rip-relative-offset of 0x00000056 is L0-address_of_next_instruction. // address_of_next_instruction is the address of the relocation + 4.

add $6,L0(rip) r_type=X86_64_RELOC_SIGNED_1, r_length=2, r_extern=0, r_pcrel=1, r_symbolnum=3 83 05 18 00 00 00 06 // assumes L0 is in third section and there is no previous non-local label. // The rip-relative-offset of 0x00000018 is L0-address_of_next_instruction. // address_of_next_instruction is the address of the relocation + 4 + 1. // The +1 comes from SIGNED_1. This is used because the relocation is not // at the end of the instruction.

.quad L1 r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev 12 00 00 00 00 00 00 00 // assumes _prev is the first non-local label 0x12 bytes before L1

.quad L0 r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=0, r_pcrel=0, r_symbolnum=3 56 00 00 00 00 00 00 00 // assumes L0 is in third section, has an address of 0x00000056 in .o // file, and there is no previous non-local label

.quad _foo - . r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo EE FF FF FF FF FF FF FF // assumes _prev is the first non-local label 0x12 bytes before this // .quad

.quad _foo - L1 r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo EE FF FF FF FF FF FF FF // assumes _prev is the first non-local label 0x12 bytes before L1

.quad L1 - _prev // No relocations. This is an assembly time constant. 12 00 00 00 00 00 00 00 // assumes _prev is the first non-local label 0x12 bytes before L1

In final linked images, there are only two valid relocation kinds:

r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_pcrel=0, r_extern=1, r_symbolnum=sym_index

This tells dyld to add the address of a symbol to a pointer sized (8-byte) piece of data (i.e on disk the 8-byte piece of data contains the addend). The r_symbolnum contains the index into the symbol table of the target symbol.

r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_pcrel=0, r_extern=0, r_symbolnum=0 This tells dyld to adjust the pointer sized (8-byte) piece of data by the amount the containing image was loaded from its base address (e.g. slide).

Enumerator
MachX8664RelocUnsigned 

for absolute addresses

MachX8664RelocSigned 

for signed 32-bit displacement

MachX8664RelocBranch 

a CALL/JMP instruction with 32-bit displacement

MachX8664RelocGotLoad 

a MOVQ load of a GOT entry

MachX8664RelocGot 

other GOT references

MachX8664RelocSubtractor 

must be followed by a MachX8664RelocUnsigned

MachX8664RelocSigned1 

for signed 32-bit displacement with a -1 addend

MachX8664RelocSigned2 

for signed 32-bit displacement with a -2 addend

MachX8664RelocSigned4 

for signed 32-bit displacement with a -4 addend

MachX8664RelocThreadLocalVariable 

for thread local variables

Definition at line 2591 of file AppleMachoImage.h.