Index: unk/kLdr/kLdrModMACHO.h
===================================================================
--- /trunk/kLdr/kLdrModMACHO.h	(revision 2952)
+++ 	(revision )
@@ -1,626 +1,0 @@
-/* $Id $ */
-/** @file
- * Mach-0 structures, types and defines.
- */
-
-#ifndef __kLdrModMachO_h__
-#define __kLdrModMachO_h__
-
-
-#ifndef IMAGE_FAT_SIGNATURE
-/** The FAT signature (universal binaries). */
-# define IMAGE_FAT_SIGNATURE            UINT32_C(0xcafebabe)
-#endif
-#ifndef IMAGE_FAT_SIGNATURE_OE
-/** The FAT signature (universal binaries), other endian. */
-# define IMAGE_FAT_SIGNATURE_OE         UINT32_C(0xbebafeca)
-#endif
-
-/**
- * The fat header found at the start of universal binaries.
- * It is followed by \a nfat_arch numbers of \a fat_arch structures.
- */
-typedef struct fat_header
-{
-    uint32_t        magic;
-    uint32_t        nfat_arch;
-} fat_header_t;
-
-/**
- * Description of fat file item.
- */
-struct fat_arch
-{
-    int32_t         cputype;
-    int32_t         cpusubtype;
-    uint32_t        offset;
-    uint32_t        size;
-    uint32_t        align;          /**< Power of 2. */
-} fat_arch_t;
-
-
-
-#ifndef IMAGE_MACHO32_SIGNATURE
-/** The 32-bit Mach-O signature. */
-# define IMAGE_MACHO32_SIGNATURE        UINT32_C(0xfeedface)
-#endif
-#ifndef IMAGE_MACHO32_SIGNATURE_OE
-/** The 32-bit Mach-O signature, other endian. */
-# define IMAGE_MACHO32_SIGNATURE_OE     UINT32_C(0xcefaedfe)
-#endif
-#define MH_MAGIC    IMAGE_MACHO32_SIGNATURE
-#define MH_CIGAM    IMAGE_MACHO32_SIGNATURE_OE
-
-/**
- * 32-bit Mach-O header.
- * This is followed by \a ncmds number of load commands.
- * @see mach_header_64
- */
-typedef struct mach_header_32
-{
-    uint32_t        magic;
-    int32_t         cputype;
-    int32_t         cpusubtype;
-    uint32_t        filetype;
-    uint32_t        ncmds;
-    uint32_t        sizeofcmds;
-    uint32_t        flags;
-} mach_header_32_t;
-
-
-
-#ifndef IMAGE_MACHO64_SIGNATURE
-/** The 64-bit Mach-O signature. */
-# define IMAGE_MACHO64_SIGNATURE        UINT32_C(0xfeedfacf)
-#endif
-#ifndef IMAGE_MACHO64_SIGNATURE_OE
-/** The 64-bit Mach-O signature, other endian. */
-# define IMAGE_MACHO64_SIGNATURE_OE     UINT32_C(0xfefaedfe)
-#endif
-#define MH_MAGIC_64 IMAGE_MACHO64_SIGNATURE
-#define MH_CIGAM_64 IMAGE_MACHO64_SIGNATURE_OE
-
-/**
- * 64-bit Mach-O header.
- * This is followed by \a ncmds number of load commands.
- * @see mach_header
- */
-typedef struct mach_header_64
-{
-    uint32_t        magic;
-    int32_t         cputype;
-    int32_t         cpusubtype;
-    uint32_t        filetype;
-    uint32_t        ncmds;
-    uint32_t        sizeofcmds;
-    uint32_t        flags;
-    uint32_t        reserved;       /**< (for proper struct and command alignment I guess) */
-} mach_header_64_t;
-
-
-/** @name File types (mach_header_64::filetype, mach_header_32::filetype)
- * @{
- */
-#define MH_OBJECT           UINT32_C(1) /**< Object (relocatable). */
-#define MH_EXECUTE          UINT32_C(2) /**< Executable (demand paged). */
-#define MH_FVMLIB           UINT32_C(3) /**< Fixed VM shared library. */
-#define MH_CORE             UINT32_C(4) /**< Core file. */
-#define MH_PRELOAD          UINT32_C(5) /**< Preloaded executable. */
-#define MH_DYLIB            UINT32_C(6) /**< Dynamically bound shared library. */
-#define MH_DYLINKER         UINT32_C(7) /**< Dynamic linker. */
-#define MH_BUNDLE           UINT32_C(8) /**< Dymamically bound bundle. */
-#define MH_DYLIB_STUB       UINT32_C(9) /**< Shared library stub for static linking. */
-#define MH_DSYM             UINT32_C(10)/**< Debug symbols. */
-
-/** @} */
-
-
-/** @name Mach-O Header flags (mach_header_64::flags, mach_header_32::flags)
- * @{
- */
-#define MH_NOUNDEFS                 UINT32_C(0x00000001) /**< No undefined symbols. */
-#define MH_INCRLINK                 UINT32_C(0x00000002) /**< Partial increment link output. */
-#define MH_DYLDLINK                 UINT32_C(0x00000004) /**< Food for the dynamic linker, not for ld. */
-#define MH_BINDATLOAD               UINT32_C(0x00000008) /**< Bind all undefined symbols at load time. */
-#define MH_PREBOUND                 UINT32_C(0x00000010) /**< Contains prebound undefined symbols. */
-#define MH_SPLIT_SEGS               UINT32_C(0x00000020) /**< Read-only and read-write segments are split. */
-#define MH_LAZY_INIT                UINT32_C(0x00000040) /**< Obsolete flag for doing lazy init when data is written. */
-#define MH_TWOLEVEL                 UINT32_C(0x00000080) /**< Uses two-level name space bindings. */
-#define MH_FORCE_FLAT               UINT32_C(0x00000100) /**< Task: The executable forces all images to use flat name space bindings. */
-#define MH_NOMULTIDEFS              UINT32_C(0x00000200) /**< No multiple symbol definitions, safe to use two-level namespace hints. */
-#define MH_NOFIXPREBINDING          UINT32_C(0x00000400) /**< The dynamic linker should not notify the prebinding agent about this executable. */
-#define MH_PREBINDABLE              UINT32_C(0x00000800) /**< Not prebound, but it can be. Invalid if MH_PREBOUND is set. */
-#define MH_ALLMODSBOUND             UINT32_C(0x00001000) /**< Binds to all two-level namespace modules of preqs. Requires MH_PREBINDABLE and MH_TWOLEVEL to be set. */
-#define MH_SUBSECTIONS_VIA_SYMBOLS  UINT32_C(0x00002000) /**< Safe to divide sections into sub-sections via symbols for dead code stripping. */
-#define MH_CANONICAL                UINT32_C(0x00004000) /**< Canonicalized via unprebind. */
-#define MH_WEAK_DEFINES             UINT32_C(0x00008000) /**< The (finally) linked image has weak symbols. */
-#define MH_BINDS_TO_WEAK            UINT32_C(0x00010000) /**< The (finally) linked image uses weak symbols. */
-#define MH_ALLOW_STACK_EXECUTION    UINT32_C(0x00020000) /**< Task: allow stack execution. (MH_EXECUTE only) */
-#define MH_VALID_FLAGS              UINT32_C(0x0003ffff) /**< Mask containing the defined flags. */
-/** @} */
-
-
-/** @name CPU types / bits (mach_header_64::cputype, mach_header_32::cputype, fat_arch::cputype)
- * @{
- */
-#define CPU_ARCH_MASK               INT32_C(0xff000000)
-#define CPU_ARCH_ABI64              INT32_C(0x01000000)
-#define CPU_TYPE_ANY                INT32_C(-1)
-#define CPU_TYPE_VAX                INT32_C(1)
-#define CPU_TYPE_MC680x0            INT32_C(6)
-#define CPU_TYPE_X86                INT32_C(7)
-#define CPU_TYPE_I386               CPU_TYPE_X86
-#define CPU_TYPE_X86_64             (CPU_TYPE_X86 | CPU_ARCH_ABI64)
-#define CPU_TYPE_MC98000            INT32_C(10)
-#define CPU_TYPE_HPPA               INT32_C(11)
-#define CPU_TYPE_MC88000            INT32_C(13)
-#define CPU_TYPE_SPARC              INT32_C(14)
-#define CPU_TYPE_I860               INT32_C(15)
-#define CPU_TYPE_POWERPC            INT32_C(18)
-#define CPU_TYPE_POWERPC64          (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
-/** @} */
-
-
-/** @name CPU subtypes (mach_header_64::cpusubtype, mach_header_32::cpusubtype, fat_arch::cpusubtype)
- * @{ */
-#define CPU_SUBTYPE_MULTIPLE        INT32_C(-1)
-#define CPU_SUBTYPE_LITTLE_ENDIAN   INT32_C(0)  /**< figure this one out. */
-#define CPU_SUBTYPE_BIG_ENDIAN      INT32_C(1)  /**< ditto */
-
-/* VAX */
-#define CPU_SUBTYPE_VAX_ALL         INT32_C(0)
-#define CPU_SUBTYPE_VAX780          INT32_C(1)
-#define CPU_SUBTYPE_VAX785          INT32_C(2)
-#define CPU_SUBTYPE_VAX750          INT32_C(3)
-#define CPU_SUBTYPE_VAX730          INT32_C(4)
-#define CPU_SUBTYPE_UVAXI           INT32_C(5)
-#define CPU_SUBTYPE_UVAXII          INT32_C(6)
-#define CPU_SUBTYPE_VAX8200         INT32_C(7)
-#define CPU_SUBTYPE_VAX8500         INT32_C(8)
-#define CPU_SUBTYPE_VAX8600         INT32_C(9)
-#define CPU_SUBTYPE_VAX8650         INT32_C(10)
-#define CPU_SUBTYPE_VAX8800         INT32_C(11)
-#define CPU_SUBTYPE_UVAXIII         INT32_C(12)
-
-/* MC680xx */
-#define CPU_SUBTYPE_MC680x0_ALL     INT32_C(1)
-#define CPU_SUBTYPE_MC68030         INT32_C(1)
-#define CPU_SUBTYPE_MC68040         INT32_C(2)
-#define CPU_SUBTYPE_MC68030_ONLY    INT32_C(3)
-
-/* I386 */
-#define CPU_SUBTYPE_INTEL(fam, model)       ( (int32_t)(((model) << 4) | (fam)) )
-#define CPU_SUBTYPE_INTEL_FAMILY(subtype)   ( (subtype) & 0xf )
-#define CPU_SUBTYPE_INTEL_MODEL(subtype)    ( (subtype) >> 4 )
-#define CPU_SUBTYPE_INTEL_FAMILY_MAX        0xf
-#define CPU_SUBTYPE_INTEL_MODEL_ALL         0
-
-#define CPU_SUBTYPE_I386_ALL        CPU_SUBTYPE_INTEL(3, 0)
-#define CPU_SUBTYPE_386             CPU_SUBTYPE_INTEL(3, 0)
-#define CPU_SUBTYPE_486             CPU_SUBTYPE_INTEL(4, 0)
-#define CPU_SUBTYPE_486SX           CPU_SUBTYPE_INTEL(4, 8)
-#define CPU_SUBTYPE_586             CPU_SUBTYPE_INTEL(5, 0)
-#define CPU_SUBTYPE_PENT            CPU_SUBTYPE_INTEL(5, 0)
-#define CPU_SUBTYPE_PENTPRO         CPU_SUBTYPE_INTEL(6, 1)
-#define CPU_SUBTYPE_PENTII_M3       CPU_SUBTYPE_INTEL(6, 3)
-#define CPU_SUBTYPE_PENTII_M5       CPU_SUBTYPE_INTEL(6, 5)
-#define CPU_SUBTYPE_CELERON         CPU_SUBTYPE_INTEL(7, 6)
-#define CPU_SUBTYPE_CELERON_MOBILE  CPU_SUBTYPE_INTEL(7, 7)
-#define CPU_SUBTYPE_PENTIUM_3       CPU_SUBTYPE_INTEL(8, 0)
-#define CPU_SUBTYPE_PENTIUM_3_M     CPU_SUBTYPE_INTEL(8, 1)
-#define CPU_SUBTYPE_PENTIUM_3_XEON  CPU_SUBTYPE_INTEL(8, 2)
-#define CPU_SUBTYPE_PENTIUM_M       CPU_SUBTYPE_INTEL(9, 0)
-#define CPU_SUBTYPE_PENTIUM_4       CPU_SUBTYPE_INTEL(10, 0)
-#define CPU_SUBTYPE_PENTIUM_4_M     CPU_SUBTYPE_INTEL(10, 1)
-#define CPU_SUBTYPE_ITANIUM         CPU_SUBTYPE_INTEL(11, 0)
-#define CPU_SUBTYPE_ITANIUM_2       CPU_SUBTYPE_INTEL(11, 1)
-#define CPU_SUBTYPE_XEON            CPU_SUBTYPE_INTEL(12, 0)
-#define CPU_SUBTYPE_XEON_MP         CPU_SUBTYPE_INTEL(12, 1)
-
-/* X86 */
-#define CPU_SUBTYPE_X86_ALL         INT32_C(3) /* CPU_SUBTYPE_I386_ALL */
-#define CPU_SUBTYPE_X86_64_ALL      INT32_C(3) /* CPU_SUBTYPE_I386_ALL */
-#define CPU_SUBTYPE_X86_ARCH1       INT32_C(4) /* CPU_SUBTYPE_I486_ALL */
-
-/* MIPS */
-#define CPU_SUBTYPE_MIPS_ALL        INT32_C(0)
-#define CPU_SUBTYPE_MIPS_R2300      INT32_C(1)
-#define CPU_SUBTYPE_MIPS_R2600      INT32_C(2)
-#define CPU_SUBTYPE_MIPS_R2800      INT32_C(3)
-#define CPU_SUBTYPE_MIPS_R2000a     INT32_C(4)
-#define CPU_SUBTYPE_MIPS_R2000      INT32_C(5)
-#define CPU_SUBTYPE_MIPS_R3000a     INT32_C(6)
-#define CPU_SUBTYPE_MIPS_R3000      INT32_C(7)
-
-/* MC98000 (PowerPC) */
-#define CPU_SUBTYPE_MC98000_ALL     INT32_C(0)
-#define CPU_SUBTYPE_MC98601         INT32_C(1)
-
-/* HP-PA */
-#define CPU_SUBTYPE_HPPA_ALL        INT32_C(0)
-#define CPU_SUBTYPE_HPPA_7100       INT32_C(0)
-#define CPU_SUBTYPE_HPPA_7100LC     INT32_C(1)
-
-/* MC88000 */
-#define CPU_SUBTYPE_MC88000_ALL     INT32_C(0)
-#define CPU_SUBTYPE_MC88100         INT32_C(1)
-#define CPU_SUBTYPE_MC88110         INT32_C(2)
-
-/* SPARC */
-#define CPU_SUBTYPE_SPARC_ALL       INT32_C(0)
-
-/* I860 */
-#define CPU_SUBTYPE_I860_ALL        INT32_C(0)
-#define CPU_SUBTYPE_I860_860        INT32_C(1)
-
-/* PowerPC */
-#define CPU_SUBTYPE_POWERPC_ALL     INT32_C(0)
-#define CPU_SUBTYPE_POWERPC_601     INT32_C(1)
-#define CPU_SUBTYPE_POWERPC_602     INT32_C(2)
-#define CPU_SUBTYPE_POWERPC_603     INT32_C(3)
-#define CPU_SUBTYPE_POWERPC_603e    INT32_C(4)
-#define CPU_SUBTYPE_POWERPC_603ev   INT32_C(5)
-#define CPU_SUBTYPE_POWERPC_604     INT32_C(6)
-#define CPU_SUBTYPE_POWERPC_604e    INT32_C(7)
-#define CPU_SUBTYPE_POWERPC_620     INT32_C(8)
-#define CPU_SUBTYPE_POWERPC_750     INT32_C(9)
-#define CPU_SUBTYPE_POWERPC_7400    INT32_C(10)
-#define CPU_SUBTYPE_POWERPC_7450    INT32_C(11)
-#define CPU_SUBTYPE_POWERPC_Max     INT32_C(10)
-#define CPU_SUBTYPE_POWERPC_SCVger  INT32_C(11)
-#define CPU_SUBTYPE_POWERPC_970     INT32_C(100)
-
-/** @} */
-
-
-/**
- * The load command common core structure.
- *
- * After the Mach-O header follows an array of variable sized
- * load command which all has this header in common.
- */
-typedef struct load_command
-{
-    uint32_t        cmd;            /**< The load command id. */
-    uint32_t        cmdsize;        /**< The size of the command (including this header?). */
-} load_command_t;
-
-/** @name Load Command IDs (load_command::cmd)
- * @{
- */
-/** Flag that when set requires the dynamic linker to fail if it doesn't
- * grok the command. The dynamic linker will otherwise ignore commands it
- * doesn't understand. Introduced with Mac OS X 10.1. */
-#define LC_REQ_DYLD         UINT32_C(0x80000000)
-
-#define LC_SEGMENT_32       UINT32_C(0x01)  /**< Segment to be mapped (32-bit). See segment_command_32. */
-#define LC_SYMTAB           UINT32_C(0x02)  /**< 'stab' symbol table. See symtab_command. */
-#define LC_SYMSEG           UINT32_C(0x03)  /**< Obsoleted gdb symbol table. */
-#define LC_THREAD           UINT32_C(0x04)  /**< Thread. See thread_command. */
-#define LC_UNIXTHREAD       UINT32_C(0x05)  /**< Unix thread (includes stack and stuff). See thread_command. */
-#define LC_LOADFVMLIB       UINT32_C(0x06)  /**< Load a specified fixed VM shared library  (obsolete?). See fvmlib_command. */
-#define LC_IDFVMLIB         UINT32_C(0x07)  /**< Fixed VM shared library id (obsolete?). See fvmlib_command. */
-#define LC_IDENT            UINT32_C(0x08)  /**< Identification info (obsolete). See ident_command. */
-#define LC_FVMFILE          UINT32_C(0x09)  /**< Fixed VM file inclusion (internal). See fvmfile_command. */
-#define LC_PREPAGE          UINT32_C(0x0a)  /**< Prepage command (internal). See ?? */
-#define LC_DYSYMTAB         UINT32_C(0x0b)  /**< Symbol table for dynamic linking. See dysymtab_command. */
-#define LC_LOAD_DYLIB       UINT32_C(0x0c)  /**< Load a dynamically linked shared library. See dylib_command. */
-#define LC_ID_DYLIB         UINT32_C(0x0d)  /**< Dynamically linked share library ident. See dylib_command. */
-#define LC_LOAD_DYLINKER    UINT32_C(0x0e)  /**< Load a dynamical link editor. See dylinker_command. */
-#define LC_ID_DYLINKER      UINt32_C(0x0f)  /**< Dynamic link editor ident. See dylinker_command. */
-#define LC_PREBOUND_DYLIB   UINT32_C(0x10)  /**< Prebound modules for dynamically linking of a shared lib. See prebound_dylib_command. */
-#define LC_ROUTINES         UINT32_C(0x11)  /**< Image routines. See routines_command_32. */
-#define LC_SUB_FRAMEWORK    UINT32_C(0x12)  /**< Sub framework. See sub_framework_command. */
-#define LC_SUB_UMBRELLA     UINT32_C(0x13)  /**< Sub umbrella. See sub_umbrella_command. */
-#define LC_SUB_CLIENT       UINT32_C(0x14)  /**< Sub client. See sub_client_command. */
-#define LC_SUB_LIBRARY      UINT32_C(0x15)  /**< Sub library. See sub_library_command. */
-#define LC_TWOLEVEL_HINTS   UINT32_C(0x16)  /**< Two-level namespace lookup hints. See twolevel_hints_command. */
-#define LC_PREBIND_CKSUM    UINT32_C(0x17)  /**< Prebind checksum. See prebind_cksum_command. */
-#define LC_LOAD_WEAK_DYLIB (UINT32_C(0x18) | LC_REQ_DYLD) /**< Dylib that can be missing, all symbols weak. See dylib_command. */
-#define LC_SEGMENT_64       UINT32_C(0x19)  /**< segment to be mapped (64-bit). See segment_command_32. */
-#define LC_ROUTINES_64      UINT32_C(0x1a)  /**< Image routines (64-bit). See routines_command_32. */
-#define LC_UUID             UINT32_C(0x1b)  /**< The UUID of the object module. See uuid_command.  */
-/** @} */
-
-
-/**
- * Load Command String.
- */
-typedef struct lc_str
-{
-    /** Offset of the string relative to the load_command structure.
-     * The string is zero-terminated. the size of the load command
-     * is zero padded up to a multiple of 4 bytes. */
-    uint32_t        offset;
-} lc_str_t;
-
-
-/**
- * Segment load command (32-bit).
- */
-typedef struct segment_command_32
-{
-    uint32_t        cmd;            /**< LC_SEGMENT */
-    uint32_t        cmdsize;        /**< sizeof(self) + sections. */
-    char            segname[16];    /**< The segment name. */
-    uint32_t        vmaddr;         /**< Memory address of this segment. */
-    uint32_t        vmsize;         /**< Size of this segment. */
-    uint32_t        fileoff;        /**< The file location of the segment. */
-    uint32_t        filesize;       /**< The file size of the segment. */
-    uint32_t        maxprot;        /**< Maximum VM protection. */
-    uint32_t        initprot;       /**< Initial VM protection. */
-    uint32_t        nsects;         /**< Number of section desciptors following this structure. */
-    uint32_t        flags;          /**< Flags (SG_*). */
-} segment_command_32_t;
-
-
-/**
- * Segment load command (64-bit).
- * Same as segment_command_32 except 4 members has been blown up to 64-bit.
- */
-typedef struct segment_command_64
-{
-    uint32_t        cmd;            /**< LC_SEGMENT */
-    uint32_t        cmdsize;        /**< sizeof(self) + sections. */
-    char            segname[16];    /**< The segment name. */
-    uint64_t        vmaddr;         /**< Memory address of this segment. */
-    uint64_t        vmsize;         /**< Size of this segment. */
-    uint64_t        fileoff;        /**< The file location of the segment. */
-    uint64_t        filesize;       /**< The file size of the segment. */
-    uint32_t        maxprot;        /**< Maximum VM protection. */
-    uint32_t        initprot;       /**< Initial VM protection. */
-    uint32_t        nsects;         /**< Number of section desciptors following this structure. */
-    uint32_t        flags;          /**< Flags (SG_*). */
-} segment_command_64_t;
-
-/** @name Segment flags (segment_command_64::flags, segment_command_32::flags)
- * @{ */
-/** Map the file bits in the top end of the memory area for the segment
- * instead of the low end. Intended for stacks in core dumps.
- * The part of the segment memory not covered by file bits will be zeroed. */
-#define SG_HIGHVM           UINT32_C(0x00000001)
-/** This segment is the virtual memory allocated by a fixed VM library.
- * (Used for overlap checking in the linker.) */
-#define SG_FVMLIB           UINT32_C(0x00000002)
-/** No relocations for or symbols that's relocated to in this segment.
- * The segment can therefore safely be replaced. */
-#define SG_NORELOC          UINT32_C(0x00000004)
-/** The segment is protected.
- * The first page isn't protected if it starts at file offset 0
- * (so that the mach header and this load command can be easily mapped). */
-#define SG_PROTECTED_VERSION_1 UINT32_C(0x00000008)
-/** @} */
-
-
-/**
- * 32-bit section (part of a segment load command).
- */
-typedef struct section_32
-{
-    char            sectname[16];   /**< The section name. */
-    char            segname[16];    /**< The name of the segment this section goes into. */
-    uint32_t        addr;           /**< The memory address of this section. */
-    uint32_t        size;           /**< The size of this section. */
-    uint32_t        offset;         /**< The file offset of this section. */
-    uint32_t        align;          /**< The section alignment (**2). */
-    uint32_t        reloff;         /**< The file offset of the relocations. */
-    uint32_t        nreloc;         /**< The number of relocations. */
-    uint32_t        flags;          /**< The section flags; section type and attribs */
-    uint32_t        reserved1;      /**< Reserved / offset / index. */
-    uint32_t        reserved2;      /**< Reserved / count / sizeof. */
-} section_32_t;
-
-/**
- * 64-bit section (part of a segment load command).
- */
-typedef struct section_64
-{
-    char            sectname[16];   /**< The section name. */
-    char            segname[16];    /**< The name of the segment this section goes into. */
-    uint64_t        addr;           /**< The memory address of this section. */
-    uint64_t        size;           /**< The size of this section. */
-    uint32_t        offset;         /**< The file offset of this section. */
-    uint32_t        align;          /**< The section alignment (**2). */
-    uint32_t        reloff;         /**< The file offset of the relocations. */
-    uint32_t        nreloc;         /**< The number of relocations. */
-    uint32_t        flags;          /**< The section flags; section type and attribs */
-    uint32_t        reserved1;      /**< Reserved / offset / index. */
-    uint32_t        reserved2;      /**< Reserved / count / sizeof. */
-    uint32_t        reserved3;      /**< (Just) Reserved. */
-} section_64_t;
-
-/** @name Section flags (section_64::flags, section_32::flags)
- * @{
- */
-/** Section type mask. */
-#define SECTION_TYPE                UINT32_C(0x000000ff)
-/** Regular section. */
-#define S_REGULAR                   0x0
-/** Zero filled section. */
-#define S_ZEROFILL                  0x1
-/** C literals. */
-#define S_CSTRING_LITERALS          0x2
-/** 4 byte literals. */
-#define S_4BYTE_LITERALS            0x3
-/** 8 byte literals. */
-#define S_8BYTE_LITERALS            0x4
-/** Pointer to literals. */
-#define S_LITERAL_POINTERS          0x5
-/** Section containing non-lazy symbol pointers.
- * Reserved1 == start index in the indirect symbol table. */
-#define S_NON_LAZY_SYMBOL_POINTERS  0x6
-/** Section containing lazy symbol pointers.
- * Reserved1 == start index in the indirect symbol table. */
-#define S_LAZY_SYMBOL_POINTERS      0x7
-/** Section containing symbol stubs.
- * Reserved2 == stub size. */
-#define S_SYMBOL_STUBS              0x8
-/** Section containing function pointers for module initialization. . */
-#define S_MOD_INIT_FUNC_POINTERS    0x9
-/** Section containing function pointers for module termination. . */
-#define S_MOD_TERM_FUNC_POINTERS    0xa
-/** Section containing symbols that are to be coalesced. */
-#define S_COALESCED                 0xb
-/** Zero filled section that be larger than 4GB. */
-#define S_GB_ZEROFILL               0xc
-/** Section containing pairs of function pointers for interposing. */
-#define S_INTERPOSING               0xd
-/** 16 byte literals. */
-#define S_16BYTE_LITERALS           0xe
-
-/** Section attribute mask. */
-#define SECTION_ATTRIBUTES          UINT32_C(0xffffff00)
-
-/** User settable attribute mask. */
-#define SECTION_ATTRIBUTES_USR      UINT32_C(0xff000000)
-/** Pure instruction (code). */
-#define S_ATTR_PURE_INSTRUCTIONS    UINT32_C(0x80000000)
-/** ranlib, ignore my symbols... */
-#define S_ATTR_NO_TOC               UINT32_C(0x40000000)
-/** May strip static symbols when linking int a MH_DYLDLINK file. */
-#define S_ATTR_STRIP_STATIC_SYMS    UINT32_C(0x20000000)
-/** No dead stripping. */
-#define S_ATTR_NO_DEAD_STRIP        UINT32_C(0x10000000)
-/** Live support. */
-#define S_ATTR_LIVE_SUPPORT         UINT32_C(0x08000000)
-/** Contains self modifying code (generally i386 code stub for dyld). */
-#define S_ATTR_SELF_MODIFYING_CODE  UINT32_C(0x04000000)
-/** Debug info (DWARF usually). */
-#define S_ATTR_DEBUG                UINT32_C(0x02000000)
-
-/** System settable attribute mask. */
-#define SECTION_ATTRIBUTES_SYS      UINT32_C(0x00ffff00)
-/** Contains some instructions (code). */
-#define S_ATTR_SOME_INSTRUCTIONS    UINT32_C(0x00000400)
-/** Has external relocations. */
-#define S_ATTR_EXT_RELOC            UINT32_C(0x00000200)
-/** Has internal (local) relocations. */
-#define S_ATTR_LOC_RELOC            UINT32_C(0x00000100)
-/** @} */
-
-/** @name Known Segment and Section Names.
- * Some of these implies special linker behaviour.
- * @{
- */
-/** Page zero - not-present page for catching invalid access. (MH_EXECUTE typically) */
-#define SEG_PAGEZERO        "__PAGEZERO"
-/** Traditional UNIX text segment.
- * Defaults to R-X. */
-#define SEG_TEXT            "__TEXT"
-/** The text part of SEG_TEXT. */
-#define SECT_TEXT               "__text"
-/** The fvmlib initialization. */
-#define SECT_FVMLIB_INIT0       "__fvmlib_init0"
-/** The section following the fvmlib initialization. */
-#define SECT_FVMLIB_INIT1       "__fvmlib_init1"
-/** The traditional UNIX data segment. (DGROUP to DOS and OS/2 people.) */
-#define SEG_DATA            "__DATA"
-/** The initialized data section. */
-#define SECT_DATA               "__data"
-/** The uninitialized data section. */
-#define SECT_BSS                "__bss"
-/** The common symbol section. */
-#define SECT_COMMON             "__common"
-/** Objective-C runtime segment. */
-#define SEG_OBJC            "__OBJC"
-/** Objective-C symbol table section. */
-#define SECT_OBJC_SYMBOLS       "__symbol_table"
-/** Objective-C module information section. */
-#define SECT_OBJC_MODULES       "__module_info"
-/** Objective-C string table section. */
-#define SECT_OBJC_STRINGS       "__selector_strs"
-/** Objective-C string table section. */
-#define SECT_OBJC_REFS          "__selector_refs"
-/** Icon segment. */
-#define SEG_ICON            "__ICON"
-/** The icon headers. */
-#define SECT_ICON_HEADER        "__header"
-/** The icons in the TIFF format. */
-#define SECT_ICON_TIFF          "__tiff"
-/** ld -seglinkedit segment containing all the structs create and maintained
- * by the linker. MH_EXECUTE and MH_FVMLIB only. */
-#define SEG_LINKEDIT        "__LINKEDIT"
-/** The unix stack segment. */
-#define SEG_UNIXSTACK       "__UNIXSTACK"
-/** The segment for the self modifying code for dynamic linking.
- * Implies RWX permissions. */
-#define SEG_IMPORT          "__IMPORT"
-/** @} */
-
-
-/** @todo fvmlib */
-/** @todo fvmlib_command (LC_IDFVMLIB or LC_LOADFVMLIB) */
-/** @todo dylib */
-/** @todo dylib_command (LC_ID_DYLIB, LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB) */
-/** @todo sub_framework_command (LC_SUB_FRAMEWORK) */
-/** @todo sub_client_command (LC_SUB_CLIENT) */
-/** @todo sub_umbrella_command (LC_SUB_UMBRELLA) */
-/** @todo sub_library_command (LC_SUB_LIBRARY) */
-/** @todo prebound_dylib_command (LC_PREBOUND_DYLIB) */
-/** @todo dylinker_command (LC_ID_DYLINKER or LC_LOAD_DYLINKER) */
-
-
-/**
- * Thread command.
- *
- * State description of a thread that is to be created. The description
- * is made up of a number of state structures preceded by a 32-bit flavor
- * and 32-bit count field stating the kind of stat structure and it's size
- * in uint32_t items respecitvly.
- *
- * LC_UNIXTHREAD differs from LC_THREAD in that it implies stack creation
- * and that it's started with the typical main(int, char **, char **) frame
- * on the stack.
- */
-typedef struct thread_command
-{
-    uint32_t        cmd;        /**< LC_UNIXTHREAD or LC_THREAD. */
-    uint32_t        cmdsize;    /**< The size of the command (including this header). */
-} thread_command_t;
-
-
-/** @todo routines_command (LC_ROUTINES) */
-/** @todo routines_command_64 (LC_ROUTINES_64) */
-
-
-/**
- * Symbol table command.
- * Contains a.out style symbol table with some tricks.
- */
-typedef struct symtab_command
-{
-    uint32_t        cmd;        /**< LC_SYMTAB */
-    uint32_t        cmdsize;    /** sizeof(symtab_command_t) */
-    uint32_t        symoff;     /** The file offset of the symbol table. */
-    uint32_t        nsyms;      /** The number of symbols in the symbol table. */
-    uint32_t        stroff;     /** The file offset of the string table. */
-    uint32_t        strsize;    /** The size of the string table. */
-} symtab_command_t;
-
-
-/** @todo dysymtab_command (LC_DYSYMTAB)  */
-/** @todo dylib_table_of_contents */
-/** @todo dylib_module_32 */
-/** @todo dylib_module_64 */
-/** @todo dylib_reference */
-/** @todo twolevel_hints_command (LC_TWOLEVEL_HINTS) */
-/** @todo twolevel_hint */
-/** @todo prebind_cksum_command (LC_PREBIND_CKSUM) */
-
-
-/**
- * UUID generated by ld.
- */
-typedef struct uuid_command
-{
-    uint32_t        cmd;        /**< LC_UUID */
-    uint32_t        cmdsize;    /**< sizeof(uuid_command_t) */
-    uint8_t         uuid[16];   /** The UUID bytes. */
-} uuid_command_t;
-
-
-/** @todo symseg_command (LC_SYMSEG) */
-/** @todo ident_command (LC_IDENT)
-/** @todo fvmfile_command (LC_FVMFILE) */
-#endif
-
