relocations.test
9.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
## Check how we print relocations.
# RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-i386 \
# RUN: | FileCheck %s --check-prefix MACHO-I386
# RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-x86-64 \
# RUN: | FileCheck %s --check-prefix MACHO-X86-64
# RUN: llvm-readobj -r --expand-relocs %p/Inputs/trivial.obj.macho-ppc \
# RUN: | FileCheck %s --check-prefix MACHO-PPC
# RUN: llvm-readobj -r --expand-relocs %p/Inputs/trivial.obj.macho-ppc64 \
# RUN: | FileCheck %s --check-prefix MACHO-PPC64
# RUN: llvm-readobj -r --expand-relocs %p/Inputs/trivial.obj.macho-arm \
# RUN: | FileCheck %s --check-prefix MACHO-ARM
# MACHO-I386: Relocations [
# MACHO-I386-NEXT: Section __text {
# MACHO-I386-NEXT: 0x18 1 2 1 GENERIC_RELOC_VANILLA 0 _SomeOtherFunction
# MACHO-I386-NEXT: 0x13 1 2 1 GENERIC_RELOC_VANILLA 0 _puts
# MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 0x22
# MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 0x8
# MACHO-I386-NEXT: }
# MACHO-I386-NEXT: ]
# MACHO-X86-64: Relocations [
# MACHO-X86-64-NEXT: Section __text {
# MACHO-X86-64-NEXT: 0xE 1 2 1 X86_64_RELOC_BRANCH 0 _SomeOtherFunction
# MACHO-X86-64-NEXT: 0x9 1 2 1 X86_64_RELOC_BRANCH 0 _puts
# MACHO-X86-64-NEXT: 0x4 1 2 1 X86_64_RELOC_SIGNED 0 L_.str
# MACHO-X86-64-NEXT: }
# MACHO-X86-64-NEXT:]
# MACHO-PPC: Relocations [
# MACHO-PPC-NEXT: Section __text {
# MACHO-PPC-NEXT: Relocation {
# MACHO-PPC-NEXT: Offset: 0x24
# MACHO-PPC-NEXT: PCRel: 0
# MACHO-PPC-NEXT: Length: 2
# MACHO-PPC-NEXT: Type: PPC_RELOC_LO16_SECTDIFF (11)
# MACHO-PPC-NEXT: Value: 0x64
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: Relocation {
# MACHO-PPC-NEXT: Offset: 0x0
# MACHO-PPC-NEXT: PCRel: 0
# MACHO-PPC-NEXT: Length: 2
# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
# MACHO-PPC-NEXT: Value: 0xC
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: Relocation {
# MACHO-PPC-NEXT: Offset: 0x1C
# MACHO-PPC-NEXT: PCRel: 0
# MACHO-PPC-NEXT: Length: 2
# MACHO-PPC-NEXT: Type: PPC_RELOC_HA16_SECTDIFF (12)
# MACHO-PPC-NEXT: Value: 0x64
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: Relocation {
# MACHO-PPC-NEXT: Offset: 0x58
# MACHO-PPC-NEXT: PCRel: 0
# MACHO-PPC-NEXT: Length: 2
# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
# MACHO-PPC-NEXT: Value: 0xC
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: Relocation {
# MACHO-PPC-NEXT: Offset: 0x18
# MACHO-PPC-NEXT: PCRel: 1
# MACHO-PPC-NEXT: Length: 2
# MACHO-PPC-NEXT: Type: PPC_RELOC_BR24 (3)
# MACHO-PPC-NEXT: Section: __picsymbolstub1 (2)
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: Section __picsymbolstub1 {
# MACHO-PPC-NEXT: Relocation {
# MACHO-PPC-NEXT: Offset: 0x14
# MACHO-PPC-NEXT: PCRel: 0
# MACHO-PPC-NEXT: Length: 2
# MACHO-PPC-NEXT: Type: PPC_RELOC_LO16_SECTDIFF (11)
# MACHO-PPC-NEXT: Value: 0x68
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: Relocation {
# MACHO-PPC-NEXT: Offset: 0x0
# MACHO-PPC-NEXT: PCRel: 0
# MACHO-PPC-NEXT: Length: 2
# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
# MACHO-PPC-NEXT: Value: 0x48
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: Relocation {
# MACHO-PPC-NEXT: Offset: 0xC
# MACHO-PPC-NEXT: PCRel: 0
# MACHO-PPC-NEXT: Length: 2
# MACHO-PPC-NEXT: Type: PPC_RELOC_HA16_SECTDIFF (12)
# MACHO-PPC-NEXT: Value: 0x68
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: Relocation {
# MACHO-PPC-NEXT: Offset: 0x20
# MACHO-PPC-NEXT: PCRel: 0
# MACHO-PPC-NEXT: Length: 2
# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
# MACHO-PPC-NEXT: Value: 0x48
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: Section __la_symbol_ptr {
# MACHO-PPC-NEXT: Relocation {
# MACHO-PPC-NEXT: Offset: 0x0
# MACHO-PPC-NEXT: PCRel: 0
# MACHO-PPC-NEXT: Length: 2
# MACHO-PPC-NEXT: Type: PPC_RELOC_VANILLA (0)
# MACHO-PPC-NEXT: Symbol: dyld_stub_binding_helper (5)
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: }
# MACHO-PPC-NEXT: ]
# MACHO-PPC64: Relocations [
# MACHO-PPC64-NEXT: Section __text {
# MACHO-PPC64-NEXT: Relocation {
# MACHO-PPC64-NEXT: Offset: 0x24
# MACHO-PPC64-NEXT: PCRel: 0
# MACHO-PPC64-NEXT: Length: 2
# MACHO-PPC64-NEXT: Type: (14)
# MACHO-PPC64-NEXT: Value: 0x64
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: Relocation {
# MACHO-PPC64-NEXT: Offset: 0x0
# MACHO-PPC64-NEXT: PCRel: 0
# MACHO-PPC64-NEXT: Length: 2
# MACHO-PPC64-NEXT: Type: (1)
# MACHO-PPC64-NEXT: Value: 0xC
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: Relocation {
# MACHO-PPC64-NEXT: Offset: 0x1C
# MACHO-PPC64-NEXT: PCRel: 0
# MACHO-PPC64-NEXT: Length: 2
# MACHO-PPC64-NEXT: Type: (12)
# MACHO-PPC64-NEXT: Value: 0x64
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: Relocation {
# MACHO-PPC64-NEXT: Offset: 0x58
# MACHO-PPC64-NEXT: PCRel: 0
# MACHO-PPC64-NEXT: Length: 2
# MACHO-PPC64-NEXT: Type: (1)
# MACHO-PPC64-NEXT: Value: 0xC
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: Relocation {
# MACHO-PPC64-NEXT: Offset: 0x18
# MACHO-PPC64-NEXT: PCRel: 1
# MACHO-PPC64-NEXT: Length: 2
# MACHO-PPC64-NEXT: Type: (3)
# MACHO-PPC64-NEXT: Section: __picsymbolstub1 (2)
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: Section __picsymbolstub1 {
# MACHO-PPC64-NEXT: Relocation {
# MACHO-PPC64-NEXT: Offset: 0x14
# MACHO-PPC64-NEXT: PCRel: 0
# MACHO-PPC64-NEXT: Length: 2
# MACHO-PPC64-NEXT: Type: (14)
# MACHO-PPC64-NEXT: Value: 0x6C
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: Relocation {
# MACHO-PPC64-NEXT: Offset: 0x0
# MACHO-PPC64-NEXT: PCRel: 0
# MACHO-PPC64-NEXT: Length: 2
# MACHO-PPC64-NEXT: Type: (1)
# MACHO-PPC64-NEXT: Value: 0x48
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: Relocation {
# MACHO-PPC64-NEXT: Offset: 0xC
# MACHO-PPC64-NEXT: PCRel: 0
# MACHO-PPC64-NEXT: Length: 2
# MACHO-PPC64-NEXT: Type: (12)
# MACHO-PPC64-NEXT: Value: 0x6C
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: Relocation {
# MACHO-PPC64-NEXT: Offset: 0x24
# MACHO-PPC64-NEXT: PCRel: 0
# MACHO-PPC64-NEXT: Length: 2
# MACHO-PPC64-NEXT: Type: (1)
# MACHO-PPC64-NEXT: Value: 0x48
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: Section __la_symbol_ptr {
# MACHO-PPC64-NEXT: Relocation {
# MACHO-PPC64-NEXT: Offset: 0x0
# MACHO-PPC64-NEXT: PCRel: 0
# MACHO-PPC64-NEXT: Length: 3
# MACHO-PPC64-NEXT: Type: (0)
# MACHO-PPC64-NEXT: Symbol: dyld_stub_binding_helper (5)
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: }
# MACHO-PPC64-NEXT: ]
# MACHO-ARM: Relocations [
# MACHO-ARM-NEXT: Section __text {
# MACHO-ARM-NEXT: Relocation {
# MACHO-ARM-NEXT: Offset: 0x38
# MACHO-ARM-NEXT: PCRel: 0
# MACHO-ARM-NEXT: Length: 2
# MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
# MACHO-ARM-NEXT: Value: 0x40
# MACHO-ARM-NEXT: }
# MACHO-ARM-NEXT: Relocation {
# MACHO-ARM-NEXT: Offset: 0x0
# MACHO-ARM-NEXT: PCRel: 0
# MACHO-ARM-NEXT: Length: 2
# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
# MACHO-ARM-NEXT: Value: 0x28
# MACHO-ARM-NEXT: }
# MACHO-ARM-NEXT: Relocation {
# MACHO-ARM-NEXT: Offset: 0x20
# MACHO-ARM-NEXT: PCRel: 1
# MACHO-ARM-NEXT: Length: 2
# MACHO-ARM-NEXT: Type: ARM_RELOC_BR24 (5)
# MACHO-ARM-NEXT: Symbol: _g
# MACHO-ARM-NEXT: }
# MACHO-ARM-NEXT: Relocation {
# MACHO-ARM-NEXT: Offset: 0x1C
# MACHO-ARM-NEXT: PCRel: 0
# MACHO-ARM-NEXT: Length: 1
# MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
# MACHO-ARM-NEXT: Symbol: _g
# MACHO-ARM-NEXT: }
# MACHO-ARM-NEXT: Relocation {
# MACHO-ARM-NEXT: Offset: 0x0
# MACHO-ARM-NEXT: PCRel: 0
# MACHO-ARM-NEXT: Length: 1
# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
# MACHO-ARM-NEXT: Section: -
# MACHO-ARM-NEXT: }
# MACHO-ARM-NEXT: Relocation {
# MACHO-ARM-NEXT: Offset: 0x18
# MACHO-ARM-NEXT: PCRel: 0
# MACHO-ARM-NEXT: Length: 0
# MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
# MACHO-ARM-NEXT: Symbol: _g
# MACHO-ARM-NEXT: }
# MACHO-ARM-NEXT: Relocation {
# MACHO-ARM-NEXT: Offset: 0x0
# MACHO-ARM-NEXT: PCRel: 0
# MACHO-ARM-NEXT: Length: 0
# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
# MACHO-ARM-NEXT: Section: -
# MACHO-ARM-NEXT: }
# MACHO-ARM-NEXT: Relocation {
# MACHO-ARM-NEXT: Offset: 0xC
# MACHO-ARM-NEXT: PCRel: 0
# MACHO-ARM-NEXT: Length: 2
# MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
# MACHO-ARM-NEXT: Value: 0x44
# MACHO-ARM-NEXT: }
# MACHO-ARM-NEXT: Relocation {
# MACHO-ARM-NEXT: Offset: 0x0
# MACHO-ARM-NEXT: PCRel: 0
# MACHO-ARM-NEXT: Length: 2
# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
# MACHO-ARM-NEXT: Value: 0x4
# MACHO-ARM-NEXT: }
# MACHO-ARM-NEXT: }
# MACHO-ARM-NEXT: ]