OpenCore
1.0.4
OpenCore Bootloader
|
Go to the source code of this file.
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 |
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.
#define FORMALIZE_CPU_SUBTYPE | ( | CpuSubtype | ) |
Definition at line 38 of file AppleMachoImage.h.
#define MACH_CPU_ARCH_ABI64 BIT24 |
Definition at line 16 of file AppleMachoImage.h.
#define MACH_CPU_ARCH_ABI64_32 BIT25 |
Definition at line 17 of file AppleMachoImage.h.
#define MACH_CPU_SUBTYPE_INTEL | ( | f, | |
Model ) |
Definition at line 29 of file AppleMachoImage.h.
#define MACH_CPU_SUBTYPE_INTEL_FAMILY | ( | Identifier | ) |
Definition at line 32 of file AppleMachoImage.h.
#define MACH_CPU_SUBTYPE_INTEL_FAMILY_MAX 0x0FU |
Definition at line 26 of file AppleMachoImage.h.
#define MACH_CPU_SUBTYPE_INTEL_MODEL | ( | Identifier | ) |
Definition at line 35 of file AppleMachoImage.h.
#define MACH_CPU_SUBTYPE_INTEL_MODEL_ALL 0U |
Definition at line 27 of file AppleMachoImage.h.
#define MACH_CPU_SUBTYPE_INTEL_MODEL_SHIFT 4U |
Definition at line 25 of file AppleMachoImage.h.
#define MACH_CPU_SUBTYPE_LIB64 BIT17 |
64 bit libraries
Definition at line 23 of file AppleMachoImage.h.
#define MACH_CPU_SUBTYPE_MASK 0xFF000000U |
mask for feature flags
Definition at line 22 of file AppleMachoImage.h.
#define MACH_CPU_TYPE_64 | ( | CpuType | ) |
Definition at line 40 of file AppleMachoImage.h.
#define MACH_CPU_TYPE_64_32 | ( | CpuType | ) |
Definition at line 42 of file AppleMachoImage.h.
#define MACH_HEADER_64_INVERT_SIGNATURE 0xCFFAEDFE |
the 64-bit mach magic number (byte swapped)
Definition at line 2058 of file AppleMachoImage.h.
#define MACH_HEADER_64_SIGNATURE 0xFEEDFACF |
the 64-bit mach magic number
Definition at line 2057 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_ALL_MODULES_BOUND BIT12 |
Definition at line 2013 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_ALLOW_STACK_EXECUTION BIT17 |
Definition at line 2018 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_APP_EXTENSION_SAFE BIT25 |
Definition at line 2026 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_BINARY_DATA_LOAD BIT3 |
Definition at line 2004 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_BINDS_TO_WEAK BIT16 |
Definition at line 2017 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_CANONICAL BIT14 |
Definition at line 2015 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_DEAD_STRIPPABLE_DYLIB BIT22 |
Definition at line 2023 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_DYLIB_IN_CACHE BIT31 |
Definition at line 2029 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_DYNAMIC_LINKER_LINK BIT2 |
Definition at line 2003 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_FORCE_FLAT BIT8 |
Definition at line 2009 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_HAS_TLV_DESCRIPTORS BIT23 |
Definition at line 2024 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_INCREMENTAL_LINK BIT1 |
Definition at line 2002 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_LAZY_INITIALIZATION BIT6 |
Definition at line 2007 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_NLIST_OUTOFSYNC_WITH_DYLDINFO BIT26 |
Definition at line 2027 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_NO_FIX_PREBINDING BIT10 |
Definition at line 2011 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_NO_HEAP_EXECUTION BIT24 |
Definition at line 2025 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_NO_MULTIPLE_DEFINITIONS BIT9 |
Definition at line 2010 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_NO_REEXPORTED_DYLIBS BIT20 |
Definition at line 2021 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_NO_UNDEFINED_REFERENCES BIT0 |
Definition at line 2001 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_POSITION_INDEPENDENT_EXECUTABLE BIT21 |
Definition at line 2022 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_PREBINDABLE BIT11 |
Definition at line 2012 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_PREBOUND BIT4 |
Definition at line 2005 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_ROOT_SAFE BIT18 |
Definition at line 2019 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_SET_UID_SAFE BIT19 |
Definition at line 2020 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_SIM_SUPPORT BIT27 |
Definition at line 2028 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_SPLIT_SEGMENTS BIT5 |
Definition at line 2006 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_SUBSECTIONS_VIA_SYNBOLS BIT13 |
Definition at line 2014 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_TWO_LEVEL BIT7 |
Definition at line 2008 of file AppleMachoImage.h.
#define MACH_HEADER_FLAG_WEAK_DEFINES BIT15 |
Definition at line 2016 of file AppleMachoImage.h.
#define MACH_HEADER_INVERT_SIGNATURE 0xCEFAEDFE |
the mach magic number (byte swapped)
Definition at line 2037 of file AppleMachoImage.h.
#define MACH_HEADER_SIGNATURE 0xFEEDFACE |
the mach magic number
Definition at line 2036 of file AppleMachoImage.h.
#define MACH_INDIRECT_SYMBOL_ABS 0x40000000U |
Definition at line 1462 of file AppleMachoImage.h.
#define MACH_INDIRECT_SYMBOL_LOCAL 0x80000000U |
Definition at line 1461 of file AppleMachoImage.h.
#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.
#define MACH_LOAD_COMMAND_BUILD_VERSION 50U |
build for platform min OS version
Definition at line 571 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_CODE_SIGNATURE 29U |
local of code signature
Definition at line 483 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_DATA_IN_CODE 41U |
table of non-in structions in __text
Definition at line 535 of file AppleMachoImage.h.
#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.
#define MACH_LOAD_COMMAND_DYLD_ENVIRONMENT 39U |
string for dyld to treat like environment variable
Definition at line 527 of file AppleMachoImage.h.
#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.
#define MACH_LOAD_COMMAND_DYLD_INFO 34U |
compressed dyld information
Definition at line 503 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_DYLD_INFO_ONLY (34U | MACH_LC_REQUIRE_DYLD) |
compressed dyld information only
Definition at line 507 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_DYLIB_CODE_SIGN_DRS 43U |
Code signing DRs copied from linked dylibs
Definition at line 543 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_DYSYMTAB 11U |
dynamic link-edit symbol table info
Definition at line 410 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_ENCRYPTION_INFO 33U |
encrypted segment information
Definition at line 499 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_ENCRYPTION_INFO_64 44U |
64-bit encrypted segment information
Definition at line 547 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_FILESET_ENTRY (53U | MACH_LC_REQUIRE_DYLD) |
used with fileset_entry_command
Definition at line 583 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_FIXED_VM_FILE 9U |
fixed VM file inclusion (internal use)
Definition at line 402 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_FUNCTION_STARTS 38U |
compressed table of function start addresses
Definition at line 523 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_HDR_ |
Definition at line 587 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_IDENTIFICATION 8U |
object identification info (obsolete)
Definition at line 398 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_IDENTIFICATION_DYLD 15U |
dynamic linker identification
Definition at line 426 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_IDENTIFICATION_VM_LIB 7U |
fixed VM shared library identification
Definition at line 394 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_IDENTITY_DYLIB 13U |
dynamically linked shared lib ident
Definition at line 418 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_LAZY_LOAD_DYLIB 32U |
delay load of dylib until first use
Definition at line 495 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_LINKER_OPTIMIZATION_HINT 46U |
optimization hints in MH_OBJECT files
Definition at line 555 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_LINKER_OPTION 45U |
linker options in MH_OBJECT files
Definition at line 551 of file AppleMachoImage.h.
#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.
#define MACH_LOAD_COMMAND_LOAD_DYLD 14U |
load a dynamic linker
Definition at line 422 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_LOAD_DYLIB 12U |
load a dynamically linked shared library
Definition at line 414 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_LOAD_FIXED_VM_LIB 6U |
load a specified fixed VM shared library
Definition at line 390 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_LOAD_UPWARD_DYLIB (35U | MACH_LC_REQUIRE_DYLD) |
load upward dylib
Definition at line 511 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_MAIN (40U | MACH_LC_REQUIRE_DYLD) |
replacement for MachLoadCommandUnixThread
Definition at line 531 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_NOTE 49U |
arbitrary data included within a Mach-O file
Definition at line 567 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_PRE_PAGE 10U |
prepage command (internal use)
Definition at line 406 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_PREBIND_CHECKSUM 23U |
prebind checksum
Definition at line 458 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_PREBOUNT_SYLIB 16U |
modules prebound for a dynamically
Definition at line 430 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_REEXPORT_DYLIB (31U | MACH_LC_REQUIRE_DYLD) |
load and re-export dylib
Definition at line 491 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_ROUTINES 17U |
image routines
Definition at line 434 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_ROUTINES_64 26U |
64-bit image routines
Definition at line 471 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_RUN_PATH (28U | MACH_LC_REQUIRE_DYLD) |
runpath additions
Definition at line 479 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_SEGMENT 1U |
segment of this file to be mapped
Definition at line 370 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_SEGMENT_64 25U |
64-bit segment of this file to be mapped
Definition at line 467 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_SEGMENT_SPLIT_INFO 30U |
local of info to split segments
Definition at line 487 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_SOURCE_VERSION 42U |
source version used to build binary
Definition at line 539 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_SUB_CLIENT 20U |
sub clien
Definition at line 446 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_SUB_FRAMEWORK 18U |
sub framework
Definition at line 438 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_SUB_LIBRARY 21U |
sub library
Definition at line 450 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_SUB_UMBRELLA 19U |
sub umbrella
Definition at line 442 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_SYMSEG 3U |
link-edit gdb symbol table info (obsolete)
Definition at line 378 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_SYMTAB 2U |
link-edit stab symbol table info
Definition at line 374 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_THREAD 4U |
thread
Definition at line 382 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_TWO_LEVEL_HINTS 22U |
two-level namespace lookup hints
Definition at line 454 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_UNIX_THREAD 5U |
unix thread (includes a stack)
Definition at line 386 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_UUID 27U |
the uuid
Definition at line 475 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_VERSION_MIN_IPHONE_OS 37U |
build for iPhoneOS min OS version
Definition at line 519 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_VERSION_MIN_MAC_OS_X 36U |
build for MacOSX min OS version
Definition at line 515 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_VERSION_MIN_TV_OS 47U |
build for AppleTV min OS version
Definition at line 559 of file AppleMachoImage.h.
#define MACH_LOAD_COMMAND_VERSION_MIN_WATCH_OS 48U |
build for Watch min OS version
Definition at line 563 of file AppleMachoImage.h.
#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.
#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.
#define MACH_N_AST 0x32U |
AST file path: name,,NO_SECT,0,0.
Definition at line 2205 of file AppleMachoImage.h.
#define MACH_N_BCOMM 0xE2U |
begin common: name,,NO_SECT,0,0
Definition at line 2225 of file AppleMachoImage.h.
#define MACH_N_BINCL 0x82U |
include file beginning: name,,NO_SECT,0,sum
Definition at line 2214 of file AppleMachoImage.h.
#define MACH_N_BNSYM 0x2EU |
begin nsect sym: 0,,n_sect,0,address
Definition at line 2204 of file AppleMachoImage.h.
#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.
#define MACH_N_ECOML 0xE8U |
end common (local name): 0,,n_sect,0,address
Definition at line 2227 of file AppleMachoImage.h.
#define MACH_N_ECOMM 0xE4U |
end common: name,,n_sect,0,0
Definition at line 2226 of file AppleMachoImage.h.
#define MACH_N_EINCL 0xA2U |
include file end: name,,NO_SECT,0,0
Definition at line 2220 of file AppleMachoImage.h.
#define MACH_N_ENSYM 0x4EU |
end nsect sym: 0,,n_sect,0,address
Definition at line 2209 of file AppleMachoImage.h.
#define MACH_N_ENTRY 0xA4U |
alternate entry: name,,n_sect,linenumber,address
Definition at line 2221 of file AppleMachoImage.h.
#define MACH_N_EXCL 0xC2U |
deleted include file: name,,NO_SECT,0,sum
Definition at line 2223 of file AppleMachoImage.h.
#define MACH_N_FNAME 0x22U |
procedure name (f77 kludge): name,,NO_SECT,0,0
Definition at line 2200 of file AppleMachoImage.h.
#define MACH_N_FUN 0x24U |
procedure: name,,n_sect,linenumber,address
Definition at line 2201 of file AppleMachoImage.h.
#define MACH_N_GSYM 0x20U |
global symbol: name,,NO_SECT,type,0
Definition at line 2199 of file AppleMachoImage.h.
#define MACH_N_LBRAC 0xC0U |
left bracket: 0,,NO_SECT,nesting level,address
Definition at line 2222 of file AppleMachoImage.h.
#define MACH_N_LCSYM 0x28U |
.lcomm symbol: name,,n_sect,type,address
Definition at line 2203 of file AppleMachoImage.h.
#define MACH_N_LENG 0xFEU |
second stab entry with length information
Definition at line 2228 of file AppleMachoImage.h.
#define MACH_N_LSYM 0x80U |
local sym: name,,NO_SECT,type,offset
Definition at line 2213 of file AppleMachoImage.h.
#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.
#define MACH_N_OLEVEL 0x8AU |
compiler -O level: name,,NO_SECT,0,0
Definition at line 2218 of file AppleMachoImage.h.
#define MACH_N_OPT 0x3CU |
emitted with gcc2_compiled and in gcc source
Definition at line 2206 of file AppleMachoImage.h.
#define MACH_N_OSO 0x66U |
object file name: name,,0,0,st_mtime
Definition at line 2212 of file AppleMachoImage.h.
#define MACH_N_PARAMS 0x86U |
compiler parameters: name,,NO_SECT,0,0
Definition at line 2216 of file AppleMachoImage.h.
#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.
#define MACH_N_PSYM 0xA0U |
parameter: name,,NO_SECT,type,offset
Definition at line 2219 of file AppleMachoImage.h.
#define MACH_N_RBRAC 0xE0U |
right bracket: 0,,NO_SECT,nesting level,address
Definition at line 2224 of file AppleMachoImage.h.
#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.
#define MACH_N_RSYM 0x40U |
register sym: name,,NO_SECT,type,register
Definition at line 2207 of file AppleMachoImage.h.
#define MACH_N_SLINE 0x44U |
src line: 0,,n_sect,linenumber,address
Definition at line 2208 of file AppleMachoImage.h.
#define MACH_N_SO 0x64U |
source file name: name,,n_sect,0,address
Definition at line 2211 of file AppleMachoImage.h.
#define MACH_N_SOL 0x84U |
#included file name: name,,n_sect,0,address
Definition at line 2215 of file AppleMachoImage.h.
#define MACH_N_SSYM 0x60U |
structure elt: name,,NO_SECT,type,struct_offset
Definition at line 2210 of file AppleMachoImage.h.
#define MACH_N_STSYM 0x26U |
static symbol: name,,n_sect,type,address
Definition at line 2202 of file AppleMachoImage.h.
#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.
#define MACH_N_TYPE_ABS 0x2U |
absolute, n_sect == NO_SECT
Definition at line 2159 of file AppleMachoImage.h.
#define MACH_N_TYPE_EXT 0x01U |
external symbol bit, set for external symbols
Definition at line 2145 of file AppleMachoImage.h.
#define MACH_N_TYPE_INDR 0xAU |
indirect
Definition at line 2162 of file AppleMachoImage.h.
#define MACH_N_TYPE_PBUD 0xCU |
prebound undefined (defined in a dylib)
Definition at line 2161 of file AppleMachoImage.h.
#define MACH_N_TYPE_PEXT 0x10U |
private external symbol bit
Definition at line 2143 of file AppleMachoImage.h.
#define MACH_N_TYPE_SECT 0xEU |
defined in section number n_sect
Definition at line 2160 of file AppleMachoImage.h.
#define MACH_N_TYPE_STAB 0xE0U |
if any of these bits set, a symbolic debugging entry
Definition at line 2141 of file AppleMachoImage.h.
#define MACH_N_TYPE_TYPE 0x0EU |
mask for the type bit
Definition at line 2144 of file AppleMachoImage.h.
#define MACH_N_TYPE_UNDF 0x0U |
undefined, n_sect == NO_SECT
Definition at line 2158 of file AppleMachoImage.h.
#define MACH_N_VERSION 0x88U |
compiler version: name,,NO_SECT,0,0
Definition at line 2217 of file AppleMachoImage.h.
#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.
#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.
#define MACH_PLATFORM_BRIDGEOS 5U |
Definition at line 1622 of file AppleMachoImage.h.
#define MACH_PLATFORM_DRIVERKIT 10U |
Definition at line 1627 of file AppleMachoImage.h.
#define MACH_PLATFORM_IOS 2U |
Definition at line 1619 of file AppleMachoImage.h.
#define MACH_PLATFORM_IOSSIMULATOR 7U |
Definition at line 1624 of file AppleMachoImage.h.
#define MACH_PLATFORM_MACCATALYST 6U |
Definition at line 1623 of file AppleMachoImage.h.
#define MACH_PLATFORM_MACOS 1U |
Known values for the platform field above.
Definition at line 1618 of file AppleMachoImage.h.
#define MACH_PLATFORM_TVOS 3U |
Definition at line 1620 of file AppleMachoImage.h.
#define MACH_PLATFORM_TVOSSIMULATOR 8U |
Definition at line 1625 of file AppleMachoImage.h.
#define MACH_PLATFORM_WATCHOS 4U |
Definition at line 1621 of file AppleMachoImage.h.
#define MACH_PLATFORM_WATCHOSSIMULATOR 9U |
Definition at line 1626 of file AppleMachoImage.h.
#define MACH_RELOC_ABSOLUTE 0U |
absolute relocation type for Mach-O files
Definition at line 2312 of file AppleMachoImage.h.
#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.
#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.
#define MACH_SECTION_ATTRIBUTE_EXTERNAL_RELOCATION BIT9 |
section has external relocation entries
Definition at line 770 of file AppleMachoImage.h.
#define MACH_SECTION_ATTRIBUTE_LIVE_SUPPORT BIT27 |
blocks are live if they reference live blocks
Definition at line 803 of file AppleMachoImage.h.
#define MACH_SECTION_ATTRIBUTE_LOCAL_RELOCATION BIT8 |
section has local relocation entries
Definition at line 766 of file AppleMachoImage.h.
#define MACH_SECTION_ATTRIBUTE_NO_DEAD_STRIP BIT28 |
no dead stripping
Definition at line 807 of file AppleMachoImage.h.
#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.
#define MACH_SECTION_ATTRIBUTE_PURE_INSTRUCTIONS BIT31 |
section contains only true machine instructions
Definition at line 821 of file AppleMachoImage.h.
#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.
#define MACH_SECTION_ATTRIBUTE_SOME_INSTRUCTIONS BIT10 |
section contains some machine instructions
Definition at line 774 of file AppleMachoImage.h.
#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.
#define MACH_SECTION_ATTRIBUTES_MASK 0xFFFFFF00U |
24 section attributes
Definition at line 783 of file AppleMachoImage.h.
#define MACH_SECTION_ATTRIBUTES_SYSYTEM 0x00FFFF00U |
system setable attributes
Definition at line 758 of file AppleMachoImage.h.
#define MACH_SECTION_ATTRIBUTES_USER 0xFF000000U |
User setable attributes
Definition at line 762 of file AppleMachoImage.h.
#define MACH_SECTION_TYPE_MASK 0x000000FFU |
256 section types
Definition at line 782 of file AppleMachoImage.h.
#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.
#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.
#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.
#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.
#define MACH_SEGMENT_VM_PROT_EXECUTE BIT2 |
Definition at line 628 of file AppleMachoImage.h.
#define MACH_SEGMENT_VM_PROT_NONE 0U |
Definition at line 624 of file AppleMachoImage.h.
#define MACH_SEGMENT_VM_PROT_READ BIT0 |
Definition at line 626 of file AppleMachoImage.h.
#define MACH_SEGMENT_VM_PROT_WRITE BIT1 |
Definition at line 627 of file AppleMachoImage.h.
#define MACH_SOURCE_VERSION_A | ( | Version | ) |
Definition at line 1899 of file AppleMachoImage.h.
#define MACH_SOURCE_VERSION_A_MASK 0xFFFFFF0000000000U |
Definition at line 1893 of file AppleMachoImage.h.
#define MACH_SOURCE_VERSION_B | ( | Version | ) |
Definition at line 1900 of file AppleMachoImage.h.
#define MACH_SOURCE_VERSION_B_MASK 0x000000FFC0000000U |
Definition at line 1894 of file AppleMachoImage.h.
#define MACH_SOURCE_VERSION_C | ( | Version | ) |
Definition at line 1901 of file AppleMachoImage.h.
#define MACH_SOURCE_VERSION_D | ( | Version | ) |
Definition at line 1902 of file AppleMachoImage.h.
#define MACH_SOURCE_VERSION_D_MASK 0x00000000000FFC00U |
Definition at line 1896 of file AppleMachoImage.h.
#define MACH_SOURCE_VERSION_E | ( | Version | ) |
Definition at line 1903 of file AppleMachoImage.h.
#define MACH_SOURCE_VERSION_E_MASK 0x00000000000003FFU |
Definition at line 1897 of file AppleMachoImage.h.
#define MACH_SOURCE_VERSION_V_MASK 0x000000003FF00000U |
Definition at line 1895 of file AppleMachoImage.h.
#define MACH_TOOL_CLANG 1U |
Known values for the tool field above.
Definition at line 1632 of file AppleMachoImage.h.
#define MACH_TOOL_LD 3U |
Definition at line 1634 of file AppleMachoImage.h.
#define MACH_TOOL_SWIFT 2U |
Definition at line 1633 of file AppleMachoImage.h.
#define MACH_VALID_THREAD_STATE_FLAVOR | ( | Flavor | ) |
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.
#define MACH_X86_THREAD_STATE_MAX 614 |
Size of maximum exported thread state in words
Definition at line 1102 of file AppleMachoImage.h.
#define MAX_SECT 255 |
1 thru 255 inclusive
Definition at line 2184 of file AppleMachoImage.h.
#define NEXT_MACH_LOAD_COMMAND | ( | Command | ) |
Definition at line 591 of file AppleMachoImage.h.
#define NEXT_MACH_SEGMENT | ( | Segment | ) |
Definition at line 891 of file AppleMachoImage.h.
#define NEXT_MACH_SEGMENT_64 | ( | Segment | ) |
Definition at line 922 of file AppleMachoImage.h.
#define NO_SECT 0 |
symbol is not in any section
Definition at line 2183 of file AppleMachoImage.h.
typedef UINT32 MACH_CPU_FAMILY |
Definition at line 295 of file AppleMachoImage.h.
typedef INT32 MACH_CPU_SUBTYPE |
Definition at line 235 of file AppleMachoImage.h.
typedef INT32 MACH_CPU_THREADTYPE |
Definition at line 296 of file AppleMachoImage.h.
typedef INT32 MACH_CPU_TYPE |
Definition at line 79 of file AppleMachoImage.h.
typedef UINT32 MACH_HEADER_FILE_TYPE |
Definition at line 1996 of file AppleMachoImage.h.
typedef UINT32 MACH_HEADER_FLAGS |
Definition at line 2031 of file AppleMachoImage.h.
typedef UINT32 MACH_LOAD_COMMAND_TYPE |
Definition at line 585 of file AppleMachoImage.h.
typedef UINT32 MACH_SEGMENT_FLAGS |
Definition at line 630 of file AppleMachoImage.h.
typedef INT32 MACH_VM_PROTECTION |
Definition at line 297 of file AppleMachoImage.h.
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
Definition at line 58 of file AppleMachoImage.h.
anonymous enum |
Definition at line 81 of file AppleMachoImage.h.
anonymous enum |
CPU Family definitions
Definition at line 240 of file AppleMachoImage.h.
anonymous enum |
Constants for the type of a section
Definition at line 635 of file AppleMachoImage.h.
anonymous enum |
Definition at line 1074 of file AppleMachoImage.h.
anonymous enum |
Values for MACH_DYLD_CHAINED_STARTS_IN_SEGMENT.PointerFormat.
Definition at line 1859 of file AppleMachoImage.h.
anonymous enum |
Definition at line 1875 of file AppleMachoImage.h.
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
Definition at line 1977 of file AppleMachoImage.h.
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.
Definition at line 2431 of file AppleMachoImage.h.
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).
Definition at line 2591 of file AppleMachoImage.h.