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