1 # RUN: yaml2obj --docnum=1 %s -o %t.armv7
2 # RUN: llvm-objdump --private-headers %t.armv7 | FileCheck %s --check-prefix=ARMV7
4 # ARMV7: segname __PAGEZERO
5 # ARMV7-NEXT: vmaddr 0x00000000
6 # ARMV7-NEXT: vmsize 0x00004000
7 # ARMV7: segname __TEXT
8 # ARMV7-NEXT: vmaddr 0x00004000
9 # ARMV7-NEXT: vmsize 0x00008000
10 # ARMV7: segname __LINKEDIT
11 # ARMV7-NEXT: vmaddr 0x0000c000
12 # ARMV7-NEXT: vmsize 0x00004000
14 # RUN: yaml2obj --docnum=2 %s -o %t.arm64
15 # RUN: llvm-objdump --private-headers %t.arm64 | FileCheck %s --check-prefix=ARM64
17 # ARM64: segname __PAGEZERO
18 # ARM64-NEXT: vmaddr 0x0000000000000000
19 # ARM64-NEXT: vmsize 0x0000000100000000
20 # ARM64: segname __TEXT
21 # ARM64-NEXT: vmaddr 0x0000000100000000
22 # ARM64-NEXT: vmsize 0x0000000000008000
23 # ARM64: segname __LINKEDIT
24 # ARM64-NEXT: vmaddr 0x0000000100008000
25 # ARM64-NEXT: vmsize 0x0000000000004000
27 # RUN: yaml2obj --docnum=3 %s -o %t.arm64_32
28 # RUN: llvm-objdump --private-headers %t.arm64_32 | FileCheck %s --check-prefix=ARM64_32
30 # ARM64_32: segname __PAGEZERO
31 # ARM64_32-NEXT: vmaddr 0x00000000
32 # ARM64_32-NEXT: vmsize 0x00004000
33 # ARM64_32: segname __TEXT
34 # ARM64_32-NEXT: vmaddr 0x00004000
35 # ARM64_32-NEXT: vmsize 0x00008000
36 # ARM64_32: segname __LINKEDIT
37 # ARM64_32-NEXT: vmaddr 0x0000c000
38 # ARM64_32-NEXT: vmsize 0x00004000
40 # RUN: yaml2obj --docnum=4 %s -o %t.x86_64
41 # RUN: llvm-objdump --private-headers %t.x86_64 | FileCheck %s --check-prefix=X86_64
43 # X86_64: segname __PAGEZERO
44 # X86_64-NEXT: vmaddr 0x0000000000000000
45 # X86_64-NEXT: vmsize 0x0000000100000000
46 # X86_64: segname __TEXT
47 # X86_64-NEXT: vmaddr 0x0000000100000000
48 # X86_64-NEXT: vmsize 0x0000000000001000
49 # X86_64: segname __LINKEDIT
50 # X86_64-NEXT: vmaddr 0x0000000100001000
51 # X86_64-NEXT: vmsize 0x0000000000001000
55 ## Case 1: armv7 iOS binary.
56 ## This binary can be built on OSX as follows:
57 ## main.c: int main() { return 0; }
58 ## xcrun -sdk iphoneos clang -arch armv7 main.c -o main.exe
63 cpusubtype: 0x00000009
94 addr: 0x000000000000BFF6
101 reserved1: 0x00000000
102 reserved2: 0x00000000
103 reserved3: 0x00000000
104 content: 81B00020009001B07047
116 - cmd: LC_DYLD_INFO_ONLY
154 - cmd: LC_LOAD_DYLINKER
157 Content: '/usr/lib/dyld'
161 uuid: C84A0193-BE6F-3625-882F-CBFC052AF6CF
162 - cmd: LC_VERSION_MIN_IPHONEOS
166 - cmd: LC_SOURCE_VERSION
173 - cmd: LC_ENCRYPTION_INFO
183 current_version: 83951616
184 compatibility_version: 65536
185 Content: '/usr/lib/libSystem.B.dylib'
187 - cmd: LC_FUNCTION_STARTS
191 - cmd: LC_DATA_IN_CODE
200 Flags: 0x0000000000000000
201 Address: 0x0000000000000000
202 Other: 0x0000000000000000
208 Flags: 0x0000000000000000
209 Address: 0x0000000000000000
210 Other: 0x0000000000000000
215 Name: _mh_execute_header
216 Flags: 0x0000000000000000
217 Address: 0x0000000000000000
218 Other: 0x0000000000000000
223 Flags: 0x0000000000000000
224 Address: 0x0000000000007FF7
225 Other: 0x0000000000000000
245 - __mh_execute_header
253 ## Case 2: arm64 iOS binary.
254 ## This binary can be built on OSX as follows:
255 ## main.c: int main() { return 0; }
256 ## xcrun -sdk iphoneos clang -arch arm64 main.c -o main.exe
261 cpusubtype: 0x00000000
293 addr: 0x0000000100007FA0
300 reserved1: 0x00000000
301 reserved2: 0x00000000
302 reserved3: 0x00000000
303 content: FF4300D1FF0F00B908008052E00308AAFF430091C0035FD6
304 - sectname: __unwind_info
306 addr: 0x0000000100007FB8
313 reserved1: 0x00000000
314 reserved2: 0x00000000
315 reserved3: 0x00000000
316 content: 010000001C000000000000001C000000000000001C00000002000000A07F00003400000034000000B97F00000000000034000000030000000C000100100001000000000000100002
328 - cmd: LC_DYLD_INFO_ONLY
366 - cmd: LC_LOAD_DYLINKER
369 Content: '/usr/lib/dyld'
373 uuid: 945B24FC-E351-3186-9D74-A88A7A93392A
374 - cmd: LC_BUILD_VERSION
383 - cmd: LC_SOURCE_VERSION
390 - cmd: LC_ENCRYPTION_INFO_64
401 current_version: 83951616
402 compatibility_version: 65536
403 Content: '/usr/lib/libSystem.B.dylib'
405 - cmd: LC_FUNCTION_STARTS
409 - cmd: LC_DATA_IN_CODE
418 Flags: 0x0000000000000000
419 Address: 0x0000000000000000
420 Other: 0x0000000000000000
426 Flags: 0x0000000000000000
427 Address: 0x0000000000000000
428 Other: 0x0000000000000000
433 Name: _mh_execute_header
434 Flags: 0x0000000000000000
435 Address: 0x0000000000000000
436 Other: 0x0000000000000000
441 Flags: 0x0000000000000000
442 Address: 0x0000000000007FA0
443 Other: 0x0000000000000000
463 - __mh_execute_header
471 ## Case 3: arm64_32 WatchOS binary.
472 ## This binary can be built on OSX as follows:
473 ## main.c: int main() { return 0; }
474 ## xcrun -sdk watchos clang -arch arm64_32 main.c -o main.exe
479 cpusubtype: 0x00000001
510 addr: 0x000000000000BFA0
517 reserved1: 0x00000000
518 reserved2: 0x00000000
519 reserved3: 0x00000000
520 content: FF4300D108008052E80F00B9E00308AAFF430091C0035FD6
521 - sectname: __unwind_info
523 addr: 0x000000000000BFB8
530 reserved1: 0x00000000
531 reserved2: 0x00000000
532 reserved3: 0x00000000
533 content: 010000001C000000000000001C000000000000001C00000002000000A07F00003400000034000000B97F00000000000034000000030000000C000100100001000000000000100002
545 - cmd: LC_DYLD_INFO_ONLY
583 - cmd: LC_LOAD_DYLINKER
586 Content: '/usr/lib/dyld'
590 uuid: F33E5680-8F64-3402-8952-7FD251400D78
591 - cmd: LC_BUILD_VERSION
600 - cmd: LC_SOURCE_VERSION
607 - cmd: LC_ENCRYPTION_INFO
617 current_version: 83951616
618 compatibility_version: 65536
619 Content: '/usr/lib/libSystem.B.dylib'
621 - cmd: LC_FUNCTION_STARTS
625 - cmd: LC_DATA_IN_CODE
634 Flags: 0x0000000000000000
635 Address: 0x0000000000000000
636 Other: 0x0000000000000000
642 Flags: 0x0000000000000000
643 Address: 0x0000000000000000
644 Other: 0x0000000000000000
649 Name: _mh_execute_header
650 Flags: 0x0000000000000000
651 Address: 0x0000000000000000
652 Other: 0x0000000000000000
657 Flags: 0x0000000000000000
658 Address: 0x0000000000007FA0
659 Other: 0x0000000000000000
679 - __mh_execute_header
687 ## Case 4: x86_64 OSX binary.
688 ## This binary can be built on OSX as follows:
689 ## main.c: int main() { return 0; }
690 ## clang -arch x86_64 main.c -o main.exe
695 cpusubtype: 0x80000003
727 addr: 0x0000000100000FA0
734 reserved1: 0x00000000
735 reserved2: 0x00000000
736 reserved3: 0x00000000
737 content: 554889E531C0C745FC000000005DC3
738 - sectname: __unwind_info
740 addr: 0x0000000100000FB0
747 reserved1: 0x00000000
748 reserved2: 0x00000000
749 reserved3: 0x00000000
750 content: 010000001C000000000000001C000000000000001C00000002000000A00F00003400000034000000B00F00000000000034000000030000000C000100100001000000000000000001
762 - cmd: LC_DYLD_INFO_ONLY
800 - cmd: LC_LOAD_DYLINKER
803 Content: '/usr/lib/dyld'
807 uuid: D70F7C9D-410A-3567-83E2-4CA3F33585FF
808 - cmd: LC_BUILD_VERSION
817 - cmd: LC_SOURCE_VERSION
829 current_version: 82115073
830 compatibility_version: 65536
831 Content: '/usr/lib/libSystem.B.dylib'
833 - cmd: LC_FUNCTION_STARTS
837 - cmd: LC_DATA_IN_CODE
846 Flags: 0x0000000000000000
847 Address: 0x0000000000000000
848 Other: 0x0000000000000000
854 Flags: 0x0000000000000000
855 Address: 0x0000000000000000
856 Other: 0x0000000000000000
861 Name: _mh_execute_header
862 Flags: 0x0000000000000000
863 Address: 0x0000000000000000
864 Other: 0x0000000000000000
869 Flags: 0x0000000000000000
870 Address: 0x0000000000000FA0
871 Other: 0x0000000000000000
891 - __mh_execute_header