Home | History | Annotate | Download | only in ARM
      1 @ RUN: llvm-mc -n -triple armv7-apple-darwin10 %s -filetype=obj -o %t.obj
      2 @ RUN: macho-dump --dump-section-data < %t.obj > %t.dump
      3 @ RUN: FileCheck < %t.dump %s
      4 
      5 	.syntax unified
      6         .text
      7 _f0:
      8         bl _printf
      9 
     10 _f1:
     11         bl _f0
     12 
     13         .data
     14 _d0:
     15 Ld0_0:
     16         .long Lsc0_0 - Ld0_0
     17 
     18 	.section	__TEXT,__cstring,cstring_literals
     19 Lsc0_0:
     20         .long 0
     21 
     22 @ CHECK: ('cputype', 12)
     23 @ CHECK: ('cpusubtype', 9)
     24 @ CHECK: ('filetype', 1)
     25 @ CHECK: ('num_load_commands', 3)
     26 @ CHECK: ('load_commands_size', 364)
     27 @ CHECK: ('flag', 0)
     28 @ CHECK: ('load_commands', [
     29 @ CHECK:   # Load Command 0
     30 @ CHECK:  (('command', 1)
     31 @ CHECK:   ('size', 260)
     32 @ CHECK:   ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     33 @ CHECK:   ('vm_addr', 0)
     34 @ CHECK:   ('vm_size', 16)
     35 @ CHECK:   ('file_offset', 392)
     36 @ CHECK:   ('file_size', 16)
     37 @ CHECK:   ('maxprot', 7)
     38 @ CHECK:   ('initprot', 7)
     39 @ CHECK:   ('num_sections', 3)
     40 @ CHECK:   ('flags', 0)
     41 @ CHECK:   ('sections', [
     42 @ CHECK:     # Section 0
     43 @ CHECK:    (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     44 @ CHECK:     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     45 @ CHECK:     ('address', 0)
     46 @ CHECK:     ('size', 8)
     47 @ CHECK:     ('offset', 392)
     48 @ CHECK:     ('alignment', 0)
     49 @ CHECK:     ('reloc_offset', 408)
     50 @ CHECK:     ('num_reloc', 2)
     51 @ CHECK:     ('flags', 0x80000400)
     52 @ CHECK:     ('reserved1', 0)
     53 @ CHECK:     ('reserved2', 0)
     54 @ CHECK:    ),
     55 @ CHECK:   ('_relocations', [
     56 @ CHECK:     # Relocation 0
     57 @ CHECK:     (('word-0', 0x4),
     58 @ CHECK:      ('word-1', 0x55000001)),
     59 @ CHECK:     # Relocation 1
     60 @ CHECK:     (('word-0', 0x0),
     61 @ CHECK:      ('word-1', 0x5d000003)),
     62 @ CHECK:   ])
     63 @ CHECK:   ('_section_data', 'feffffeb fdffffeb')
     64 @ CHECK:     # Section 1
     65 @ CHECK:    (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     66 @ CHECK:     ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     67 @ CHECK:     ('address', 8)
     68 @ CHECK:     ('size', 4)
     69 @ CHECK:     ('offset', 400)
     70 @ CHECK:     ('alignment', 0)
     71 @ CHECK:     ('reloc_offset', 424)
     72 @ CHECK:     ('num_reloc', 2)
     73 @ CHECK:     ('flags', 0x0)
     74 @ CHECK:     ('reserved1', 0)
     75 @ CHECK:     ('reserved2', 0)
     76 @ CHECK:    ),
     77 @ CHECK:   ('_relocations', [
     78 @ CHECK:     # Relocation 0
     79 @ CHECK:     (('word-0', 0xa2000000),
     80 @ CHECK:      ('word-1', 0xc)),
     81 @ CHECK:     # Relocation 1
     82 @ CHECK:     (('word-0', 0xa1000000),
     83 @ CHECK:      ('word-1', 0x8)),
     84 @ CHECK:   ])
     85 @ CHECK:   ('_section_data', '04000000')
     86 @ CHECK:     # Section 2
     87 @ CHECK:    (('section_name', '__cstring\x00\x00\x00\x00\x00\x00\x00')
     88 @ CHECK:     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     89 @ CHECK:     ('address', 12)
     90 @ CHECK:     ('size', 4)
     91 @ CHECK:     ('offset', 404)
     92 @ CHECK:     ('alignment', 0)
     93 @ CHECK:     ('reloc_offset', 0)
     94 @ CHECK:     ('num_reloc', 0)
     95 @ CHECK:     ('flags', 0x2)
     96 @ CHECK:     ('reserved1', 0)
     97 @ CHECK:     ('reserved2', 0)
     98 @ CHECK:    ),
     99 @ CHECK:   ('_relocations', [
    100 @ CHECK:   ])
    101 @ CHECK:   ('_section_data', '00000000')
    102 @ CHECK:   ])
    103 @ CHECK:  ),
    104 @ CHECK:   # Load Command 1
    105 @ CHECK:  (('command', 2)
    106 @ CHECK:   ('size', 24)
    107 @ CHECK:   ('symoff', 440)
    108 @ CHECK:   ('nsyms', 4)
    109 @ CHECK:   ('stroff', 488)
    110 @ CHECK:   ('strsize', 24)
    111 @ CHECK:   ('_string_data', '\x00_printf\x00_f0\x00_f1\x00_d0\x00\x00\x00\x00')
    112 @ CHECK:   ('_symbols', [
    113 @ CHECK:     # Symbol 0
    114 @ CHECK:    (('n_strx', 9)
    115 @ CHECK:     ('n_type', 0xe)
    116 @ CHECK:     ('n_sect', 1)
    117 @ CHECK:     ('n_desc', 0)
    118 @ CHECK:     ('n_value', 0)
    119 @ CHECK:     ('_string', '_f0')
    120 @ CHECK:    ),
    121 @ CHECK:     # Symbol 1
    122 @ CHECK:    (('n_strx', 13)
    123 @ CHECK:     ('n_type', 0xe)
    124 @ CHECK:     ('n_sect', 1)
    125 @ CHECK:     ('n_desc', 0)
    126 @ CHECK:     ('n_value', 4)
    127 @ CHECK:     ('_string', '_f1')
    128 @ CHECK:    ),
    129 @ CHECK:     # Symbol 2
    130 @ CHECK:    (('n_strx', 17)
    131 @ CHECK:     ('n_type', 0xe)
    132 @ CHECK:     ('n_sect', 2)
    133 @ CHECK:     ('n_desc', 0)
    134 @ CHECK:     ('n_value', 8)
    135 @ CHECK:     ('_string', '_d0')
    136 @ CHECK:    ),
    137 @ CHECK:     # Symbol 3
    138 @ CHECK:    (('n_strx', 1)
    139 @ CHECK:     ('n_type', 0x1)
    140 @ CHECK:     ('n_sect', 0)
    141 @ CHECK:     ('n_desc', 0)
    142 @ CHECK:     ('n_value', 0)
    143 @ CHECK:     ('_string', '_printf')
    144 @ CHECK:    ),
    145 @ CHECK:   ])
    146 @ CHECK:  ),
    147 @ CHECK:   # Load Command 2
    148 @ CHECK:  (('command', 11)
    149 @ CHECK:   ('size', 80)
    150 @ CHECK:   ('ilocalsym', 0)
    151 @ CHECK:   ('nlocalsym', 3)
    152 @ CHECK:   ('iextdefsym', 3)
    153 @ CHECK:   ('nextdefsym', 0)
    154 @ CHECK:   ('iundefsym', 3)
    155 @ CHECK:   ('nundefsym', 1)
    156 @ CHECK:   ('tocoff', 0)
    157 @ CHECK:   ('ntoc', 0)
    158 @ CHECK:   ('modtaboff', 0)
    159 @ CHECK:   ('nmodtab', 0)
    160 @ CHECK:   ('extrefsymoff', 0)
    161 @ CHECK:   ('nextrefsyms', 0)
    162 @ CHECK:   ('indirectsymoff', 0)
    163 @ CHECK:   ('nindirectsyms', 0)
    164 @ CHECK:   ('extreloff', 0)
    165 @ CHECK:   ('nextrel', 0)
    166 @ CHECK:   ('locreloff', 0)
    167 @ CHECK:   ('nlocrel', 0)
    168 @ CHECK:   ('_indirect_symbols', [
    169 @ CHECK:   ])
    170 @ CHECK:  ),
    171 @ CHECK: ])
    172