Expand description
Mach-O File Format Parser for Rust
§Examples
use std::io::{Read, Cursor};
use std::fs::File;
use mach_object::{OFile, CPU_TYPE_X86_64, MachCommand, LoadCommand};
let mut f = File::open("tests/helloworld").unwrap();
let mut buf = Vec::new();
let size = f.read_to_end(&mut buf).unwrap();
let mut cur = Cursor::new(&buf[..size]);
if let OFile::MachFile { ref header, ref commands } = OFile::parse(&mut cur).unwrap() {
assert_eq!(header.cputype, CPU_TYPE_X86_64);
assert_eq!(header.ncmds as usize, commands.len());
for &MachCommand(ref cmd, cmdsize) in commands {
if let &LoadCommand::Segment64 { ref segname, ref sections, .. } = cmd {
println!("segment: {}", segname);
for ref sect in sections {
println!(" section: {}", sect.sectname);
}
}
}
}
For more detail, please check the unit tests and the otool example.
Structs§
- ArHeader
- the archive file header
- Bind
- A stream of BIND opcodes to bind all binding symbols.
- Bind
OpCodes - An iterator over the
BindOpCode
- Bind
Symbol - The mach binding symbol information
- Bind
Symbol Flags - Flags for bind symbol
- Build
Tool - Build
Version - The build_version_command contains the min OS version on which this binary was built to run for its platform. The list of known platforms and tool values following it.
- Data
InCode Entry - The
LC_DATA_IN_CODE
load commands uses aLinkEditData
to point to an array ofDataInCodeEntry
entries. - DyLib
- Dynamically linked shared libraries are identified by two things.
- DyLib
Module - a module table entry
- DyLib
TocEntry - a table of contents entry
- Export
Symbol - Export
Symbol Flags - The following are used on the flags byte of a terminal node in the export information.
- Export
Trie - FatArch
- For each architecture in the file, specified by a pair of cputype and cpusubtype,
the
FatArch
describes the file offset, file size and alignment in the file of the architecture specific member. - FatHeader
- The structures of the file format for “fat” architecture specific file (wrapper design).
At the begining of the file there is one
FatHeader
structure followed by a number ofFatArch
structures. - FvmLib
- Fixed virtual memory shared libraries are identified by two things.
- Lazy
Bind - A stream of BIND opcodes to bind all lazy symbols.
- Lazy
Bind Symbol - The mach lazy binding symbol information
- LcString
- A variable length string in a load command is represented by an
LcString
structure. - Link
Edit Data - The
LinkEditData
contains the offsets and sizes of a blob of data in the __LINKEDIT segment. - Mach
Command - Wrap load command with size in the Mach-O file
- Mach
Header - The mach header appears at the very beginning of the object file
- RanLib
- Structure of the __.SYMDEF table of contents for an archive.
- Rebase
- A stream of REBASE opcodes
- Rebase
OpCodes - An iterator over the
RebaseOpCode
of a rebase infomation block. - Rebase
Symbol - The rebase symbol information
- Section
- A segment is made up of zero or more sections.
- Section
Attributes - Constants for the section attributes part of the flags field of a section structure.
- Section
Flags - The flags field of a section structure is separated into two parts a section type and section attributes.
- Segment
Flags - Constants for the flags field of the segment_command
- Source
Version Tag - The packed version.
- Symbol
Iter Symbol
Iter- Version
Tag - The encoded version.
- Weak
Bind - A stream of BIND opcodes to bind all weak binding symbols.
- Weak
Bind Symbol - The mach weak binding symbol information
Enums§
- ARMThread
Flavors - Bind
OpCode OpCode
for the binding symbol- Bind
Symbol Type - Bind or rebase symbol type
- Build
Target - The min OS version on which this binary was built to run.
- Export
Kind - Export
Type - Load
Command - The load commands directly follow the mach header.
- Mach
Error - OFile
- The abstract file block, including mach-o file, fat/universal file, archive file and symdef block
- PPCThread
Flavors - Platform
- Rebase
OpCode OpCode
for the rebasing symbol- Symbol
- the link-edit 4.3BSD “stab” style symbol
- Thread
State - Tool
- X86Thread
Flavor
Constants§
- ARMAG
- AR_
EFMT1 - BIND_
IMMEDIATE_ MASK - BIND_
OPCODE_ ADD_ ADDR_ ULEB - BIND_
OPCODE_ DONE - BIND_
OPCODE_ DO_ BIND - BIND_
OPCODE_ DO_ BIND_ ADD_ ADDR_ IMM_ SCALED - BIND_
OPCODE_ DO_ BIND_ ADD_ ADDR_ ULEB - BIND_
OPCODE_ DO_ BIND_ ULEB_ TIMES_ SKIPPING_ ULEB - BIND_
OPCODE_ MASK - BIND_
OPCODE_ SET_ ADDEND_ SLEB - BIND_
OPCODE_ SET_ DYLIB_ ORDINAL_ IMM - BIND_
OPCODE_ SET_ DYLIB_ ORDINAL_ ULEB - BIND_
OPCODE_ SET_ DYLIB_ SPECIAL_ IMM - BIND_
OPCODE_ SET_ SEGMENT_ AND_ OFFSET_ ULEB - BIND_
OPCODE_ SET_ SYMBOL_ TRAILING_ FLAGS_ IMM - BIND_
OPCODE_ SET_ TYPE_ IMM - BIND_
SPECIAL_ DYLIB_ FLAT_ LOOKUP - BIND_
SPECIAL_ DYLIB_ MAIN_ EXECUTABLE - BIND_
SPECIAL_ DYLIB_ SELF - BIND_
SYMBOL_ FLAGS_ NON_ WEAK_ DEFINITION - BIND_
SYMBOL_ FLAGS_ WEAK_ IMPORT - BIND_
TYPE_ POINTER - BIND_
TYPE_ TEXT_ ABSOLUT E32 - BIND_
TYPE_ TEXT_ PCRE L32 - CPU_
ARCH_ ABI64 - 64 bit ABI
- CPU_
ARCH_ MASK - mask for architecture bits
- CPU_
SUBTYPE_ 386 - CPU_
SUBTYPE_ 486 - CPU_
SUBTYPE_ 586 - CPU_
SUBTYPE_ 486SX - CPU_
SUBTYPE_ ARM64_ ALL - CPU_
SUBTYPE_ ARM64_ E - CPU_
SUBTYPE_ ARM64_ V8 - CPU_
SUBTYPE_ ARM_ ALL - CPU_
SUBTYPE_ ARM_ V6 - CPU_
SUBTYPE_ ARM_ V7 - CPU_
SUBTYPE_ ARM_ V8 - CPU_
SUBTYPE_ ARM_ V4T - CPU_
SUBTYPE_ ARM_ V5TEJ - CPU_
SUBTYPE_ ARM_ V6M - CPU_
SUBTYPE_ ARM_ V7EM - CPU_
SUBTYPE_ ARM_ V7F - CPU_
SUBTYPE_ ARM_ V7K - CPU_
SUBTYPE_ ARM_ V7M - CPU_
SUBTYPE_ ARM_ V7S - CPU_
SUBTYPE_ ARM_ XSCALE - CPU_
SUBTYPE_ BIG_ ENDIAN - CPU_
SUBTYPE_ CELERON - CPU_
SUBTYPE_ CELERON_ MOBILE - CPU_
SUBTYPE_ HPPA_ 7100 - CPU_
SUBTYPE_ HPPA_ 7100LC - CPU_
SUBTYPE_ HPPA_ ALL - CPU_
SUBTYPE_ I386_ ALL - CPU_
SUBTYPE_ I860_ 860 - CPU_
SUBTYPE_ I860_ ALL - CPU_
SUBTYPE_ INTEL_ FAMILY_ MAX - CPU_
SUBTYPE_ INTEL_ MODEL_ ALL - CPU_
SUBTYPE_ ITANIUM - CPU_
SUBTYPE_ ITANIUM_ 2 - CPU_
SUBTYPE_ LIB64 - 64 bit libraries
- CPU_
SUBTYPE_ LITTLE_ ENDIAN - CPU_
SUBTYPE_ MASK - mask for feature flags
- CPU_
SUBTYPE_ MC680 X0_ ALL - CPU_
SUBTYPE_ MC68030 - CPU_
SUBTYPE_ MC68040 - CPU_
SUBTYPE_ MC88100 - CPU_
SUBTYPE_ MC88110 - CPU_
SUBTYPE_ MC98601 - CPU_
SUBTYPE_ MC68030_ ONLY - CPU_
SUBTYPE_ MC88000_ ALL - CPU_
SUBTYPE_ MC98000_ ALL - CPU_
SUBTYPE_ MIPS_ ALL - CPU_
SUBTYPE_ MIPS_ R2000 - CPU_
SUBTYPE_ MIPS_ R2300 - CPU_
SUBTYPE_ MIPS_ R2600 - CPU_
SUBTYPE_ MIPS_ R2800 - CPU_
SUBTYPE_ MIPS_ R3000 - CPU_
SUBTYPE_ MIPS_ R2000A - CPU_
SUBTYPE_ MIPS_ R3000A - CPU_
SUBTYPE_ MULTIPLE - CPU_
SUBTYPE_ PENT - CPU_
SUBTYPE_ PENTII_ M3 - CPU_
SUBTYPE_ PENTII_ M5 - CPU_
SUBTYPE_ PENTIUM_ 3 - CPU_
SUBTYPE_ PENTIUM_ 4 - CPU_
SUBTYPE_ PENTIUM_ 3_ M - CPU_
SUBTYPE_ PENTIUM_ 3_ XEON - CPU_
SUBTYPE_ PENTIUM_ 4_ M - CPU_
SUBTYPE_ PENTIUM_ M - CPU_
SUBTYPE_ PENTPRO - CPU_
SUBTYPE_ POWERPC_ 601 - CPU_
SUBTYPE_ POWERPC_ 602 - CPU_
SUBTYPE_ POWERPC_ 603 - CPU_
SUBTYPE_ POWERPC_ 604 - CPU_
SUBTYPE_ POWERPC_ 620 - CPU_
SUBTYPE_ POWERPC_ 750 - CPU_
SUBTYPE_ POWERPC_ 970 - CPU_
SUBTYPE_ POWERPC_ 603E - CPU_
SUBTYPE_ POWERPC_ 603EV - CPU_
SUBTYPE_ POWERPC_ 604E - CPU_
SUBTYPE_ POWERPC_ 7400 - CPU_
SUBTYPE_ POWERPC_ 7450 - CPU_
SUBTYPE_ POWERPC_ ALL - CPU_
SUBTYPE_ SPARC_ ALL - CPU_
SUBTYPE_ UVAXI - CPU_
SUBTYPE_ UVAXII - CPU_
SUBTYPE_ UVAXIII - CPU_
SUBTYPE_ VAX730 - CPU_
SUBTYPE_ VAX750 - CPU_
SUBTYPE_ VAX780 - CPU_
SUBTYPE_ VAX785 - CPU_
SUBTYPE_ VAX8200 - CPU_
SUBTYPE_ VAX8500 - CPU_
SUBTYPE_ VAX8600 - CPU_
SUBTYPE_ VAX8650 - CPU_
SUBTYPE_ VAX8800 - CPU_
SUBTYPE_ VAX_ ALL - CPU_
SUBTYPE_ X86_ 64_ ALL - CPU_
SUBTYPE_ X86_ 64_ H - CPU_
SUBTYPE_ X86_ ALL - CPU_
SUBTYPE_ X86_ ARCH1 - CPU_
SUBTYPE_ XEON - CPU_
SUBTYPE_ XEON_ MP - CPU_
TYPE_ ALPHA - CPU_
TYPE_ ANY - CPU_
TYPE_ ARM - CPU_
TYPE_ ARM64 - CPU_
TYPE_ HPPA - CPU_
TYPE_ I386 - CPU_
TYPE_ I860 - CPU_
TYPE_ MC680 X0 - CPU_
TYPE_ MC88000 - CPU_
TYPE_ MC98000 - CPU_
TYPE_ MIPS - CPU_
TYPE_ NS32032 - CPU_
TYPE_ NS32332 - CPU_
TYPE_ NS32532 - CPU_
TYPE_ POWERPC - CPU_
TYPE_ POWERP C64 - CPU_
TYPE_ ROMP - CPU_
TYPE_ RS6000 - CPU_
TYPE_ SPARC - CPU_
TYPE_ VAX - CPU_
TYPE_ X86 - CPU_
TYPE_ X86_ 64 - DICE_
KIND_ ABS_ JUMP_ TABL E32 - DICE_
KIND_ DATA - DICE_
KIND_ JUMP_ TABL E8 - DICE_
KIND_ JUMP_ TABL E16 - DICE_
KIND_ JUMP_ TABL E32 - DYNAMIC_
LOOKUP_ ORDINAL - EXECUTABLE_
ORDINAL - EXPORT_
SYMBOL_ FLAGS_ KIND_ ABSOLUTE - EXPORT_
SYMBOL_ FLAGS_ KIND_ MASK - EXPORT_
SYMBOL_ FLAGS_ KIND_ REGULAR - EXPORT_
SYMBOL_ FLAGS_ KIND_ THREAD_ LOCAL - FAT_
CIGAM - FAT_
CIGA M64 - FAT_
MAGIC - FAT_
MAGI C64 - INDIRECT_
SYMBOL_ ABS - INDIRECT_
SYMBOL_ LOCAL - LC_
BUILD_ VERSION - build for platform min OS version
- LC_
CODE_ SIGNATURE - local of code signature
- LC_
DATA_ IN_ CODE - table of non-instructions in __text
- LC_
DYLD_ CHAINED_ FIXUPS - LC_
DYLD_ ENVIRONMENT - string for dyld to treat like environment variable
- LC_
DYLD_ EXPORTS_ TRIE - LC_
DYLD_ INFO - compressed dyld information
- LC_
DYLD_ INFO_ ONLY - compressed dyld information only
- LC_
DYLIB_ CODE_ SIGN_ DRS - Code signing DRs copied from linked dylibs
- LC_
DYSYMTAB - dynamic link-edit symbol table info
- LC_
ENCRYPTION_ INFO - encrypted segment information
- LC_
ENCRYPTION_ INFO_ 64 - 64-bit encrypted segment information
- LC_
FUNCTION_ STARTS - compressed table of function start addresses
- LC_
FVMFILE - fixed VM file inclusion (internal use)
- LC_
IDENT - object identification info (obsolete)
- LC_
IDFVMLIB - fixed VM shared library identification
- LC_
ID_ DYLIB - dynamically linked shared lib ident
- LC_
ID_ DYLINKER - dynamic linker identification
- LC_
LAZY_ LOAD_ DYLIB - delay load of dylib until first use
- LC_
LINKER_ OPTIMIZATION_ HINT - optimization hints in
MH_OBJECT
files - LC_
LINKER_ OPTION - linker options in
MH_OBJECT
files - LC_
LOADFVMLIB - load a specified fixed VM shared library
- LC_
LOAD_ DYLIB - load a dynamically linked shared library
- LC_
LOAD_ DYLINKER - load a dynamic linker
- LC_
LOAD_ UPWARD_ DYLIB - load upward dylib
- LC_
LOAD_ WEAK_ DYLIB - LC_MAIN
- replacement for
LC_UNIXTHREAD
- LC_NOTE
- arbitrary data included within a Mach-O file
- LC_
PREBIND_ CKSUM - prebind checksum
- LC_
PREBOUND_ DYLIB - modules prebound for a dynamically
- LC_
PREPAGE - prepage command (internal use)
- LC_
REEXPORT_ DYLIB - load and re-export dylib
- LC_
REQ_ DYLD - LC_
ROUTINES - LC_
ROUTINES_ 64 - 64-bit image routines
- LC_
RPATH - runpath additions
- LC_
SEGMENT - LC_
SEGMENT_ 64 - 64-bit segment of this file to be mapped
- LC_
SEGMENT_ SPLIT_ INFO - local of info to split segments
- LC_
SOURCE_ VERSION - source version used to build binary
- LC_
SUB_ CLIENT - sub client
- LC_
SUB_ FRAMEWORK - sub framework
- LC_
SUB_ LIBRARY - sub library
- LC_
SUB_ UMBRELLA - sub umbrella
- LC_
SYMSEG - link-edit gdb symbol table info (obsolete)
- LC_
SYMTAB - link-edit stab symbol table info
- LC_
THREAD - thread
- LC_
TWOLEVEL_ HINTS - two-level namespace lookup hints
- LC_
UNIXTHREAD - unix thread (includes a stack)
- LC_UUID
- the uuid
- LC_
VERSION_ MIN_ IPHONEOS - build for
iPhoneOS
min OS version - LC_
VERSION_ MIN_ MACOSX - build for
MacOSX
min OS version - LC_
VERSION_ MIN_ TVOS - build for
AppleTV
min OS version - LC_
VERSION_ MIN_ WATCHOS - build for Watch min OS version
- MAX_
LIBRARY_ ORDINAL - MH_
ALLMODSBOUND - indicates that this binary binds to all two-level namespace modules of its dependent libraries.
only used when
MH_PREBINDABLE
andMH_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 - 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 NXSwapInt(MH_MAGIC)
- MH_
CIGAM_ 64 NXSwapInt(MH_MAGIC_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 - 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_
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 - the mach magic number
- MH_
MAGIC_ 64 - the 64-bit mach magic number
- 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
- N_
ALT_ ENTRY - The
N_ALT_ENTRY
bit of then_desc
field indicates that the symbol is pinned to the previous content. - N_
ARM_ THUMB_ DEF - The
N_ARM_THUMB_DEF
bit of then_desc
field indicates that the symbol is a defintion of a Thumb function. - N_AST
- AST file path:
name,,NO_SECT,0,0
- N_BCOMM
- begin common:
name,,NO_SECT,0,0
- N_BINCL
- include file beginning:
name,,NO_SECT,0,sum
- N_BNSYM
- begin nsect sym:
0,,n_sect,0,address
- N_
DESC_ DISCARDED - The
N_DESC_DISCARDED
bit of then_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. - N_ECOML
- end common (local name):
0,,n_sect,0,address
- N_ECOMM
- end common:
name,,n_sect,0,0
- N_EINCL
- include file end:
name,,NO_SECT,0,0
- N_ENSYM
- end nsect
sym: 0,,n_sect,0,address
- N_ENTRY
- alternate entry:
name,,n_sect,linenumber,address
- N_EXCL
- deleted include file:
name,,NO_SECT,0,sum
- N_FNAME
- procedure name (f77 kludge):
name,,NO_SECT,0,0
- N_FUN
- procedure:
name,,n_sect,linenumber,address
- N_GSYM
- global symbol:
name,,NO_SECT,type,0
- N_LBRAC
- left bracket:
0,,NO_SECT,nesting level,address
- N_LCSYM
- .lcomm symbol:
name,,n_sect,type,address
- N_LENG
- second stab entry with length information
- N_LSYM
- local sym:
name,,NO_SECT,type,offset
- N_
NO_ DEAD_ STRIP - The
N_NO_DEAD_STRIP
bit of then_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. - N_
OLEVEL - compiler -O level:
name,,NO_SECT,0,0
- N_OPT
- emitted with gcc2 compiled and in gcc source
- N_OSO
- object file name:
name,,0,0,st_mtime
- N_
PARAMS - compiler parameters:
name,,NO_SECT,0,0
- N_PC
- global pascal symbol:
name,,NO_SECT,subtype,line
- N_PSYM
- parameter:
name,,NO_SECT,type,offset
- N_RBRAC
- right bracket:
0,,NO_SECT,nesting level,address
- N_
REF_ TO_ WEAK - The
N_REF_TO_WEAK
bit of then_desc
field indicates to the dynamic linker that the undefined symbol should be resolved using flat namespace searching. - N_RSYM
- register sym:
name,,NO_SECT,type,register
- N_SLINE
- src line:
0,,n_sect,linenumber,address
- N_SO
- source file name:
name,,n_sect,0,address
- N_SOL
- #included file name:
name,,n_sect,0,address
- N_SSYM
- structure elt:
name,,NO_SECT,type,struct_offset
- N_STSYM
- static symbol:
name,,n_sect,type,address
- N_
SYMBOL_ RESOLVER - The
N_SYMBOL_RESOLVER
bit of then_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) - N_
VERSION - compiler version:
name,,NO_SECT,0,0
- N_
WEAK_ DEF - The
N_WEAK_DEF
bit of then_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. - N_
WEAK_ REF - The
N_WEAK_REF
bit of then_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. - PLATFORM_
BRIDGEOS - PLATFORM_
IOS - PLATFORM_
MACOS - PLATFORM_
TVOS - PLATFORM_
WATCHOS - REBASE_
IMMEDIATE_ MASK - REBASE_
OPCODE_ ADD_ ADDR_ IMM_ SCALED - REBASE_
OPCODE_ ADD_ ADDR_ ULEB - REBASE_
OPCODE_ DONE - REBASE_
OPCODE_ DO_ REBASE_ ADD_ ADDR_ ULEB - REBASE_
OPCODE_ DO_ REBASE_ IMM_ TIMES - REBASE_
OPCODE_ DO_ REBASE_ ULEB_ TIMES - REBASE_
OPCODE_ DO_ REBASE_ ULEB_ TIMES_ SKIPPING_ ULEB - REBASE_
OPCODE_ MASK - REBASE_
OPCODE_ SET_ SEGMENT_ AND_ OFFSET_ ULEB - REBASE_
OPCODE_ SET_ TYPE_ IMM - REBASE_
TYPE_ POINTER - REBASE_
TYPE_ TEXT_ ABSOLUT E32 - REBASE_
TYPE_ TEXT_ PCRE L32 - REFERENCED_
DYNAMICALLY - To simplify stripping of objects that use are used with the dynamic link editor, the static link editor marks the symbols defined an object that are referenced by a dynamicly bound object (dynamic shared libraries, bundles). With this marking strip knows not to strip these symbols.
- REFERENCE_
FLAG_ DEFINED - REFERENCE_
FLAG_ PRIVATE_ DEFINED - REFERENCE_
FLAG_ PRIVATE_ UNDEFINED_ LAZY - REFERENCE_
FLAG_ PRIVATE_ UNDEFINED_ NON_ LAZY - REFERENCE_
FLAG_ UNDEFINED_ LAZY - REFERENCE_
FLAG_ UNDEFINED_ NON_ LAZY - REFERENCE_
TYPE - To support the lazy binding of undefined symbols in the dynamic link-editor, the undefined symbols in the symbol table (the nlist structures) are marked with the indication if the undefined reference is a lazy reference or non-lazy reference. If both a non-lazy reference and a lazy reference is made to the same symbol the non-lazy reference takes precedence. A reference is lazy only when all references to that symbol are made through a symbol pointer in a lazy symbol pointer section.
- SECTION_
ATTRIBUTES - SECTION_
TYPE - SELF_
LIBRARY_ ORDINAL - SYMDEF
- SYMDEF_
SORTED - S_
4BYTE_ LITERALS - section with only 4 byte literals
- S_
8BYTE_ LITERALS - section with only 8 byte literals
- S_
16BYTE_ LITERALS - section with only 16 byte literals
- S_
COALESCED - section contains symbols that are to be coalesced
- S_
CSTRING_ LITERALS - section with only literal C strings
- S_
DTRACE_ DOF - section contains
DTrace
Object Format - S_
GB_ ZEROFILL - zero fill on demand section that can be larger than 4 gigabytes)
- S_
INTERPOSING - section with only pairs of function pointers for interposing
- S_
LAZY_ DYLIB_ SYMBOL_ POINTERS - section with only lazy symbol pointers to lazy loaded dylibs
- S_
LAZY_ SYMBOL_ POINTERS - section with only lazy symbol pointers
- S_
LITERAL_ POINTERS - section with only pointers to literals
- S_
MOD_ INIT_ FUNC_ POINTERS - section with only function pointers for initialization
- S_
MOD_ TERM_ FUNC_ POINTERS - section with only function pointers for termination
- S_
NON_ LAZY_ SYMBOL_ POINTERS - section with only non-lazy symbol pointers
- S_
REGULAR - regular section
- S_
SYMBOL_ STUBS - section with only symbol stubs, byte size of stub in the reserved2 field
- S_
THREAD_ LOCAL_ INIT_ FUNCTION_ POINTERS - functions to call to initialize TLV values
- S_
THREAD_ LOCAL_ REGULAR - template of initial values for TLVs
- S_
THREAD_ LOCAL_ VARIABLES - TLV descriptors
- S_
THREAD_ LOCAL_ VARIABLE_ POINTERS - pointers to TLV descriptors
- S_
THREAD_ LOCAL_ ZEROFILL - template of initial values for TLVs
- S_
ZEROFILL - zero fill on demand section
- TOOL_
CLANG - TOOL_LD
- TOOL_
SWIFT
Statics§
- SECT_
BSS - the real uninitialized data section no padding
- SECT_
COMMON - the section common symbols are allocated in by the link editor
- SECT_
DATA - the real initialized data section no padding, no bss overlap
- SECT_
FVMLIB_ INIT0 - the fvmlib initialization section
- SECT_
FVMLIB_ INIT1 - the section following the fvmlib initialization section
- SECT_
ICON_ HEADER - the icon headers
- SECT_
ICON_ TIFF - the icons in tiff format
- SECT_
OBJC_ MODULES - module information
- SECT_
OBJC_ REFS - string table
- SECT_
OBJC_ STRINGS - string table
- SECT_
OBJC_ SYMBOLS - symbol table
- SECT_
TEXT - the real text part of the text
- SEG_
DATA - the tradition UNIX data segment
- SEG_
ICON - the icon segment
- SEG_
IMPORT - the segment for the self (dyld) modifing code stubs that has read, write and execute permissions
- SEG_
LINKEDIT - the segment containing all structs created and maintained by the link editor.
Created with -seglinkedit option to ld(1) for
MH_EXECUTE
andFVMLIB
file types only - SEG_
OBJC - objective-C runtime segment
- SEG_
PAGEZERO - the pagezero segment which has no protections and catches NULL references for
MH_EXECUTE
files - SEG_
TEXT - the tradition UNIX text segment
- SEG_
UNIXSTACK - the unix stack segment
Traits§
- Checked
Slice - Cursor
Ext - Read
String Ext - Read a fixed size string
- Symbol
Reference - Reference type and flags of symbol