1// RUN: llvm-objdump -p %p/Inputs/hello.obj.macho-arm | FileCheck %s 2// RUN: llvm-objdump -p %p/Inputs/hello.exe.macho-arm \ 3// RUN: | FileCheck %s -check-prefix=EXE 4// RUN: llvm-objdump -macho -private-headers %p/Inputs/thumb.armv7m \ 5// RUN: | FileCheck %s -check-prefix=THREAD 6 7CHECK: Mach header 8CHECK: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags 9CHECK: MH_MAGIC ARM V7 0x00 OBJECT 3 568 SUBSECTIONS_VIA_SYMBOLS 10CHECK: Load command 0 11CHECK: cmd LC_SEGMENT 12CHECK: cmdsize 464 13CHECK: segname 14CHECK: vmaddr 0x00000000 15CHECK: vmsize 0x00000043 16CHECK: fileoff 596 17CHECK: filesize 67 18CHECK: maxprot rwx 19CHECK: initprot rwx 20CHECK: nsects 6 21CHECK: flags (none) 22CHECK: Section 23CHECK: sectname __text 24CHECK: segname __TEXT 25CHECK: addr 0x00000000 26CHECK: size 0x00000036 27CHECK: offset 596 28CHECK: align 2^2 (4) 29CHECK: reloff 664 30CHECK: nreloc 5 31CHECK: type S_REGULAR 32CHECK: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS 33CHECK: reserved1 0 34CHECK: reserved2 0 35CHECK: Section 36CHECK: sectname __textcoal_nt 37CHECK: segname __TEXT 38CHECK: addr 0x00000036 39CHECK: size 0x00000000 40CHECK: offset 650 41CHECK: align 2^0 (1) 42CHECK: reloff 0 43CHECK: nreloc 0 44CHECK: type S_COALESCED 45CHECK: attributes PURE_INSTRUCTIONS 46CHECK: reserved1 0 47CHECK: reserved2 0 48CHECK: Section 49CHECK: sectname __const_coal 50CHECK: segname __TEXT 51CHECK: addr 0x00000036 52CHECK: size 0x00000000 53CHECK: offset 650 54CHECK: align 2^0 (1) 55CHECK: reloff 0 56CHECK: nreloc 0 57CHECK: type S_COALESCED 58CHECK: attributes (none) 59CHECK: reserved1 0 60CHECK: reserved2 0 61CHECK: Section 62CHECK: sectname __picsymbolstub4 63CHECK: segname __TEXT 64CHECK: addr 0x00000036 65CHECK: size 0x00000000 66CHECK: offset 650 67CHECK: align 2^0 (1) 68CHECK: reloff 0 69CHECK: nreloc 0 70CHECK: type S_SYMBOL_STUBS 71CHECK: attributes (none) 72CHECK: reserved1 0 (index into indirect symbol table) 73CHECK: reserved2 16 (size of stubs) 74CHECK: Section 75CHECK: sectname __StaticInit 76CHECK: segname __TEXT 77CHECK: addr 0x00000036 78CHECK: size 0x00000000 79CHECK: offset 650 80CHECK: align 2^0 (1) 81CHECK: reloff 0 82CHECK: nreloc 0 83CHECK: type S_REGULAR 84CHECK: attributes PURE_INSTRUCTIONS 85CHECK: reserved1 0 86CHECK: reserved2 0 87CHECK: Section 88CHECK: sectname __cstring 89CHECK: segname __TEXT 90CHECK: addr 0x00000036 91CHECK: size 0x0000000d 92CHECK: offset 650 93CHECK: align 2^0 (1) 94CHECK: reloff 0 95CHECK: nreloc 0 96CHECK: type S_CSTRING_LITERALS 97CHECK: attributes (none) 98CHECK: reserved1 0 99CHECK: reserved2 0 100CHECK: Load command 1 101CHECK: cmd LC_SYMTAB 102CHECK: cmdsize 24 103CHECK: symoff 704 104CHECK: nsyms 2 105CHECK: stroff 728 106CHECK: strsize 16 107CHECK: Load command 2 108CHECK: cmd LC_DYSYMTAB 109CHECK: cmdsize 80 110CHECK: ilocalsym 0 111CHECK: nlocalsym 0 112CHECK: iextdefsym 0 113CHECK: nextdefsym 1 114CHECK: iundefsym 1 115CHECK: nundefsym 1 116CHECK: tocoff 0 117CHECK: ntoc 0 118CHECK: modtaboff 0 119CHECK: nmodtab 0 120CHECK: extrefsymoff 0 121CHECK: nextrefsyms 0 122CHECK: indirectsymoff 0 123CHECK: nindirectsyms 0 124CHECK: extreloff 0 125CHECK: nextrel 0 126CHECK: locreloff 0 127CHECK: nlocrel 0 128 129EXE: Mach header 130EXE: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags 131EXE: MH_MAGIC ARM V7 0x00 EXECUTE 17 1012 NOUNDEFS DYLDLINK TWOLEVEL PIE 132EXE: Load command 0 133EXE: cmd LC_SEGMENT 134EXE: cmdsize 56 135EXE: segname __PAGEZERO 136EXE: vmaddr 0x00000000 137EXE: vmsize 0x00004000 138EXE: fileoff 0 139EXE: filesize 0 140EXE: maxprot --- 141EXE: initprot --- 142EXE: nsects 0 143EXE: flags (none) 144EXE: Load command 1 145EXE: cmd LC_SEGMENT 146EXE: cmdsize 328 147EXE: segname __TEXT 148EXE: vmaddr 0x00004000 149EXE: vmsize 0x00008000 150EXE: fileoff 0 151EXE: filesize 32768 152EXE: maxprot r-x 153EXE: initprot r-x 154EXE: nsects 4 155EXE: flags (none) 156EXE: Section 157EXE: sectname __text 158EXE: segname __TEXT 159EXE: addr 0x0000bf84 160EXE: size 0x00000036 161EXE: offset 32644 162EXE: align 2^2 (4) 163EXE: reloff 0 164EXE: nreloc 0 165EXE: type S_REGULAR 166EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS 167EXE: reserved1 0 168EXE: reserved2 0 169EXE: Section 170EXE: sectname __stub_helper 171EXE: segname __TEXT 172EXE: addr 0x0000bfbc 173EXE: size 0x00000030 174EXE: offset 32700 175EXE: align 2^2 (4) 176EXE: reloff 0 177EXE: nreloc 0 178EXE: type S_REGULAR 179EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS 180EXE: reserved1 0 181EXE: reserved2 0 182EXE: Section 183EXE: sectname __cstring 184EXE: segname __TEXT 185EXE: addr 0x0000bfec 186EXE: size 0x0000000d 187EXE: offset 32748 188EXE: align 2^0 (1) 189EXE: reloff 0 190EXE: nreloc 0 191EXE: type S_CSTRING_LITERALS 192EXE: attributes (none) 193EXE: reserved1 0 194EXE: reserved2 0 195EXE: Section 196EXE: sectname __symbolstub1 197EXE: segname __TEXT 198EXE: addr 0x0000bffc 199EXE: size 0x00000004 200EXE: offset 32764 201EXE: align 2^2 (4) 202EXE: reloff 0 203EXE: nreloc 0 204EXE: type S_SYMBOL_STUBS 205EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS 206EXE: reserved1 0 (index into indirect symbol table) 207EXE: reserved2 4 (size of stubs) 208EXE: Load command 2 209EXE: cmd LC_SEGMENT 210EXE: cmdsize 192 211EXE: segname __DATA 212EXE: vmaddr 0x0000c000 213EXE: vmsize 0x00004000 214EXE: fileoff 32768 215EXE: filesize 16384 216EXE: maxprot rw- 217EXE: initprot rw- 218EXE: nsects 2 219EXE: flags (none) 220EXE: Section 221EXE: sectname __lazy_symbol 222EXE: segname __DATA 223EXE: addr 0x0000c000 224EXE: size 0x00000004 225EXE: offset 32768 226EXE: align 2^2 (4) 227EXE: reloff 0 228EXE: nreloc 0 229EXE: type S_LAZY_SYMBOL_POINTERS 230EXE: attributes (none) 231EXE: reserved1 1 (index into indirect symbol table) 232EXE: reserved2 0 233EXE: Section 234EXE: sectname __nl_symbol_ptr 235EXE: segname __DATA 236EXE: addr 0x0000c004 237EXE: size 0x00000008 238EXE: offset 32772 239EXE: align 2^2 (4) 240EXE: reloff 0 241EXE: nreloc 0 242EXE: type S_NON_LAZY_SYMBOL_POINTERS 243EXE: attributes (none) 244EXE: reserved1 2 (index into indirect symbol table) 245EXE: reserved2 0 246EXE: Load command 3 247EXE: cmd LC_SEGMENT 248EXE: cmdsize 56 249EXE: segname __LINKEDIT 250EXE: vmaddr 0x00010000 251EXE: vmsize 0x00004000 252EXE: fileoff 49152 253EXE: filesize 256 254EXE: maxprot r-- 255EXE: initprot r-- 256EXE: nsects 0 257EXE: flags (none) 258EXE: Load command 4 259EXE: cmd LC_DYLD_INFO_ONLY 260EXE: cmdsize 48 261EXE: rebase_off 49152 262EXE: rebase_size 4 263EXE: bind_off 49156 264EXE: bind_size 24 265EXE: weak_bind_off 0 266EXE: weak_bind_size 0 267EXE: lazy_bind_off 49180 268EXE: lazy_bind_size 16 269EXE: export_off 49196 270EXE: export_size 44 271EXE: Load command 5 272EXE: cmd LC_SYMTAB 273EXE: cmdsize 24 274EXE: symoff 49264 275EXE: nsyms 5 276EXE: stroff 49340 277EXE: strsize 68 278EXE: Load command 6 279EXE: cmd LC_DYSYMTAB 280EXE: cmdsize 80 281EXE: ilocalsym 0 282EXE: nlocalsym 1 283EXE: iextdefsym 1 284EXE: nextdefsym 2 285EXE: iundefsym 3 286EXE: nundefsym 2 287EXE: tocoff 0 288EXE: ntoc 0 289EXE: modtaboff 0 290EXE: nmodtab 0 291EXE: extrefsymoff 0 292EXE: nextrefsyms 0 293EXE: indirectsymoff 49324 294EXE: nindirectsyms 4 295EXE: extreloff 0 296EXE: nextrel 0 297EXE: locreloff 0 298EXE: nlocrel 0 299EXE: Load command 7 300EXE: cmd LC_LOAD_DYLINKER 301EXE: cmdsize 28 302EXE: name /usr/lib/dyld (offset 12) 303EXE: Load command 8 304EXE: cmd LC_UUID 305EXE: cmdsize 24 306EXE: uuid C2D9351C-1EF1-330B-A2AB-EED6CF7D2C5D 307EXE: Load command 9 308EXE: cmd LC_VERSION_MIN_IPHONEOS 309EXE: cmdsize 16 310EXE: version 8.0 311EXE: sdk 8.0 312EXE: Load command 10 313EXE: cmd LC_SOURCE_VERSION 314EXE: cmdsize 16 315EXE: version 0.0 316EXE: Load command 11 317EXE: cmd LC_MAIN 318EXE: cmdsize 24 319EXE: entryoff 32645 320EXE: stacksize 0 321EXE: Load command 12 322EXE: cmd LC_ENCRYPTION_INFO 323EXE: cmdsize 20 324EXE: cryptoff 16384 325EXE: cryptsize 16384 326EXE: cryptid 0 327EXE: Load command 13 328EXE: cmd LC_LOAD_DYLIB 329EXE: cmdsize 52 330EXE: name /usr/lib/libSystem.B.dylib (offset 24) 331EXE: current version 1213.0.0 332EXE: compatibility version 1.0.0 333EXE: Load command 14 334EXE: cmd LC_FUNCTION_STARTS 335EXE: cmdsize 16 336EXE: dataoff 49240 337EXE: datasize 4 338EXE: Load command 15 339EXE: cmd LC_DATA_IN_CODE 340EXE: cmdsize 16 341EXE: dataoff 49244 342EXE: datasize 0 343EXE: Load command 16 344EXE: cmd LC_DYLIB_CODE_SIGN_DRS 345EXE: cmdsize 16 346EXE: dataoff 49244 347EXE: datasize 20 348 349THREAD: Load command 6 350THREAD: cmd LC_UNIXTHREAD 351THREAD: cmdsize 84 352THREAD: flavor ARM_THREAD_STATE 353THREAD: count ARM_THREAD_STATE_COUNT 354THREAD: r0 0x00000000 r1 0x00000000 r2 0x00000000 r3 0x00000000 355THREAD: r4 0x00000000 r5 0x00000000 r6 0x00000000 r7 0x00000000 356THREAD: r8 0x00000000 r9 0x00000000 r10 0x00000000 r11 0x00000000 357THREAD: r12 0x00000000 sp 0x00000000 lr 0x00000000 pc 0x00001fff 358THREAD: cpsr 0x00000000 359