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