1 // RUN: llvm-objdump -p %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
2 // RUN: llvm-objdump -p %p/Inputs/hello.exe.macho-x86_64 \
3 // RUN: | FileCheck %s -check-prefix=EXE
4 // RUN: llvm-objdump -p %p/Inputs/dylibLoadKinds.macho-x86_64 \
5 // RUN: | FileCheck %s -check-prefix=LOAD
6 // RUN: llvm-objdump -p %p/Inputs/linkerOption.macho-x86_64 \
7 // RUN: | FileCheck %s -check-prefix=LD_OPT
8 // RUN: llvm-objdump -p %p/Inputs/dylibSubFramework.macho-x86_64 \
9 // RUN: | FileCheck %s -check-prefix=SUB_FRAME
10 // RUN: llvm-objdump -p %p/Inputs/dylibSubUmbrella.macho-x86_64 \
11 // RUN: | FileCheck %s -check-prefix=SUB_UMB
12 // RUN: llvm-objdump -p %p/Inputs/dylibSubLibrary.macho-x86_64 \
13 // RUN: | FileCheck %s -check-prefix=SUB_LIB
14 // RUN: llvm-objdump -p %p/Inputs/dylibSubClient.macho-x86_64 \
15 // RUN: | FileCheck %s -check-prefix=SUB_CLI
16 // RUN: llvm-objdump -p %p/Inputs/dylibRoutines.macho-x86_64 \
17 // RUN: | FileCheck %s -check-prefix=ROUTINE
18 // RUN: llvm-objdump -p %p/Inputs/exeThread.macho-x86_64 \
19 // RUN: | FileCheck %s -check-prefix=THREAD
20 // RUN: llvm-objdump -macho -p -arch i386 %p/Inputs/macho-universal.x86_64.i386 \
21 // RUN: | FileCheck %s -check-prefix=FATi386
22 // RUN: llvm-objdump -p -arch i386 %p/Inputs/macho-universal.x86_64.i386 \
23 // RUN: | FileCheck %s -check-prefix=FATi386
24 // RUN: llvm-objdump -p -non-verbose %p/Inputs/hello.obj.macho-x86_64 \
25 // RUN: | FileCheck %s -check-prefix=NON_VERBOSE
26 // RUN: llvm-objdump -p %p/Inputs/codesig.macho-x86_64 \
27 // RUN: | FileCheck %s -check-prefix=CODESIG
28 // RUN: llvm-objdump -p %p/Inputs/note.macho-x86 \
29 // RUN: | FileCheck %s -check-prefix=NOTE
32 CHECK: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
33 CHECK: MH_MAGIC_64 X86_64 ALL 0x00 OBJECT 3 496 SUBSECTIONS_VIA_SYMBOLS
35 CHECK: cmd LC_SEGMENT_64
38 CHECK: vmaddr 0x0000000000000000
39 CHECK: vmsize 0x00000000000000a8
47 CHECK: sectname __text
49 CHECK: addr 0x0000000000000000
50 CHECK: size 0x000000000000003b
56 CHECK: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
60 CHECK: sectname __cstring
62 CHECK: addr 0x000000000000003b
63 CHECK: size 0x000000000000000d
68 CHECK: type S_CSTRING_LITERALS
69 CHECK: attributes (none)
73 CHECK: sectname __compact_unwind
75 CHECK: addr 0x0000000000000048
76 CHECK: size 0x0000000000000020
82 CHECK: attributes DEBUG
86 CHECK: sectname __eh_frame
88 CHECK: addr 0x0000000000000068
89 CHECK: size 0x0000000000000040
94 CHECK: type S_COALESCED
95 CHECK: attributes NO_TOC STRIP_STATIC_SYMS LIVE_SUPPORT
105 CHECK: Load command 2
106 CHECK: cmd LC_DYSYMTAB
118 CHECK: extrefsymoff 0
120 CHECK: indirectsymoff 0
121 CHECK: nindirectsyms 0
128 EXE: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
129 EXE: MH_MAGIC_64 X86_64 ALL LIB64 EXECUTE 16 1296 NOUNDEFS DYLDLINK TWOLEVEL PIE
131 EXE: cmd LC_SEGMENT_64
133 EXE: segname __PAGEZERO
134 EXE: vmaddr 0x0000000000000000
135 EXE: vmsize 0x0000000100000000
143 EXE: cmd LC_SEGMENT_64
146 EXE: vmaddr 0x0000000100000000
147 EXE: vmsize 0x0000000000001000
157 EXE: addr 0x0000000100000f30
158 EXE: size 0x000000000000003b
164 EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
168 EXE: sectname __stubs
170 EXE: addr 0x0000000100000f6c
171 EXE: size 0x0000000000000006
176 EXE: type S_SYMBOL_STUBS
177 EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
178 EXE: reserved1 0 (index into indirect symbol table)
179 EXE: reserved2 6 (size of stubs)
181 EXE: sectname __stub_helper
183 EXE: addr 0x0000000100000f74
184 EXE: size 0x000000000000001a
190 EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
194 EXE: sectname __cstring
196 EXE: addr 0x0000000100000f8e
197 EXE: size 0x000000000000000d
202 EXE: type S_CSTRING_LITERALS
203 EXE: attributes (none)
207 EXE: sectname __unwind_info
209 EXE: addr 0x0000000100000f9b
210 EXE: size 0x0000000000000048
216 EXE: attributes (none)
220 EXE: sectname __eh_frame
222 EXE: addr 0x0000000100000fe8
223 EXE: size 0x0000000000000018
229 EXE: attributes (none)
233 EXE: cmd LC_SEGMENT_64
236 EXE: vmaddr 0x0000000100001000
237 EXE: vmsize 0x0000000000001000
245 EXE: sectname __nl_symbol_ptr
247 EXE: addr 0x0000000100001000
248 EXE: size 0x0000000000000010
253 EXE: type S_NON_LAZY_SYMBOL_POINTERS
254 EXE: attributes (none)
255 EXE: reserved1 1 (index into indirect symbol table)
258 EXE: sectname __la_symbol_ptr
260 EXE: addr 0x0000000100001010
261 EXE: size 0x0000000000000008
266 EXE: type S_LAZY_SYMBOL_POINTERS
267 EXE: attributes (none)
268 EXE: reserved1 3 (index into indirect symbol table)
271 EXE: cmd LC_SEGMENT_64
273 EXE: segname __LINKEDIT
274 EXE: vmaddr 0x0000000100002000
275 EXE: vmsize 0x0000000000001000
283 EXE: cmd LC_DYLD_INFO_ONLY
290 EXE: weak_bind_size 0
291 EXE: lazy_bind_off 8224
292 EXE: lazy_bind_size 16
317 EXE: indirectsymoff 8424
324 EXE: cmd LC_LOAD_DYLINKER
326 EXE: name /usr/lib/dyld (offset 12)
330 EXE: uuid 65C2DD41-79B0-3B34-871B-8CB3446AB762
332 EXE: cmd LC_VERSION_MIN_MACOSX
337 EXE: cmd LC_SOURCE_VERSION
346 EXE: cmd LC_LOAD_DYLIB
348 EXE: name /usr/lib/libSystem.B.dylib (offset 24)
349 EXE: current version 1197.1.1
350 EXE: compatibility version 1.0.0
352 EXE: cmd LC_FUNCTION_STARTS
357 EXE: cmd LC_DATA_IN_CODE
362 EXE: cmd LC_DYLIB_CODE_SIGN_DRS
368 LOAD: Load command 10
369 LOAD: cmd LC_LOAD_DYLIB
371 LOAD: name /usr/lib/foo1.dylib (offset 24)
372 LOAD: current version 0.0.0
373 LOAD: compatibility version 0.0.0
374 LOAD: Load command 11
375 LOAD: cmd LC_LOAD_WEAK_DYLIB
377 LOAD: name /usr/lib/foo2.dylib (offset 24)
378 LOAD: current version 0.0.0
379 LOAD: compatibility version 0.0.0
380 LOAD: Load command 12
381 LOAD: cmd LC_REEXPORT_DYLIB
383 LOAD: name /usr/lib/foo3.dylib (offset 24)
384 LOAD: current version 0.0.0
385 LOAD: compatibility version 0.0.0
386 LOAD: Load command 13
387 LOAD: cmd LC_LAZY_LOAD_DYLIB
389 LOAD: name /usr/lib/foo4.dylib (offset 24)
390 LOAD: current version 0.0.0
391 LOAD: compatibility version 0.0.0
393 LD_OPT: Load command 4
394 LD_OPT: cmd LC_LINKER_OPTION
397 LD_OPT: string #1 -lc++
398 LD_OPT: Load command 5
399 LD_OPT: cmd LC_LINKER_OPTION
402 LD_OPT: string #1 -framework
403 LD_OPT: string #2 Foundation
405 SUB_FRAME: Load command 10
406 SUB_FRAME: cmd LC_SUB_FRAMEWORK
407 SUB_FRAME: cmdsize 16
408 SUB_FRAME: umbrella Bar (offset 12)
410 SUB_UMB: Load command 5
411 SUB_UMB: cmd LC_SUB_UMBRELLA
413 SUB_UMB: sub_umbrella Foo (offset 12)
415 SUB_LIB: Load command 5
416 SUB_LIB: cmd LC_SUB_LIBRARY
418 SUB_LIB: sub_library libfoo (offset 12)
420 SUB_CLI: Load command 10
421 SUB_CLI: cmd LC_SUB_CLIENT
423 SUB_CLI: client bar (offset 12)
425 ROUTINE: Load command 6
426 ROUTINE: cmd LC_ROUTINES_64
428 ROUTINE: init_address 0x0000000000000f80
429 ROUTINE: init_module 0
437 THREAD: Load command 10
438 THREAD: cmd LC_UNIXTHREAD
440 THREAD: flavor x86_THREAD_STATE64
441 THREAD: count x86_THREAD_STATE64_COUNT
442 THREAD: rax 0x0000000000000000 rbx 0x0000000000000000 rcx 0x0000000000000000
443 THREAD: rdx 0x0000000000000000 rdi 0x0000000000000000 rsi 0x0000000000000000
444 THREAD: rbp 0x0000000000000000 rsp 0x0000000000000000 r8 0x0000000000000000
445 THREAD: r9 0x0000000000000000 r10 0x0000000000000000 r11 0x0000000000000000
446 THREAD: r12 0x0000000000000000 r13 0x0000000000000000 r14 0x0000000000000000
447 THREAD: r15 0x0000000000000000 rip 0x0000000100000d00
448 THREAD: rflags 0x0000000000000000 cs 0x0000000000000000 fs 0x0000000000000000
449 THREAD: gs 0x0000000000000000
452 FATi386: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
453 FATi386: MH_MAGIC I386 ALL 0x00 EXECUTE 16 716 NOUNDEFS DYLDLINK TWOLEVEL PIE MH_NO_HEAP_EXECUTION
455 NON_VERBOSE: Mach header
456 NON_VERBOSE: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
457 NON_VERBOSE: 0xfeedfacf 16777223 3 0x00 1 3 496 0x00002000
458 NON_VERBOSE: Load command 0
459 NON_VERBOSE: cmd LC_SEGMENT_64
460 NON_VERBOSE: cmdsize 392
462 NON_VERBOSE: vmaddr 0x0000000000000000
463 NON_VERBOSE: vmsize 0x00000000000000a8
464 NON_VERBOSE: fileoff 528
465 NON_VERBOSE: filesize 168
466 NON_VERBOSE: maxprot 0x00000007
467 NON_VERBOSE: initprot 0x00000007
468 NON_VERBOSE: nsects 4
469 NON_VERBOSE: flags 0x0
471 NON_VERBOSE: sectname __text
472 NON_VERBOSE: segname __TEXT
473 NON_VERBOSE: addr 0x0000000000000000
474 NON_VERBOSE: size 0x000000000000003b
475 NON_VERBOSE: offset 528
476 NON_VERBOSE: align 2^4 (16)
477 NON_VERBOSE: reloff 696
478 NON_VERBOSE: nreloc 2
479 NON_VERBOSE: flags 0x80000400
480 NON_VERBOSE: reserved1 0
481 NON_VERBOSE: reserved2 0
483 NON_VERBOSE: sectname __cstring
484 NON_VERBOSE: segname __TEXT
485 NON_VERBOSE: addr 0x000000000000003b
486 NON_VERBOSE: size 0x000000000000000d
487 NON_VERBOSE: offset 587
488 NON_VERBOSE: align 2^0 (1)
489 NON_VERBOSE: reloff 0
490 NON_VERBOSE: nreloc 0
491 NON_VERBOSE: flags 0x00000002
492 NON_VERBOSE: reserved1 0
493 NON_VERBOSE: reserved2 0
495 NON_VERBOSE: sectname __compact_unwind
496 NON_VERBOSE: segname __LD
497 NON_VERBOSE: addr 0x0000000000000048
498 NON_VERBOSE: size 0x0000000000000020
499 NON_VERBOSE: offset 600
500 NON_VERBOSE: align 2^3 (8)
501 NON_VERBOSE: reloff 712
502 NON_VERBOSE: nreloc 1
503 NON_VERBOSE: flags 0x02000000
504 NON_VERBOSE: reserved1 0
505 NON_VERBOSE: reserved2 0
507 NON_VERBOSE: sectname __eh_frame
508 NON_VERBOSE: segname __TEXT
509 NON_VERBOSE: addr 0x0000000000000068
510 NON_VERBOSE: size 0x0000000000000040
511 NON_VERBOSE: offset 632
512 NON_VERBOSE: align 2^3 (8)
513 NON_VERBOSE: reloff 0
514 NON_VERBOSE: nreloc 0
515 NON_VERBOSE: flags 0x6800000b
516 NON_VERBOSE: reserved1 0
517 NON_VERBOSE: reserved2 0
518 NON_VERBOSE: Load command 1
519 NON_VERBOSE: cmd LC_SYMTAB
520 NON_VERBOSE: cmdsize 24
521 NON_VERBOSE: symoff 720
523 NON_VERBOSE: stroff 800
524 NON_VERBOSE: strsize 44
525 NON_VERBOSE: Load command 2
526 NON_VERBOSE: cmd LC_DYSYMTAB
527 NON_VERBOSE: cmdsize 80
528 NON_VERBOSE: ilocalsym 0
529 NON_VERBOSE: nlocalsym 2
530 NON_VERBOSE: iextdefsym 2
531 NON_VERBOSE: nextdefsym 2
532 NON_VERBOSE: iundefsym 4
533 NON_VERBOSE: nundefsym 1
534 NON_VERBOSE: tocoff 0
536 NON_VERBOSE: modtaboff 0
537 NON_VERBOSE: nmodtab 0
538 NON_VERBOSE: extrefsymoff 0
539 NON_VERBOSE: nextrefsyms 0
540 NON_VERBOSE: indirectsymoff 0
541 NON_VERBOSE: nindirectsyms 0
542 NON_VERBOSE: extreloff 0
543 NON_VERBOSE: nextrel 0
544 NON_VERBOSE: locreloff 0
545 NON_VERBOSE: nlocrel 0
547 CODESIG: cmd LC_CODE_SIGNATURE
549 CODESIG: dataoff 8496
554 NOTE: data_owner DATA OWNER