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