-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Parser for Mach-O object format. -- -- Parser for Mach-O object format. @package macho @version 0.2 -- | Data.Macho is a module for parsing a ByteString of a Mach-O file into -- a Macho record. module Data.Macho -- | Parse a ByteString of a Mach-O object into a Macho record. parseMacho :: ByteString -> Macho data Macho Macho :: MachoHeader -> [LC_COMMAND] -> Macho -- | Header information. m_header :: Macho -> MachoHeader -- | List of load commands describing Mach-O contents. m_commands :: Macho -> [LC_COMMAND] data MachoHeader MachoHeader :: CPU_TYPE -> CPU_SUBTYPE -> MH_FILETYPE -> [MH_FLAGS] -> MachoHeader -- | CPU family the Mach-O executes on. mh_cputype :: MachoHeader -> CPU_TYPE -- | Specific CPU type the Mach-O executes on. mh_cpusubtype :: MachoHeader -> CPU_SUBTYPE -- | Type of Mach-o file. mh_filetype :: MachoHeader -> MH_FILETYPE -- | Flags. mh_flags :: MachoHeader -> [MH_FLAGS] data LC_COMMAND -- | segment of this file to be mapped LC_SEGMENT :: MachoSegment -> LC_COMMAND -- | static link-edit symbol table and stab info LC_SYMTAB :: [MachoSymbol] -> ByteString -> LC_COMMAND -- | thread state information (list of (flavor, [long]) pairs) LC_THREAD :: [(Word32, [Word32])] -> LC_COMMAND -- | unix thread state information (includes a stack) (list of (flavor, -- [long] pairs) LC_UNIXTHREAD :: [(Word32, [Word32])] -> LC_COMMAND -- | dynamic link-edit symbol table info LC_DYSYMTAB :: MachoDynamicSymbolTable -> LC_COMMAND -- | load a dynamically linked shared library (name, timestamp, current -- version, compatibility version) LC_LOAD_DYLIB :: String -> Word32 -> Word32 -> Word32 -> LC_COMMAND -- | dynamically linked shared lib ident (name, timestamp, current version, -- compatibility version) LC_ID_DYLIB :: String -> Word32 -> Word32 -> Word32 -> LC_COMMAND -- | load a dynamic linker (name of dynamic linker) LC_LOAD_DYLINKER :: String -> LC_COMMAND -- | dynamic linker identification (name of dynamic linker) LC_ID_DYLINKER :: String -> LC_COMMAND -- | modules prebound for a dynamically linked shared library (name, list -- of module indices) LC_PREBOUND_DYLIB :: String -> [Word8] -> LC_COMMAND -- | image routines (virtual address of initialization routine, module -- index where it resides) LC_ROUTINES :: Word32 -> Word32 -> LC_COMMAND -- | sub framework (name) LC_SUB_FRAMEWORK :: String -> LC_COMMAND -- | sub umbrella (name) LC_SUB_UMBRELLA :: String -> LC_COMMAND -- | sub client (name) LC_SUB_CLIENT :: String -> LC_COMMAND -- | sub library (name) LC_SUB_LIBRARY :: String -> LC_COMMAND -- | two-level namespace lookup hints (list of (subimage index, symbol -- table index) pairs LC_TWOLEVEL_HINTS :: [(Word32, Word32)] -> LC_COMMAND -- | prebind checksum (checksum) LC_PREBIND_CKSUM :: Word32 -> LC_COMMAND -- | load a dynamically linked shared library that is allowed to be missing -- (symbols are weak imported) (name, timestamp, current version, -- compatibility version) LC_LOAD_WEAK_DYLIB :: String -> Word32 -> Word32 -> Word32 -> LC_COMMAND -- | 64-bit segment of this file to mapped LC_SEGMENT_64 :: MachoSegment -> LC_COMMAND -- | 64-bit image routines (virtual address of initialization routine, -- module index where it resides) LC_ROUTINES_64 :: Word64 -> Word64 -> LC_COMMAND -- | the uuid for an image or its corresponding dsym file (8 element list -- of bytes) LC_UUID :: [Word8] -> LC_COMMAND -- | runpath additions (path) LC_RPATH :: String -> LC_COMMAND -- | local of code signature LC_CODE_SIGNATURE :: Word32 -> Word32 -> LC_COMMAND -- | local of info to split segments LC_SEGMENT_SPLIT_INFO :: Word32 -> Word32 -> LC_COMMAND data CPU_TYPE CPU_TYPE_X86 :: CPU_TYPE CPU_TYPE_X86_64 :: CPU_TYPE CPU_TYPE_ARM :: CPU_TYPE CPU_TYPE_POWERPC :: CPU_TYPE CPU_TYPE_POWERPC64 :: CPU_TYPE data CPU_SUBTYPE CPU_SUBTYPE_INTEL :: CPU_SUBTYPE CPU_SUBTYPE_I386_ALL :: CPU_SUBTYPE CPU_SUBTYPE_386 :: CPU_SUBTYPE CPU_SUBTYPE_486 :: CPU_SUBTYPE CPU_SUBTYPE_486SX :: CPU_SUBTYPE CPU_SUBTYPE_PENT :: CPU_SUBTYPE CPU_SUBTYPE_PENTPRO :: CPU_SUBTYPE CPU_SUBTYPE_PENTII_M3 :: CPU_SUBTYPE CPU_SUBTYPE_PENTII_M5 :: CPU_SUBTYPE CPU_SUBTYPE_CELERON :: CPU_SUBTYPE CPU_SUBTYPE_CELERON_MOBILE :: CPU_SUBTYPE CPU_SUBTYPE_PENTIUM_3 :: CPU_SUBTYPE CPU_SUBTYPE_PENTIUM_3_M :: CPU_SUBTYPE CPU_SUBTYPE_PENTIUM_3_XEON :: CPU_SUBTYPE CPU_SUBTYPE_PENTIUM_M :: CPU_SUBTYPE CPU_SUBTYPE_PENTIUM_4 :: CPU_SUBTYPE CPU_SUBTYPE_PENTIUM_4_M :: CPU_SUBTYPE CPU_SUBTYPE_ITANIUM :: CPU_SUBTYPE CPU_SUBTYPE_ITANIUM_2 :: CPU_SUBTYPE CPU_SUBTYPE_XEON :: CPU_SUBTYPE CPU_SUBTYPE_XEON_MP :: CPU_SUBTYPE CPU_SUBTYPE_INTEL_FAMILY :: CPU_SUBTYPE CPU_SUBTYPE_INTEL_FAMILY_MAX :: CPU_SUBTYPE CPU_SUBTYPE_INTEL_MODEL :: CPU_SUBTYPE CPU_SUBTYPE_INTEL_MODEL_ALL :: CPU_SUBTYPE CPU_SUBTYPE_X86_ALL :: CPU_SUBTYPE CPU_SUBTYPE_X86_64_ALL :: CPU_SUBTYPE CPU_SUBTYPE_X86_ARCH1 :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_ALL :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_601 :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_602 :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_603 :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_603e :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_603ev :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_604 :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_604e :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_620 :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_750 :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_7400 :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_7450 :: CPU_SUBTYPE CPU_SUBTYPE_POWERPC_970 :: CPU_SUBTYPE CPU_SUBTYPE_ARM_ALL :: CPU_SUBTYPE CPU_SUBTYPE_ARM_V4T :: CPU_SUBTYPE CPU_SUBTYPE_ARM_V6 :: CPU_SUBTYPE data MH_FLAGS -- | the object file has no undefined references MH_NOUNDEFS :: MH_FLAGS -- | the object file is the output of an incremental link against a base -- file and can't be link edited again MH_INCRLINK :: MH_FLAGS -- | the object file is input for the dynamic linker and can't be staticly -- link edited again MH_DYLDLINK :: MH_FLAGS -- | the object file's undefined references are bound by the dynamic linker -- when loaded. MH_BINDATLOAD :: MH_FLAGS -- | the file has its dynamic undefined references prebound. MH_PREBOUND :: MH_FLAGS -- | the file has its read-only and read-write segments split MH_SPLIT_SEGS :: MH_FLAGS -- | the image is using two-level name space bindings MH_TWOLEVEL :: MH_FLAGS -- | the executable is forcing all images to use flat name space bindings MH_FORCE_FLAT :: MH_FLAGS -- | this umbrella guarantees no multiple defintions of symbols in its -- sub-images so the two-level namespace hints can always be used. MH_NOMULTIDEFS :: MH_FLAGS -- | do not have dyld notify the prebinding agent about this executable MH_NOFIXPREBINDING :: MH_FLAGS -- | the binary is not prebound but can have its prebinding redone. only -- used when MH_PREBOUND is not set. MH_PREBINDABLE :: MH_FLAGS -- | 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_ALLMODSBOUND :: MH_FLAGS -- | safe to divide up the sections into sub-sections via symbols for dead -- code stripping MH_SUBSECTIONS_VIA_SYMBOLS :: MH_FLAGS -- | the binary has been canonicalized via the unprebind operation MH_CANONICAL :: MH_FLAGS -- | the final linked image contains external weak symbols MH_WEAK_DEFINES :: MH_FLAGS -- | the final linked image uses weak symbols MH_BINDS_TO_WEAK :: MH_FLAGS -- | When this bit is set, all stacks in the task will be given stack -- execution privilege. Only used in MH_EXECUTE filetypes. MH_ALLOW_STACK_EXECUTION :: MH_FLAGS -- | When this bit is set, the binary declares it is safe for use in -- processes with uid zero MH_ROOT_SAFE :: MH_FLAGS -- | When this bit is set, the binary declares it is safe for use in -- processes when issetugid() is true MH_SETUID_SAFE :: MH_FLAGS -- | 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_NO_REEXPORTED_DYLIBS :: MH_FLAGS -- | When this bit is set, the OS will load the main executable at a random -- address. Only used in MH_EXECUTE filetypes. MH_PIE :: MH_FLAGS data VM_PROT -- | read permission VM_PROT_READ :: VM_PROT -- | write permission VM_PROT_WRITE :: VM_PROT -- | execute permission VM_PROT_EXECUTE :: VM_PROT data MachoSegment MachoSegment :: String -> Word64 -> Word64 -> Word64 -> Word64 -> [VM_PROT] -> [VM_PROT] -> [SG_FLAG] -> [MachoSection] -> MachoSegment -- | segment name seg_segname :: MachoSegment -> String -- | virtual address where the segment is loaded seg_vmaddr :: MachoSegment -> Word64 -- | size of segment at runtime seg_vmsize :: MachoSegment -> Word64 -- | file offset of the segment seg_fileoff :: MachoSegment -> Word64 -- | size of segment in file seg_filesize :: MachoSegment -> Word64 -- | maximum virtual memory protection seg_maxprot :: MachoSegment -> [VM_PROT] -- | initial virtual memory protection seg_initprot :: MachoSegment -> [VM_PROT] -- | segment flags seg_flags :: MachoSegment -> [SG_FLAG] -- | sections owned by this segment seg_sections :: MachoSegment -> [MachoSection] data SG_FLAG -- | 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). SG_HIGHVM :: SG_FLAG -- | This segment has nothing that was relocated in it and nothing -- relocated to it, that is it may be safely replaced without relocation. SG_NORELOC :: SG_FLAG data MachoSection MachoSection :: String -> String -> Word64 -> Word64 -> Int -> [Relocation] -> S_TYPE -> [S_USER_ATTR] -> [S_SYS_ATTR] -> MachoSection -- | name of section sec_sectname :: MachoSection -> String -- | name of segment that should own this section sec_segname :: MachoSection -> String -- | virtual memoy address for section sec_addr :: MachoSection -> Word64 -- | size of section sec_size :: MachoSection -> Word64 -- | alignment required by section (literal form, not power of two, e.g. 8 -- not 3) sec_align :: MachoSection -> Int -- | relocations for this section sec_relocs :: MachoSection -> [Relocation] -- | type of section sec_type :: MachoSection -> S_TYPE -- | user attributes of section sec_user_attrs :: MachoSection -> [S_USER_ATTR] -- | system attibutes of section sec_sys_attrs :: MachoSection -> [S_SYS_ATTR] data S_TYPE -- | regular section S_REGULAR :: S_TYPE -- | zero fill on demand section S_ZEROFILL :: S_TYPE -- | section with only literal C strings S_CSTRING_LITERALS :: S_TYPE -- | section with only 4 byte literals S_4BYTE_LITERALS :: S_TYPE -- | section with only 8 byte literals S_8BYTE_LITERALS :: S_TYPE -- | section with only pointers to literals S_LITERAL_POINTERS :: S_TYPE -- | section with only non-lazy symbol pointers S_NON_LAZY_SYMBOL_POINTERS :: S_TYPE -- | section with only lazy symbol pointers S_LAZY_SYMBOL_POINTERS :: S_TYPE -- | section with only symbol stubs, bte size of stub in the reserved2 -- field S_SYMBOL_STUBS :: S_TYPE -- | section with only function pointers for initialization S_MOD_INIT_FUNC_POINTERS :: S_TYPE -- | section with only function pointers for termination S_MOD_TERM_FUNC_POINTERS :: S_TYPE -- | section contains symbols that are to be coalesced S_COALESCED :: S_TYPE -- | zero fill on demand section (that can be larger than 4 gigabytes) S_GB_ZEROFILL :: S_TYPE -- | section with only pairs of function pointers for interposing S_INTERPOSING :: S_TYPE -- | section with only 16 byte literals S_16BYTE_LITERALS :: S_TYPE -- | section contains DTrace Object Format S_DTRACE_DOF :: S_TYPE -- | section with only lazy symbol pointers to lazy loaded dylibs S_LAZY_DYLIB_SYMBOL_POINTERS :: S_TYPE data S_USER_ATTR -- | section contains only true machine instructions S_ATTR_PURE_INSTRUCTIONS :: S_USER_ATTR -- | setion contains coalesced symbols that are not to be in a ranlib table -- of contents S_ATTR_NO_TOC :: S_USER_ATTR -- | ok to strip static symbols in this section in files with the -- MH_DYLDLINK flag S_ATTR_STRIP_STATIC_SYMS :: S_USER_ATTR -- | no dead stripping S_ATTR_NO_DEAD_STRIP :: S_USER_ATTR -- | blocks are live if they reference live blocks S_ATTR_LIVE_SUPPORT :: S_USER_ATTR -- | used with i386 code stubs written on by dyld S_ATTR_SELF_MODIFYING_CODE :: S_USER_ATTR -- | a debug section S_ATTR_DEBUG :: S_USER_ATTR data S_SYS_ATTR -- | section contains soem machine instructions S_ATTR_SOME_INSTRUCTIONS :: S_SYS_ATTR -- | section has external relocation entries S_ATTR_EXT_RELOC :: S_SYS_ATTR -- | section has local relocation entries S_ATTR_LOC_RELOC :: S_SYS_ATTR data N_TYPE -- | undefined symbol, n_sect is 0 N_UNDF :: N_TYPE -- | absolute symbol, does not need relocation, n_sect is 0 N_ABS :: N_TYPE -- | symbol is defined in section n_sect N_SECT :: N_TYPE -- | symbol is undefined and the image is using a prebound value for the -- symbol, n_sect is 0 N_PBUD :: N_TYPE -- | symbol is defined to be the same as another symbol. n_value is a -- string table offset indicating the name of that symbol N_INDR :: N_TYPE -- | stab global symbol: name,,0,type,0 N_GSYM :: N_TYPE -- | stab procedure name (f77 kludge): name,,0,0,0 N_FNAME :: N_TYPE -- | stab procedure: name,,n_sect,linenumber,address N_FUN :: N_TYPE -- | stab static symbol: name,,n_sect,type,address N_STSYM :: N_TYPE -- | stab .lcomm symbol: name,,n_sect,type,address N_LCSYM :: N_TYPE -- | stab begin nsect sym: 0,,n_sect,0,address N_BNSYM :: N_TYPE -- | stab emitted with gcc2_compiled and in gcc source N_OPT :: N_TYPE -- | stab register sym: name,,0,type,register N_RSYM :: N_TYPE -- | stab src line: 0,,n_sect,linenumber,address N_SLINE :: N_TYPE -- | stab end nsect sym: 0,,n_sect,0,address N_ENSYM :: N_TYPE -- | stab structure elt: name,,0,type,struct_offset N_SSYM :: N_TYPE -- | stab source file name: name,,n_sect,0,address N_SO :: N_TYPE -- | stab object file name: name,,0,0,st_mtime N_OSO :: N_TYPE -- | stab local sym: name,,0,type,offset N_LSYM :: N_TYPE -- | stab include file beginning: name,,0,0,sum N_BINCL :: N_TYPE -- | stab #included file name: name,,n_sect,0,address N_SOL :: N_TYPE -- | stab compiler parameters: name,,0,0,0 N_PARAMS :: N_TYPE -- | stab compiler version: name,,0,0,0 N_VERSION :: N_TYPE -- | stab compiler -O level: name,,0,0,0 N_OLEVEL :: N_TYPE -- | stab parameter: name,,0,type,offset N_PSYM :: N_TYPE -- | stab include file end: name,,0,0,0 N_EINCL :: N_TYPE -- | stab alternate entry: name,,n_sect,linenumber,address N_ENTRY :: N_TYPE -- | stab left bracket: 0,,0,nesting level,address N_LBRAC :: N_TYPE -- | stab deleted include file: name,,0,0,sum N_EXCL :: N_TYPE -- | stab right bracket: 0,,0,nesting level,address N_RBRAC :: N_TYPE -- | stab begin common: name,,0,0,0 N_BCOMM :: N_TYPE -- | stab end common: name,,n_sect,0,0 N_ECOMM :: N_TYPE -- | stab end common (local name): 0,,n_sect,0,address N_ECOML :: N_TYPE -- | stab second stab entry with length information N_LENG :: N_TYPE -- | stab global pascal symbol: name,,0,subtype,line N_PC :: N_TYPE data REFERENCE_FLAG -- | reference to an external non-lazy symbol REFERENCE_FLAG_UNDEFINED_NON_LAZY :: REFERENCE_FLAG -- | reference to an external lazy symbol REFERENCE_FLAG_UNDEFINED_LAZY :: REFERENCE_FLAG -- | symbol is defined in this module REFERENCE_FLAG_DEFINED :: REFERENCE_FLAG -- | symbol is defined in this module and visible only to modules within -- this shared library REFERENCE_FLAG_PRIVATE_DEFINED :: REFERENCE_FLAG -- | reference to an external non-lazy symbol and visible only to modules -- within this shared library REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY :: REFERENCE_FLAG -- | reference to an external lazy symbol and visible only to modules -- within this shared library REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY :: REFERENCE_FLAG -- | set for all symbols referenced by dynamic loader APIs REFERENCED_DYNAMICALLY :: REFERENCE_FLAG -- | indicates the symbol is a weak reference, set to 0 if definition -- cannot be found N_WEAK_REF :: REFERENCE_FLAG -- | indicates the symbol is a weak definition, will be overridden by a -- strong definition at link-time N_WEAK_DEF :: REFERENCE_FLAG -- | for two-level mach-o objects, specifies the index of the library in -- which this symbol is defined. zero specifies current image. LIBRARY_ORDINAL :: Word16 -> REFERENCE_FLAG data MachoSymbol MachoSymbol :: String -> N_TYPE -> Bool -> Bool -> Word8 -> Either Word16 [REFERENCE_FLAG] -> Word64 -> MachoSymbol -- | symbol name sym_name :: MachoSymbol -> String -- | symbol type sym_type :: MachoSymbol -> N_TYPE -- | true if limited global scope sym_pext :: MachoSymbol -> Bool -- | true if external symbol sym_ext :: MachoSymbol -> Bool -- | section index where the symbol can be found sym_sect :: MachoSymbol -> Word8 -- | for stab entries, Left Word16 is the uninterpreted flags field, -- otherwise Right [REFERENCE_FLAG] are the symbol flags sym_flags :: MachoSymbol -> Either Word16 [REFERENCE_FLAG] -- | symbol value, 32-bit symbol values are promoted to 64-bit for -- simpliciy sym_value :: MachoSymbol -> Word64 data DylibModule DylibModule :: Word32 -> (Word32, Word32) -> (Word32, Word32) -> (Word32, Word32) -> (Word32, Word32) -> (Word32, Word32) -> (Word32, Word32) -> Word32 -> Word64 -> DylibModule -- | module name string table offset dylib_module_name_offset :: DylibModule -> Word32 -- | (initial, count) pair of symbol table indices for externally defined -- symbols dylib_ext_def_sym :: DylibModule -> (Word32, Word32) -- | (initial, count) pair of symbol table indices for referenced symbols dylib_ref_sym :: DylibModule -> (Word32, Word32) -- | (initial, count) pair of symbol table indices for local symbols dylib_local_sym :: DylibModule -> (Word32, Word32) -- | (initial, count) pair of symbol table indices for externally -- referenced symbols dylib_ext_rel :: DylibModule -> (Word32, Word32) -- | (initial, count) pair of symbol table indices for the index of the -- module init section and the number of init pointers dylib_init :: DylibModule -> (Word32, Word32) -- | (initial, count) pair of symbol table indices for the index of the -- module term section and the number of term pointers dylib_term :: DylibModule -> (Word32, Word32) -- | statically linked address of the start of the data for this module in -- the __module_info section in the __OBJC segment dylib_objc_module_info_addr :: DylibModule -> Word32 -- | number of bytes of data for this module that are used in the -- __module_info section in the __OBJC segment dylib_objc_module_info_size :: DylibModule -> Word64 -- | Platform-specific relocation types. data R_TYPE GENERIC_RELOC_VANILLA :: R_TYPE GENERIC_RELOC_PAIR :: R_TYPE GENERIC_RELOC_SECTDIFF :: R_TYPE GENERIC_RELOC_LOCAL_SECTDIFF :: R_TYPE GENERIC_RELOC_PB_LA_PTR :: R_TYPE X86_64_RELOC_BRANCH :: R_TYPE X86_64_RELOC_GOT_LOAD :: R_TYPE X86_64_RELOC_GOT :: R_TYPE X86_64_RELOC_SIGNED :: R_TYPE X86_64_RELOC_UNSIGNED :: R_TYPE X86_64_RELOC_SUBTRACTOR :: R_TYPE X86_64_RELOC_SIGNED_1 :: R_TYPE X86_64_RELOC_SIGNED_2 :: R_TYPE X86_64_RELOC_SIGNED_4 :: R_TYPE PPC_RELOC_VANILLA :: R_TYPE PPC_RELOC_PAIR :: R_TYPE PPC_RELOC_BR14 :: R_TYPE PPC_RELOC_BR24 :: R_TYPE PPC_RELOC_HI16 :: R_TYPE PPC_RELOC_LO16 :: R_TYPE PPC_RELOC_HA16 :: R_TYPE PPC_RELOC_LO14 :: R_TYPE PPC_RELOC_SECTDIFF :: R_TYPE PPC_RELOC_LOCAL_SECTDIFF :: R_TYPE PPC_RELOC_PB_LA_PTR :: R_TYPE PPC_RELOC_HI16_SECTDIFF :: R_TYPE PPC_RELOC_LO16_SECTDIFF :: R_TYPE PPC_RELOC_HA16_SECTDIFF :: R_TYPE PPC_RELOC_JBSR :: R_TYPE PPC_RELOC_LO14_SECTDIFF :: R_TYPE data Relocation RelocationInfo :: Int32 -> Word32 -> Bool -> Word32 -> Bool -> R_TYPE -> Relocation -- | offset from start of section to place to be relocated ri_address :: Relocation -> Int32 -- | index into symbol or section table ri_symbolnum :: Relocation -> Word32 -- | indicates if the item to be relocated is part of an instruction -- containing PC-relative addressing ri_pcrel :: Relocation -> Bool -- | length of item containing address to be relocated (literal form (4) -- instead of power of two (2)) ri_length :: Relocation -> Word32 -- | indicates whether symbolnum is an index into the symbol table (True) -- or section table (False) ri_extern :: Relocation -> Bool -- | relocation type ri_type :: Relocation -> R_TYPE ScatteredRelocationInfo :: Bool -> Word32 -> R_TYPE -> Word32 -> Int32 -> Relocation -- | indicates if the item to be relocated is part of an instruction -- containing PC-relative addressing rs_pcrel :: Relocation -> Bool -- | length of item containing address to be relocated (literal form (4) -- instead of power of two (2)) rs_length :: Relocation -> Word32 -- | relocation type rs_type :: Relocation -> R_TYPE -- | offset from start of section to place to be relocated rs_address :: Relocation -> Word32 -- | address of the relocatable expression for the item in the file that -- needs to be updated if the address is changed rs_value :: Relocation -> Int32 data MachoDynamicSymbolTable MachoDynamicSymbolTable :: (Word32, Word32) -> (Word32, Word32) -> (Word32, Word32) -> [(Word32, Word32)] -> [DylibModule] -> [Word32] -> [Word32] -> [Relocation] -> [Relocation] -> MachoDynamicSymbolTable -- | symbol table index and count for local symbols localSyms :: MachoDynamicSymbolTable -> (Word32, Word32) -- | symbol table index and count for externally defined symbols extDefSyms :: MachoDynamicSymbolTable -> (Word32, Word32) -- | symbol table index and count for undefined symbols undefSyms :: MachoDynamicSymbolTable -> (Word32, Word32) -- | list of symbol index and module index pairs tocEntries :: MachoDynamicSymbolTable -> [(Word32, Word32)] -- | modules modules :: MachoDynamicSymbolTable -> [DylibModule] -- | list of external reference symbol indices extRefSyms :: MachoDynamicSymbolTable -> [Word32] -- | list of indirect symbol indices indirectSyms :: MachoDynamicSymbolTable -> [Word32] -- | external locations extRels :: MachoDynamicSymbolTable -> [Relocation] -- | local relocations locRels :: MachoDynamicSymbolTable -> [Relocation] data MH_FILETYPE -- | relocatable object file MH_OBJECT :: MH_FILETYPE -- | demand paged executable file MH_EXECUTE :: MH_FILETYPE -- | core file MH_CORE :: MH_FILETYPE -- | preloaded executable file MH_PRELOAD :: MH_FILETYPE -- | dynamically bound shared library MH_DYLIB :: MH_FILETYPE -- | dynamic link editor MH_DYLINKER :: MH_FILETYPE -- | dynamically bound bundle file MH_BUNDLE :: MH_FILETYPE -- | shared library stub for static. linking only, no section contents MH_DYLIB_STUB :: MH_FILETYPE -- | companion file with only debug. sections MH_DSYM :: MH_FILETYPE instance Show MachoDynamicSymbolTable instance Eq MachoDynamicSymbolTable instance Show Relocation instance Eq Relocation instance Show R_TYPE instance Eq R_TYPE instance Show DylibModule instance Eq DylibModule instance Show MachoSymbol instance Eq MachoSymbol instance Show REFERENCE_FLAG instance Eq REFERENCE_FLAG instance Show N_TYPE instance Eq N_TYPE instance Show S_SYS_ATTR instance Eq S_SYS_ATTR instance Show S_USER_ATTR instance Eq S_USER_ATTR instance Show S_TYPE instance Eq S_TYPE instance Show MachoSection instance Eq MachoSection instance Show SG_FLAG instance Eq SG_FLAG instance Show MachoSegment instance Eq MachoSegment instance Show VM_PROT instance Eq VM_PROT instance Show LC_COMMAND instance Eq LC_COMMAND instance Show MH_FLAGS instance Eq MH_FLAGS instance Show MH_FILETYPE instance Eq MH_FILETYPE instance Show Macho instance Eq Macho instance Show MachoHeader instance Eq MachoHeader instance Show CPU_SUBTYPE instance Eq CPU_SUBTYPE instance Show CPU_TYPE instance Eq CPU_TYPE