comparison test/MC/MachO/ARM/darwin-Thumb-reloc.s @ 95:afa8332a0e37 LLVM3.8

LLVM 3.8
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 13 Oct 2015 17:48:58 +0900
parents 95c75e76d11b
children c2174574ed3a
comparison
equal deleted inserted replaced
84:f3e34b893a5f 95:afa8332a0e37
1 @ RUN: llvm-mc -n -triple thumbv7-apple-darwin10 %s -filetype=obj -o %t.obj 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 2 @ RUN: llvm-readobj -file-headers -s -sd -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols < %t.obj > %t.dump
3 @ RUN: FileCheck < %t.dump %s 3 @ RUN: FileCheck < %t.dump %s
4 4
5 .syntax unified 5 .syntax unified
6 .section __TEXT,__text,regular,pure_instructions 6 .section __TEXT,__text,regular,pure_instructions
7 .globl _main 7 .globl _main
20 L_.str: 20 L_.str:
21 .asciz "s0" 21 .asciz "s0"
22 22
23 .subsections_via_symbols 23 .subsections_via_symbols
24 24
25 @ CHECK: ('cputype', 12) 25 @ CHECK: File: <stdin>
26 @ CHECK: ('cpusubtype', 9) 26 @ CHECK: Format: Mach-O arm
27 @ CHECK: ('filetype', 1) 27 @ CHECK: Arch: arm
28 @ CHECK: ('num_load_commands', 3) 28 @ CHECK: AddressSize: 32bit
29 @ CHECK: ('load_commands_size', 296) 29 @ CHECK: MachHeader {
30 @ CHECK: ('flag', 8192) 30 @ CHECK: Magic: Magic (0xFEEDFACE)
31 @ CHECK: ('load_commands', [ 31 @ CHECK: CpuType: Arm (0xC)
32 @ CHECK: # Load Command 0 32 @ CHECK: CpuSubType: CPU_SUBTYPE_ARM_V7 (0x9)
33 @ CHECK: (('command', 1) 33 @ CHECK: FileType: Relocatable (0x1)
34 @ CHECK: ('size', 192) 34 @ CHECK: NumOfLoadCommands: 4
35 @ CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') 35 @ CHECK: SizeOfLoadCommands: 312
36 @ CHECK: ('vm_addr', 0) 36 @ CHECK: Flags [ (0x2000)
37 @ CHECK: ('vm_size', 11) 37 @ CHECK: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000)
38 @ CHECK: ('file_offset', 324) 38 @ CHECK: ]
39 @ CHECK: ('file_size', 11) 39 @ CHECK: }
40 @ CHECK: ('maxprot', 7) 40 @ CHECK: Sections [
41 @ CHECK: ('initprot', 7) 41 @ CHECK: Section {
42 @ CHECK: ('num_sections', 2) 42 @ CHECK: Index: 0
43 @ CHECK: ('flags', 0) 43 @ CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
44 @ CHECK: ('sections', [ 44 @ CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
45 @ CHECK: # Section 0 45 @ CHECK: Address: 0x0
46 @ CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') 46 @ CHECK: Size: 0x8
47 @ CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') 47 @ CHECK: Offset: 340
48 @ CHECK: ('address', 0) 48 @ CHECK: Alignment: 2
49 @ CHECK: ('size', 8) 49 @ CHECK: RelocationOffset: 0x160
50 @ CHECK: ('offset', 324) 50 @ CHECK: RelocationCount: 3
51 @ CHECK: ('alignment', 2) 51 @ CHECK: Type: 0x0
52 @ CHECK: ('reloc_offset', 336) 52 @ CHECK: Attributes [ (0x800004)
53 @ CHECK: ('num_reloc', 3) 53 @ CHECK: PureInstructions (0x800000)
54 @ CHECK: ('flags', 0x80000400) 54 @ CHECK: SomeInstructions (0x4)
55 @ CHECK: ('reserved1', 0) 55 @ CHECK: ]
56 @ CHECK: ('reserved2', 0) 56 @ CHECK: Reserved1: 0x0
57 @ CHECK: ), 57 @ CHECK: Reserved2: 0x0
58 @ CHECK: ('_relocations', [ 58 @ CHECK: SectionData (
59 @ CHECK: # Relocation 0 59 @ CHECK: 0000: FFF7FEEF 04000000 |........|
60 @ CHECK: (('word-0', 0xa2000004), 60 @ CHECK: )
61 @ CHECK: ('word-1', 0x8)), 61 @ CHECK: }
62 @ CHECK: # Relocation 1 62 @ CHECK: Section {
63 @ CHECK: (('word-0', 0xa1000000), 63 @ CHECK: Index: 1
64 @ CHECK: ('word-1', 0x0)), 64 @ CHECK: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
65 @ CHECK: # Relocation 2 65 @ CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
66 @ CHECK: (('word-0', 0x0), 66 @ CHECK: Address: 0x8
67 @ CHECK: ('word-1', 0x6d000001)), 67 @ CHECK: Size: 0x3
68 @ CHECK: ]) 68 @ CHECK: Offset: 348
69 @ CHECK-FIXME: ('_section_data', 'fff7feef 04000000') 69 @ CHECK: Alignment: 2
70 @ CHECK: # Section 1 70 @ CHECK: RelocationOffset: 0x0
71 @ CHECK: (('section_name', '__cstring\x00\x00\x00\x00\x00\x00\x00') 71 @ CHECK: RelocationCount: 0
72 @ CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') 72 @ CHECK: Type: ExtReloc (0x2)
73 @ CHECK: ('address', 8) 73 @ CHECK: Attributes [ (0x0)
74 @ CHECK: ('size', 3) 74 @ CHECK: ]
75 @ CHECK: ('offset', 332) 75 @ CHECK: Reserved1: 0x0
76 @ CHECK: ('alignment', 2) 76 @ CHECK: Reserved2: 0x0
77 @ CHECK: ('reloc_offset', 0) 77 @ CHECK: SectionData (
78 @ CHECK: ('num_reloc', 0) 78 @ CHECK: 0000: 733000 |s0.|
79 @ CHECK: ('flags', 0x2) 79 @ CHECK: )
80 @ CHECK: ('reserved1', 0) 80 @ CHECK: }
81 @ CHECK: ('reserved2', 0) 81 @ CHECK: ]
82 @ CHECK: ), 82 @ CHECK: Relocations [
83 @ CHECK: ('_relocations', [ 83 @ CHECK: Section __text {
84 @ CHECK: ]) 84 @ CHECK: 0x4 0 2 n/a ARM_RELOC_SECTDIFF 1 0x8
85 @ CHECK: ('_section_data', '733000') 85 @ CHECK: 0x0 0 2 n/a ARM_RELOC_PAIR 1 0x0
86 @ CHECK: ]) 86 @ CHECK: 0x0 1 2 1 ARM_THUMB_RELOC_BR22 0 _printf
87 @ CHECK: ), 87 @ CHECK: }
88 @ CHECK: # Load Command 1 88 @ CHECK: ]
89 @ CHECK: (('command', 2) 89 @ CHECK: Symbols [
90 @ CHECK: ('size', 24) 90 @ CHECK: Symbol {
91 @ CHECK: ('symoff', 360) 91 @ CHECK: Name: _main (1)
92 @ CHECK: ('nsyms', 2) 92 @ CHECK: Extern
93 @ CHECK: ('stroff', 384) 93 @ CHECK: Type: Section (0xE)
94 @ CHECK: ('strsize', 16) 94 @ CHECK: Section: __text (0x1)
95 @ CHECK: ('_string_data', '\x00_main\x00_printf\x00\x00') 95 @ CHECK: RefType: 0x8
96 @ CHECK: ('_symbols', [ 96 @ CHECK: Flags [ (0x0)
97 @ CHECK: # Symbol 0 97 @ CHECK: ]
98 @ CHECK: (('n_strx', 1) 98 @ CHECK: Value: 0x0
99 @ CHECK: ('n_type', 0xf) 99 @ CHECK: }
100 @ CHECK: ('n_sect', 1) 100 @ CHECK: Symbol {
101 @ CHECK: ('n_desc', 8) 101 @ CHECK: Name: _printf (7)
102 @ CHECK: ('n_value', 0) 102 @ CHECK: Extern
103 @ CHECK: ('_string', '_main') 103 @ CHECK: Type: Undef (0x0)
104 @ CHECK: ), 104 @ CHECK: Section: (0x0)
105 @ CHECK: # Symbol 1 105 @ CHECK: RefType: UndefinedNonLazy (0x0)
106 @ CHECK: (('n_strx', 7) 106 @ CHECK: Flags [ (0x0)
107 @ CHECK: ('n_type', 0x1) 107 @ CHECK: ]
108 @ CHECK: ('n_sect', 0) 108 @ CHECK: Value: 0x0
109 @ CHECK: ('n_desc', 0) 109 @ CHECK: }
110 @ CHECK: ('n_value', 0) 110 @ CHECK: ]
111 @ CHECK: ('_string', '_printf') 111 @ CHECK: Indirect Symbols {
112 @ CHECK: ), 112 @ CHECK: Number: 0
113 @ CHECK: ]) 113 @ CHECK: Symbols [
114 @ CHECK: ), 114 @ CHECK: ]
115 @ CHECK: # Load Command 2 115 @ CHECK: }
116 @ CHECK: (('command', 11) 116 @ CHECK: Segment {
117 @ CHECK: ('size', 80) 117 @ CHECK: Cmd: LC_SEGMENT
118 @ CHECK: ('ilocalsym', 0) 118 @ CHECK: Name:
119 @ CHECK: ('nlocalsym', 0) 119 @ CHECK: Size: 192
120 @ CHECK: ('iextdefsym', 0) 120 @ CHECK: vmaddr: 0x0
121 @ CHECK: ('nextdefsym', 1) 121 @ CHECK: vmsize: 0xB
122 @ CHECK: ('iundefsym', 1) 122 @ CHECK: fileoff: 340
123 @ CHECK: ('nundefsym', 1) 123 @ CHECK: filesize: 11
124 @ CHECK: ('tocoff', 0) 124 @ CHECK: maxprot: rwx
125 @ CHECK: ('ntoc', 0) 125 @ CHECK: initprot: rwx
126 @ CHECK: ('modtaboff', 0) 126 @ CHECK: nsects: 2
127 @ CHECK: ('nmodtab', 0) 127 @ CHECK: flags: 0x0
128 @ CHECK: ('extrefsymoff', 0) 128 @ CHECK: }
129 @ CHECK: ('nextrefsyms', 0) 129 @ CHECK: Dysymtab {
130 @ CHECK: ('indirectsymoff', 0) 130 @ CHECK: ilocalsym: 0
131 @ CHECK: ('nindirectsyms', 0) 131 @ CHECK: nlocalsym: 0
132 @ CHECK: ('extreloff', 0) 132 @ CHECK: iextdefsym: 0
133 @ CHECK: ('nextrel', 0) 133 @ CHECK: nextdefsym: 1
134 @ CHECK: ('locreloff', 0) 134 @ CHECK: iundefsym: 1
135 @ CHECK: ('nlocrel', 0) 135 @ CHECK: nundefsym: 1
136 @ CHECK: ('_indirect_symbols', [ 136 @ CHECK: tocoff: 0
137 @ CHECK: ]) 137 @ CHECK: ntoc: 0
138 @ CHECK: ), 138 @ CHECK: modtaboff: 0
139 @ CHECK: ]) 139 @ CHECK: nmodtab: 0
140 @ CHECK: extrefsymoff: 0
141 @ CHECK: nextrefsyms: 0
142 @ CHECK: indirectsymoff: 0
143 @ CHECK: nindirectsyms: 0
144 @ CHECK: extreloff: 0
145 @ CHECK: nextrel: 0
146 @ CHECK: locreloff: 0
147 @ CHECK: nlocrel: 0
148 @ CHECK: }