1 // arm
-reloc.def
-- ARM relocation definitions.
3 // Copyright (C
) 2010-2022 Free Software Foundation
, Inc.
4 // Written by Doug Kwan
<dougkwan@google.com
>.
6 // This file is part of gold.
8 // This program is free software
; you can redistribute it and
/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation
; either version
3 of the License
, or
11 // (at your option
) any later version.
13 // This program is distributed in the hope that it will be useful
,
14 // but WITHOUT ANY WARRANTY
; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program
; if not
, write to the Free Software
20 // Foundation
, Inc.
, 51 Franklin Street
- Fifth Floor
, Boston
,
21 // MA
02110-1301, USA.
23 // The information here is based on the official ARM document
"ELF for ARM
24 // Architecture" (Document number ARM IHI
0044C
). The first five columns of
25 // the table below are derived from Table
4-8 in the ARM ELF document. Each
26 // relocation from Table
4-8 corresponds to one relocation definition in the
27 // table below. A relocation definition has the following information
:
29 // Name
: This is the name of the relocation without the
"R_ARM_" prefix.
31 // Type
: Relocation type. There are four.
32 // - STATIC for static relocations processed by a static linker.
33 // - DYNAMIC for dynamic relocations processed by a dynamic linker.
34 // - PRIVATE for R_ARM_PRIVATE_
<n
> private relocation type.
35 // - OBSOLETE for old relocation types no longer used.
36 // We do not use DEPRECATED as a distinct type since we still have to
37 // handle deprecated relocations so we one of the types above.
39 // Deprecated
: Whether this is a deprecated relocation type. The linker
40 // is expected to handle these though they should not be generated by fully
41 // conforming tool
-chains.
43 // Operation
: An expression specifying how the linker should perform a
44 // relocation. If there is no operation or the operation cannot be
45 // specified
, it is
"NONE".
47 // Implemented
: Whether this is implemented by the gold.
49 // Group_index
: For a group relocation type
, it is one of
0, 1 or
2. For
50 // a non
-group relocation type
, it is
-1.
52 // Overflow
: Whether gold should check for overflow. This is
"No" by default
53 // for relocation types DYNAMIC
, PRIVATE and OBSOLETE.
55 // Overflow
-----------------------------------------------------------------+
56 // Group index
----------------------------------------------------------+ |
57 // Implemented
-------------------------------------------------------+ | |
58 // Operation
-------------------------------+ | | |
59 // Class
----------------------------+ | | | |
60 // Deprecated
--------------------+ | | | | |
61 // Type
----------------+ | | | | | |
64 RD(NONE
, STATIC
, N
, MISC
, NONE
, Y
, -1, N
)
65 RD(PC24
, STATIC
, Y
, ARM
, ((S
+ A
) | T
) - P
, Y
, -1, Y
)
66 RD(ABS32
, STATIC
, N
, DATA
, (S
+ A
) | T
, Y
, -1, N
)
67 RD(REL32
, STATIC
, N
, DATA
, ((S
+ A
) | T
) - P
, Y
, -1, N
)
68 RD(LDR_PC_G0
, STATIC
, N
, ARM
, S
+ A
- P
, Y
, 0, Y
)
69 RD(ABS16
, STATIC
, N
, DATA
, S
+ A
, Y
, -1, Y
)
70 RD(ABS12
, STATIC
, N
, ARM
, S
+ A
, Y
, -1, Y
)
71 RD(THM_ABS5
, STATIC
, N
, THM16
, S
+ A
, Y
, -1, Y
)
72 RD(ABS8
, STATIC
, N
, DATA
, S
+ A
, Y
, -1, Y
)
73 RD(SBREL32
, STATIC
, N
, DATA
, ((S
+ A
) | T
) - B(S
) , N
, -1, N
)
74 RD(THM_CALL
, STATIC
, N
, THM32
, ((S
+ A
) | T
) - P
, Y
, -1, Y
)
75 RD(THM_PC8
, STATIC
, N
, THM16
, S
+ A
- Pa
, Y
, -1, Y
)
76 RD(BREL_ADJ
, DYNAMIC
, N
, DATA
, DELTA_B(S
) + A
, Y
, -1, N
)
77 RD(TLS_DESC
, DYNAMIC
, N
, DATA
, NONE
, Y
, -1, N
)
78 RD(THM_SWI8
, OBSOLETE
, N
, NONE
, NONE
, N
, -1, N
)
79 RD(XPC25
, OBSOLETE
, N
, NONE
, NONE
, N
, -1, N
)
80 RD(THM_XPC22
, OBSOLETE
, N
, NONE
, NONE
, N
, -1, N
)
81 RD(TLS_DTPMOD32
, DYNAMIC
, N
, DATA
, Module(S
) , Y
, -1, N
)
82 RD(TLS_DTPOFF32
, DYNAMIC
, N
, DATA
, S
+ A
- TLS
, Y
, -1, N
)
83 RD(TLS_TPOFF32
, DYNAMIC
, N
, DATA
, S
+ A
- tp
, Y
, -1, N
)
84 RD(COPY
, DYNAMIC
, N
, MISC
, NONE
, Y
, -1, N
)
85 RD(GLOB_DAT
, DYNAMIC
, N
, DATA
, (S
+ A
) | T
, Y
, -1, N
)
86 RD(JUMP_SLOT
, DYNAMIC
, N
, DATA
, (S
+ A
) | T
, Y
, -1, N
)
87 RD(RELATIVE
, DYNAMIC
, N
, DATA
, B(S
) + A
, Y
, -1, N
)
88 RD(GOTOFF32
, STATIC
, N
, DATA
, ((S
+ A
) | T
) - GOT_ORG
, Y
, -1, N
)
89 RD(BASE_PREL
, STATIC
, N
, DATA
, B(S
) + A
- P
, Y
, -1, N
)
90 RD(GOT_BREL
, STATIC
, N
, DATA
, GOT(S
) + A
- GOT_ORG
, Y
, -1, N
)
91 RD(PLT32
, STATIC
, Y
, ARM
, ((S
+ A
) | T
) - P
, Y
, -1, Y
)
92 RD(CALL
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - P
, Y
, -1, Y
)
93 RD(JUMP24
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - P
, Y
, -1, Y
)
94 RD(THM_JUMP24
, STATIC
, N
, THM32
, ((S
+ A
) | T
) - P
, Y
, -1, Y
)
95 RD(BASE_ABS
, STATIC
, N
, DATA
, B(S
) + A
, Y
, -1, N
)
96 RD(ALU_PCREL_7_0
, OBSOLETE
, N
, NONE
, NONE
, N
, -1, N
)
97 RD(ALU_PCREL_15_8
, OBSOLETE
, N
, NONE
, NONE
, N
, -1, N
)
98 RD(ALU_PCREL_23_15
, OBSOLETE
, N
, NONE
, NONE
, N
, -1, N
)
99 RD(LDR_SBREL_11_0_NC
, STATIC
, Y
, ARM
, S
+ A
- B(S
) , N
, -1, N
)
100 RD(ALU_SBREL_19_12_NC
, STATIC
, Y
, ARM
, S
+ A
- B(S
) , N
, -1, N
)
101 RD(ALU_SBREL_27_20_CK
, STATIC
, Y
, ARM
, S
+ A
- B(S
) , N
, -1, Y
)
102 RD(TARGET1
, STATIC
, N
, MISC
, NONE
, Y
, -1, N
)
103 RD(SBREL31
, STATIC
, Y
, DATA
, ((S
+ A
) | T
) - B(S
) , N
, -1, N
)
104 RD(V4BX
, STATIC
, N
, MISC
, NONE
, Y
, -1, N
)
105 RD(TARGET2
, STATIC
, N
, MISC
, NONE
, Y
, -1, N
)
106 RD(PREL31
, STATIC
, N
, DATA
, ((S
+ A
) | T
) - P
, Y
, -1, Y
)
107 RD(MOVW_ABS_NC
, STATIC
, N
, ARM
, (S
+ A
) | T
, Y
, -1, N
)
108 RD(MOVT_ABS
, STATIC
, N
, ARM
, S
+ A
, Y
, -1, Y
)
109 RD(MOVW_PREL_NC
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - P
, Y
, -1, N
)
110 RD(MOVT_PREL
, STATIC
, N
, ARM
, (S
+ A
) - P
, Y
, -1, Y
)
111 RD(THM_MOVW_ABS_NC
, STATIC
, N
, THM32
, (S
+ A
) | T
, Y
, -1, N
)
112 RD(THM_MOVT_ABS
, STATIC
, N
, THM32
, S
+ A
, Y
, -1, N
)
113 RD(THM_MOVW_PREL_NC
, STATIC
, N
, THM32
, ((S
+ A
) | T
) - P
, Y
, -1, N
)
114 RD(THM_MOVT_PREL
, STATIC
, N
, THM32
, S
+ A
- P
, Y
, -1, N
)
115 RD(THM_JUMP19
, STATIC
, N
, THM32
, ((S
+ A
) | T
) - P
, Y
, -1, Y
)
116 RD(THM_JUMP6
, STATIC
, N
, THM16
, S
+ A
- P
, Y
, -1, Y
)
117 RD(THM_ALU_PREL_11_0
, STATIC
, N
, THM32
, ((S
+ A
) | T
) - Pa
, Y
, -1, Y
)
118 RD(THM_PC12
, STATIC
, N
, THM32
, S
+ A
- Pa
, Y
, -1, Y
)
119 RD(ABS32_NOI
, STATIC
, N
, DATA
, S
+ A
, Y
, -1, N
)
120 RD(REL32_NOI
, STATIC
, N
, DATA
, S
+ A
- P
, N
, -1, N
)
121 RD(ALU_PC_G0_NC
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - P
, Y
, 0, N
)
122 RD(ALU_PC_G0
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - P
, Y
, 0, Y
)
123 RD(ALU_PC_G1_NC
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - P
, Y
, 1, N
)
124 RD(ALU_PC_G1
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - P
, Y
, 1, Y
)
125 RD(ALU_PC_G2
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - P
, Y
, 2, Y
)
126 RD(LDR_PC_G1
, STATIC
, N
, ARM
, S
+ A
- P
, Y
, 1, Y
)
127 RD(LDR_PC_G2
, STATIC
, N
, ARM
, S
+ A
- P
, Y
, 2, Y
)
128 RD(LDRS_PC_G0
, STATIC
, N
, ARM
, S
+ A
- P
, Y
, 0, Y
)
129 RD(LDRS_PC_G1
, STATIC
, N
, ARM
, S
+ A
- P
, Y
, 1, Y
)
130 RD(LDRS_PC_G2
, STATIC
, N
, ARM
, S
+ A
- P
, Y
, 2, Y
)
131 RD(LDC_PC_G0
, STATIC
, N
, ARM
, S
+ A
- P
, Y
, 0, Y
)
132 RD(LDC_PC_G1
, STATIC
, N
, ARM
, S
+ A
- P
, Y
, 1, Y
)
133 RD(LDC_PC_G2
, STATIC
, N
, ARM
, S
+ A
- P
, Y
, 2, Y
)
134 RD(ALU_SB_G0_NC
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - B(S
) , Y
, 0, N
)
135 RD(ALU_SB_G0
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - B(S
) , Y
, 0, Y
)
136 RD(ALU_SB_G1_NC
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - B(S
) , Y
, 1, N
)
137 RD(ALU_SB_G1
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - B(S
) , Y
, 1, Y
)
138 RD(ALU_SB_G2
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - B(S
) , Y
, 2, Y
)
139 RD(LDR_SB_G0
, STATIC
, N
, ARM
, S
+ A
- B(S
) , Y
, 0, Y
)
140 RD(LDR_SB_G1
, STATIC
, N
, ARM
, S
+ A
- B(S
) , Y
, 1, Y
)
141 RD(LDR_SB_G2
, STATIC
, N
, ARM
, S
+ A
- B(S
) , Y
, 2, Y
)
142 RD(LDRS_SB_G0
, STATIC
, N
, ARM
, S
+ A
- B(S
) , Y
, 0, Y
)
143 RD(LDRS_SB_G1
, STATIC
, N
, ARM
, S
+ A
- B(S
) , Y
, 1, Y
)
144 RD(LDRS_SB_G2
, STATIC
, N
, ARM
, S
+ A
- B(S
) , Y
, 2, Y
)
145 RD(LDC_SB_G0
, STATIC
, N
, ARM
, S
+ A
- B(S
) , Y
, 0, Y
)
146 RD(LDC_SB_G1
, STATIC
, N
, ARM
, S
+ A
- B(S
) , Y
, 1, Y
)
147 RD(LDC_SB_G2
, STATIC
, N
, ARM
, S
+ A
- B(S
) , Y
, 2, Y
)
148 RD(MOVW_BREL_NC
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - B(S
) , Y
, -1, N
)
149 RD(MOVT_BREL
, STATIC
, N
, ARM
, S
+ A
- B(S
) , Y
, -1, Y
)
150 RD(MOVW_BREL
, STATIC
, N
, ARM
, ((S
+ A
) | T
) - B(S
) , Y
, -1, Y
)
151 RD(THM_MOVW_BREL_NC
, STATIC
, N
, THM32
, ((S
+ A
) | T
) - B(S
) , Y
, -1, N
)
152 RD(THM_MOVT_BREL
, STATIC
, N
, THM32
, S
+ A
- B(S
) , Y
, -1, N
)
153 RD(THM_MOVW_BREL
, STATIC
, N
, THM32
, ((S
+ A
) | T
) - B(S
) , Y
, -1, Y
)
154 RD(TLS_GOTDESC
, STATIC
, N
, DATA
, NONE
, Y
, -1, N
)
155 RD(TLS_CALL
, STATIC
, N
, ARM
, NONE
, N
, -1, Y
)
156 RD(TLS_DESCSEQ
, STATIC
, N
, ARM
, NONE
, N
, -1, Y
)
157 RD(THM_TLS_CALL
, STATIC
, N
, THM32
, NONE
, N
, -1, Y
)
158 RD(PLT32_ABS
, STATIC
, N
, DATA
, PLT(S
) + A
, N
, -1, N
)
159 RD(GOT_ABS
, STATIC
, N
, DATA
, GOT(S
) + A
, N
, -1, N
)
160 RD(GOT_PREL
, STATIC
, N
, DATA
, GOT(S
) + A
- P
, Y
, -1, N
)
161 RD(GOT_BREL12
, STATIC
, N
, ARM
, GOT(S
) + A
- GOT_ORG
, N
, -1, Y
)
162 RD(GOTOFF12
, STATIC
, N
, ARM
, S
+ A
- GOT_ORG
, N
, -1, Y
)
163 RD(GOTRELAX
, STATIC
, N
, MISC
, NONE
, N
, -1, N
)
164 RD(GNU_VTENTRY
, STATIC
, Y
, DATA
, NONE
, Y
, -1, N
)
165 RD(GNU_VTINHERIT
, STATIC
, Y
, DATA
, NONE
, Y
, -1, N
)
166 RD(THM_JUMP11
, STATIC
, N
, THM16
, S
+ A
- P
, Y
, -1, Y
)
167 RD(THM_JUMP8
, STATIC
, N
, THM16
, S
+ A
- P
, Y
, -1, Y
)
168 RD(TLS_GD32
, STATIC
, N
, DATA
, GOT(S
) + A
- P
, Y
, -1, N
)
169 RD(TLS_LDM32
, STATIC
, N
, DATA
, GOT(S
) + A
- P
, Y
, -1, N
)
170 RD(TLS_LDO32
, STATIC
, N
, DATA
, S
+ A
- TLS
, Y
, -1, N
)
171 RD(TLS_IE32
, STATIC
, N
, DATA
, GOT(S
) + A
- P
, Y
, -1, N
)
172 RD(TLS_LE32
, STATIC
, N
, DATA
, S
+ A
- tp
, Y
, -1, N
)
173 RD(TLS_LDO12
, STATIC
, N
, ARM
, S
+ A
- TLS
, N
, -1, Y
)
174 RD(TLS_LE12
, STATIC
, N
, ARM
, S
+ A
- tp
, N
, -1, Y
)
175 RD(TLS_IE12GP
, STATIC
, N
, ARM
, GOT(S
) + A
- GOT_ORG
, N
, -1, Y
)
176 RD(PRIVATE_0
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
177 RD(PRIVATE_1
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
178 RD(PRIVATE_2
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
179 RD(PRIVATE_3
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
180 RD(PRIVATE_4
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
181 RD(PRIVATE_5
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
182 RD(PRIVATE_6
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
183 RD(PRIVATE_7
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
184 RD(PRIVATE_8
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
185 RD(PRIVATE_9
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
186 RD(PRIVATE_10
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
187 RD(PRIVATE_11
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
188 RD(PRIVATE_12
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
189 RD(PRIVATE_13
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
190 RD(PRIVATE_14
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
191 RD(PRIVATE_15
, PRIVATE
, N
, NONE
, NONE
, N
, -1, N
)
192 RD(ME_TOO
, OBSOLETE
, N
, NONE
, NONE
, N
, -1, N
)
193 RD(THM_TLS_DESCSEQ16
, STATIC
, N
, THM16
, NONE
, N
, -1, Y
)
194 RD(THM_TLS_DESCSEQ32
, STATIC
, N
, THM32
, NONE
, N
, -1, Y
)