File: relocations.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (220 lines) | stat: -rw-r--r-- 7,764 bytes parent folder | download | duplicates (4)
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
# RUN: llvm-mc --triple=loongarch64 < %s --show-encoding \
# RUN:     | FileCheck --check-prefixes=INSTR,FIXUP %s
# RUN: llvm-mc --filetype=obj --triple=loongarch64 < %s \
# RUN:     | llvm-readobj -r - | FileCheck --check-prefix=RELOC %s

## Check prefixes:
## RELOC - Check the relocation in the object.
## FIXUP - Check the fixup on the instruction.
## INSTR - Check the instruction is handled properly by the ASMPrinter.

.long foo
# RELOC: R_LARCH_32 foo

.quad foo
# RELOC: R_LARCH_64 foo

bne $t1, $t2, %b16(foo)
# RELOC: R_LARCH_B16
# INSTR: bne $t1, $t2, %b16(foo)
# FIXUP: fixup A - offset: 0, value: %b16(foo), kind: fixup_loongarch_b16

bnez $t1, %b21(foo)
# RELOC: R_LARCH_B21
# INSTR: bnez $t1, %b21(foo)
# FIXUP: fixup A - offset: 0, value: %b21(foo), kind: fixup_loongarch_b21

bl %plt(foo)
# RELOC: R_LARCH_B26
# INSTR: bl %plt(foo)
# FIXUP: fixup A - offset: 0, value: %plt(foo), kind: fixup_loongarch_b26

bl foo
# RELOC: R_LARCH_B26
# INSTR: bl foo
# FIXUP: fixup A - offset: 0, value: foo, kind: fixup_loongarch_b26

lu12i.w $t1, %abs_hi20(foo)
# RELOC: R_LARCH_ABS_HI20 foo 0x0
# INSTR: lu12i.w $t1, %abs_hi20(foo)
# FIXUP: fixup A - offset: 0, value: %abs_hi20(foo), kind: fixup_loongarch_abs_hi20

ori $t1, $t1, %abs_lo12(foo)
# RELOC: R_LARCH_ABS_LO12 foo 0x0
# INSTR: ori $t1, $t1, %abs_lo12(foo)
# FIXUP: fixup A - offset: 0, value: %abs_lo12(foo), kind: fixup_loongarch_abs_lo12

lu32i.d $t1, %abs64_lo20(foo)
# RELOC: R_LARCH_ABS64_LO20 foo 0x0
# INSTR: lu32i.d $t1, %abs64_lo20(foo)
# FIXUP: fixup A - offset: 0, value: %abs64_lo20(foo), kind: fixup_loongarch_abs64_lo20

lu52i.d $t1, $t1, %abs64_hi12(foo)
# RELOC: R_LARCH_ABS64_HI12 foo 0x0
# INSTR: lu52i.d $t1, $t1, %abs64_hi12(foo)
# FIXUP: fixup A - offset: 0, value: %abs64_hi12(foo), kind: fixup_loongarch_abs64_hi12

pcalau12i $t1, %pc_hi20(foo)
# RELOC: R_LARCH_PCALA_HI20 foo 0x0
# INSTR: pcalau12i $t1, %pc_hi20(foo)
# FIXUP: fixup A - offset: 0, value: %pc_hi20(foo), kind: FK_NONE

pcalau12i $t1, %pc_hi20(foo+4)
# RELOC: R_LARCH_PCALA_HI20 foo 0x4
# INSTR: pcalau12i $t1, %pc_hi20(foo+4)
# FIXUP: fixup A - offset: 0, value: %pc_hi20(foo+4), kind: FK_NONE

addi.d $t1, $t1, %pc_lo12(foo)
# RELOC: R_LARCH_PCALA_LO12 foo 0x0
# INSTR: addi.d  $t1, $t1, %pc_lo12(foo)
# FIXUP: fixup A - offset: 0, value: %pc_lo12(foo), kind: FK_NONE

addi.d $t1, $t1, %pc_lo12(foo+4)
# RELOC: R_LARCH_PCALA_LO12 foo 0x4
# INSTR: addi.d  $t1, $t1, %pc_lo12(foo+4)
# FIXUP: fixup A - offset: 0, value: %pc_lo12(foo+4), kind: FK_NONE

jirl $zero, $t1, %pc_lo12(foo)
# RELOC: R_LARCH_PCALA_LO12 foo 0x0
# INSTR: jirl $zero, $t1, %pc_lo12(foo)
# FIXUP: fixup A - offset: 0, value: %pc_lo12(foo), kind: FK_NONE

st.b $t1, $a2, %pc_lo12(foo)
# RELOC: R_LARCH_PCALA_LO12 foo 0x0
# INSTR: st.b  $t1, $a2, %pc_lo12(foo)
# FIXUP: fixup A - offset: 0, value: %pc_lo12(foo), kind: FK_NONE

st.b $t1, $a2, %pc_lo12(foo+4)
# RELOC: R_LARCH_PCALA_LO12 foo 0x4
# INSTR: st.b  $t1, $a2, %pc_lo12(foo+4)
# FIXUP: fixup A - offset: 0, value: %pc_lo12(foo+4), kind: FK_NONE

lu32i.d $t1, %pc64_lo20(foo)
# RELOC: R_LARCH_PCALA64_LO20 foo 0x0
# INSTR: lu32i.d $t1, %pc64_lo20(foo)
# FIXUP: fixup A - offset: 0, value: %pc64_lo20(foo), kind: FK_NONE

lu52i.d $t1, $t1, %pc64_hi12(foo)
# RELOC: R_LARCH_PCALA64_HI12 foo 0x0
# INSTR: lu52i.d $t1, $t1, %pc64_hi12(foo)
# FIXUP: fixup A - offset: 0, value: %pc64_hi12(foo), kind: FK_NONE

pcalau12i $t1, %got_pc_hi20(foo)
# RELOC: R_LARCH_GOT_PC_HI20 foo 0x0
# INSTR: pcalau12i $t1, %got_pc_hi20(foo)
# FIXUP: fixup A - offset: 0, value: %got_pc_hi20(foo), kind: FK_NONE

ld.d $t1, $a2, %got_pc_lo12(foo)
# RELOC: R_LARCH_GOT_PC_LO12 foo 0x0
# INSTR: ld.d  $t1, $a2, %got_pc_lo12(foo)
# FIXUP: fixup A - offset: 0, value: %got_pc_lo12(foo), kind: FK_NONE

lu32i.d $t1, %got64_pc_lo20(foo)
# RELOC: R_LARCH_GOT64_PC_LO20 foo 0x0
# INSTR: lu32i.d $t1, %got64_pc_lo20(foo)
# FIXUP: fixup A - offset: 0, value: %got64_pc_lo20(foo), kind: FK_NONE

lu52i.d $t1, $t1, %got64_pc_hi12(foo)
# RELOC: R_LARCH_GOT64_PC_HI12 foo 0x0
# INSTR: lu52i.d $t1, $t1, %got64_pc_hi12(foo)
# FIXUP: fixup A - offset: 0, value: %got64_pc_hi12(foo), kind: FK_NONE

lu12i.w $t1, %got_hi20(foo)
# RELOC: R_LARCH_GOT_HI20 foo 0x0
# INSTR: lu12i.w $t1, %got_hi20(foo)
# FIXUP: fixup A - offset: 0, value: %got_hi20(foo), kind: FK_NONE

ori $t1, $a2, %got_lo12(foo)
# RELOC: R_LARCH_GOT_LO12 foo 0x0
# INSTR: ori  $t1, $a2, %got_lo12(foo)
# FIXUP: fixup A - offset: 0, value: %got_lo12(foo), kind: FK_NONE

lu32i.d $t1, %got64_lo20(foo)
# RELOC: R_LARCH_GOT64_LO20 foo 0x0
# INSTR: lu32i.d $t1, %got64_lo20(foo)
# FIXUP: fixup A - offset: 0, value: %got64_lo20(foo), kind: FK_NONE

lu52i.d $t1, $t1, %got64_hi12(foo)
# RELOC: R_LARCH_GOT64_HI12 foo 0x0
# INSTR: lu52i.d $t1, $t1, %got64_hi12(foo)
# FIXUP: fixup A - offset: 0, value: %got64_hi12(foo), kind: FK_NONE

lu12i.w $t1, %le_hi20(foo)
# RELOC: R_LARCH_TLS_LE_HI20 foo 0x0
# INSTR: lu12i.w $t1, %le_hi20(foo)
# FIXUP: fixup A - offset: 0, value: %le_hi20(foo), kind: fixup_loongarch_tls_le_hi20

ori $t1, $a2, %le_lo12(foo)
# RELOC: R_LARCH_TLS_LE_LO12 foo 0x0
# INSTR: ori  $t1, $a2, %le_lo12(foo)
# FIXUP: fixup A - offset: 0, value: %le_lo12(foo), kind: fixup_loongarch_tls_le_lo12

lu32i.d $t1, %le64_lo20(foo)
# RELOC: R_LARCH_TLS_LE64_LO20 foo 0x0
# INSTR: lu32i.d $t1, %le64_lo20(foo)
# FIXUP: fixup A - offset: 0, value: %le64_lo20(foo), kind: fixup_loongarch_tls_le64_lo20

lu52i.d $t1, $t1, %le64_hi12(foo)
# RELOC: R_LARCH_TLS_LE64_HI12 foo 0x0
# INSTR: lu52i.d $t1, $t1, %le64_hi12(foo)
# FIXUP: fixup A - offset: 0, value: %le64_hi12(foo), kind: fixup_loongarch_tls_le64_hi12

pcalau12i $t1, %ie_pc_hi20(foo)
# RELOC: R_LARCH_TLS_IE_PC_HI20 foo 0x0
# INSTR: pcalau12i $t1, %ie_pc_hi20(foo)
# FIXUP: fixup A - offset: 0, value: %ie_pc_hi20(foo), kind: FK_NONE

ld.d $t1, $a2, %ie_pc_lo12(foo)
# RELOC: R_LARCH_TLS_IE_PC_LO12 foo 0x0
# INSTR: ld.d  $t1, $a2, %ie_pc_lo12(foo)
# FIXUP: fixup A - offset: 0, value: %ie_pc_lo12(foo), kind: FK_NONE

lu32i.d $t1, %ie64_pc_lo20(foo)
# RELOC: R_LARCH_TLS_IE64_PC_LO20 foo 0x0
# INSTR: lu32i.d $t1, %ie64_pc_lo20(foo)
# FIXUP: fixup A - offset: 0, value: %ie64_pc_lo20(foo), kind: FK_NONE

lu52i.d $t1, $t1, %ie64_pc_hi12(foo)
# RELOC: R_LARCH_TLS_IE64_PC_HI12 foo 0x0
# INSTR: lu52i.d $t1, $t1, %ie64_pc_hi12(foo)
# FIXUP: fixup A - offset: 0, value: %ie64_pc_hi12(foo), kind: FK_NONE

lu12i.w $t1, %ie_hi20(foo)
# RELOC: R_LARCH_TLS_IE_HI20 foo 0x0
# INSTR: lu12i.w $t1, %ie_hi20(foo)
# FIXUP: fixup A - offset: 0, value: %ie_hi20(foo), kind: FK_NONE

ori $t1, $a2, %ie_lo12(foo)
# RELOC: R_LARCH_TLS_IE_LO12 foo 0x0
# INSTR: ori  $t1, $a2, %ie_lo12(foo)
# FIXUP: fixup A - offset: 0, value: %ie_lo12(foo), kind: FK_NONE

lu32i.d $t1, %ie64_lo20(foo)
# RELOC: R_LARCH_TLS_IE64_LO20 foo 0x0
# INSTR: lu32i.d $t1, %ie64_lo20(foo)
# FIXUP: fixup A - offset: 0, value: %ie64_lo20(foo), kind: FK_NONE

lu52i.d $t1, $t1, %ie64_hi12(foo)
# RELOC: R_LARCH_TLS_IE64_HI12 foo 0x0
# INSTR: lu52i.d $t1, $t1, %ie64_hi12(foo)
# FIXUP: fixup A - offset: 0, value: %ie64_hi12(foo), kind: FK_NONE

pcalau12i $t1, %ld_pc_hi20(foo)
# RELOC: R_LARCH_TLS_LD_PC_HI20 foo 0x0
# INSTR: pcalau12i $t1, %ld_pc_hi20(foo)
# FIXUP: fixup A - offset: 0, value: %ld_pc_hi20(foo), kind: FK_NONE

lu12i.w $t1, %ld_hi20(foo)
# RELOC: R_LARCH_TLS_LD_HI20 foo 0x0
# INSTR: lu12i.w $t1, %ld_hi20(foo)
# FIXUP: fixup A - offset: 0, value: %ld_hi20(foo), kind: FK_NONE

pcalau12i $t1, %gd_pc_hi20(foo)
# RELOC: R_LARCH_TLS_GD_PC_HI20 foo 0x0
# INSTR: pcalau12i $t1, %gd_pc_hi20(foo)
# FIXUP: fixup A - offset: 0, value: %gd_pc_hi20(foo), kind: FK_NONE

lu12i.w $t1, %gd_hi20(foo)
# RELOC: R_LARCH_TLS_GD_HI20 foo 0x0
# INSTR: lu12i.w $t1, %gd_hi20(foo)
# FIXUP: fixup A - offset: 0, value: %gd_hi20(foo), kind: FK_NONE