Expand description
A header contains minimal architecture information, the binary kind, the number of load commands, as well as an endianness hint
Structs§
Constants§
- MH_
ALLMODSBOUND - indicates that this binary binds to all two-level namespace modules of its dependent libraries. Only used when MH_PREBINDABLE and MH_TWOLEVEL are both set.
- MH_
ALLOW_ STACK_ EXECUTION - When this bit is set, all stacks in the task will be given stack execution privilege. Only used in MH_EXECUTE filetypes.
- MH_
APP_ EXTENSION_ SAFE - The code was linked for use in an application extension.
- MH_
BINDATLOAD - the object file’s undefined references are bound by the dynamic linker when loaded.
- MH_
BINDS_ TO_ WEAK - the final linked image uses weak symbols
- MH_
BUNDLE - dynamically bound bundle file
- MH_
CANONICAL - the binary has been canonicalized via the unprebind operation
- MH_
CIGAM - MH_
CIGAM_ 64 - MH_CORE
- core file
- MH_
DEAD_ STRIPPABLE_ DYLIB - Only for use on dylibs. When linking against a dylib that has this bit set, the static linker will automatically not create a LC_LOAD_DYLIB load command to the dylib if no symbols are being referenced from the dylib.
- MH_DSYM
- companion file with only debug sections
- MH_
DYLDLINK - the object file is input for the dynamic linker and can’t be staticly link edited again
- MH_
DYLIB - dynamically bound shared library
- MH_
DYLIB_ STUB - shared library stub for static linking only, no section contents
- MH_
DYLINKER - dynamic link editor
- MH_
EXECUTE - demand paged executable file
- MH_
FILESET - set of mach-o’s
- MH_
FORCE_ FLAT - the executable is forcing all images to use flat name space bindings
- MH_
FVMLIB - fixed VM shared library file
- MH_
HAS_ TLV_ DESCRIPTORS - Contains a section of type S_THREAD_LOCAL_VARIABLES
- MH_
INCRLINK - the object file is the output of an incremental link against a base file and can’t be link edited again
- MH_
KEXT_ BUNDLE - x86_64 kexts
- MH_
LAZY_ INIT - the shared library init routine is to be run lazily via catching memory faults to its writeable segments (obsolete)
- MH_
MAGIC - Mach Header magic constant
- MH_
MAGIC_ 64 - Mach Header magic constant for 64-bit
- MH_
NOFIXPREBINDING - do not have dyld notify the prebinding agent about this executable
- MH_
NOMULTIDEFS - this umbrella guarantees no multiple defintions of symbols in its sub-images so the two-level namespace hints can always be used.
- MH_
NOUNDEFS - the object file has no undefined references
- MH_
NO_ HEAP_ EXECUTION - When this bit is set, the OS will run the main executable with a non-executable heap even on platforms (e.g. i386) that don’t require it. Only used in MH_EXECUTE filetypes.
- MH_
NO_ REEXPORTED_ DYLIBS - When this bit is set on a dylib, the static linker does not need to examine dependent dylibs to see if any are re-exported
- MH_
OBJECT - relocatable object file
- MH_PIE
- When this bit is set, the OS will load the main executable at a random address. Only used in MH_EXECUTE filetypes.
- MH_
PREBINDABLE - the binary is not prebound but can have its prebinding redone. only used when MH_PREBOUND is not set.
- MH_
PREBOUND - the file has its dynamic undefined references prebound.
- MH_
PRELOAD - preloaded executable file
- MH_
ROOT_ SAFE - When this bit is set, the binary declares it is safe for use in processes with uid zero
- MH_
SETUID_ SAFE - When this bit is set, the binary declares it is safe for use in processes when issetugid() is true
- MH_
SPLIT_ SEGS - the file has its read-only and read-write segments split
- MH_
SUBSECTIONS_ VIA_ SYMBOLS - safe to divide up the sections into sub-sections via symbols for dead code stripping
- MH_
TWOLEVEL - the image is using two-level name space bindings
- MH_
WEAK_ DEFINES - the final linked image contains external weak symbols
- SIZEOF_
HEADER_ 32 - SIZEOF_
HEADER_ 64