Blob


1 /*
2 * Copyright (c) 1999-2010 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
25 #ifndef __MACH_H
26 #define __MACH_H
28 #define MH_OBJECT 0x1
29 #define MH_EXECUTE 0x2
30 #define MH_FVMLIB 0x3
31 #define MH_CORE 0x4
32 #define MH_PRELOAD 0x5
33 #define MH_DYLIB 0x6
34 #define MH_DYLINKER 0x7
35 #define MH_BUNDLE 0x8
36 #define MH_DYLIB_STUB 0x9
37 #define MH_NOUNDEFS 0x1
38 #define MH_INCRLINK 0x2
39 #define MH_DYLDLINK 0x4
40 #define MH_BINDATLOAD 0x8
41 #define MH_PREBOUND 0x10
42 #define MH_SPLIT_SEGS 0x20
43 #define MH_LAZY_INIT 0x40
44 #define MH_TWOLEVEL 0x80
45 #define MH_FORCE_FLAT 0x100
46 #define MH_NOMULTIDEFS 0x200
47 #define MH_NOFIXPREBINDING 0x400
48 #define MH_PREBINDABLE 0x800
49 #define MH_ALLMODSBOUND 0x1000
50 #define MH_SUBSECTIONS_VIA_SYMBOLS 0x2000
51 #define MH_CANONICAL 0x4000
52 #define MH_WEAK_DEFINES 0x8000
53 #define MH_BINDS_TO_WEAK 0x10000
54 #define MH_ALLOW_STACK_EXECUTION 0x20000
56 #define LC_REQ_DYLD 0x80000000
58 #define LC_SEGMENT 0x1
59 #define LC_SYMTAB 0x2
60 #define LC_SYMSEG 0x3
61 #define LC_THREAD 0x4
62 #define LC_UNIXTHREAD 0x5
63 #define LC_LOADFVMLIB 0x6
64 #define LC_IDFVMLIB 0x7
65 #define LC_IDENT 0x8
66 #define LC_FVMFILE 0x9
67 #define LC_PREPAGE 0xa
68 #define LC_DYSYMTAB 0xb
69 #define LC_LOAD_DYLIB 0xc
70 #define LC_ID_DYLIB 0xd
71 #define LC_LOAD_DYLINKER 0xe
72 #define LC_ID_DYLINKER 0xf
73 #define LC_PREBOUND_DYLIB 0x10
74 #define LC_ROUTINES 0x11
75 #define LC_SUB_FRAMEWORK 0x12
76 #define LC_SUB_UMBRELLA 0x13
77 #define LC_SUB_CLIENT 0x14
78 #define LC_SUB_LIBRARY 0x15
79 #define LC_TWOLEVEL_HINTS 0x16
80 #define LC_PREBIND_CKSUM 0x17
82 #define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
84 #define SG_HIGHVM 0x1
85 #define SG_FVMLIB 0x2
86 #define SG_NORELOC 0x4
87 #define SG_PROTECTED_VERSION_1 0x8
89 #define SECTION_TYPE 0x000000ff
90 #define SECTION_ATTRIBUTES 0xffffff00
92 #define S_REGULAR 0x0
93 #define S_ZEROFILL 0x1
94 #define S_CSTRING_LITERALS 0x2
95 #define S_4BYTE_LITERALS 0x3
96 #define S_8BYTE_LITERALS 0x4
97 #define S_LITERAL_POINTERS 0x5
99 #define S_NON_LAZY_SYMBOL_POINTERS 0x6
100 #define S_LAZY_SYMBOL_POINTERS 0x7
101 #define S_SYMBOL_STUBS 0x8
102 #define S_MOD_INIT_FUNC_POINTERS 0x9
103 #define S_MOD_TERM_FUNC_POINTERS 0xa
104 #define S_COALESCED 0xb
105 #define S_GB_ZEROFILL 0xc
106 #define S_INTERPOSING 0xd
108 #define SECTION_ATTRIBUTES_USR 0xff000000
109 #define S_ATTR_PURE_INSTRUCTIONS 0x80000000
110 #define S_ATTR_NO_TOC 0x40000000
111 #define S_ATTR_STRIP_STATIC_SYMS 0x20000000
112 #define S_ATTR_NO_DEAD_STRIP 0x10000000
113 #define S_ATTR_LIVE_SUPPORT 0x08000000
114 #define S_ATTR_SELF_MODIFYING_CODE 0x04000000
115 #define SECTION_ATTRIBUTES_SYS 0x00ffff00
116 #define S_ATTR_SOME_INSTRUCTIONS 0x00000400
117 #define S_ATTR_EXT_RELOC 0x00000200
118 #define S_ATTR_LOC_RELOC 0x00000100
120 #define SEG_PAGEZERO "__PAGEZERO"
121 #define SEG_TEXT "__TEXT"
122 #define SECT_TEXT "__text"
123 #define SECT_FVMLIB_INIT0 "__fvmlib_init0"
124 #define SECT_FVMLIB_INIT1 "__fvmlib_init1"
125 #define SEG_DATA "__DATA"
126 #define SECT_DATA "__data"
127 #define SECT_BSS "__bss"
128 #define SECT_COMMON "__common"
129 #define SEG_OBJC "__OBJC"
130 #define SECT_OBJC_SYMBOLS "__symbol_table"
131 #define SECT_OBJC_MODULES "__module_info"
132 #define SECT_OBJC_STRINGS "__selector_strs"
133 #define SECT_OBJC_REFS "__selector_refs"
134 #define SEG_ICON "__ICON"
135 #define SECT_ICON_HEADER "__header"
136 #define SECT_ICON_TIFF "__tiff"
137 #define SEG_LINKEDIT "__LINKEDIT"
138 #define SEG_UNIXSTACK "__UNIXSTACK"
139 #define SEG_IMPORT "__IMPORT"
141 /*
142 * Capability bits used in the definition of cpu_type.
143 */
144 #define CPU_ARCH_MASK 0xff000000 /* mask for architecture bits */
145 #define CPU_ARCH_ABI64 0x01000000 /* 64 bit ABI */
147 #define CPU_TYPE_ANY ((cpu_type_t) -1)
149 #define CPU_TYPE_VAX ((cpu_type_t) 1)
150 /* skip ((cpu_type_t) 2) */
151 /* skip ((cpu_type_t) 3) */
152 /* skip ((cpu_type_t) 4) */
153 /* skip ((cpu_type_t) 5) */
154 #define CPU_TYPE_MC680x0 ((cpu_type_t) 6)
155 #define CPU_TYPE_X86 ((cpu_type_t) 7)
156 #define CPU_TYPE_I386 CPU_TYPE_X86 /* compatibility */
157 #define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64)
159 /* skip CPU_TYPE_MIPS ((cpu_type_t) 8) */
160 /* skip ((cpu_type_t) 9) */
161 #define CPU_TYPE_MC98000 ((cpu_type_t) 10)
162 #define CPU_TYPE_HPPA ((cpu_type_t) 11)
163 #define CPU_TYPE_ARM ((cpu_type_t) 12)
164 #define CPU_TYPE_MC88000 ((cpu_type_t) 13)
165 #define CPU_TYPE_SPARC ((cpu_type_t) 14)
166 #define CPU_TYPE_I860 ((cpu_type_t) 15)
167 /* skip CPU_TYPE_ALPHA ((cpu_type_t) 16) */
168 /* skip ((cpu_type_t) 17) */
169 #define CPU_TYPE_POWERPC ((cpu_type_t) 18)
170 #define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
172 /*
173 * Machine subtypes (these are defined here, instead of in a machine
174 * dependent directory, so that any program can get all definitions
175 * regardless of where is it compiled).
176 */
178 /*
179 * Capability bits used in the definition of cpu_subtype.
180 */
181 #define CPU_SUBTYPE_MASK 0xff000000 /* mask for feature flags */
182 #define CPU_SUBTYPE_LIB64 0x80000000 /* 64 bit libraries */
185 /*
186 * Object files that are hand-crafted to run on any
187 * implementation of an architecture are tagged with
188 * CPU_SUBTYPE_MULTIPLE. This functions essentially the same as
189 * the "ALL" subtype of an architecture except that it allows us
190 * to easily find object files that may need to be modified
191 * whenever a new implementation of an architecture comes out.
193 * It is the responsibility of the implementor to make sure the
194 * software handles unsupported implementations elegantly.
195 */
196 #define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1)
197 #define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0)
198 #define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1)
200 /*
201 * Machine threadtypes.
202 * This is none - not defined - for most machine types/subtypes.
203 */
204 #define CPU_THREADTYPE_NONE ((cpu_threadtype_t) 0)
206 /*
207 * VAX subtypes (these do *not* necessary conform to the actual cpu
208 * ID assigned by DEC available via the SID register).
209 */
211 #define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0)
212 #define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1)
213 #define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2)
214 #define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3)
215 #define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4)
216 #define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5)
217 #define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6)
218 #define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7)
219 #define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8)
220 #define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9)
221 #define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10)
222 #define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11)
223 #define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12)
225 /*
226 * 680x0 subtypes
228 * The subtype definitions here are unusual for historical reasons.
229 * NeXT used to consider 68030 code as generic 68000 code. For
230 * backwards compatability:
232 * CPU_SUBTYPE_MC68030 symbol has been preserved for source code
233 * compatability.
235 * CPU_SUBTYPE_MC680x0_ALL has been defined to be the same
236 * subtype as CPU_SUBTYPE_MC68030 for binary comatability.
238 * CPU_SUBTYPE_MC68030_ONLY has been added to allow new object
239 * files to be tagged as containing 68030-specific instructions.
240 */
242 #define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1)
243 #define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1) /* compat */
244 #define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2)
245 #define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3)
247 /*
248 * I386 subtypes
249 */
251 #define CPU_SUBTYPE_INTEL(f, m) ((cpu_subtype_t) (f) + ((m) << 4))
253 #define CPU_SUBTYPE_I386_ALL CPU_SUBTYPE_INTEL(3, 0)
254 #define CPU_SUBTYPE_386 CPU_SUBTYPE_INTEL(3, 0)
255 #define CPU_SUBTYPE_486 CPU_SUBTYPE_INTEL(4, 0)
256 #define CPU_SUBTYPE_486SX CPU_SUBTYPE_INTEL(4, 8) // 8 << 4 = 128
257 #define CPU_SUBTYPE_586 CPU_SUBTYPE_INTEL(5, 0)
258 #define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0)
259 #define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1)
260 #define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3)
261 #define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5)
262 #define CPU_SUBTYPE_CELERON CPU_SUBTYPE_INTEL(7, 6)
263 #define CPU_SUBTYPE_CELERON_MOBILE CPU_SUBTYPE_INTEL(7, 7)
264 #define CPU_SUBTYPE_PENTIUM_3 CPU_SUBTYPE_INTEL(8, 0)
265 #define CPU_SUBTYPE_PENTIUM_3_M CPU_SUBTYPE_INTEL(8, 1)
266 #define CPU_SUBTYPE_PENTIUM_3_XEON CPU_SUBTYPE_INTEL(8, 2)
267 #define CPU_SUBTYPE_PENTIUM_M CPU_SUBTYPE_INTEL(9, 0)
268 #define CPU_SUBTYPE_PENTIUM_4 CPU_SUBTYPE_INTEL(10, 0)
269 #define CPU_SUBTYPE_PENTIUM_4_M CPU_SUBTYPE_INTEL(10, 1)
270 #define CPU_SUBTYPE_ITANIUM CPU_SUBTYPE_INTEL(11, 0)
271 #define CPU_SUBTYPE_ITANIUM_2 CPU_SUBTYPE_INTEL(11, 1)
272 #define CPU_SUBTYPE_XEON CPU_SUBTYPE_INTEL(12, 0)
273 #define CPU_SUBTYPE_XEON_MP CPU_SUBTYPE_INTEL(12, 1)
275 #define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15)
276 #define CPU_SUBTYPE_INTEL_FAMILY_MAX 15
278 #define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4)
279 #define CPU_SUBTYPE_INTEL_MODEL_ALL 0
281 /*
282 * X86 subtypes.
283 */
285 #define CPU_SUBTYPE_X86_ALL ((cpu_subtype_t)3)
286 #define CPU_SUBTYPE_X86_64_ALL ((cpu_subtype_t)3)
287 #define CPU_SUBTYPE_X86_ARCH1 ((cpu_subtype_t)4)
290 #define CPU_THREADTYPE_INTEL_HTT ((cpu_threadtype_t) 1)
292 /*
293 * Mips subtypes.
294 */
296 #define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0)
297 #define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1)
298 #define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2)
299 #define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3)
300 #define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */
301 #define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5)
302 #define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */
303 #define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7)
305 /*
306 * MC98000 (PowerPC) subtypes
307 */
308 #define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0)
309 #define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1)
311 /*
312 * HPPA subtypes for Hewlett-Packard HP-PA family of
313 * risc processors. Port by NeXT to 700 series.
314 */
316 #define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0)
317 #define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0) /* compat */
318 #define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1)
320 /*
321 * MC88000 subtypes.
322 */
323 #define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0)
324 #define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1)
325 #define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2)
327 /*
328 * SPARC subtypes
329 */
330 #define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0)
332 /*
333 * I860 subtypes
334 */
335 #define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0)
336 #define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1)
338 /*
339 * PowerPC subtypes
340 */
341 #define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0)
342 #define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1)
343 #define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2)
344 #define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3)
345 #define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4)
346 #define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5)
347 #define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6)
348 #define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7)
349 #define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8)
350 #define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9)
351 #define CPU_SUBTYPE_POWERPC_7400 ((cpu_subtype_t) 10)
352 #define CPU_SUBTYPE_POWERPC_7450 ((cpu_subtype_t) 11)
353 #define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
355 /*
356 * ARM subtypes
357 */
358 #define CPU_SUBTYPE_ARM_ALL ((cpu_subtype_t) 0)
359 #define CPU_SUBTYPE_ARM_V4T ((cpu_subtype_t) 5)
360 #define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6)
361 #define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7)
362 #define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8)
363 #define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9)
366 typedef int vm_prot_t;
367 typedef int cpu_type_t;
368 typedef int cpu_subtype_t;
369 typedef int cpu_threadtype_t;
371 #define FAT_MAGIC 0xcafebabe
372 #define FAT_CIGAM 0xbebafeca
374 #define MH_MAGIC 0xfeedface
375 #define MH_CIGAM 0xcefaedfe
376 #define MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */
377 #define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */
379 struct fat_header {
380 uint32_t magic;
381 uint32_t nfat_arch;
382 };
384 struct fat_arch {
385 cpu_type_t cputype;
386 cpu_subtype_t cpusubtype;
387 uint32_t offset;
388 uint32_t size;
389 uint32_t align;
390 };
392 struct mach_header_magic {
393 uint32_t magic;
394 };
396 struct mach_header {
397 uint32_t magic;
398 cpu_type_t cputype;
399 cpu_subtype_t cpusubtype;
400 uint32_t filetype;
401 uint32_t ncmds;
402 uint32_t sizeofcmds;
403 uint32_t flags;
404 };
406 struct mach_header_64 {
407 uint32_t magic; /* mach magic number identifier */
408 cpu_type_t cputype; /* cpu specifier */
409 cpu_subtype_t cpusubtype; /* machine specifier */
410 uint32_t filetype; /* type of file */
411 uint32_t ncmds; /* number of load commands */
412 uint32_t sizeofcmds; /* the size of all the load commands */
413 uint32_t flags; /* flags */
414 uint32_t reserved; /* reserved */
415 };
417 struct load_command {
418 uint32_t cmd;
419 uint32_t cmdsize;
420 };
422 struct segment_command {
423 uint32_t cmd;
424 uint32_t cmdsize;
425 char segname[16];
426 uint32_t vmaddr;
427 uint32_t vmsize;
428 uint32_t fileoff;
429 uint32_t filesize;
430 vm_prot_t maxprot;
431 vm_prot_t initprot;
432 uint32_t nsects;
433 uint32_t flags;
434 };
436 struct segment_command_64 { /* for 64-bit architectures */
437 uint32_t cmd; /* LC_SEGMENT_64 */
438 uint32_t cmdsize; /* includes sizeof section_64 structs */
439 char segname[16]; /* segment name */
440 uint64_t vmaddr; /* memory address of this segment */
441 uint64_t vmsize; /* memory size of this segment */
442 uint64_t fileoff; /* file offset of this segment */
443 uint64_t filesize; /* amount to map from the file */
444 vm_prot_t maxprot; /* maximum VM protection */
445 vm_prot_t initprot; /* initial VM protection */
446 uint32_t nsects; /* number of sections in segment */
447 uint32_t flags; /* flags */
448 };
450 struct section {
451 char sectname[16];
452 char segname[16];
453 uint32_t addr;
454 uint32_t size;
455 uint32_t offset;
456 uint32_t align;
457 uint32_t reloff;
458 uint32_t nreloc;
459 uint32_t flags;
460 uint32_t reserved1;
461 uint32_t reserved2;
462 };
464 struct section_64 { /* for 64-bit architectures */
465 char sectname[16]; /* name of this section */
466 char segname[16]; /* segment this section goes in */
467 uint64_t addr; /* memory address of this section */
468 uint64_t size; /* size in bytes of this section */
469 uint32_t offset; /* file offset of this section */
470 uint32_t align; /* section alignment (power of 2) */
471 uint32_t reloff; /* file offset of relocation entries */
472 uint32_t nreloc; /* number of relocation entries */
473 uint32_t flags; /* flags (section type and attributes)*/
474 uint32_t reserved1; /* reserved (for offset or index) */
475 uint32_t reserved2; /* reserved (for count or sizeof) */
476 uint32_t reserved3; /* reserved */
477 };
479 union lc_str {
480 uint32_t offset;
481 #ifndef __LP64__
482 char *ptr;
483 #endif
484 };
486 struct symtab_command {
487 uint32_t cmd;
488 uint32_t cmdsize;
489 uint32_t symoff;
490 uint32_t nsyms;
491 uint32_t stroff;
492 uint32_t strsize;
493 };
495 struct dylib {
496 union lc_str name;
497 uint32_t timestamp;
498 uint32_t current_version;
499 uint32_t compatibility_version;
500 };
502 struct dylib_command {
503 uint32_t cmd;
504 uint32_t cmdsize;
505 struct dylib dylib;
506 };
508 struct dylinker_command {
509 uint32_t cmd;
510 uint32_t cmdsize;
511 union lc_str name;
512 };
514 struct dysymtab_command {
515 uint32_t cmd;
516 uint32_t cmdsize;
517 uint32_t ilocalsym;
518 uint32_t nlocalsym;
519 uint32_t iextdefsym;
520 uint32_t nextdefsym;
521 uint32_t iundefsym;
522 uint32_t nundefsym;
523 uint32_t tocoff;
524 uint32_t ntoc;
525 uint32_t modtaboff;
526 uint32_t nmodtab;
527 uint32_t extrefsymoff;
528 uint32_t nextrefsyms;
529 uint32_t indirectsymoff;
530 uint32_t nindirectsyms;
531 uint32_t extreloff;
532 uint32_t nextrel;
533 uint32_t locreloff;
534 uint32_t nlocrel;
535 };
537 struct dylib_table_of_contents {
538 uint32_t symbol_index;
539 uint32_t module_index;
540 };
542 struct dylib_module {
543 uint32_t module_name;
544 uint32_t iextdefsym;
545 uint32_t nextdefsym;
546 uint32_t irefsym;
547 uint32_t nrefsym;
548 uint32_t ilocalsym;
549 uint32_t nlocalsym;
550 uint32_t iextrel;
551 uint32_t nextrel;
552 uint32_t iinit_iterm;
553 uint32_t ninit_nterm;
554 uint32_t objc_module_info_addr;
555 uint32_t objc_module_info_size;
556 };
558 struct twolevel_hints_command {
559 uint32_t cmd;
560 uint32_t cmdsize;
561 uint32_t offset;
562 uint32_t nhints;
563 };
566 #endif