1*a9fa9459Szrj /* Mach-O support for BFD. 2*a9fa9459Szrj Copyright (C) 2011-2016 Free Software Foundation, Inc. 3*a9fa9459Szrj 4*a9fa9459Szrj This file is part of BFD, the Binary File Descriptor library. 5*a9fa9459Szrj 6*a9fa9459Szrj This program is free software; you can redistribute it and/or modify 7*a9fa9459Szrj it under the terms of the GNU General Public License as published by 8*a9fa9459Szrj the Free Software Foundation; either version 3 of the License, or 9*a9fa9459Szrj (at your option) any later version. 10*a9fa9459Szrj 11*a9fa9459Szrj This program is distributed in the hope that it will be useful, 12*a9fa9459Szrj but WITHOUT ANY WARRANTY; without even the implied warranty of 13*a9fa9459Szrj MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*a9fa9459Szrj GNU General Public License for more details. 15*a9fa9459Szrj 16*a9fa9459Szrj You should have received a copy of the GNU General Public License 17*a9fa9459Szrj along with this program; if not, write to the Free Software 18*a9fa9459Szrj Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 19*a9fa9459Szrj MA 02110-1301, USA. */ 20*a9fa9459Szrj 21*a9fa9459Szrj #ifndef _MACH_O_EXTERNAL_H 22*a9fa9459Szrj #define _MACH_O_EXTERNAL_H 23*a9fa9459Szrj 24*a9fa9459Szrj struct mach_o_header_external 25*a9fa9459Szrj { 26*a9fa9459Szrj unsigned char magic[4]; /* Magic number. */ 27*a9fa9459Szrj unsigned char cputype[4]; /* CPU that this object is for. */ 28*a9fa9459Szrj unsigned char cpusubtype[4]; /* CPU subtype. */ 29*a9fa9459Szrj unsigned char filetype[4]; /* Type of file. */ 30*a9fa9459Szrj unsigned char ncmds[4]; /* Number of load commands. */ 31*a9fa9459Szrj unsigned char sizeofcmds[4]; /* Total size of load commands. */ 32*a9fa9459Szrj unsigned char flags[4]; /* Flags. */ 33*a9fa9459Szrj unsigned char reserved[4]; /* Reserved (on 64-bit version only). */ 34*a9fa9459Szrj }; 35*a9fa9459Szrj 36*a9fa9459Szrj #define BFD_MACH_O_HEADER_SIZE 28 37*a9fa9459Szrj #define BFD_MACH_O_HEADER_64_SIZE 32 38*a9fa9459Szrj 39*a9fa9459Szrj /* 32-bit section header. */ 40*a9fa9459Szrj 41*a9fa9459Szrj struct mach_o_section_32_external 42*a9fa9459Szrj { 43*a9fa9459Szrj unsigned char sectname[16]; /* Section name. */ 44*a9fa9459Szrj unsigned char segname[16]; /* Segment that the section belongs to. */ 45*a9fa9459Szrj unsigned char addr[4]; /* Address of this section in memory. */ 46*a9fa9459Szrj unsigned char size[4]; /* Size in bytes of this section. */ 47*a9fa9459Szrj unsigned char offset[4]; /* File offset of this section. */ 48*a9fa9459Szrj unsigned char align[4]; /* log2 of this section's alignment. */ 49*a9fa9459Szrj unsigned char reloff[4]; /* File offset of this section's relocs. */ 50*a9fa9459Szrj unsigned char nreloc[4]; /* Number of relocs for this section. */ 51*a9fa9459Szrj unsigned char flags[4]; /* Section flags/attributes. */ 52*a9fa9459Szrj unsigned char reserved1[4]; 53*a9fa9459Szrj unsigned char reserved2[4]; 54*a9fa9459Szrj }; 55*a9fa9459Szrj #define BFD_MACH_O_SECTION_SIZE 68 56*a9fa9459Szrj 57*a9fa9459Szrj /* 64-bit section header. */ 58*a9fa9459Szrj 59*a9fa9459Szrj struct mach_o_section_64_external 60*a9fa9459Szrj { 61*a9fa9459Szrj unsigned char sectname[16]; /* Section name. */ 62*a9fa9459Szrj unsigned char segname[16]; /* Segment that the section belongs to. */ 63*a9fa9459Szrj unsigned char addr[8]; /* Address of this section in memory. */ 64*a9fa9459Szrj unsigned char size[8]; /* Size in bytes of this section. */ 65*a9fa9459Szrj unsigned char offset[4]; /* File offset of this section. */ 66*a9fa9459Szrj unsigned char align[4]; /* log2 of this section's alignment. */ 67*a9fa9459Szrj unsigned char reloff[4]; /* File offset of this section's relocs. */ 68*a9fa9459Szrj unsigned char nreloc[4]; /* Number of relocs for this section. */ 69*a9fa9459Szrj unsigned char flags[4]; /* Section flags/attributes. */ 70*a9fa9459Szrj unsigned char reserved1[4]; 71*a9fa9459Szrj unsigned char reserved2[4]; 72*a9fa9459Szrj unsigned char reserved3[4]; 73*a9fa9459Szrj }; 74*a9fa9459Szrj #define BFD_MACH_O_SECTION_64_SIZE 80 75*a9fa9459Szrj 76*a9fa9459Szrj struct mach_o_load_command_external 77*a9fa9459Szrj { 78*a9fa9459Szrj unsigned char cmd[4]; /* The type of load command. */ 79*a9fa9459Szrj unsigned char cmdsize[4]; /* Size in bytes of entire command. */ 80*a9fa9459Szrj }; 81*a9fa9459Szrj #define BFD_MACH_O_LC_SIZE 8 82*a9fa9459Szrj 83*a9fa9459Szrj struct mach_o_segment_command_32_external 84*a9fa9459Szrj { 85*a9fa9459Szrj unsigned char segname[16]; /* Name of this segment. */ 86*a9fa9459Szrj unsigned char vmaddr[4]; /* Virtual memory address of this segment. */ 87*a9fa9459Szrj unsigned char vmsize[4]; /* Size there, in bytes. */ 88*a9fa9459Szrj unsigned char fileoff[4]; /* Offset in bytes of the data to be mapped. */ 89*a9fa9459Szrj unsigned char filesize[4]; /* Size in bytes on disk. */ 90*a9fa9459Szrj unsigned char maxprot[4]; /* Maximum permitted vm protection. */ 91*a9fa9459Szrj unsigned char initprot[4]; /* Initial vm protection. */ 92*a9fa9459Szrj unsigned char nsects[4]; /* Number of sections in this segment. */ 93*a9fa9459Szrj unsigned char flags[4]; /* Flags that affect the loading. */ 94*a9fa9459Szrj }; 95*a9fa9459Szrj #define BFD_MACH_O_LC_SEGMENT_SIZE 56 /* Include the header. */ 96*a9fa9459Szrj 97*a9fa9459Szrj struct mach_o_segment_command_64_external 98*a9fa9459Szrj { 99*a9fa9459Szrj unsigned char segname[16]; /* Name of this segment. */ 100*a9fa9459Szrj unsigned char vmaddr[8]; /* Virtual memory address of this segment. */ 101*a9fa9459Szrj unsigned char vmsize[8]; /* Size there, in bytes. */ 102*a9fa9459Szrj unsigned char fileoff[8]; /* Offset in bytes of the data to be mapped. */ 103*a9fa9459Szrj unsigned char filesize[8]; /* Size in bytes on disk. */ 104*a9fa9459Szrj unsigned char maxprot[4]; /* Maximum permitted vm protection. */ 105*a9fa9459Szrj unsigned char initprot[4]; /* Initial vm protection. */ 106*a9fa9459Szrj unsigned char nsects[4]; /* Number of sections in this segment. */ 107*a9fa9459Szrj unsigned char flags[4]; /* Flags that affect the loading. */ 108*a9fa9459Szrj }; 109*a9fa9459Szrj #define BFD_MACH_O_LC_SEGMENT_64_SIZE 72 /* Include the header. */ 110*a9fa9459Szrj 111*a9fa9459Szrj struct mach_o_reloc_info_external 112*a9fa9459Szrj { 113*a9fa9459Szrj unsigned char r_address[4]; 114*a9fa9459Szrj unsigned char r_symbolnum[4]; 115*a9fa9459Szrj }; 116*a9fa9459Szrj #define BFD_MACH_O_RELENT_SIZE 8 117*a9fa9459Szrj 118*a9fa9459Szrj /* Relocations are based on 'address' being a section offset and an assumption 119*a9fa9459Szrj that sections are never more than 2^24-1 bytes in size. Relocation data 120*a9fa9459Szrj also carry information on type/size/PC-relative/extern and whether scattered 121*a9fa9459Szrj or not [stored in the MSB of the r_address]. */ 122*a9fa9459Szrj 123*a9fa9459Szrj #define BFD_MACH_O_SR_SCATTERED 0x80000000 124*a9fa9459Szrj 125*a9fa9459Szrj /* For a non-scattered reloc, the relocation info is found in r_symbolnum. 126*a9fa9459Szrj Bytes 1 to 3 contain the symbol number (0xffffff, in a non-scattered PAIR). 127*a9fa9459Szrj Byte 4 contains the relocation info - but with differing bit-positions 128*a9fa9459Szrj dependent on target endian-ness - as below. */ 129*a9fa9459Szrj 130*a9fa9459Szrj #define BFD_MACH_O_LE_PCREL 0x01 131*a9fa9459Szrj #define BFD_MACH_O_LE_LENGTH_SHIFT 1 132*a9fa9459Szrj #define BFD_MACH_O_LE_EXTERN 0x08 133*a9fa9459Szrj #define BFD_MACH_O_LE_TYPE_SHIFT 4 134*a9fa9459Szrj 135*a9fa9459Szrj #define BFD_MACH_O_BE_PCREL 0x80 136*a9fa9459Szrj #define BFD_MACH_O_BE_LENGTH_SHIFT 5 137*a9fa9459Szrj #define BFD_MACH_O_BE_EXTERN 0x10 138*a9fa9459Szrj #define BFD_MACH_O_BE_TYPE_SHIFT 0 139*a9fa9459Szrj 140*a9fa9459Szrj /* The field sizes are the same for both BE and LE. */ 141*a9fa9459Szrj #define BFD_MACH_O_LENGTH_MASK 0x03 142*a9fa9459Szrj #define BFD_MACH_O_TYPE_MASK 0x0f 143*a9fa9459Szrj 144*a9fa9459Szrj /* For a scattered reloc entry the info is contained in r_address. There 145*a9fa9459Szrj is no need to discriminate on target endian-ness, since the design was 146*a9fa9459Szrj arranged to produce the same layout on both. Scattered relocations are 147*a9fa9459Szrj only used for local items, therefore there is no 'extern' field. */ 148*a9fa9459Szrj 149*a9fa9459Szrj #define BFD_MACH_O_SR_PCREL 0x40000000 150*a9fa9459Szrj #define BFD_MACH_O_GET_SR_LENGTH(s) (((s) >> 28) & 0x3) 151*a9fa9459Szrj #define BFD_MACH_O_GET_SR_TYPE(s) (((s) >> 24) & 0x0f) 152*a9fa9459Szrj #define BFD_MACH_O_GET_SR_ADDRESS(s) ((s) & 0x00ffffff) 153*a9fa9459Szrj #define BFD_MACH_O_SET_SR_LENGTH(l) (((l) & 0x3) << 28) 154*a9fa9459Szrj #define BFD_MACH_O_SET_SR_TYPE(t) (((t) & 0xf) << 24) 155*a9fa9459Szrj #define BFD_MACH_O_SET_SR_ADDRESS(s) ((s) & 0x00ffffff) 156*a9fa9459Szrj 157*a9fa9459Szrj struct mach_o_symtab_command_external 158*a9fa9459Szrj { 159*a9fa9459Szrj unsigned char symoff[4]; /* File offset of the symbol table. */ 160*a9fa9459Szrj unsigned char nsyms[4]; /* Number of symbols. */ 161*a9fa9459Szrj unsigned char stroff[4]; /* File offset of the string table. */ 162*a9fa9459Szrj unsigned char strsize[4]; /* String table size. */ 163*a9fa9459Szrj }; 164*a9fa9459Szrj 165*a9fa9459Szrj struct mach_o_nlist_external 166*a9fa9459Szrj { 167*a9fa9459Szrj unsigned char n_strx[4]; 168*a9fa9459Szrj unsigned char n_type[1]; 169*a9fa9459Szrj unsigned char n_sect[1]; 170*a9fa9459Szrj unsigned char n_desc[2]; 171*a9fa9459Szrj unsigned char n_value[4]; 172*a9fa9459Szrj }; 173*a9fa9459Szrj #define BFD_MACH_O_NLIST_SIZE 12 174*a9fa9459Szrj 175*a9fa9459Szrj struct mach_o_nlist_64_external 176*a9fa9459Szrj { 177*a9fa9459Szrj unsigned char n_strx[4]; 178*a9fa9459Szrj unsigned char n_type[1]; 179*a9fa9459Szrj unsigned char n_sect[1]; 180*a9fa9459Szrj unsigned char n_desc[2]; 181*a9fa9459Szrj unsigned char n_value[8]; 182*a9fa9459Szrj }; 183*a9fa9459Szrj #define BFD_MACH_O_NLIST_64_SIZE 16 184*a9fa9459Szrj 185*a9fa9459Szrj struct mach_o_thread_command_external 186*a9fa9459Szrj { 187*a9fa9459Szrj unsigned char flavour[4]; 188*a9fa9459Szrj unsigned char count[4]; 189*a9fa9459Szrj }; 190*a9fa9459Szrj 191*a9fa9459Szrj /* For commands that just have a string or a path. */ 192*a9fa9459Szrj struct mach_o_str_command_external 193*a9fa9459Szrj { 194*a9fa9459Szrj unsigned char str[4]; 195*a9fa9459Szrj }; 196*a9fa9459Szrj 197*a9fa9459Szrj struct mach_o_dylib_command_external 198*a9fa9459Szrj { 199*a9fa9459Szrj unsigned char name[4]; 200*a9fa9459Szrj unsigned char timestamp[4]; 201*a9fa9459Szrj unsigned char current_version[4]; 202*a9fa9459Szrj unsigned char compatibility_version[4]; 203*a9fa9459Szrj }; 204*a9fa9459Szrj 205*a9fa9459Szrj struct mach_o_dysymtab_command_external 206*a9fa9459Szrj { 207*a9fa9459Szrj unsigned char ilocalsym[4]; /* Index of. */ 208*a9fa9459Szrj unsigned char nlocalsym[4]; /* Number of. */ 209*a9fa9459Szrj unsigned char iextdefsym[4]; 210*a9fa9459Szrj unsigned char nextdefsym[4]; 211*a9fa9459Szrj unsigned char iundefsym[4]; 212*a9fa9459Szrj unsigned char nundefsym[4]; 213*a9fa9459Szrj unsigned char tocoff[4]; 214*a9fa9459Szrj unsigned char ntoc[4]; 215*a9fa9459Szrj unsigned char modtaboff[4]; 216*a9fa9459Szrj unsigned char nmodtab[4]; 217*a9fa9459Szrj unsigned char extrefsymoff[4]; 218*a9fa9459Szrj unsigned char nextrefsyms[4]; 219*a9fa9459Szrj unsigned char indirectsymoff[4]; 220*a9fa9459Szrj unsigned char nindirectsyms[4]; 221*a9fa9459Szrj unsigned char extreloff[4]; 222*a9fa9459Szrj unsigned char nextrel[4]; 223*a9fa9459Szrj unsigned char locreloff[4]; 224*a9fa9459Szrj unsigned char nlocrel[4]; 225*a9fa9459Szrj }; 226*a9fa9459Szrj 227*a9fa9459Szrj struct mach_o_dylib_module_external 228*a9fa9459Szrj { 229*a9fa9459Szrj unsigned char module_name[4]; 230*a9fa9459Szrj unsigned char iextdefsym[4]; 231*a9fa9459Szrj unsigned char nextdefsym[4]; 232*a9fa9459Szrj unsigned char irefsym[4]; 233*a9fa9459Szrj unsigned char nrefsym[4]; 234*a9fa9459Szrj unsigned char ilocalsym[4]; 235*a9fa9459Szrj unsigned char nlocalsym[4]; 236*a9fa9459Szrj unsigned char iextrel[4]; 237*a9fa9459Szrj unsigned char nextrel[4]; 238*a9fa9459Szrj unsigned char iinit_iterm[4]; 239*a9fa9459Szrj unsigned char ninit_nterm[4]; 240*a9fa9459Szrj unsigned char objc_module_info_addr[4]; 241*a9fa9459Szrj unsigned char objc_module_info_size[4]; 242*a9fa9459Szrj }; 243*a9fa9459Szrj #define BFD_MACH_O_DYLIB_MODULE_SIZE 52 244*a9fa9459Szrj 245*a9fa9459Szrj struct mach_o_dylib_module_64_external 246*a9fa9459Szrj { 247*a9fa9459Szrj unsigned char module_name[4]; 248*a9fa9459Szrj unsigned char iextdefsym[4]; 249*a9fa9459Szrj unsigned char nextdefsym[4]; 250*a9fa9459Szrj unsigned char irefsym[4]; 251*a9fa9459Szrj unsigned char nrefsym[4]; 252*a9fa9459Szrj unsigned char ilocalsym[4]; 253*a9fa9459Szrj unsigned char nlocalsym[4]; 254*a9fa9459Szrj unsigned char iextrel[4]; 255*a9fa9459Szrj unsigned char nextrel[4]; 256*a9fa9459Szrj unsigned char iinit_iterm[4]; 257*a9fa9459Szrj unsigned char ninit_nterm[4]; 258*a9fa9459Szrj unsigned char objc_module_info_size[4]; 259*a9fa9459Szrj unsigned char objc_module_info_addr[8]; 260*a9fa9459Szrj }; 261*a9fa9459Szrj #define BFD_MACH_O_DYLIB_MODULE_64_SIZE 56 262*a9fa9459Szrj 263*a9fa9459Szrj struct mach_o_dylib_table_of_contents_external 264*a9fa9459Szrj { 265*a9fa9459Szrj unsigned char symbol_index[4]; 266*a9fa9459Szrj unsigned char module_index[4]; 267*a9fa9459Szrj }; 268*a9fa9459Szrj #define BFD_MACH_O_TABLE_OF_CONTENT_SIZE 8 269*a9fa9459Szrj 270*a9fa9459Szrj struct mach_o_linkedit_data_command_external 271*a9fa9459Szrj { 272*a9fa9459Szrj unsigned char dataoff[4]; 273*a9fa9459Szrj unsigned char datasize[4]; 274*a9fa9459Szrj }; 275*a9fa9459Szrj 276*a9fa9459Szrj struct mach_o_dyld_info_command_external 277*a9fa9459Szrj { 278*a9fa9459Szrj unsigned char rebase_off[4]; 279*a9fa9459Szrj unsigned char rebase_size[4]; 280*a9fa9459Szrj unsigned char bind_off[4]; 281*a9fa9459Szrj unsigned char bind_size[4]; 282*a9fa9459Szrj unsigned char weak_bind_off[4]; 283*a9fa9459Szrj unsigned char weak_bind_size[4]; 284*a9fa9459Szrj unsigned char lazy_bind_off[4]; 285*a9fa9459Szrj unsigned char lazy_bind_size[4]; 286*a9fa9459Szrj unsigned char export_off[4]; 287*a9fa9459Szrj unsigned char export_size[4]; 288*a9fa9459Szrj }; 289*a9fa9459Szrj 290*a9fa9459Szrj struct mach_o_prebound_dylib_command_external 291*a9fa9459Szrj { 292*a9fa9459Szrj unsigned char name[4]; 293*a9fa9459Szrj unsigned char nmodules[4]; 294*a9fa9459Szrj unsigned char linked_modules[4]; 295*a9fa9459Szrj }; 296*a9fa9459Szrj 297*a9fa9459Szrj struct mach_o_prebind_cksum_command_external 298*a9fa9459Szrj { 299*a9fa9459Szrj unsigned char cksum[4]; 300*a9fa9459Szrj }; 301*a9fa9459Szrj 302*a9fa9459Szrj struct mach_o_twolevel_hints_command_external 303*a9fa9459Szrj { 304*a9fa9459Szrj unsigned char offset[4]; 305*a9fa9459Szrj unsigned char nhints[4]; 306*a9fa9459Szrj }; 307*a9fa9459Szrj 308*a9fa9459Szrj struct mach_o_version_min_command_external 309*a9fa9459Szrj { 310*a9fa9459Szrj unsigned char version[4]; 311*a9fa9459Szrj unsigned char reserved[4]; 312*a9fa9459Szrj }; 313*a9fa9459Szrj 314*a9fa9459Szrj struct mach_o_encryption_info_command_external 315*a9fa9459Szrj { 316*a9fa9459Szrj unsigned char cryptoff[4]; /* File offset of the encrypted area. */ 317*a9fa9459Szrj unsigned char cryptsize[4]; /* Size of the encrypted area. */ 318*a9fa9459Szrj unsigned char cryptid[4]; /* Encryption method. */ 319*a9fa9459Szrj }; 320*a9fa9459Szrj 321*a9fa9459Szrj struct mach_o_encryption_info_64_command_external 322*a9fa9459Szrj { 323*a9fa9459Szrj unsigned char cryptoff[4]; /* File offset of the encrypted area. */ 324*a9fa9459Szrj unsigned char cryptsize[4]; /* Size of the encrypted area. */ 325*a9fa9459Szrj unsigned char cryptid[4]; /* Encryption method. */ 326*a9fa9459Szrj unsigned char pad[4]; /* Pad to make struct size a multiple of 8. */ 327*a9fa9459Szrj }; 328*a9fa9459Szrj 329*a9fa9459Szrj struct mach_o_fvmlib_command_external 330*a9fa9459Szrj { 331*a9fa9459Szrj unsigned char name[4]; /* Offset of the name. */ 332*a9fa9459Szrj unsigned char minor_version[4]; 333*a9fa9459Szrj unsigned char header_addr[4]; 334*a9fa9459Szrj }; 335*a9fa9459Szrj 336*a9fa9459Szrj struct mach_o_entry_point_command_external 337*a9fa9459Szrj { 338*a9fa9459Szrj unsigned char entryoff[8]; /* File offset of the entry point. */ 339*a9fa9459Szrj unsigned char stacksize[8]; /* Initial stack size, if no null. */ 340*a9fa9459Szrj }; 341*a9fa9459Szrj 342*a9fa9459Szrj struct mach_o_source_version_command_external 343*a9fa9459Szrj { 344*a9fa9459Szrj unsigned char version[8]; /* Version A.B.C.D.E, with 10 bits for B-E, 345*a9fa9459Szrj and 24 bits for A. */ 346*a9fa9459Szrj }; 347*a9fa9459Szrj 348*a9fa9459Szrj /* The LD_DATA_IN_CODE command use a linkedit_data_command that points to 349*a9fa9459Szrj a table of entries. */ 350*a9fa9459Szrj 351*a9fa9459Szrj struct mach_o_data_in_code_entry_external 352*a9fa9459Szrj { 353*a9fa9459Szrj unsigned char offset[4]; /* Offset from the mach_header. */ 354*a9fa9459Szrj unsigned char length[2]; /* Number of bytes. */ 355*a9fa9459Szrj unsigned char kind[2]; /* Kind. See BFD_MACH_O_DICE_ values. */ 356*a9fa9459Szrj }; 357*a9fa9459Szrj 358*a9fa9459Szrj struct mach_o_linker_option_command_external 359*a9fa9459Szrj { 360*a9fa9459Szrj unsigned char count[4]; /* Number of strings. */ 361*a9fa9459Szrj /* COUNT null terminated UTF-8 strings, with 0 at the end for padding. */ 362*a9fa9459Szrj }; 363*a9fa9459Szrj 364*a9fa9459Szrj struct mach_o_fat_header_external 365*a9fa9459Szrj { 366*a9fa9459Szrj unsigned char magic[4]; 367*a9fa9459Szrj unsigned char nfat_arch[4]; /* Number of components. */ 368*a9fa9459Szrj }; 369*a9fa9459Szrj 370*a9fa9459Szrj struct mach_o_fat_arch_external 371*a9fa9459Szrj { 372*a9fa9459Szrj unsigned char cputype[4]; 373*a9fa9459Szrj unsigned char cpusubtype[4]; 374*a9fa9459Szrj unsigned char offset[4]; /* File offset of the member. */ 375*a9fa9459Szrj unsigned char size[4]; /* Size of the member. */ 376*a9fa9459Szrj unsigned char align[4]; /* Power of 2. */ 377*a9fa9459Szrj }; 378*a9fa9459Szrj 379*a9fa9459Szrj struct mach_o_dyld_cache_header_external 380*a9fa9459Szrj { 381*a9fa9459Szrj unsigned char magic[16]; 382*a9fa9459Szrj 383*a9fa9459Szrj unsigned char mapping_offset[4]; 384*a9fa9459Szrj unsigned char mapping_count[4]; 385*a9fa9459Szrj unsigned char images_offset[4]; 386*a9fa9459Szrj unsigned char images_count[4]; 387*a9fa9459Szrj 388*a9fa9459Szrj unsigned char dyld_base_address[8]; 389*a9fa9459Szrj 390*a9fa9459Szrj unsigned char code_signature_offset[8]; 391*a9fa9459Szrj unsigned char code_signature_size[8]; 392*a9fa9459Szrj 393*a9fa9459Szrj unsigned char slide_info_offset[8]; 394*a9fa9459Szrj unsigned char slide_info_size[8]; 395*a9fa9459Szrj 396*a9fa9459Szrj unsigned char local_symbols_offset[8]; 397*a9fa9459Szrj unsigned char local_symbols_size[8]; 398*a9fa9459Szrj }; 399*a9fa9459Szrj 400*a9fa9459Szrj struct mach_o_dyld_cache_mapping_info_external 401*a9fa9459Szrj { 402*a9fa9459Szrj unsigned char address[8]; 403*a9fa9459Szrj unsigned char size[8]; 404*a9fa9459Szrj unsigned char file_offset[8]; 405*a9fa9459Szrj unsigned char max_prot[4]; 406*a9fa9459Szrj unsigned char init_prot[4]; 407*a9fa9459Szrj }; 408*a9fa9459Szrj 409*a9fa9459Szrj struct mach_o_dyld_cache_image_info_external 410*a9fa9459Szrj { 411*a9fa9459Szrj unsigned char address[8]; 412*a9fa9459Szrj unsigned char mtime[8]; 413*a9fa9459Szrj unsigned char inode[8]; 414*a9fa9459Szrj unsigned char path_file_offset[4]; 415*a9fa9459Szrj unsigned char pad[4]; 416*a9fa9459Szrj }; 417*a9fa9459Szrj 418*a9fa9459Szrj 419*a9fa9459Szrj #endif /* _MACH_O_EXTERNAL_H */ 420