struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / sdbinutils / include / elf / arc-reloc.def
blobd58fa05fecff8f80b3ac43ff9335404f35f9a1e3
1 /* ARC relocation types
2 Copyright (C) 2015-2022 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 GAS/GDB is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3, or (at your option)
19 any later version.
21 GAS/GDB is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
26 You should have received a copy of the GNU General Public License
27 along with GAS or GDB; see the file COPYING3. If not, write to
28 the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
29 MA 02110-1301, USA. */
32 ARC_RELOC_HOWTO(ARC_NONE, 0, \
33 2, \
34 32, \
35 replace_none, \
36 bitfield, \
39 ARC_RELOC_HOWTO(ARC_8, 1, \
40 0, \
41 8, \
42 replace_bits8, \
43 bitfield, \
44 ( S + A ))
46 ARC_RELOC_HOWTO(ARC_16, 2, \
47 1, \
48 16, \
49 replace_bits16, \
50 bitfield, \
51 ( S + A ))
53 ARC_RELOC_HOWTO(ARC_24, 3, \
54 2, \
55 24, \
56 replace_bits24, \
57 bitfield, \
58 ( S + A ))
60 ARC_RELOC_HOWTO(ARC_32, 4, \
61 2, \
62 32, \
63 replace_word32, \
64 bitfield, \
65 ( S + A ))
67 ARC_RELOC_HOWTO(ARC_N8, 8, \
68 0, \
69 8, \
70 replace_bits8, \
71 bitfield, \
72 ( A - S ))
74 ARC_RELOC_HOWTO(ARC_N16, 9, \
75 1, \
76 16, \
77 replace_bits16, \
78 bitfield, \
79 ( A - S ))
81 ARC_RELOC_HOWTO(ARC_N24, 10, \
82 2, \
83 24, \
84 replace_bits24, \
85 bitfield, \
86 ( A - S ))
88 ARC_RELOC_HOWTO(ARC_N32, 11, \
89 2, \
90 32, \
91 replace_word32, \
92 bitfield, \
93 ( A - S ))
95 ARC_RELOC_HOWTO(ARC_SDA, 12, \
96 2, \
97 9, \
98 replace_disp9, \
99 bitfield, \
100 ( ME ( ( ( S + A ) - _SDA_BASE_ ) ) ))
102 ARC_RELOC_HOWTO(ARC_SECTOFF, 13, \
103 2, \
104 32, \
105 replace_word32, \
106 bitfield, \
107 ( ( S - SECTSTART ) + A ))
109 ARC_RELOC_HOWTO(ARC_S21H_PCREL, 14, \
110 2, \
111 20, \
112 replace_disp21h, \
113 signed, \
114 ( ME ( ( ( ( S + A ) - P ) >> 1 ) ) ))
116 ARC_RELOC_HOWTO(ARC_S21W_PCREL, 15, \
117 2, \
118 19, \
119 replace_disp21w, \
120 signed, \
121 ( ME ( ( ( ( S + A ) - P ) >> 2 ) ) ))
123 ARC_RELOC_HOWTO(ARC_S25H_PCREL, 16, \
124 2, \
125 24, \
126 replace_disp25h, \
127 signed, \
128 ( ME ( ( ( ( S + A ) - P ) >> 1 ) ) ))
130 ARC_RELOC_HOWTO(ARC_S25W_PCREL, 17, \
131 2, \
132 23, \
133 replace_disp25w, \
134 signed, \
135 ( ME ( ( ( ( S + A ) - P ) >> 2 ) ) ))
137 ARC_RELOC_HOWTO(ARC_SDA32, 18, \
138 2, \
139 32, \
140 replace_word32, \
141 signed, \
142 ( ( ( S + A ) - _SDA_BASE_ ) ))
144 ARC_RELOC_HOWTO(ARC_SDA_LDST, 19, \
145 2, \
146 9, \
147 replace_disp9ls, \
148 signed, \
149 ( ME ( ( ( S + A ) - _SDA_BASE_ ) ) ))
151 ARC_RELOC_HOWTO(ARC_SDA_LDST1, 20, \
152 2, \
153 9, \
154 replace_disp9ls, \
155 signed, \
156 ( ME ( ( ( ( S + A ) - _SDA_BASE_ ) >> 1 ) ) ))
158 ARC_RELOC_HOWTO(ARC_SDA_LDST2, 21, \
159 2, \
160 9, \
161 replace_disp9ls, \
162 signed, \
163 ( ME ( ( ( ( S + A ) - _SDA_BASE_ ) >> 2 ) ) ))
165 ARC_RELOC_HOWTO(ARC_SDA16_LD, 22, \
166 1, \
167 9, \
168 replace_disp9s, \
169 signed, \
170 ( ( S + A ) - _SDA_BASE_ ))
172 ARC_RELOC_HOWTO(ARC_SDA16_LD1, 23, \
173 1, \
174 9, \
175 replace_disp9s, \
176 signed, \
177 ( ( ( S + A ) - _SDA_BASE_ ) >> 1 ))
179 ARC_RELOC_HOWTO(ARC_SDA16_LD2, 24, \
180 1, \
181 9, \
182 replace_disp9s, \
183 signed, \
184 ( ( ( S + A ) - _SDA_BASE_ ) >> 2 ))
186 ARC_RELOC_HOWTO(ARC_S13_PCREL, 25, \
187 1, \
188 11, \
189 replace_disp13s, \
190 signed, \
191 ( ( ( S + A ) - P ) >> 2 ))
193 ARC_RELOC_HOWTO(ARC_W, 26, \
194 2, \
195 32, \
196 replace_word32, \
197 bitfield, \
198 ( ( S + A ) & ( ~3 ) ))
200 ARC_RELOC_HOWTO(ARC_32_ME, 27, \
201 2, \
202 32, \
203 replace_limm, \
204 signed, \
205 ( ME ( ( S + A ) ) ))
207 ARC_RELOC_HOWTO(ARC_32_ME_S, 105, \
208 2, \
209 32, \
210 replace_limms, \
211 signed, \
212 ( ME ( ( S + A ) ) ))
214 ARC_RELOC_HOWTO(ARC_N32_ME, 28, \
215 2, \
216 32, \
217 replace_word32, \
218 bitfield, \
219 ( ME ( ( A - S ) ) ))
221 ARC_RELOC_HOWTO(ARC_SECTOFF_ME, 29, \
222 2, \
223 32, \
224 replace_word32, \
225 bitfield, \
226 ( ME ( ( ( S - SECTSTART ) + A ) ) ))
228 ARC_RELOC_HOWTO(ARC_SDA32_ME, 30, \
229 2, \
230 32, \
231 replace_limm, \
232 signed, \
233 ( ME ( ( ( S + A ) - _SDA_BASE_ ) ) ))
235 ARC_RELOC_HOWTO(ARC_W_ME, 31, \
236 2, \
237 32, \
238 replace_word32, \
239 bitfield, \
240 ( ME ( ( ( S + A ) & ( ~3 ) ) ) ))
242 ARC_RELOC_HOWTO(AC_SECTOFF_U8, 35, \
243 2, \
244 9, \
245 replace_disp9ls, \
246 bitfield, \
247 ( ME ( ( ( S + A ) - SECTSTART ) ) ))
249 ARC_RELOC_HOWTO(AC_SECTOFF_U8_1, 36, \
250 2, \
251 9, \
252 replace_disp9ls, \
253 bitfield, \
254 ( ME ( ( ( ( S + A ) - SECTSTART ) >> 1 ) ) ))
256 ARC_RELOC_HOWTO(AC_SECTOFF_U8_2, 37, \
257 2, \
258 9, \
259 replace_disp9ls, \
260 bitfield, \
261 ( ME ( ( ( ( S + A ) - SECTSTART ) >> 2 ) ) ))
263 ARC_RELOC_HOWTO(AC_SECTOFF_S9, 38, \
264 2, \
265 9, \
266 replace_disp9ls, \
267 bitfield, \
268 ( ME ( ( ( ( S + A ) - SECTSTART ) - 256 ) ) ))
270 ARC_RELOC_HOWTO(AC_SECTOFF_S9_1, 39, \
271 2, \
272 9, \
273 replace_disp9ls, \
274 bitfield, \
275 ( ME ( ( ( ( ( S + A ) - SECTSTART ) - 256 ) >> 1 ) ) ))
277 ARC_RELOC_HOWTO(AC_SECTOFF_S9_2, 40, \
278 2, \
279 9, \
280 replace_disp9ls, \
281 bitfield, \
282 ( ME ( ( ( ( ( S + A ) - SECTSTART ) - 256 ) >> 2 ) ) ))
284 ARC_RELOC_HOWTO(ARC_SECTOFF_ME_1, 41, \
285 2, \
286 32, \
287 replace_word32, \
288 bitfield, \
289 ( ME ( ( ( ( S - SECTSTART ) + A ) >> 1 ) ) ))
291 ARC_RELOC_HOWTO(ARC_SECTOFF_ME_2, 42, \
292 2, \
293 32, \
294 replace_word32, \
295 bitfield, \
296 ( ME ( ( ( ( S - SECTSTART ) + A ) >> 2 ) ) ))
298 ARC_RELOC_HOWTO(ARC_SECTOFF_1, 43, \
299 2, \
300 32, \
301 replace_word32, \
302 bitfield, \
303 ( ( ( S - SECTSTART ) + A ) >> 1 ))
305 ARC_RELOC_HOWTO(ARC_SECTOFF_2, 44, \
306 2, \
307 32, \
308 replace_word32, \
309 bitfield, \
310 ( ( ( S - SECTSTART ) + A ) >> 2 ))
312 ARC_RELOC_HOWTO(ARC_SDA_12, 45, \
313 2, \
314 12, \
315 replace_disp12s, \
316 signed, \
317 ( ME ( ( ( S + A ) - _SDA_BASE_ ) ) ))
319 ARC_RELOC_HOWTO(ARC_SDA16_ST2, 48, \
320 1, \
321 9, \
322 replace_disp9s1, \
323 signed, \
324 ( ( ( S + A ) - _SDA_BASE_ ) >> 2 ))
326 ARC_RELOC_HOWTO(ARC_32_PCREL, 49, \
327 2, \
328 32, \
329 replace_word32, \
330 signed, \
331 ( ( S + A ) - PDATA ))
333 ARC_RELOC_HOWTO(ARC_PC32, 50, \
334 2, \
335 32, \
336 replace_word32, \
337 signed, \
338 ( ME ( ( ( S + A ) - P ) ) ))
340 ARC_RELOC_HOWTO(ARC_GOT32, 59, \
341 2, \
342 32, \
343 replace_word32, \
344 dont, \
345 ( G + A ))
347 ARC_RELOC_HOWTO(ARC_GOTPC32, 51, \
348 2, \
349 32, \
350 replace_word32, \
351 signed, \
352 ( ME ( ( ( ( GOT + G ) + A ) - P ) ) ))
354 ARC_RELOC_HOWTO(ARC_PLT32, 52, \
355 2, \
356 32, \
357 replace_word32, \
358 signed, \
359 ( ME ( ( ( L + A ) - P ) ) ))
361 ARC_RELOC_HOWTO(ARC_COPY, 53, \
362 2, \
363 0, \
364 replace_none, \
365 signed, \
366 none)
368 ARC_RELOC_HOWTO(ARC_GLOB_DAT, 54, \
369 2, \
370 32, \
371 replace_word32, \
372 signed, \
375 ARC_RELOC_HOWTO(ARC_JMP_SLOT, 55, \
376 2, \
377 32, \
378 replace_word32, \
379 signed, \
380 ( ME ( S ) ))
382 ARC_RELOC_HOWTO(ARC_RELATIVE, 56, \
383 2, \
384 32, \
385 replace_word32, \
386 signed, \
387 ( ME ( ( B + A ) ) ))
389 ARC_RELOC_HOWTO(ARC_GOTOFF, 57, \
390 2, \
391 32, \
392 replace_word32, \
393 signed, \
394 ( ME ( ( ( S + A ) - GOT ) ) ))
396 ARC_RELOC_HOWTO(ARC_GOTPC, 58, \
397 2, \
398 32, \
399 replace_word32, \
400 signed, \
401 ( ME ( ( GOT_BEGIN - P ) ) ))
403 ARC_RELOC_HOWTO(ARC_S21W_PCREL_PLT, 60, \
404 2, \
405 19, \
406 replace_disp21w, \
407 signed, \
408 ( ME ( ( ( ( L + A ) - P ) >> 2 ) ) ))
410 ARC_RELOC_HOWTO(ARC_S25H_PCREL_PLT, 61, \
411 2, \
412 24, \
413 replace_disp25h, \
414 signed, \
415 ( ME ( ( ( ( L + A ) - P ) >> 1 ) ) ))
417 ARC_RELOC_HOWTO(ARC_JLI_SECTOFF, 63, \
418 1, \
419 10, \
420 replace_jli, \
421 bitfield, \
422 ( ( S - JLI ) >> 2))
424 ARC_RELOC_HOWTO(ARC_TLS_DTPMOD, 66, \
425 2, \
426 32, \
427 replace_word32, \
428 dont, \
431 ARC_RELOC_HOWTO(ARC_TLS_TPOFF, 68, \
432 2, \
433 32, \
434 replace_word32, \
435 dont, \
438 ARC_RELOC_HOWTO(ARC_TLS_GD_GOT, 69, \
439 2, \
440 32, \
441 replace_word32, \
442 dont, \
443 ( ME ( ( ( G + GOT ) - P ) ) ))
445 ARC_RELOC_HOWTO(ARC_TLS_GD_LD, 70, \
446 2, \
447 0, \
448 replace_none, \
449 dont, \
452 ARC_RELOC_HOWTO(ARC_TLS_GD_CALL, 71, \
453 2, \
454 32, \
455 replace_word32, \
456 dont, \
459 ARC_RELOC_HOWTO(ARC_TLS_IE_GOT, 72, \
460 2, \
461 32, \
462 replace_word32, \
463 dont, \
464 ( ME ( ( ( G + GOT ) - P ) ) ))
466 ARC_RELOC_HOWTO(ARC_TLS_DTPOFF, 67, \
467 2, \
468 32, \
469 replace_word32, \
470 dont, \
471 ( ME ( S - FINAL_SECTSTART ) + A ))
473 ARC_RELOC_HOWTO(ARC_TLS_DTPOFF_S9, 73, \
474 2, \
475 32, \
476 replace_word32, \
477 dont, \
478 ( ME ( ( S - TLS_REL ) ) ))
480 ARC_RELOC_HOWTO(ARC_TLS_LE_S9, 74, \
481 2, \
482 32, \
483 replace_word32, \
484 dont, \
485 ( ME ( ( ( S + TCB_SIZE ) - TLS_REL ) ) ))
487 ARC_RELOC_HOWTO(ARC_TLS_LE_32, 75, \
488 2, \
489 32, \
490 replace_word32, \
491 dont, \
492 ( ME ( ( ( ( S + A ) + TLS_TBSS ) - TLS_REL ) ) ))
494 ARC_RELOC_HOWTO(ARC_S25W_PCREL_PLT, 76, \
495 2, \
496 23, \
497 replace_disp25w, \
498 signed, \
499 ( ME ( ( ( ( L + A ) - P ) >> 2 ) ) ))
501 ARC_RELOC_HOWTO(ARC_S21H_PCREL_PLT, 77, \
502 2, \
503 20, \
504 replace_disp21h, \
505 signed, \
506 ( ME ( ( ( ( L + A ) - P ) >> 1 ) ) ))
508 ARC_RELOC_HOWTO(ARC_NPS_CMEM16, 78, \
509 2, \
510 16, \
511 replace_bits16, \
512 dont, \
513 ( ME ( S + A )))