#include <stdint.h>
#include "third_party/darwin_xnu_macho/mach/machine.h"
#include "third_party/darwin_xnu_macho/mach/vm_prot.h"
Go to the source code of this file.
Macros | |
#define | BIND_IMMEDIATE_MASK 0x0F |
#define | BIND_OPCODE_ADD_ADDR_ULEB 0x80 |
#define | BIND_OPCODE_DO_BIND 0x90 |
#define | BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xB0 |
#define | BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xA0 |
#define | BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xC0 |
#define | BIND_OPCODE_DONE 0x00 |
#define | BIND_OPCODE_MASK 0xF0 |
#define | BIND_OPCODE_SET_ADDEND_SLEB 0x60 |
#define | BIND_OPCODE_SET_DYLIB_ORDINAL_IMM 0x10 |
#define | BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB 0x20 |
#define | BIND_OPCODE_SET_DYLIB_SPECIAL_IMM 0x30 |
#define | BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x70 |
#define | BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM 0x40 |
#define | BIND_OPCODE_SET_TYPE_IMM 0x50 |
#define | BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2 |
#define | BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1 |
#define | BIND_SPECIAL_DYLIB_SELF 0 |
#define | BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION 0x8 |
#define | BIND_SYMBOL_FLAGS_WEAK_IMPORT 0x1 |
#define | BIND_TYPE_POINTER 1 |
#define | BIND_TYPE_TEXT_ABSOLUTE32 2 |
#define | BIND_TYPE_TEXT_PCREL32 3 |
#define | DICE_KIND_ABS_JUMP_TABLE32 0x0005 |
#define | DICE_KIND_DATA 0x0001 |
#define | DICE_KIND_JUMP_TABLE16 0x0003 |
#define | DICE_KIND_JUMP_TABLE32 0x0004 |
#define | DICE_KIND_JUMP_TABLE8 0x0002 |
#define | EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03 |
#define | EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00 |
#define | EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01 |
#define | EXPORT_SYMBOL_FLAGS_REEXPORT 0x08 |
#define | EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10 |
#define | EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04 |
#define | INDIRECT_SYMBOL_ABS 0x40000000 |
#define | INDIRECT_SYMBOL_LOCAL 0x80000000 |
#define | LC_BUILD_VERSION 0x32 /* build for platform min OS version */ |
#define | LC_CODE_SIGNATURE 0x1d /* local of code signature */ |
#define | LC_DATA_IN_CODE 0x29 /* table of non-instructions in __text */ |
#define | LC_DYLD_ENVIRONMENT |
#define | LC_DYLD_INFO 0x22 /* compressed dyld information */ |
#define | LC_DYLD_INFO_ONLY (0x22|LC_REQ_DYLD) /* compressed dyld information only */ |
#define | LC_DYLIB_CODE_SIGN_DRS 0x2B /* Code signing DRs copied from linked dylibs */ |
#define | LC_DYSYMTAB 0xb /* dynamic link-edit symbol table info */ |
#define | LC_ENCRYPTION_INFO 0x21 /* encrypted segment information */ |
#define | LC_ENCRYPTION_INFO_64 0x2C /* 64-bit encrypted segment information */ |
#define | LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */ |
#define | LC_FVMFILE 0x9 /* fixed VM file inclusion (internal use) */ |
#define | LC_ID_DYLIB 0xd /* dynamically linked shared lib ident */ |
#define | LC_ID_DYLINKER 0xf /* dynamic linker identification */ |
#define | LC_IDENT 0x8 /* object identification info (obsolete) */ |
#define | LC_IDFVMLIB 0x7 /* fixed VM shared library identification */ |
#define | LC_LAZY_LOAD_DYLIB 0x20 /* delay load of dylib until first use */ |
#define | LC_LINKER_OPTIMIZATION_HINT 0x2E /* optimization hints in MH_OBJECT files */ |
#define | LC_LINKER_OPTION 0x2D /* linker options in MH_OBJECT files */ |
#define | LC_LOAD_DYLIB 0xc /* load a dynamically linked shared library */ |
#define | LC_LOAD_DYLINKER 0xe /* load a dynamic linker */ |
#define | LC_LOAD_UPWARD_DYLIB (0x23 | LC_REQ_DYLD) /* load upward dylib */ |
#define | LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) |
#define | LC_LOADFVMLIB 0x6 /* load a specified fixed VM shared library */ |
#define | LC_MAIN (0x28|LC_REQ_DYLD) /* replacement for LC_UNIXTHREAD */ |
#define | LC_NOTE 0x31 /* arbitrary data included within a Mach-O file */ |
#define | LC_PREBIND_CKSUM 0x17 /* prebind checksum */ |
#define | LC_PREBOUND_DYLIB 0x10 /* modules prebound for a dynamically */ |
#define | LC_PREPAGE 0xa /* prepage command (internal use) */ |
#define | LC_REEXPORT_DYLIB (0x1f | LC_REQ_DYLD) /* load and re-export dylib */ |
#define | LC_REQ_DYLD 0x80000000 |
#define | LC_ROUTINES 0x11 /* image routines */ |
#define | LC_ROUTINES_64 0x1a /* 64-bit image routines */ |
#define | LC_RPATH (0x1c | LC_REQ_DYLD) /* runpath additions */ |
#define | LC_SEGMENT 0x1 /* segment of this file to be mapped */ |
#define | LC_SEGMENT_64 |
#define | LC_SEGMENT_SPLIT_INFO 0x1e /* local of info to split segments */ |
#define | LC_SOURCE_VERSION 0x2A /* source version used to build binary */ |
#define | LC_SUB_CLIENT 0x14 /* sub client */ |
#define | LC_SUB_FRAMEWORK 0x12 /* sub framework */ |
#define | LC_SUB_LIBRARY 0x15 /* sub library */ |
#define | LC_SUB_UMBRELLA 0x13 /* sub umbrella */ |
#define | LC_SYMSEG 0x3 /* link-edit gdb symbol table info (obsolete) */ |
#define | LC_SYMTAB 0x2 /* link-edit stab symbol table info */ |
#define | LC_THREAD 0x4 /* thread */ |
#define | LC_TWOLEVEL_HINTS 0x16 /* two-level namespace lookup hints */ |
#define | LC_UNIXTHREAD 0x5 /* unix thread (includes a stack) */ |
#define | LC_UUID 0x1b /* the uuid */ |
#define | LC_VERSION_MIN_IPHONEOS 0x25 /* build for iPhoneOS min OS version */ |
#define | LC_VERSION_MIN_MACOSX 0x24 /* build for MacOSX min OS version */ |
#define | LC_VERSION_MIN_TVOS 0x2F /* build for AppleTV min OS version */ |
#define | LC_VERSION_MIN_WATCHOS 0x30 /* build for Watch min OS version */ |
#define | MH_ALLMODSBOUND |
#define | MH_ALLOW_STACK_EXECUTION |
#define | MH_APP_EXTENSION_SAFE |
#define | MH_BINDATLOAD |
#define | MH_BINDS_TO_WEAK |
#define | MH_BUNDLE 0x8 /* dynamically bound bundle file */ |
#define | MH_CANONICAL |
#define | MH_CIGAM 0xcefaedfe /* NXSwapInt(MH_MAGIC) */ |
#define | MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */ |
#define | MH_CORE 0x4 /* core file */ |
#define | MH_DEAD_STRIPPABLE_DYLIB |
#define | MH_DSYM 0xa /* companion file with only debug */ |
#define | MH_DYLDLINK |
#define | MH_DYLIB 0x6 /* dynamically bound shared library */ |
#define | MH_DYLIB_STUB 0x9 /* shared library stub for static */ |
#define | MH_DYLINKER 0x7 /* dynamic link editor */ |
#define | MH_EXECUTE 0x2 /* demand paged executable file */ |
#define | MH_FORCE_FLAT |
#define | MH_FVMLIB 0x3 /* fixed VM shared library file */ |
#define | MH_HAS_TLV_DESCRIPTORS |
#define | MH_INCRLINK |
#define | MH_KEXT_BUNDLE 0xb /* x86_64 kexts */ |
#define | MH_LAZY_INIT |
#define | MH_MAGIC 0xfeedface /* the mach magic number */ |
#define | MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */ |
#define | MH_NO_HEAP_EXECUTION |
#define | MH_NO_REEXPORTED_DYLIBS |
#define | MH_NOFIXPREBINDING |
#define | MH_NOMULTIDEFS |
#define | MH_NOUNDEFS |
#define | MH_OBJECT 0x1 /* relocatable object file */ |
#define | MH_PIE |
#define | MH_PREBINDABLE |
#define | MH_PREBOUND |
#define | MH_PRELOAD 0x5 /* preloaded executable file */ |
#define | MH_ROOT_SAFE |
#define | MH_SETUID_SAFE |
#define | MH_SPLIT_SEGS |
#define | MH_SUBSECTIONS_VIA_SYMBOLS |
#define | MH_TWOLEVEL |
#define | MH_WEAK_DEFINES |
#define | PLATFORM_IOS 2 |
#define | PLATFORM_MACOS 1 |
#define | PLATFORM_TVOS 3 |
#define | PLATFORM_WATCHOS 4 |
#define | REBASE_IMMEDIATE_MASK 0x0F |
#define | REBASE_OPCODE_ADD_ADDR_IMM_SCALED 0x40 |
#define | REBASE_OPCODE_ADD_ADDR_ULEB 0x30 |
#define | REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB 0x70 |
#define | REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x50 |
#define | REBASE_OPCODE_DO_REBASE_ULEB_TIMES 0x60 |
#define | REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB 0x80 |
#define | REBASE_OPCODE_DONE 0x00 |
#define | REBASE_OPCODE_MASK 0xF0 |
#define | REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x20 |
#define | REBASE_OPCODE_SET_TYPE_IMM 0x10 |
#define | REBASE_TYPE_POINTER 1 |
#define | REBASE_TYPE_TEXT_ABSOLUTE32 2 |
#define | REBASE_TYPE_TEXT_PCREL32 3 |
#define | S_16BYTE_LITERALS |
#define | S_4BYTE_LITERALS 0x3 /* section with only 4 byte literals */ |
#define | S_8BYTE_LITERALS 0x4 /* section with only 8 byte literals */ |
#define | S_ATTR_DEBUG 0x02000000 /* a debug section */ |
#define | S_ATTR_EXT_RELOC |
#define | S_ATTR_LIVE_SUPPORT |
#define | S_ATTR_LOC_RELOC |
#define | S_ATTR_NO_DEAD_STRIP 0x10000000 /* no dead stripping */ |
#define | S_ATTR_NO_TOC |
#define | S_ATTR_PURE_INSTRUCTIONS |
#define | S_ATTR_SELF_MODIFYING_CODE |
#define | S_ATTR_SOME_INSTRUCTIONS |
#define | S_ATTR_STRIP_STATIC_SYMS |
#define | S_COALESCED |
#define | S_CSTRING_LITERALS 0x2 /* section with only literal C strings*/ |
#define | S_DTRACE_DOF |
#define | S_GB_ZEROFILL |
#define | S_INTERPOSING |
#define | S_LAZY_DYLIB_SYMBOL_POINTERS |
#define | S_LAZY_SYMBOL_POINTERS |
#define | S_LITERAL_POINTERS 0x5 /* section with only pointers to */ |
#define | S_MOD_INIT_FUNC_POINTERS |
#define | S_MOD_TERM_FUNC_POINTERS |
#define | S_NON_LAZY_SYMBOL_POINTERS |
#define | S_REGULAR 0x0 /* regular section */ |
#define | S_SYMBOL_STUBS |
#define | S_THREAD_LOCAL_INIT_FUNCTION_POINTERS |
#define | S_THREAD_LOCAL_REGULAR |
#define | S_THREAD_LOCAL_VARIABLE_POINTERS |
#define | S_THREAD_LOCAL_VARIABLES 0x13 /* TLV descriptors */ |
#define | S_THREAD_LOCAL_ZEROFILL |
#define | S_ZEROFILL 0x1 /* zero fill on demand section */ |
#define | SECT_BSS "__bss" /* the real uninitialized data section*/ |
#define | SECT_COMMON "__common" /* the section common symbols are */ |
#define | SECT_DATA "__data" /* the real initialized data section */ |
#define | SECT_FVMLIB_INIT0 "__fvmlib_init0" /* the fvmlib initialization */ |
#define | SECT_FVMLIB_INIT1 "__fvmlib_init1" /* the section following the */ |
#define | SECT_ICON_HEADER "__header" /* the icon headers */ |
#define | SECT_ICON_TIFF "__tiff" /* the icons in tiff format */ |
#define | SECT_OBJC_MODULES "__module_info" /* module information */ |
#define | SECT_OBJC_REFS "__selector_refs" /* string table */ |
#define | SECT_OBJC_STRINGS "__selector_strs" /* string table */ |
#define | SECT_OBJC_SYMBOLS "__symbol_table" /* symbol table */ |
#define | SECT_TEXT "__text" /* the real text part of the text */ |
#define | SECTION_ATTRIBUTES 0xffffff00 /* 24 section attributes */ |
#define | SECTION_ATTRIBUTES_SYS 0x00ffff00 /* system setable attributes */ |
#define | SECTION_ATTRIBUTES_USR 0xff000000 /* User setable attributes */ |
#define | SECTION_TYPE 0x000000ff /* 256 section types */ |
#define | SEG_DATA "__DATA" /* the tradition UNIX data segment */ |
#define | SEG_ICON "__ICON" /* the icon segment */ |
#define | SEG_IMPORT "__IMPORT" /* the segment for the self (dyld) */ |
#define | SEG_LINKEDIT "__LINKEDIT" /* the segment containing all structs */ |
#define | SEG_OBJC "__OBJC" /* objective-C runtime segment */ |
#define | SEG_PAGEZERO "__PAGEZERO" /* the pagezero segment which has no */ |
#define | SEG_TEXT "__TEXT" /* the tradition UNIX text segment */ |
#define | SEG_UNIXSTACK "__UNIXSTACK" /* the unix stack segment */ |
#define | SG_FVMLIB |
#define | SG_HIGHVM |
#define | SG_NORELOC |
#define | SG_PROTECTED_VERSION_1 |
#define | TOOL_CLANG 1 |
#define | TOOL_LD 3 |
#define | TOOL_SWIFT 2 |
#define LC_DYLD_ENVIRONMENT |
#define LC_DYLD_INFO 0x22 /* compressed dyld information */ |
#define LC_DYLD_INFO_ONLY (0x22|LC_REQ_DYLD) /* compressed dyld information only */ |
#define LC_ENCRYPTION_INFO 0x21 /* encrypted segment information */ |
#define LC_ENCRYPTION_INFO_64 0x2C /* 64-bit encrypted segment information */ |
#define LC_ID_DYLIB 0xd /* dynamically linked shared lib ident */ |
#define LC_ID_DYLINKER 0xf /* dynamic linker identification */ |
#define LC_IDENT 0x8 /* object identification info (obsolete) */ |
#define LC_IDFVMLIB 0x7 /* fixed VM shared library identification */ |
#define LC_LOAD_UPWARD_DYLIB (0x23 | LC_REQ_DYLD) /* load upward dylib */ |
#define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) |
#define LC_MAIN (0x28|LC_REQ_DYLD) /* replacement for LC_UNIXTHREAD */ |
#define LC_PREPAGE 0xa /* prepage command (internal use) */ |
#define LC_REEXPORT_DYLIB (0x1f | LC_REQ_DYLD) /* load and re-export dylib */ |
#define LC_RPATH (0x1c | LC_REQ_DYLD) /* runpath additions */ |
#define LC_SEGMENT_64 |
#define LC_SYMSEG 0x3 /* link-edit gdb symbol table info (obsolete) */ |
#define LC_SYMTAB 0x2 /* link-edit stab symbol table info */ |
#define LC_TWOLEVEL_HINTS 0x16 /* two-level namespace lookup hints */ |
#define MH_ALLMODSBOUND |
#define MH_ALLOW_STACK_EXECUTION |
#define MH_APP_EXTENSION_SAFE |
#define MH_BINDATLOAD |
#define MH_BINDS_TO_WEAK |
#define MH_CANONICAL |
#define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */ |
#define MH_DEAD_STRIPPABLE_DYLIB |
#define MH_DYLDLINK |
#define MH_DYLIB 0x6 /* dynamically bound shared library */ |
#define MH_DYLIB_STUB 0x9 /* shared library stub for static */ |
#define MH_FORCE_FLAT |
#define MH_HAS_TLV_DESCRIPTORS |
#define MH_INCRLINK |
#define MH_LAZY_INIT |
#define MH_NO_HEAP_EXECUTION |
#define MH_NO_REEXPORTED_DYLIBS |
#define MH_NOFIXPREBINDING |
#define MH_NOMULTIDEFS |
#define MH_NOUNDEFS |
#define MH_PIE |
#define MH_PREBINDABLE |
#define MH_PREBOUND |
#define MH_ROOT_SAFE |
#define MH_SETUID_SAFE |
#define MH_SPLIT_SEGS |
#define MH_SUBSECTIONS_VIA_SYMBOLS |
#define MH_TWOLEVEL |
#define MH_WEAK_DEFINES |
#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB 0x80 |
#define S_16BYTE_LITERALS |
#define S_4BYTE_LITERALS 0x3 /* section with only 4 byte literals */ |
#define S_8BYTE_LITERALS 0x4 /* section with only 8 byte literals */ |
#define S_ATTR_EXT_RELOC |
#define S_ATTR_LIVE_SUPPORT |
#define S_ATTR_LOC_RELOC |
#define S_ATTR_NO_DEAD_STRIP 0x10000000 /* no dead stripping */ |
#define S_ATTR_NO_TOC |
#define S_ATTR_PURE_INSTRUCTIONS |
#define S_ATTR_SELF_MODIFYING_CODE |
#define S_ATTR_SOME_INSTRUCTIONS |
#define S_ATTR_STRIP_STATIC_SYMS |
#define S_COALESCED |
#define S_DTRACE_DOF |
#define S_GB_ZEROFILL |
#define S_INTERPOSING |
#define S_LAZY_DYLIB_SYMBOL_POINTERS |
#define S_LAZY_SYMBOL_POINTERS |
#define S_MOD_INIT_FUNC_POINTERS |
#define S_MOD_TERM_FUNC_POINTERS |
#define S_NON_LAZY_SYMBOL_POINTERS |
#define S_SYMBOL_STUBS |
#define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS |
#define S_THREAD_LOCAL_REGULAR |
#define S_THREAD_LOCAL_VARIABLE_POINTERS |
#define S_THREAD_LOCAL_VARIABLES 0x13 /* TLV descriptors */ |
#define S_THREAD_LOCAL_ZEROFILL |
#define SECT_COMMON "__common" /* the section common symbols are */ |
#define SECT_DATA "__data" /* the real initialized data section */ |
#define SECT_FVMLIB_INIT0 "__fvmlib_init0" /* the fvmlib initialization */ |
#define SECT_FVMLIB_INIT1 "__fvmlib_init1" /* the section following the */ |
#define SECT_ICON_TIFF "__tiff" /* the icons in tiff format */ |
#define SECT_OBJC_MODULES "__module_info" /* module information */ |
#define SECT_OBJC_REFS "__selector_refs" /* string table */ |
#define SECT_OBJC_STRINGS "__selector_strs" /* string table */ |
#define SECT_OBJC_SYMBOLS "__symbol_table" /* symbol table */ |
#define SECT_TEXT "__text" /* the real text part of the text */ |
#define SECTION_ATTRIBUTES 0xffffff00 /* 24 section attributes */ |
#define SECTION_ATTRIBUTES_SYS 0x00ffff00 /* system setable attributes */ |
#define SECTION_ATTRIBUTES_USR 0xff000000 /* User setable attributes */ |
#define SEG_DATA "__DATA" /* the tradition UNIX data segment */ |
#define SEG_LINKEDIT "__LINKEDIT" /* the segment containing all structs */ |
#define SEG_OBJC "__OBJC" /* objective-C runtime segment */ |
#define SEG_PAGEZERO "__PAGEZERO" /* the pagezero segment which has no */ |
#define SEG_TEXT "__TEXT" /* the tradition UNIX text segment */ |
#define SEG_UNIXSTACK "__UNIXSTACK" /* the unix stack segment */ |
#define SG_FVMLIB |
#define SG_HIGHVM |
#define SG_NORELOC |
#define SG_PROTECTED_VERSION_1 |