Home | History | Annotate | Download | only in MachO
      1 // RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
      2 
      3 	.section	__DATA,__datacoal_nt,coalesced
      4 	.section	__TEXT,__const_coal,coalesced
      5 	.globl	__ZTS3optIbE            ## @_ZTS3optIbE
      6 	.weak_definition	__ZTS3optIbE
      7 __ZTS3optIbE:
      8 
      9 
     10 	.section	__DATA,__datacoal_nt,coalesced
     11 	.globl	__ZTI3optIbE            ## @_ZTI3optIbE
     12 	.weak_definition	__ZTI3optIbE
     13 
     14 __ZTI3optIbE:
     15 	.long	__ZTS3optIbE
     16 
     17 // CHECK:      ('cputype', 7)
     18 // CHECK-NEXT: ('cpusubtype', 3)
     19 // CHECK-NEXT: ('filetype', 1)
     20 // CHECK-NEXT: ('num_load_commands', 3)
     21 // CHECK-NEXT: ('load_commands_size', 364)
     22 // CHECK-NEXT: ('flag', 0)
     23 // CHECK-NEXT: ('load_commands', [
     24 // CHECK-NEXT:   # Load Command 0
     25 // CHECK-NEXT:  (('command', 1)
     26 // CHECK-NEXT:   ('size', 260)
     27 // CHECK-NEXT:   ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     28 // CHECK-NEXT:   ('vm_addr', 0)
     29 // CHECK-NEXT:   ('vm_size', 4)
     30 // CHECK-NEXT:   ('file_offset', 392)
     31 // CHECK-NEXT:   ('file_size', 4)
     32 // CHECK-NEXT:   ('maxprot', 7)
     33 // CHECK-NEXT:   ('initprot', 7)
     34 // CHECK-NEXT:   ('num_sections', 3)
     35 // CHECK-NEXT:   ('flags', 0)
     36 // CHECK-NEXT:   ('sections', [
     37 // CHECK-NEXT:     # Section 0
     38 // CHECK-NEXT:    (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     39 // CHECK-NEXT:     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     40 // CHECK-NEXT:     ('address', 0)
     41 // CHECK-NEXT:     ('size', 0)
     42 // CHECK-NEXT:     ('offset', 392)
     43 // CHECK-NEXT:     ('alignment', 0)
     44 // CHECK-NEXT:     ('reloc_offset', 0)
     45 // CHECK-NEXT:     ('num_reloc', 0)
     46 // CHECK-NEXT:     ('flags', 0x80000000)
     47 // CHECK-NEXT:     ('reserved1', 0)
     48 // CHECK-NEXT:     ('reserved2', 0)
     49 // CHECK-NEXT:    ),
     50 // CHECK-NEXT:   ('_relocations', [
     51 // CHECK-NEXT:   ])
     52 // CHECK-NEXT:   ('_section_data', '')
     53 // CHECK-NEXT:     # Section 1
     54 // CHECK-NEXT:    (('section_name', '__datacoal_nt\x00\x00\x00')
     55 // CHECK-NEXT:     ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     56 // CHECK-NEXT:     ('address', 0)
     57 // CHECK-NEXT:     ('size', 4)
     58 // CHECK-NEXT:     ('offset', 392)
     59 // CHECK-NEXT:     ('alignment', 0)
     60 // CHECK-NEXT:     ('reloc_offset', 396)
     61 // CHECK-NEXT:     ('num_reloc', 1)
     62 // CHECK-NEXT:     ('flags', 0xb)
     63 // CHECK-NEXT:     ('reserved1', 0)
     64 // CHECK-NEXT:     ('reserved2', 0)
     65 // CHECK-NEXT:    ),
     66 // CHECK-NEXT:   ('_relocations', [
     67 // CHECK-NEXT:     # Relocation 0
     68 // CHECK-NEXT:     (('word-0', 0x0),
     69 // CHECK-NEXT:      ('word-1', 0xc000001)),
     70 // CHECK-NEXT:   ])
     71 // CHECK-NEXT:   ('_section_data', '00000000')
     72 // CHECK-NEXT:     # Section 2
     73 // CHECK-NEXT:    (('section_name', '__const_coal\x00\x00\x00\x00')
     74 // CHECK-NEXT:     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     75 // CHECK-NEXT:     ('address', 4)
     76 // CHECK-NEXT:     ('size', 0)
     77 // CHECK-NEXT:     ('offset', 396)
     78 // CHECK-NEXT:     ('alignment', 0)
     79 // CHECK-NEXT:     ('reloc_offset', 0)
     80 // CHECK-NEXT:     ('num_reloc', 0)
     81 // CHECK-NEXT:     ('flags', 0xb)
     82 // CHECK-NEXT:     ('reserved1', 0)
     83 // CHECK-NEXT:     ('reserved2', 0)
     84 // CHECK-NEXT:    ),
     85 // CHECK-NEXT:   ('_relocations', [
     86 // CHECK-NEXT:   ])
     87 // CHECK-NEXT:   ('_section_data', '')
     88 // CHECK-NEXT:   ])
     89 // CHECK-NEXT:  ),
     90 // CHECK-NEXT:   # Load Command 1
     91 // CHECK-NEXT:  (('command', 2)
     92 // CHECK-NEXT:   ('size', 24)
     93 // CHECK-NEXT:   ('symoff', 404)
     94 // CHECK-NEXT:   ('nsyms', 2)
     95 // CHECK-NEXT:   ('stroff', 428)
     96 // CHECK-NEXT:   ('strsize', 28)
     97 // CHECK-NEXT:   ('_string_data', '\x00__ZTS3optIbE\x00__ZTI3optIbE\x00\x00')
     98 // CHECK-NEXT:   ('_symbols', [
     99 // CHECK-NEXT:     # Symbol 0
    100 // CHECK-NEXT:    (('n_strx', 14)
    101 // CHECK-NEXT:     ('n_type', 0xf)
    102 // CHECK-NEXT:     ('n_sect', 2)
    103 // CHECK-NEXT:     ('n_desc', 128)
    104 // CHECK-NEXT:     ('n_value', 0)
    105 // CHECK-NEXT:     ('_string', '__ZTI3optIbE')
    106 // CHECK-NEXT:    ),
    107 // CHECK-NEXT:     # Symbol 1
    108 // CHECK-NEXT:    (('n_strx', 1)
    109 // CHECK-NEXT:     ('n_type', 0xf)
    110 // CHECK-NEXT:     ('n_sect', 3)
    111 // CHECK-NEXT:     ('n_desc', 128)
    112 // CHECK-NEXT:     ('n_value', 4)
    113 // CHECK-NEXT:     ('_string', '__ZTS3optIbE')
    114 // CHECK-NEXT:    ),
    115 // CHECK-NEXT:   ])
    116 // CHECK-NEXT:  ),
    117 // CHECK-NEXT:   # Load Command 2
    118 // CHECK-NEXT:  (('command', 11)
    119 // CHECK-NEXT:   ('size', 80)
    120 // CHECK-NEXT:   ('ilocalsym', 0)
    121 // CHECK-NEXT:   ('nlocalsym', 0)
    122 // CHECK-NEXT:   ('iextdefsym', 0)
    123 // CHECK-NEXT:   ('nextdefsym', 2)
    124 // CHECK-NEXT:   ('iundefsym', 2)
    125 // CHECK-NEXT:   ('nundefsym', 0)
    126 // CHECK-NEXT:   ('tocoff', 0)
    127 // CHECK-NEXT:   ('ntoc', 0)
    128 // CHECK-NEXT:   ('modtaboff', 0)
    129 // CHECK-NEXT:   ('nmodtab', 0)
    130 // CHECK-NEXT:   ('extrefsymoff', 0)
    131 // CHECK-NEXT:   ('nextrefsyms', 0)
    132 // CHECK-NEXT:   ('indirectsymoff', 0)
    133 // CHECK-NEXT:   ('nindirectsyms', 0)
    134 // CHECK-NEXT:   ('extreloff', 0)
    135 // CHECK-NEXT:   ('nextrel', 0)
    136 // CHECK-NEXT:   ('locreloff', 0)
    137 // CHECK-NEXT:   ('nlocrel', 0)
    138 // CHECK-NEXT:   ('_indirect_symbols', [
    139 // CHECK-NEXT:   ])
    140 // CHECK-NEXT:  ),
    141 // CHECK-NEXT: ])
    142