Home | History | Annotate | Download | only in AArch64
      1 // RUN: llvm-objdump -p %p/Inputs/hello.obj.macho-aarch64 | FileCheck %s
      2 // RUN: llvm-objdump -p %p/Inputs/hello.exe.macho-aarch64 \
      3 // RUN:     | FileCheck %s -check-prefix=EXE
      4  
      5 CHECK: Mach header
      6 CHECK:       magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
      7 CHECK: MH_MAGIC_64   ARM64        ALL  0x00      OBJECT     4        352 SUBSECTIONS_VIA_SYMBOLS
      8 CHECK: Load command 0
      9 CHECK:       cmd LC_SEGMENT_64
     10 CHECK:   cmdsize 232
     11 CHECK:   segname 
     12 CHECK:    vmaddr 0x0000000000000000
     13 CHECK:    vmsize 0x000000000000004d
     14 CHECK:   fileoff 384
     15 CHECK:  filesize 77
     16 CHECK:   maxprot rwx
     17 CHECK:  initprot rwx
     18 CHECK:    nsects 2
     19 CHECK:     flags (none)
     20 CHECK: Section
     21 CHECK:   sectname __text
     22 CHECK:    segname __TEXT
     23 CHECK:       addr 0x0000000000000000
     24 CHECK:       size 0x0000000000000040
     25 CHECK:     offset 384
     26 CHECK:      align 2^2 (4)
     27 CHECK:     reloff 464
     28 CHECK:     nreloc 3
     29 CHECK:       type S_REGULAR
     30 CHECK: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
     31 CHECK:  reserved1 0
     32 CHECK:  reserved2 0
     33 CHECK: Section
     34 CHECK:   sectname __cstring
     35 CHECK:    segname __TEXT
     36 CHECK:       addr 0x0000000000000040
     37 CHECK:       size 0x000000000000000d
     38 CHECK:     offset 448
     39 CHECK:      align 2^0 (1)
     40 CHECK:     reloff 0
     41 CHECK:     nreloc 0
     42 CHECK:       type S_CSTRING_LITERALS
     43 CHECK: attributes (none)
     44 CHECK:  reserved1 0
     45 CHECK:  reserved2 0
     46 CHECK: Load command 1
     47 CHECK:       cmd LC_VERSION_MIN_IPHONEOS
     48 CHECK:   cmdsize 16
     49 CHECK:   version 9.0
     50 CHECK:       sdk n/a
     51 CHECK: Load command 2
     52 CHECK:      cmd LC_SYMTAB
     53 CHECK:  cmdsize 24
     54 CHECK:   symoff 488
     55 CHECK:    nsyms 5
     56 CHECK:   stroff 568
     57 CHECK:  strsize 36
     58 CHECK: Load command 3
     59 CHECK:             cmd LC_DYSYMTAB
     60 CHECK:         cmdsize 80
     61 CHECK:       ilocalsym 0
     62 CHECK:       nlocalsym 3
     63 CHECK:      iextdefsym 3
     64 CHECK:      nextdefsym 1
     65 CHECK:       iundefsym 4
     66 CHECK:       nundefsym 1
     67 CHECK:          tocoff 0
     68 CHECK:            ntoc 0
     69 CHECK:       modtaboff 0
     70 CHECK:         nmodtab 0
     71 CHECK:    extrefsymoff 0
     72 CHECK:     nextrefsyms 0
     73 CHECK:  indirectsymoff 0
     74 CHECK:   nindirectsyms 0
     75 CHECK:       extreloff 0
     76 CHECK:         nextrel 0
     77 CHECK:       locreloff 0
     78 CHECK:         nlocrel 0
     79 
     80 EXE: Mach header
     81 EXE:       magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
     82 EXE: MH_MAGIC_64   ARM64        ALL  0x00     EXECUTE    17       1240   NOUNDEFS DYLDLINK TWOLEVEL PIE
     83 EXE: Load command 0
     84 EXE:       cmd LC_SEGMENT_64
     85 EXE:   cmdsize 72
     86 EXE:   segname __PAGEZERO
     87 EXE:    vmaddr 0x0000000000000000
     88 EXE:    vmsize 0x0000000100000000
     89 EXE:   fileoff 0
     90 EXE:  filesize 0
     91 EXE:   maxprot ---
     92 EXE:  initprot ---
     93 EXE:    nsects 0
     94 EXE:     flags (none)
     95 EXE: Load command 1
     96 EXE:       cmd LC_SEGMENT_64
     97 EXE:   cmdsize 472
     98 EXE:   segname __TEXT
     99 EXE:    vmaddr 0x0000000100000000
    100 EXE:    vmsize 0x0000000000008000
    101 EXE:   fileoff 0
    102 EXE:  filesize 32768
    103 EXE:   maxprot r-x
    104 EXE:  initprot r-x
    105 EXE:    nsects 5
    106 EXE:     flags (none)
    107 EXE: Section
    108 EXE:   sectname __text
    109 EXE:    segname __TEXT
    110 EXE:       addr 0x0000000100007f38
    111 EXE:       size 0x0000000000000040
    112 EXE:     offset 32568
    113 EXE:      align 2^2 (4)
    114 EXE:     reloff 0
    115 EXE:     nreloc 0
    116 EXE:       type S_REGULAR
    117 EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
    118 EXE:  reserved1 0
    119 EXE:  reserved2 0
    120 EXE: Section
    121 EXE:   sectname __stubs
    122 EXE:    segname __TEXT
    123 EXE:       addr 0x0000000100007f78
    124 EXE:       size 0x000000000000000c
    125 EXE:     offset 32632
    126 EXE:      align 2^1 (2)
    127 EXE:     reloff 0
    128 EXE:     nreloc 0
    129 EXE:       type S_SYMBOL_STUBS
    130 EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
    131 EXE:  reserved1 0 (index into indirect symbol table)
    132 EXE:  reserved2 12 (size of stubs)
    133 EXE: Section
    134 EXE:   sectname __stub_helper
    135 EXE:    segname __TEXT
    136 EXE:       addr 0x0000000100007f84
    137 EXE:       size 0x0000000000000024
    138 EXE:     offset 32644
    139 EXE:      align 2^2 (4)
    140 EXE:     reloff 0
    141 EXE:     nreloc 0
    142 EXE:       type S_REGULAR
    143 EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
    144 EXE:  reserved1 0
    145 EXE:  reserved2 0
    146 EXE: Section
    147 EXE:   sectname __cstring
    148 EXE:    segname __TEXT
    149 EXE:       addr 0x0000000100007fa8
    150 EXE:       size 0x000000000000000d
    151 EXE:     offset 32680
    152 EXE:      align 2^0 (1)
    153 EXE:     reloff 0
    154 EXE:     nreloc 0
    155 EXE:       type S_CSTRING_LITERALS
    156 EXE: attributes (none)
    157 EXE:  reserved1 0
    158 EXE:  reserved2 0
    159 EXE: Section
    160 EXE:   sectname __unwind_info
    161 EXE:    segname __TEXT
    162 EXE:       addr 0x0000000100007fb8
    163 EXE:       size 0x0000000000000048
    164 EXE:     offset 32696
    165 EXE:      align 2^2 (4)
    166 EXE:     reloff 0
    167 EXE:     nreloc 0
    168 EXE:       type S_REGULAR
    169 EXE: attributes (none)
    170 EXE:  reserved1 0
    171 EXE:  reserved2 0
    172 EXE: Load command 2
    173 EXE:       cmd LC_SEGMENT_64
    174 EXE:   cmdsize 232
    175 EXE:   segname __DATA
    176 EXE:    vmaddr 0x0000000100008000
    177 EXE:    vmsize 0x0000000000004000
    178 EXE:   fileoff 32768
    179 EXE:  filesize 16384
    180 EXE:   maxprot rw-
    181 EXE:  initprot rw-
    182 EXE:    nsects 2
    183 EXE:     flags (none)
    184 EXE: Section
    185 EXE:   sectname __got
    186 EXE:    segname __DATA
    187 EXE:       addr 0x0000000100008000
    188 EXE:       size 0x0000000000000010
    189 EXE:     offset 32768
    190 EXE:      align 2^3 (8)
    191 EXE:     reloff 0
    192 EXE:     nreloc 0
    193 EXE:       type S_NON_LAZY_SYMBOL_POINTERS
    194 EXE: attributes (none)
    195 EXE:  reserved1 1 (index into indirect symbol table)
    196 EXE:  reserved2 0
    197 EXE: Section
    198 EXE:   sectname __la_symbol_ptr
    199 EXE:    segname __DATA
    200 EXE:       addr 0x0000000100008010
    201 EXE:       size 0x0000000000000008
    202 EXE:     offset 32784
    203 EXE:      align 2^3 (8)
    204 EXE:     reloff 0
    205 EXE:     nreloc 0
    206 EXE:       type S_LAZY_SYMBOL_POINTERS
    207 EXE: attributes (none)
    208 EXE:  reserved1 3 (index into indirect symbol table)
    209 EXE:  reserved2 0
    210 EXE: Load command 3
    211 EXE:       cmd LC_SEGMENT_64
    212 EXE:   cmdsize 72
    213 EXE:   segname __LINKEDIT
    214 EXE:    vmaddr 0x000000010000c000
    215 EXE:    vmsize 0x0000000000004000
    216 EXE:   fileoff 49152
    217 EXE:  filesize 264
    218 EXE:   maxprot r--
    219 EXE:  initprot r--
    220 EXE:    nsects 0
    221 EXE:     flags (none)
    222 EXE: Load command 4
    223 EXE:             cmd LC_DYLD_INFO_ONLY
    224 EXE:         cmdsize 48
    225 EXE:      rebase_off 49152
    226 EXE:     rebase_size 8
    227 EXE:        bind_off 49160
    228 EXE:       bind_size 24
    229 EXE:   weak_bind_off 0
    230 EXE:  weak_bind_size 0
    231 EXE:   lazy_bind_off 49184
    232 EXE:  lazy_bind_size 16
    233 EXE:      export_off 49200
    234 EXE:     export_size 48
    235 EXE: Load command 5
    236 EXE:      cmd LC_SYMTAB
    237 EXE:  cmdsize 24
    238 EXE:   symoff 49280
    239 EXE:    nsyms 4
    240 EXE:   stroff 49360
    241 EXE:  strsize 56
    242 EXE: Load command 6
    243 EXE:             cmd LC_DYSYMTAB
    244 EXE:         cmdsize 80
    245 EXE:       ilocalsym 0
    246 EXE:       nlocalsym 0
    247 EXE:      iextdefsym 0
    248 EXE:      nextdefsym 2
    249 EXE:       iundefsym 2
    250 EXE:       nundefsym 2
    251 EXE:          tocoff 0
    252 EXE:            ntoc 0
    253 EXE:       modtaboff 0
    254 EXE:         nmodtab 0
    255 EXE:    extrefsymoff 0
    256 EXE:     nextrefsyms 0
    257 EXE:  indirectsymoff 49344
    258 EXE:   nindirectsyms 4
    259 EXE:       extreloff 0
    260 EXE:         nextrel 0
    261 EXE:       locreloff 0
    262 EXE:         nlocrel 0
    263 EXE: Load command 7
    264 EXE:           cmd LC_LOAD_DYLINKER
    265 EXE:       cmdsize 32
    266 EXE:          name /usr/lib/dyld (offset 12)
    267 EXE: Load command 8
    268 EXE:      cmd LC_UUID
    269 EXE:  cmdsize 24
    270 EXE:     uuid D687F888-CD3F-3276-8C94-BA3CCA21D820
    271 EXE: Load command 9
    272 EXE:       cmd LC_VERSION_MIN_IPHONEOS
    273 EXE:   cmdsize 16
    274 EXE:   version 9.0
    275 EXE:       sdk 9.0
    276 EXE: Load command 10
    277 EXE:       cmd LC_SOURCE_VERSION
    278 EXE:   cmdsize 16
    279 EXE:   version 0.0
    280 EXE: Load command 11
    281 EXE:        cmd LC_MAIN
    282 EXE:    cmdsize 24
    283 EXE:   entryoff 32568
    284 EXE:  stacksize 0
    285 EXE: Load command 12
    286 EXE:           cmd LC_ENCRYPTION_INFO_64
    287 EXE:       cmdsize 24
    288 EXE:      cryptoff 16384
    289 EXE:     cryptsize 16384
    290 EXE:       cryptid 0
    291 EXE:           pad 0
    292 EXE: Load command 13
    293 EXE:           cmd LC_LOAD_DYLIB
    294 EXE:       cmdsize 56
    295 EXE:          name /usr/lib/libSystem.B.dylib (offset 24)
    296 EXE:       current version 1215.0.0
    297 EXE: compatibility version 1.0.0
    298 EXE: Load command 14
    299 EXE:       cmd LC_FUNCTION_STARTS
    300 EXE:   cmdsize 16
    301 EXE:   dataoff 49248
    302 EXE:  datasize 8
    303 EXE: Load command 15
    304 EXE:       cmd LC_DATA_IN_CODE
    305 EXE:   cmdsize 16
    306 EXE:   dataoff 49256
    307 EXE:  datasize 0
    308 EXE: Load command 16
    309 EXE:       cmd LC_DYLIB_CODE_SIGN_DRS
    310 EXE:   cmdsize 16
    311 EXE:   dataoff 49256
    312 EXE:  datasize 24
    313