1 /* ARC relocation types
2 Copyright (C
) 2015-2017 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
)
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, \
39 ARC_RELOC_HOWTO(ARC_8
, 1, \
46 ARC_RELOC_HOWTO(ARC_16
, 2, \
53 ARC_RELOC_HOWTO(ARC_24
, 3, \
60 ARC_RELOC_HOWTO(ARC_32
, 4, \
67 ARC_RELOC_HOWTO(ARC_N8
, 8, \
74 ARC_RELOC_HOWTO(ARC_N16
, 9, \
81 ARC_RELOC_HOWTO(ARC_N24
, 10, \
88 ARC_RELOC_HOWTO(ARC_N32
, 11, \
95 ARC_RELOC_HOWTO(ARC_SDA
, 12, \
100 ( ME ( ( ( S
+ A
) - _SDA_BASE_
) ) ))
102 ARC_RELOC_HOWTO(ARC_SECTOFF
, 13, \
107 ( ( S
- SECTSTART
) + A
))
109 ARC_RELOC_HOWTO(ARC_S21H_PCREL
, 14, \
114 ( ME ( ( ( ( S
+ A
) - P
) >> 1 ) ) ))
116 ARC_RELOC_HOWTO(ARC_S21W_PCREL
, 15, \
121 ( ME ( ( ( ( S
+ A
) - P
) >> 2 ) ) ))
123 ARC_RELOC_HOWTO(ARC_S25H_PCREL
, 16, \
128 ( ME ( ( ( ( S
+ A
) - P
) >> 1 ) ) ))
130 ARC_RELOC_HOWTO(ARC_S25W_PCREL
, 17, \
135 ( ME ( ( ( ( S
+ A
) - P
) >> 2 ) ) ))
137 ARC_RELOC_HOWTO(ARC_SDA32
, 18, \
142 ( ( ( S
+ A
) - _SDA_BASE_
) ))
144 ARC_RELOC_HOWTO(ARC_SDA_LDST
, 19, \
149 ( ME ( ( ( S
+ A
) - _SDA_BASE_
) ) ))
151 ARC_RELOC_HOWTO(ARC_SDA_LDST1
, 20, \
156 ( ME ( ( ( ( S
+ A
) - _SDA_BASE_
) >> 1 ) ) ))
158 ARC_RELOC_HOWTO(ARC_SDA_LDST2
, 21, \
163 ( ME ( ( ( ( S
+ A
) - _SDA_BASE_
) >> 2 ) ) ))
165 ARC_RELOC_HOWTO(ARC_SDA16_LD
, 22, \
170 ( ( S
+ A
) - _SDA_BASE_
))
172 ARC_RELOC_HOWTO(ARC_SDA16_LD1
, 23, \
177 ( ( ( S
+ A
) - _SDA_BASE_
) >> 1 ))
179 ARC_RELOC_HOWTO(ARC_SDA16_LD2
, 24, \
184 ( ( ( S
+ A
) - _SDA_BASE_
) >> 2 ))
186 ARC_RELOC_HOWTO(ARC_S13_PCREL
, 25, \
191 ( ( ( S
+ A
) - P
) >> 2 ))
193 ARC_RELOC_HOWTO(ARC_W
, 26, \
198 ( ( S
+ A
) & ( ~
3 ) ))
200 ARC_RELOC_HOWTO(ARC_32_ME
, 27, \
205 ( ME ( ( S
+ A
) ) ))
207 ARC_RELOC_HOWTO(ARC_32_ME_S
, 105, \
212 ( ME ( ( S
+ A
) ) ))
214 ARC_RELOC_HOWTO(ARC_N32_ME
, 28, \
219 ( ME ( ( A
- S
) ) ))
221 ARC_RELOC_HOWTO(ARC_SECTOFF_ME
, 29, \
226 ( ME ( ( ( S
- SECTSTART
) + A
) ) ))
228 ARC_RELOC_HOWTO(ARC_SDA32_ME
, 30, \
233 ( ME ( ( ( S
+ A
) - _SDA_BASE_
) ) ))
235 ARC_RELOC_HOWTO(ARC_W_ME
, 31, \
240 ( ME ( ( ( S
+ A
) & ( ~
3 ) ) ) ))
242 ARC_RELOC_HOWTO(AC_SECTOFF_U8
, 35, \
247 ( ME ( ( ( S
+ A
) - SECTSTART
) ) ))
249 ARC_RELOC_HOWTO(AC_SECTOFF_U8_1
, 36, \
254 ( ME ( ( ( ( S
+ A
) - SECTSTART
) >> 1 ) ) ))
256 ARC_RELOC_HOWTO(AC_SECTOFF_U8_2
, 37, \
261 ( ME ( ( ( ( S
+ A
) - SECTSTART
) >> 2 ) ) ))
263 ARC_RELOC_HOWTO(AC_SECTOFF_S9
, 38, \
268 ( ME ( ( ( ( S
+ A
) - SECTSTART
) - 256 ) ) ))
270 ARC_RELOC_HOWTO(AC_SECTOFF_S9_1
, 39, \
275 ( ME ( ( ( ( ( S
+ A
) - SECTSTART
) - 256 ) >> 1 ) ) ))
277 ARC_RELOC_HOWTO(AC_SECTOFF_S9_2
, 40, \
282 ( ME ( ( ( ( ( S
+ A
) - SECTSTART
) - 256 ) >> 2 ) ) ))
284 ARC_RELOC_HOWTO(ARC_SECTOFF_ME_1
, 41, \
289 ( ME ( ( ( ( S
- SECTSTART
) + A
) >> 1 ) ) ))
291 ARC_RELOC_HOWTO(ARC_SECTOFF_ME_2
, 42, \
296 ( ME ( ( ( ( S
- SECTSTART
) + A
) >> 2 ) ) ))
298 ARC_RELOC_HOWTO(ARC_SECTOFF_1
, 43, \
303 ( ( ( S
- SECTSTART
) + A
) >> 1 ))
305 ARC_RELOC_HOWTO(ARC_SECTOFF_2
, 44, \
310 ( ( ( S
- SECTSTART
) + A
) >> 2 ))
312 ARC_RELOC_HOWTO(ARC_SDA_12
, 45, \
317 ( ME ( ( ( S
+ A
) - _SDA_BASE_
) ) ))
319 ARC_RELOC_HOWTO(ARC_SDA16_ST2
, 48, \
324 ( ( ( S
+ A
) - _SDA_BASE_
) >> 2 ))
326 ARC_RELOC_HOWTO(ARC_32_PCREL
, 49, \
331 ( ( S
+ A
) - PDATA
))
333 ARC_RELOC_HOWTO(ARC_PC32
, 50, \
338 ( ME ( ( ( S
+ A
) - P
) ) ))
340 ARC_RELOC_HOWTO(ARC_GOT32
, 59, \
347 ARC_RELOC_HOWTO(ARC_GOTPC32
, 51, \
352 ( ME ( ( ( ( GOT
+ G
) + A
) - P
) ) ))
354 ARC_RELOC_HOWTO(ARC_PLT32
, 52, \
359 ( ME ( ( ( L
+ A
) - P
) ) ))
361 ARC_RELOC_HOWTO(ARC_COPY
, 53, \
368 ARC_RELOC_HOWTO(ARC_GLOB_DAT
, 54, \
375 ARC_RELOC_HOWTO(ARC_JMP_SLOT
, 55, \
382 ARC_RELOC_HOWTO(ARC_RELATIVE
, 56, \
387 ( ME ( ( B
+ A
) ) ))
389 ARC_RELOC_HOWTO(ARC_GOTOFF
, 57, \
394 ( ME ( ( ( S
+ A
) - GOT
) ) ))
396 ARC_RELOC_HOWTO(ARC_GOTPC
, 58, \
401 ( ME ( ( GOT_BEGIN
- P
) ) ))
403 ARC_RELOC_HOWTO(ARC_S21W_PCREL_PLT
, 60, \
408 ( ME ( ( ( ( L
+ A
) - P
) >> 2 ) ) ))
410 ARC_RELOC_HOWTO(ARC_S25H_PCREL_PLT
, 61, \
415 ( ME ( ( ( ( L
+ A
) - P
) >> 1 ) ) ))
417 ARC_RELOC_HOWTO(ARC_JLI_SECTOFF
, 63, \
424 ARC_RELOC_HOWTO(ARC_TLS_DTPMOD
, 66, \
431 ARC_RELOC_HOWTO(ARC_TLS_TPOFF
, 68, \
438 ARC_RELOC_HOWTO(ARC_TLS_GD_GOT
, 69, \
443 ( ME ( ( ( G
+ GOT
) - P
) ) ))
445 ARC_RELOC_HOWTO(ARC_TLS_GD_LD
, 70, \
452 ARC_RELOC_HOWTO(ARC_TLS_GD_CALL
, 71, \
459 ARC_RELOC_HOWTO(ARC_TLS_IE_GOT
, 72, \
464 ( ME ( ( ( G
+ GOT
) - P
) ) ))
466 ARC_RELOC_HOWTO(ARC_TLS_DTPOFF
, 67, \
471 ( ME ( S
- SECTSTART
) + A
))
473 ARC_RELOC_HOWTO(ARC_TLS_DTPOFF_S9
, 73, \
478 ( ME ( ( S
- TLS_REL
) ) ))
480 ARC_RELOC_HOWTO(ARC_TLS_LE_S9
, 74, \
485 ( ME ( ( ( S
+ TCB_SIZE
) - TLS_REL
) ) ))
487 ARC_RELOC_HOWTO(ARC_TLS_LE_32
, 75, \
492 ( ME ( ( ( ( S
+ A
) + TCB_SIZE
) - TLS_REL
) ) ))
494 ARC_RELOC_HOWTO(ARC_S25W_PCREL_PLT
, 76, \
499 ( ME ( ( ( ( L
+ A
) - P
) >> 2 ) ) ))
501 ARC_RELOC_HOWTO(ARC_S21H_PCREL_PLT
, 77, \
506 ( ME ( ( ( ( L
+ A
) - P
) >> 1 ) ) ))
508 ARC_RELOC_HOWTO(ARC_NPS_CMEM16
, 78, \