Home | History | Annotate | Download | only in ARM
      1 @ RUN: llvm-mc -n -triple thumbv7-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 	.section	__TEXT,__text,regular,pure_instructions
      7 	.globl	_main
      8 	.align	2
      9 	.code	16
     10 	.thumb_func	_main
     11 _main:
     12 LPC0_0:
     13 	blx	_printf
     14 	.align	2
     15 LCPI0_0:
     16 	.long	L_.str-(LPC0_0+4)
     17 
     18 	.section	__TEXT,__cstring,cstring_literals
     19 	.align	2
     20 L_.str:
     21 	.asciz	 "s0"
     22 
     23 .subsections_via_symbols
     24 
     25 @ CHECK: ('cputype', 12)
     26 @ CHECK: ('cpusubtype', 9)
     27 @ CHECK: ('filetype', 1)
     28 @ CHECK: ('num_load_commands', 3)
     29 @ CHECK: ('load_commands_size', 296)
     30 @ CHECK: ('flag', 8192)
     31 @ CHECK: ('load_commands', [
     32 @ CHECK:   # Load Command 0
     33 @ CHECK:  (('command', 1)
     34 @ CHECK:   ('size', 192)
     35 @ CHECK:   ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     36 @ CHECK:   ('vm_addr', 0)
     37 @ CHECK:   ('vm_size', 11)
     38 @ CHECK:   ('file_offset', 324)
     39 @ CHECK:   ('file_size', 11)
     40 @ CHECK:   ('maxprot', 7)
     41 @ CHECK:   ('initprot', 7)
     42 @ CHECK:   ('num_sections', 2)
     43 @ CHECK:   ('flags', 0)
     44 @ CHECK:   ('sections', [
     45 @ CHECK:     # Section 0
     46 @ CHECK:    (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     47 @ CHECK:     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     48 @ CHECK:     ('address', 0)
     49 @ CHECK:     ('size', 8)
     50 @ CHECK:     ('offset', 324)
     51 @ CHECK:     ('alignment', 2)
     52 @ CHECK:     ('reloc_offset', 336)
     53 @ CHECK:     ('num_reloc', 3)
     54 @ CHECK:     ('flags', 0x80000400)
     55 @ CHECK:     ('reserved1', 0)
     56 @ CHECK:     ('reserved2', 0)
     57 @ CHECK:    ),
     58 @ CHECK:   ('_relocations', [
     59 @ CHECK:     # Relocation 0
     60 @ CHECK:     (('word-0', 0xa2000004),
     61 @ CHECK:      ('word-1', 0x8)),
     62 @ CHECK:     # Relocation 1
     63 @ CHECK:     (('word-0', 0xa1000000),
     64 @ CHECK:      ('word-1', 0x0)),
     65 @ CHECK:     # Relocation 2
     66 @ CHECK:     (('word-0', 0x0),
     67 @ CHECK:      ('word-1', 0x6d000001)),
     68 @ CHECK:   ])
     69 @ CHECK-FIXME:   ('_section_data', 'fff7feef 04000000')
     70 @ CHECK:     # Section 1
     71 @ CHECK:    (('section_name', '__cstring\x00\x00\x00\x00\x00\x00\x00')
     72 @ CHECK:     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     73 @ CHECK:     ('address', 8)
     74 @ CHECK:     ('size', 3)
     75 @ CHECK:     ('offset', 332)
     76 @ CHECK:     ('alignment', 2)
     77 @ CHECK:     ('reloc_offset', 0)
     78 @ CHECK:     ('num_reloc', 0)
     79 @ CHECK:     ('flags', 0x2)
     80 @ CHECK:     ('reserved1', 0)
     81 @ CHECK:     ('reserved2', 0)
     82 @ CHECK:    ),
     83 @ CHECK:   ('_relocations', [
     84 @ CHECK:   ])
     85 @ CHECK:   ('_section_data', '733000')
     86 @ CHECK:   ])
     87 @ CHECK:  ),
     88 @ CHECK:   # Load Command 1
     89 @ CHECK:  (('command', 2)
     90 @ CHECK:   ('size', 24)
     91 @ CHECK:   ('symoff', 360)
     92 @ CHECK:   ('nsyms', 2)
     93 @ CHECK:   ('stroff', 384)
     94 @ CHECK:   ('strsize', 16)
     95 @ CHECK:   ('_string_data', '\x00_main\x00_printf\x00\x00')
     96 @ CHECK:   ('_symbols', [
     97 @ CHECK:     # Symbol 0
     98 @ CHECK:    (('n_strx', 1)
     99 @ CHECK:     ('n_type', 0xf)
    100 @ CHECK:     ('n_sect', 1)
    101 @ CHECK:     ('n_desc', 8)
    102 @ CHECK:     ('n_value', 0)
    103 @ CHECK:     ('_string', '_main')
    104 @ CHECK:    ),
    105 @ CHECK:     # Symbol 1
    106 @ CHECK:    (('n_strx', 7)
    107 @ CHECK:     ('n_type', 0x1)
    108 @ CHECK:     ('n_sect', 0)
    109 @ CHECK:     ('n_desc', 0)
    110 @ CHECK:     ('n_value', 0)
    111 @ CHECK:     ('_string', '_printf')
    112 @ CHECK:    ),
    113 @ CHECK:   ])
    114 @ CHECK:  ),
    115 @ CHECK:   # Load Command 2
    116 @ CHECK:  (('command', 11)
    117 @ CHECK:   ('size', 80)
    118 @ CHECK:   ('ilocalsym', 0)
    119 @ CHECK:   ('nlocalsym', 0)
    120 @ CHECK:   ('iextdefsym', 0)
    121 @ CHECK:   ('nextdefsym', 1)
    122 @ CHECK:   ('iundefsym', 1)
    123 @ CHECK:   ('nundefsym', 1)
    124 @ CHECK:   ('tocoff', 0)
    125 @ CHECK:   ('ntoc', 0)
    126 @ CHECK:   ('modtaboff', 0)
    127 @ CHECK:   ('nmodtab', 0)
    128 @ CHECK:   ('extrefsymoff', 0)
    129 @ CHECK:   ('nextrefsyms', 0)
    130 @ CHECK:   ('indirectsymoff', 0)
    131 @ CHECK:   ('nindirectsyms', 0)
    132 @ CHECK:   ('extreloff', 0)
    133 @ CHECK:   ('nextrel', 0)
    134 @ CHECK:   ('locreloff', 0)
    135 @ CHECK:   ('nlocrel', 0)
    136 @ CHECK:   ('_indirect_symbols', [
    137 @ CHECK:   ])
    138 @ CHECK:  ),
    139 @ CHECK: ])
    140