1 | //===-- MipsFixupKinds.h - Mips Specific Fixup Entries ----------*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #ifndef LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSFIXUPKINDS_H |
10 | #define LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSFIXUPKINDS_H |
11 | |
12 | #include "llvm/MC/MCFixup.h" |
13 | |
14 | namespace llvm { |
15 | namespace Mips { |
16 | // Although most of the current fixup types reflect a unique relocation |
17 | // one can have multiple fixup types for a given relocation and thus need |
18 | // to be uniquely named. |
19 | // |
20 | // This table *must* be in the same order of |
21 | // MCFixupKindInfo Infos[Mips::NumTargetFixupKinds] |
22 | // in MipsAsmBackend.cpp. |
23 | // |
24 | enum Fixups { |
25 | // Branch fixups resulting in R_MIPS_16. |
26 | fixup_Mips_16 = FirstTargetFixupKind, |
27 | |
28 | // Pure 32 bit data fixup resulting in - R_MIPS_32. |
29 | fixup_Mips_32, |
30 | |
31 | // Full 32 bit data relative data fixup resulting in - R_MIPS_REL32. |
32 | fixup_Mips_REL32, |
33 | |
34 | fixup_Mips_GPREL32, // R_MIPS_GPREL32 |
35 | fixup_Mips_DTPREL32, // R_MIPS_TLS_DTPREL32 |
36 | fixup_Mips_DTPREL64, // R_MIPS_TLS_DTPREL64 |
37 | fixup_Mips_TPREL32, // R_MIPS_TLS_TPREL32 |
38 | fixup_Mips_TPREL64, // R_MIPS_TLS_TPREL64 |
39 | |
40 | // Jump 26 bit fixup resulting in - R_MIPS_26. |
41 | fixup_Mips_26, |
42 | |
43 | // Pure upper 16 bit fixup resulting in - R_MIPS_HI16. |
44 | fixup_Mips_HI16, |
45 | |
46 | // Pure lower 16 bit fixup resulting in - R_MIPS_LO16. |
47 | fixup_Mips_LO16, |
48 | |
49 | // 16-bit fixup that must be resolved. |
50 | fixup_Mips_AnyImm16, |
51 | |
52 | // 16 bit fixup for GP offest resulting in - R_MIPS_GPREL16. |
53 | fixup_Mips_GPREL16, |
54 | |
55 | // 16 bit literal fixup resulting in - R_MIPS_LITERAL. |
56 | fixup_Mips_LITERAL, |
57 | |
58 | // Symbol fixup resulting in - R_MIPS_GOT16. |
59 | fixup_Mips_GOT, |
60 | |
61 | // PC relative branch fixup resulting in - R_MIPS_PC16. |
62 | fixup_Mips_PC16, |
63 | |
64 | // resulting in - R_MIPS_CALL16. |
65 | fixup_Mips_CALL16, |
66 | |
67 | // resulting in - R_MIPS_SHIFT5. |
68 | fixup_Mips_SHIFT5, |
69 | |
70 | // resulting in - R_MIPS_SHIFT6. |
71 | fixup_Mips_SHIFT6, |
72 | |
73 | // Pure 64 bit data fixup resulting in - R_MIPS_64. |
74 | fixup_Mips_64, |
75 | |
76 | // resulting in - R_MIPS_TLS_GD. |
77 | fixup_Mips_TLSGD, |
78 | |
79 | // resulting in - R_MIPS_TLS_GOTTPREL. |
80 | fixup_Mips_GOTTPREL, |
81 | |
82 | // resulting in - R_MIPS_TLS_TPREL_HI16. |
83 | fixup_Mips_TPREL_HI, |
84 | |
85 | // resulting in - R_MIPS_TLS_TPREL_LO16. |
86 | fixup_Mips_TPREL_LO, |
87 | |
88 | // resulting in - R_MIPS_TLS_LDM. |
89 | fixup_Mips_TLSLDM, |
90 | |
91 | // resulting in - R_MIPS_TLS_DTPREL_HI16. |
92 | fixup_Mips_DTPREL_HI, |
93 | |
94 | // resulting in - R_MIPS_TLS_DTPREL_LO16. |
95 | fixup_Mips_DTPREL_LO, |
96 | |
97 | // PC relative branch fixup resulting in - R_MIPS_PC16 |
98 | fixup_Mips_Branch_PCRel, |
99 | |
100 | // resulting in - R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 |
101 | // R_MICROMIPS_GPREL16/R_MICROMIPS_SUB/R_MICROMIPS_HI16 |
102 | fixup_Mips_GPOFF_HI, |
103 | fixup_MICROMIPS_GPOFF_HI, |
104 | |
105 | // resulting in - R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 |
106 | // R_MICROMIPS_GPREL16/R_MICROMIPS_SUB/R_MICROMIPS_LO16 |
107 | fixup_Mips_GPOFF_LO, |
108 | fixup_MICROMIPS_GPOFF_LO, |
109 | |
110 | // resulting in - R_MIPS_PAGE |
111 | fixup_Mips_GOT_PAGE, |
112 | |
113 | // resulting in - R_MIPS_GOT_OFST |
114 | fixup_Mips_GOT_OFST, |
115 | |
116 | // resulting in - R_MIPS_GOT_DISP |
117 | fixup_Mips_GOT_DISP, |
118 | |
119 | // resulting in - R_MIPS_HIGHER/R_MICROMIPS_HIGHER |
120 | fixup_Mips_HIGHER, |
121 | fixup_MICROMIPS_HIGHER, |
122 | |
123 | // resulting in - R_MIPS_HIGHEST/R_MICROMIPS_HIGHEST |
124 | fixup_Mips_HIGHEST, |
125 | fixup_MICROMIPS_HIGHEST, |
126 | |
127 | // resulting in - R_MIPS_GOT_HI16 |
128 | fixup_Mips_GOT_HI16, |
129 | |
130 | // resulting in - R_MIPS_GOT_LO16 |
131 | fixup_Mips_GOT_LO16, |
132 | |
133 | // resulting in - R_MIPS_CALL_HI16 |
134 | fixup_Mips_CALL_HI16, |
135 | |
136 | // resulting in - R_MIPS_CALL_LO16 |
137 | fixup_Mips_CALL_LO16, |
138 | |
139 | // resulting in - R_MIPS_PC18_S3 |
140 | fixup_MIPS_PC18_S3, |
141 | |
142 | // resulting in - R_MIPS_PC19_S2 |
143 | fixup_MIPS_PC19_S2, |
144 | |
145 | // resulting in - R_MIPS_PC21_S2 |
146 | fixup_MIPS_PC21_S2, |
147 | |
148 | // resulting in - R_MIPS_PC26_S2 |
149 | fixup_MIPS_PC26_S2, |
150 | |
151 | // resulting in - R_MIPS_PCHI16 |
152 | fixup_MIPS_PCHI16, |
153 | |
154 | // resulting in - R_MIPS_PCLO16 |
155 | fixup_MIPS_PCLO16, |
156 | |
157 | // resulting in - R_MICROMIPS_26_S1 |
158 | fixup_MICROMIPS_26_S1, |
159 | |
160 | // resulting in - R_MICROMIPS_HI16 |
161 | fixup_MICROMIPS_HI16, |
162 | |
163 | // resulting in - R_MICROMIPS_LO16 |
164 | fixup_MICROMIPS_LO16, |
165 | |
166 | // resulting in - R_MICROMIPS_GOT16 |
167 | fixup_MICROMIPS_GOT16, |
168 | |
169 | // resulting in - R_MICROMIPS_PC7_S1 |
170 | fixup_MICROMIPS_PC7_S1, |
171 | |
172 | // resulting in - R_MICROMIPS_PC10_S1 |
173 | fixup_MICROMIPS_PC10_S1, |
174 | |
175 | // resulting in - R_MICROMIPS_PC16_S1 |
176 | fixup_MICROMIPS_PC16_S1, |
177 | |
178 | // resulting in - R_MICROMIPS_PC26_S1 |
179 | fixup_MICROMIPS_PC26_S1, |
180 | |
181 | // resulting in - R_MICROMIPS_PC19_S2 |
182 | fixup_MICROMIPS_PC19_S2, |
183 | |
184 | // resulting in - R_MICROMIPS_PC18_S3 |
185 | fixup_MICROMIPS_PC18_S3, |
186 | |
187 | // resulting in - R_MICROMIPS_PC21_S1 |
188 | fixup_MICROMIPS_PC21_S1, |
189 | |
190 | // resulting in - R_MICROMIPS_CALL16 |
191 | fixup_MICROMIPS_CALL16, |
192 | |
193 | // resulting in - R_MICROMIPS_GOT_DISP |
194 | fixup_MICROMIPS_GOT_DISP, |
195 | |
196 | // resulting in - R_MICROMIPS_GOT_PAGE |
197 | fixup_MICROMIPS_GOT_PAGE, |
198 | |
199 | // resulting in - R_MICROMIPS_GOT_OFST |
200 | fixup_MICROMIPS_GOT_OFST, |
201 | |
202 | // resulting in - R_MICROMIPS_TLS_GD |
203 | fixup_MICROMIPS_TLS_GD, |
204 | |
205 | // resulting in - R_MICROMIPS_TLS_LDM |
206 | fixup_MICROMIPS_TLS_LDM, |
207 | |
208 | // resulting in - R_MICROMIPS_TLS_DTPREL_HI16 |
209 | fixup_MICROMIPS_TLS_DTPREL_HI16, |
210 | |
211 | // resulting in - R_MICROMIPS_TLS_DTPREL_LO16 |
212 | fixup_MICROMIPS_TLS_DTPREL_LO16, |
213 | |
214 | // resulting in - R_MICROMIPS_TLS_GOTTPREL. |
215 | fixup_MICROMIPS_GOTTPREL, |
216 | |
217 | // resulting in - R_MICROMIPS_TLS_TPREL_HI16 |
218 | fixup_MICROMIPS_TLS_TPREL_HI16, |
219 | |
220 | // resulting in - R_MICROMIPS_TLS_TPREL_LO16 |
221 | fixup_MICROMIPS_TLS_TPREL_LO16, |
222 | |
223 | // resulting in - R_MIPS_SUB/R_MICROMIPS_SUB |
224 | fixup_Mips_SUB, |
225 | fixup_MICROMIPS_SUB, |
226 | |
227 | // resulting in - R_MIPS_JALR/R_MICROMIPS_JALR |
228 | fixup_Mips_JALR, |
229 | fixup_MICROMIPS_JALR, |
230 | |
231 | // Marker |
232 | LastTargetFixupKind, |
233 | NumTargetFixupKinds = LastTargetFixupKind - FirstTargetFixupKind |
234 | }; |
235 | } // namespace Mips |
236 | } // namespace llvm |
237 | |
238 | #endif |
239 | |