Line data Source code
1 : use std::marker::PhantomData;
2 :
3 : use lief_ffi as ffi;
4 : use crate::generic;
5 : use crate::elf::Section;
6 :
7 : use crate::common::into_optional;
8 : use crate::common::FromFFI;
9 : use crate::declare_iterator;
10 :
11 : use super::Symbol;
12 :
13 : /// Structure which reprents an ELF relocation
14 : pub struct Relocation<'a> {
15 : ptr: cxx::UniquePtr<ffi::ELF_Relocation>,
16 : _owner: PhantomData<&'a ffi::ELF_Binary>
17 : }
18 :
19 :
20 : #[allow(non_camel_case_types)]
21 12960 : #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
22 : /// The different types of the relocation
23 : pub enum Type {
24 : X86_64_NONE,
25 : X86_64_64,
26 : X86_64_PC32,
27 : X86_64_GOT32,
28 : X86_64_PLT32,
29 : X86_64_COPY,
30 : X86_64_GLOB_DAT,
31 : X86_64_JUMP_SLOT,
32 : X86_64_RELATIVE,
33 : X86_64_GOTPCREL,
34 : X86_64_32,
35 : X86_64_32S,
36 : X86_64_16,
37 : X86_64_PC16,
38 : X86_64_8,
39 : X86_64_PC8,
40 : X86_64_DTPMOD64,
41 : X86_64_DTPOFF64,
42 : X86_64_TPOFF64,
43 : X86_64_TLSGD,
44 : X86_64_TLSLD,
45 : X86_64_DTPOFF32,
46 : X86_64_GOTTPOFF,
47 : X86_64_TPOFF32,
48 : X86_64_PC64,
49 : X86_64_GOTOFF64,
50 : X86_64_GOTPC32,
51 : X86_64_GOT64,
52 : X86_64_GOTPCREL64,
53 : X86_64_GOTPC64,
54 : X86_64_GOTPLT64,
55 : X86_64_PLTOFF64,
56 : X86_64_SIZE32,
57 : X86_64_SIZE64,
58 : X86_64_GOTPC32_TLSDESC,
59 : X86_64_TLSDESC_CALL,
60 : X86_64_TLSDESC,
61 : X86_64_IRELATIVE,
62 : X86_64_RELATIVE64,
63 : X86_64_PC32_BND,
64 : X86_64_PLT32_BND,
65 : X86_64_GOTPCRELX,
66 : X86_64_REX_GOTPCRELX,
67 : AARCH64_NONE,
68 : AARCH64_ABS64,
69 : AARCH64_ABS32,
70 : AARCH64_ABS16,
71 : AARCH64_PREL64,
72 : AARCH64_PREL32,
73 : AARCH64_PREL16,
74 : AARCH64_MOVW_UABS_G0,
75 : AARCH64_MOVW_UABS_G0_NC,
76 : AARCH64_MOVW_UABS_G1,
77 : AARCH64_MOVW_UABS_G1_NC,
78 : AARCH64_MOVW_UABS_G2,
79 : AARCH64_MOVW_UABS_G2_NC,
80 : AARCH64_MOVW_UABS_G3,
81 : AARCH64_MOVW_SABS_G0,
82 : AARCH64_MOVW_SABS_G1,
83 : AARCH64_MOVW_SABS_G2,
84 : AARCH64_LD_PREL_LO19,
85 : AARCH64_ADR_PREL_LO21,
86 : AARCH64_ADR_PREL_PG_HI21,
87 : AARCH64_ADR_PREL_PG_HI21_NC,
88 : AARCH64_ADD_ABS_LO12_NC,
89 : AARCH64_LDST8_ABS_LO12_NC,
90 : AARCH64_TSTBR14,
91 : AARCH64_CONDBR19,
92 : AARCH64_JUMP26,
93 : AARCH64_CALL26,
94 : AARCH64_LDST16_ABS_LO12_NC,
95 : AARCH64_LDST32_ABS_LO12_NC,
96 : AARCH64_LDST64_ABS_LO12_NC,
97 : AARCH64_MOVW_PREL_G0,
98 : AARCH64_MOVW_PREL_G0_NC,
99 : AARCH64_MOVW_PREL_G1,
100 : AARCH64_MOVW_PREL_G1_NC,
101 : AARCH64_MOVW_PREL_G2,
102 : AARCH64_MOVW_PREL_G2_NC,
103 : AARCH64_MOVW_PREL_G3,
104 : AARCH64_LDST128_ABS_LO12_NC,
105 : AARCH64_MOVW_GOTOFF_G0,
106 : AARCH64_MOVW_GOTOFF_G0_NC,
107 : AARCH64_MOVW_GOTOFF_G1,
108 : AARCH64_MOVW_GOTOFF_G1_NC,
109 : AARCH64_MOVW_GOTOFF_G2,
110 : AARCH64_MOVW_GOTOFF_G2_NC,
111 : AARCH64_MOVW_GOTOFF_G3,
112 : AARCH64_GOTREL64,
113 : AARCH64_GOTREL32,
114 : AARCH64_GOT_LD_PREL19,
115 : AARCH64_LD64_GOTOFF_LO15,
116 : AARCH64_ADR_GOT_PAGE,
117 : AARCH64_LD64_GOT_LO12_NC,
118 : AARCH64_LD64_GOTPAGE_LO15,
119 : AARCH64_TLSGD_ADR_PREL21,
120 : AARCH64_TLSGD_ADR_PAGE21,
121 : AARCH64_TLSGD_ADD_LO12_NC,
122 : AARCH64_TLSGD_MOVW_G1,
123 : AARCH64_TLSGD_MOVW_G0_NC,
124 : AARCH64_TLSLD_ADR_PREL21,
125 : AARCH64_TLSLD_ADR_PAGE21,
126 : AARCH64_TLSLD_ADD_LO12_NC,
127 : AARCH64_TLSLD_MOVW_G1,
128 : AARCH64_TLSLD_MOVW_G0_NC,
129 : AARCH64_TLSLD_LD_PREL19,
130 : AARCH64_TLSLD_MOVW_DTPREL_G2,
131 : AARCH64_TLSLD_MOVW_DTPREL_G1,
132 : AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
133 : AARCH64_TLSLD_MOVW_DTPREL_G0,
134 : AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
135 : AARCH64_TLSLD_ADD_DTPREL_HI12,
136 : AARCH64_TLSLD_ADD_DTPREL_LO12,
137 : AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
138 : AARCH64_TLSLD_LDST8_DTPREL_LO12,
139 : AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
140 : AARCH64_TLSLD_LDST16_DTPREL_LO12,
141 : AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
142 : AARCH64_TLSLD_LDST32_DTPREL_LO12,
143 : AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
144 : AARCH64_TLSLD_LDST64_DTPREL_LO12,
145 : AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
146 : AARCH64_TLSIE_MOVW_GOTTPREL_G1,
147 : AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
148 : AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
149 : AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
150 : AARCH64_TLSIE_LD_GOTTPREL_PREL19,
151 : AARCH64_TLSLE_MOVW_TPREL_G2,
152 : AARCH64_TLSLE_MOVW_TPREL_G1,
153 : AARCH64_TLSLE_MOVW_TPREL_G1_NC,
154 : AARCH64_TLSLE_MOVW_TPREL_G0,
155 : AARCH64_TLSLE_MOVW_TPREL_G0_NC,
156 : AARCH64_TLSLE_ADD_TPREL_HI12,
157 : AARCH64_TLSLE_ADD_TPREL_LO12,
158 : AARCH64_TLSLE_ADD_TPREL_LO12_NC,
159 : AARCH64_TLSLE_LDST8_TPREL_LO12,
160 : AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
161 : AARCH64_TLSLE_LDST16_TPREL_LO12,
162 : AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
163 : AARCH64_TLSLE_LDST32_TPREL_LO12,
164 : AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
165 : AARCH64_TLSLE_LDST64_TPREL_LO12,
166 : AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
167 : AARCH64_TLSDESC_LD_PREL19,
168 : AARCH64_TLSDESC_ADR_PREL21,
169 : AARCH64_TLSDESC_ADR_PAGE21,
170 : AARCH64_TLSDESC_LD64_LO12_NC,
171 : AARCH64_TLSDESC_ADD_LO12_NC,
172 : AARCH64_TLSDESC_OFF_G1,
173 : AARCH64_TLSDESC_OFF_G0_NC,
174 : AARCH64_TLSDESC_LDR,
175 : AARCH64_TLSDESC_ADD,
176 : AARCH64_TLSDESC_CALL,
177 : AARCH64_TLSLE_LDST128_TPREL_LO12,
178 : AARCH64_TLSLE_LDST128_TPREL_LO12_NC,
179 : AARCH64_TLSLD_LDST128_DTPREL_LO12,
180 : AARCH64_TLSLD_LDST128_DTPREL_LO12_NC,
181 : AARCH64_COPY,
182 : AARCH64_GLOB_DAT,
183 : AARCH64_JUMP_SLOT,
184 : AARCH64_RELATIVE,
185 : AARCH64_TLS_DTPREL64,
186 : AARCH64_TLS_DTPMOD64,
187 : AARCH64_TLS_TPREL64,
188 : AARCH64_TLSDESC,
189 : AARCH64_IRELATIVE,
190 : ARM_NONE,
191 : ARM_PC24,
192 : ARM_ABS32,
193 : ARM_REL32,
194 : ARM_LDR_PC_G0,
195 : ARM_ABS16,
196 : ARM_ABS12,
197 : ARM_THM_ABS5,
198 : ARM_ABS8,
199 : ARM_SBREL32,
200 : ARM_THM_CALL,
201 : ARM_THM_PC8,
202 : ARM_BREL_ADJ,
203 : ARM_TLS_DESC,
204 : ARM_THM_SWI8,
205 : ARM_XPC25,
206 : ARM_THM_XPC22,
207 : ARM_TLS_DTPMOD32,
208 : ARM_TLS_DTPOFF32,
209 : ARM_TLS_TPOFF32,
210 : ARM_COPY,
211 : ARM_GLOB_DAT,
212 : ARM_JUMP_SLOT,
213 : ARM_RELATIVE,
214 : ARM_GOTOFF32,
215 : ARM_BASE_PREL,
216 : ARM_GOT_BREL,
217 : ARM_PLT32,
218 : ARM_CALL,
219 : ARM_JUMP24,
220 : ARM_THM_JUMP24,
221 : ARM_BASE_ABS,
222 : ARM_ALU_PCREL_7_0,
223 : ARM_ALU_PCREL_15_8,
224 : ARM_ALU_PCREL_23_15,
225 : ARM_LDR_SBREL_11_0_NC,
226 : ARM_ALU_SBREL_19_12_NC,
227 : ARM_ALU_SBREL_27_20_CK,
228 : ARM_TARGET1,
229 : ARM_SBREL31,
230 : ARM_V4BX,
231 : ARM_TARGET2,
232 : ARM_PREL31,
233 : ARM_MOVW_ABS_NC,
234 : ARM_MOVT_ABS,
235 : ARM_MOVW_PREL_NC,
236 : ARM_MOVT_PREL,
237 : ARM_THM_MOVW_ABS_NC,
238 : ARM_THM_MOVT_ABS,
239 : ARM_THM_MOVW_PREL_NC,
240 : ARM_THM_MOVT_PREL,
241 : ARM_THM_JUMP19,
242 : ARM_THM_JUMP6,
243 : ARM_THM_ALU_PREL_11_0,
244 : ARM_THM_PC12,
245 : ARM_ABS32_NOI,
246 : ARM_REL32_NOI,
247 : ARM_ALU_PC_G0_NC,
248 : ARM_ALU_PC_G0,
249 : ARM_ALU_PC_G1_NC,
250 : ARM_ALU_PC_G1,
251 : ARM_ALU_PC_G2,
252 : ARM_LDR_PC_G1,
253 : ARM_LDR_PC_G2,
254 : ARM_LDRS_PC_G0,
255 : ARM_LDRS_PC_G1,
256 : ARM_LDRS_PC_G2,
257 : ARM_LDC_PC_G0,
258 : ARM_LDC_PC_G1,
259 : ARM_LDC_PC_G2,
260 : ARM_ALU_SB_G0_NC,
261 : ARM_ALU_SB_G0,
262 : ARM_ALU_SB_G1_NC,
263 : ARM_ALU_SB_G1,
264 : ARM_ALU_SB_G2,
265 : ARM_LDR_SB_G0,
266 : ARM_LDR_SB_G1,
267 : ARM_LDR_SB_G2,
268 : ARM_LDRS_SB_G0,
269 : ARM_LDRS_SB_G1,
270 : ARM_LDRS_SB_G2,
271 : ARM_LDC_SB_G0,
272 : ARM_LDC_SB_G1,
273 : ARM_LDC_SB_G2,
274 : ARM_MOVW_BREL_NC,
275 : ARM_MOVT_BREL,
276 : ARM_MOVW_BREL,
277 : ARM_THM_MOVW_BREL_NC,
278 : ARM_THM_MOVT_BREL,
279 : ARM_THM_MOVW_BREL,
280 : ARM_TLS_GOTDESC,
281 : ARM_TLS_CALL,
282 : ARM_TLS_DESCSEQ,
283 : ARM_THM_TLS_CALL,
284 : ARM_PLT32_ABS,
285 : ARM_GOT_ABS,
286 : ARM_GOT_PREL,
287 : ARM_GOT_BREL12,
288 : ARM_GOTOFF12,
289 : ARM_GOTRELAX,
290 : ARM_GNU_VTENTRY,
291 : ARM_GNU_VTINHERIT,
292 : ARM_THM_JUMP11,
293 : ARM_THM_JUMP8,
294 : ARM_TLS_GD32,
295 : ARM_TLS_LDM32,
296 : ARM_TLS_LDO32,
297 : ARM_TLS_IE32,
298 : ARM_TLS_LE32,
299 : ARM_TLS_LDO12,
300 : ARM_TLS_LE12,
301 : ARM_TLS_IE12GP,
302 : ARM_PRIVATE_0,
303 : ARM_PRIVATE_1,
304 : ARM_PRIVATE_2,
305 : ARM_PRIVATE_3,
306 : ARM_PRIVATE_4,
307 : ARM_PRIVATE_5,
308 : ARM_PRIVATE_6,
309 : ARM_PRIVATE_7,
310 : ARM_PRIVATE_8,
311 : ARM_PRIVATE_9,
312 : ARM_PRIVATE_10,
313 : ARM_PRIVATE_11,
314 : ARM_PRIVATE_12,
315 : ARM_PRIVATE_13,
316 : ARM_PRIVATE_14,
317 : ARM_PRIVATE_15,
318 : ARM_ME_TOO,
319 : ARM_THM_TLS_DESCSEQ16,
320 : ARM_THM_TLS_DESCSEQ32,
321 : ARM_IRELATIVE,
322 : ARM_RXPC25,
323 : ARM_RSBREL32,
324 : ARM_THM_RPC22,
325 : ARM_RREL32,
326 : ARM_RPC24,
327 : ARM_RBASE,
328 : HEX_NONE,
329 : HEX_B22_PCREL,
330 : HEX_B15_PCREL,
331 : HEX_B7_PCREL,
332 : HEX_LO16,
333 : HEX_HI16,
334 : HEX_32,
335 : HEX_16,
336 : HEX_8,
337 : HEX_GPREL16_0,
338 : HEX_GPREL16_1,
339 : HEX_GPREL16_2,
340 : HEX_GPREL16_3,
341 : HEX_HL16,
342 : HEX_B13_PCREL,
343 : HEX_B9_PCREL,
344 : HEX_B32_PCREL_X,
345 : HEX_32_6_X,
346 : HEX_B22_PCREL_X,
347 : HEX_B15_PCREL_X,
348 : HEX_B13_PCREL_X,
349 : HEX_B9_PCREL_X,
350 : HEX_B7_PCREL_X,
351 : HEX_16_X,
352 : HEX_12_X,
353 : HEX_11_X,
354 : HEX_10_X,
355 : HEX_9_X,
356 : HEX_8_X,
357 : HEX_7_X,
358 : HEX_6_X,
359 : HEX_32_PCREL,
360 : HEX_COPY,
361 : HEX_GLOB_DAT,
362 : HEX_JMP_SLOT,
363 : HEX_RELATIVE,
364 : HEX_PLT_B22_PCREL,
365 : HEX_GOTREL_LO16,
366 : HEX_GOTREL_HI16,
367 : HEX_GOTREL_32,
368 : HEX_GOT_LO16,
369 : HEX_GOT_HI16,
370 : HEX_GOT_32,
371 : HEX_GOT_16,
372 : HEX_DTPMOD_32,
373 : HEX_DTPREL_LO16,
374 : HEX_DTPREL_HI16,
375 : HEX_DTPREL_32,
376 : HEX_DTPREL_16,
377 : HEX_GD_PLT_B22_PCREL,
378 : HEX_GD_GOT_LO16,
379 : HEX_GD_GOT_HI16,
380 : HEX_GD_GOT_32,
381 : HEX_GD_GOT_16,
382 : HEX_IE_LO16,
383 : HEX_IE_HI16,
384 : HEX_IE_32,
385 : HEX_IE_GOT_LO16,
386 : HEX_IE_GOT_HI16,
387 : HEX_IE_GOT_32,
388 : HEX_IE_GOT_16,
389 : HEX_TPREL_LO16,
390 : HEX_TPREL_HI16,
391 : HEX_TPREL_32,
392 : HEX_TPREL_16,
393 : HEX_6_PCREL_X,
394 : HEX_GOTREL_32_6_X,
395 : HEX_GOTREL_16_X,
396 : HEX_GOTREL_11_X,
397 : HEX_GOT_32_6_X,
398 : HEX_GOT_16_X,
399 : HEX_GOT_11_X,
400 : HEX_DTPREL_32_6_X,
401 : HEX_DTPREL_16_X,
402 : HEX_DTPREL_11_X,
403 : HEX_GD_GOT_32_6_X,
404 : HEX_GD_GOT_16_X,
405 : HEX_GD_GOT_11_X,
406 : HEX_IE_32_6_X,
407 : HEX_IE_16_X,
408 : HEX_IE_GOT_32_6_X,
409 : HEX_IE_GOT_16_X,
410 : HEX_IE_GOT_11_X,
411 : HEX_TPREL_32_6_X,
412 : HEX_TPREL_16_X,
413 : HEX_TPREL_11_X,
414 : HEX_LD_PLT_B22_PCREL,
415 : HEX_LD_GOT_LO16,
416 : HEX_LD_GOT_HI16,
417 : HEX_LD_GOT_32,
418 : HEX_LD_GOT_16,
419 : HEX_LD_GOT_32_6_X,
420 : HEX_LD_GOT_16_X,
421 : HEX_LD_GOT_11_X,
422 : X86_NONE,
423 : X86_32,
424 : X86_PC32,
425 : X86_GOT32,
426 : X86_PLT32,
427 : X86_COPY,
428 : X86_GLOB_DAT,
429 : X86_JUMP_SLOT,
430 : X86_RELATIVE,
431 : X86_GOTOFF,
432 : X86_GOTPC,
433 : X86_32PLT,
434 : X86_TLS_TPOFF,
435 : X86_TLS_IE,
436 : X86_TLS_GOTIE,
437 : X86_TLS_LE,
438 : X86_TLS_GD,
439 : X86_TLS_LDM,
440 : X86_16,
441 : X86_PC16,
442 : X86_8,
443 : X86_PC8,
444 : X86_TLS_GD_32,
445 : X86_TLS_GD_PUSH,
446 : X86_TLS_GD_CALL,
447 : X86_TLS_GD_POP,
448 : X86_TLS_LDM_32,
449 : X86_TLS_LDM_PUSH,
450 : X86_TLS_LDM_CALL,
451 : X86_TLS_LDM_POP,
452 : X86_TLS_LDO_32,
453 : X86_TLS_IE_32,
454 : X86_TLS_LE_32,
455 : X86_TLS_DTPMOD32,
456 : X86_TLS_DTPOFF32,
457 : X86_TLS_TPOFF32,
458 : X86_TLS_GOTDESC,
459 : X86_TLS_DESC_CALL,
460 : X86_TLS_DESC,
461 : X86_IRELATIVE,
462 : LARCH_NONE,
463 : LARCH_32,
464 : LARCH_64,
465 : LARCH_RELATIVE,
466 : LARCH_COPY,
467 : LARCH_JUMP_SLOT,
468 : LARCH_TLS_DTPMOD32,
469 : LARCH_TLS_DTPMOD64,
470 : LARCH_TLS_DTPREL32,
471 : LARCH_TLS_DTPREL64,
472 : LARCH_TLS_TPREL32,
473 : LARCH_TLS_TPREL64,
474 : LARCH_IRELATIVE,
475 : LARCH_MARK_LA,
476 : LARCH_MARK_PCREL,
477 : LARCH_SOP_PUSH_PCREL,
478 : LARCH_SOP_PUSH_ABSOLUTE,
479 : LARCH_SOP_PUSH_DUP,
480 : LARCH_SOP_PUSH_GPREL,
481 : LARCH_SOP_PUSH_TLS_TPREL,
482 : LARCH_SOP_PUSH_TLS_GOT,
483 : LARCH_SOP_PUSH_TLS_GD,
484 : LARCH_SOP_PUSH_PLT_PCREL,
485 : LARCH_SOP_ASSERT,
486 : LARCH_SOP_NOT,
487 : LARCH_SOP_SUB,
488 : LARCH_SOP_SL,
489 : LARCH_SOP_SR,
490 : LARCH_SOP_ADD,
491 : LARCH_SOP_AND,
492 : LARCH_SOP_IF_ELSE,
493 : LARCH_SOP_POP_32_S_10_5,
494 : LARCH_SOP_POP_32_U_10_12,
495 : LARCH_SOP_POP_32_S_10_12,
496 : LARCH_SOP_POP_32_S_10_16,
497 : LARCH_SOP_POP_32_S_10_16_S2,
498 : LARCH_SOP_POP_32_S_5_20,
499 : LARCH_SOP_POP_32_S_0_5_10_16_S2,
500 : LARCH_SOP_POP_32_S_0_10_10_16_S2,
501 : LARCH_SOP_POP_32_U,
502 : LARCH_ADD8,
503 : LARCH_ADD16,
504 : LARCH_ADD24,
505 : LARCH_ADD32,
506 : LARCH_ADD64,
507 : LARCH_SUB8,
508 : LARCH_SUB16,
509 : LARCH_SUB24,
510 : LARCH_SUB32,
511 : LARCH_SUB64,
512 : LARCH_GNU_VTINHERIT,
513 : LARCH_GNU_VTENTRY,
514 : LARCH_B16,
515 : LARCH_B21,
516 : LARCH_B26,
517 : LARCH_ABS_HI20,
518 : LARCH_ABS_LO12,
519 : LARCH_ABS64_LO20,
520 : LARCH_ABS64_HI12,
521 : LARCH_PCALA_HI20,
522 : LARCH_PCALA_LO12,
523 : LARCH_PCALA64_LO20,
524 : LARCH_PCALA64_HI12,
525 : LARCH_GOT_PC_HI20,
526 : LARCH_GOT_PC_LO12,
527 : LARCH_GOT64_PC_LO20,
528 : LARCH_GOT64_PC_HI12,
529 : LARCH_GOT_HI20,
530 : LARCH_GOT_LO12,
531 : LARCH_GOT64_LO20,
532 : LARCH_GOT64_HI12,
533 : LARCH_TLS_LE_HI20,
534 : LARCH_TLS_LE_LO12,
535 : LARCH_TLS_LE64_LO20,
536 : LARCH_TLS_LE64_HI12,
537 : LARCH_TLS_IE_PC_HI20,
538 : LARCH_TLS_IE_PC_LO12,
539 : LARCH_TLS_IE64_PC_LO20,
540 : LARCH_TLS_IE64_PC_HI12,
541 : LARCH_TLS_IE_HI20,
542 : LARCH_TLS_IE_LO12,
543 : LARCH_TLS_IE64_LO20,
544 : LARCH_TLS_IE64_HI12,
545 : LARCH_TLS_LD_PC_HI20,
546 : LARCH_TLS_LD_HI20,
547 : LARCH_TLS_GD_PC_HI20,
548 : LARCH_TLS_GD_HI20,
549 : LARCH_32_PCREL,
550 : LARCH_RELAX,
551 : MIPS_NONE,
552 : MIPS_16,
553 : MIPS_32,
554 : MIPS_REL32,
555 : MIPS_26,
556 : MIPS_HI16,
557 : MIPS_LO16,
558 : MIPS_GPREL16,
559 : MIPS_LITERAL,
560 : MIPS_GOT16,
561 : MIPS_PC16,
562 : MIPS_CALL16,
563 : MIPS_GPREL32,
564 : MIPS_UNUSED1,
565 : MIPS_UNUSED2,
566 : MIPS_UNUSED3,
567 : MIPS_SHIFT5,
568 : MIPS_SHIFT6,
569 : MIPS_64,
570 : MIPS_GOT_DISP,
571 : MIPS_GOT_PAGE,
572 : MIPS_GOT_OFST,
573 : MIPS_GOT_HI16,
574 : MIPS_GOT_LO16,
575 : MIPS_SUB,
576 : MIPS_INSERT_A,
577 : MIPS_INSERT_B,
578 : MIPS_DELETE,
579 : MIPS_HIGHER,
580 : MIPS_HIGHEST,
581 : MIPS_CALL_HI16,
582 : MIPS_CALL_LO16,
583 : MIPS_SCN_DISP,
584 : MIPS_REL16,
585 : MIPS_ADD_IMMEDIATE,
586 : MIPS_PJUMP,
587 : MIPS_RELGOT,
588 : MIPS_JALR,
589 : MIPS_TLS_DTPMOD32,
590 : MIPS_TLS_DTPREL32,
591 : MIPS_TLS_DTPMOD64,
592 : MIPS_TLS_DTPREL64,
593 : MIPS_TLS_GD,
594 : MIPS_TLS_LDM,
595 : MIPS_TLS_DTPREL_HI16,
596 : MIPS_TLS_DTPREL_LO16,
597 : MIPS_TLS_GOTTPREL,
598 : MIPS_TLS_TPREL32,
599 : MIPS_TLS_TPREL64,
600 : MIPS_TLS_TPREL_HI16,
601 : MIPS_TLS_TPREL_LO16,
602 : MIPS_GLOB_DAT,
603 : MIPS_PC21_S2,
604 : MIPS_PC26_S2,
605 : MIPS_PC18_S3,
606 : MIPS_PC19_S2,
607 : MIPS_PCHI16,
608 : MIPS_PCLO16,
609 : MIPS16_26,
610 : MIPS16_GPREL,
611 : MIPS16_GOT16,
612 : MIPS16_CALL16,
613 : MIPS16_HI16,
614 : MIPS16_LO16,
615 : MIPS16_TLS_GD,
616 : MIPS16_TLS_LDM,
617 : MIPS16_TLS_DTPREL_HI16,
618 : MIPS16_TLS_DTPREL_LO16,
619 : MIPS16_TLS_GOTTPREL,
620 : MIPS16_TLS_TPREL_HI16,
621 : MIPS16_TLS_TPREL_LO16,
622 : MIPS_COPY,
623 : MIPS_JUMP_SLOT,
624 : MICROMIPS_26_S1,
625 : MICROMIPS_HI16,
626 : MICROMIPS_LO16,
627 : MICROMIPS_GPREL16,
628 : MICROMIPS_LITERAL,
629 : MICROMIPS_GOT16,
630 : MICROMIPS_PC7_S1,
631 : MICROMIPS_PC10_S1,
632 : MICROMIPS_PC16_S1,
633 : MICROMIPS_CALL16,
634 : MICROMIPS_GOT_DISP,
635 : MICROMIPS_GOT_PAGE,
636 : MICROMIPS_GOT_OFST,
637 : MICROMIPS_GOT_HI16,
638 : MICROMIPS_GOT_LO16,
639 : MICROMIPS_SUB,
640 : MICROMIPS_HIGHER,
641 : MICROMIPS_HIGHEST,
642 : MICROMIPS_CALL_HI16,
643 : MICROMIPS_CALL_LO16,
644 : MICROMIPS_SCN_DISP,
645 : MICROMIPS_JALR,
646 : MICROMIPS_HI0_LO16,
647 : MICROMIPS_TLS_GD,
648 : MICROMIPS_TLS_LDM,
649 : MICROMIPS_TLS_DTPREL_HI16,
650 : MICROMIPS_TLS_DTPREL_LO16,
651 : MICROMIPS_TLS_GOTTPREL,
652 : MICROMIPS_TLS_TPREL_HI16,
653 : MICROMIPS_TLS_TPREL_LO16,
654 : MICROMIPS_GPREL7_S2,
655 : MICROMIPS_PC23_S2,
656 : MICROMIPS_PC21_S2,
657 : MICROMIPS_PC26_S2,
658 : MICROMIPS_PC18_S3,
659 : MICROMIPS_PC19_S2,
660 : MIPS_NUM,
661 : MIPS_PC32,
662 : MIPS_EH,
663 : PPC_NONE,
664 : PPC_ADDR32,
665 : PPC_ADDR24,
666 : PPC_ADDR16,
667 : PPC_ADDR16_LO,
668 : PPC_ADDR16_HI,
669 : PPC_ADDR16_HA,
670 : PPC_ADDR14,
671 : PPC_ADDR14_BRTAKEN,
672 : PPC_ADDR14_BRNTAKEN,
673 : PPC_REL24,
674 : PPC_REL14,
675 : PPC_REL14_BRTAKEN,
676 : PPC_REL14_BRNTAKEN,
677 : PPC_GOT16,
678 : PPC_GOT16_LO,
679 : PPC_GOT16_HI,
680 : PPC_GOT16_HA,
681 : PPC_PLTREL24,
682 : PPC_JMP_SLOT,
683 : PPC_RELATIVE,
684 : PPC_LOCAL24PC,
685 : PPC_REL32,
686 : PPC_TLS,
687 : PPC_DTPMOD32,
688 : PPC_TPREL16,
689 : PPC_TPREL16_LO,
690 : PPC_TPREL16_HI,
691 : PPC_TPREL16_HA,
692 : PPC_TPREL32,
693 : PPC_DTPREL16,
694 : PPC_DTPREL16_LO,
695 : PPC_DTPREL16_HI,
696 : PPC_DTPREL16_HA,
697 : PPC_DTPREL32,
698 : PPC_GOT_TLSGD16,
699 : PPC_GOT_TLSGD16_LO,
700 : PPC_GOT_TLSGD16_HI,
701 : PPC_GOT_TLSGD16_HA,
702 : PPC_GOT_TLSLD16,
703 : PPC_GOT_TLSLD16_LO,
704 : PPC_GOT_TLSLD16_HI,
705 : PPC_GOT_TLSLD16_HA,
706 : PPC_GOT_TPREL16,
707 : PPC_GOT_TPREL16_LO,
708 : PPC_GOT_TPREL16_HI,
709 : PPC_GOT_TPREL16_HA,
710 : PPC_GOT_DTPREL16,
711 : PPC_GOT_DTPREL16_LO,
712 : PPC_GOT_DTPREL16_HI,
713 : PPC_GOT_DTPREL16_HA,
714 : PPC_TLSGD,
715 : PPC_TLSLD,
716 : PPC_REL16,
717 : PPC_REL16_LO,
718 : PPC_REL16_HI,
719 : PPC_REL16_HA,
720 : PPC64_NONE,
721 : PPC64_ADDR32,
722 : PPC64_ADDR24,
723 : PPC64_ADDR16,
724 : PPC64_ADDR16_LO,
725 : PPC64_ADDR16_HI,
726 : PPC64_ADDR16_HA,
727 : PPC64_ADDR14,
728 : PPC64_ADDR14_BRTAKEN,
729 : PPC64_ADDR14_BRNTAKEN,
730 : PPC64_REL24,
731 : PPC64_REL14,
732 : PPC64_REL14_BRTAKEN,
733 : PPC64_REL14_BRNTAKEN,
734 : PPC64_GOT16,
735 : PPC64_GOT16_LO,
736 : PPC64_GOT16_HI,
737 : PPC64_GOT16_HA,
738 : PPC64_JMP_SLOT,
739 : PPC64_RELATIVE,
740 : PPC64_REL32,
741 : PPC64_ADDR64,
742 : PPC64_ADDR16_HIGHER,
743 : PPC64_ADDR16_HIGHERA,
744 : PPC64_ADDR16_HIGHEST,
745 : PPC64_ADDR16_HIGHESTA,
746 : PPC64_REL64,
747 : PPC64_TOC16,
748 : PPC64_TOC16_LO,
749 : PPC64_TOC16_HI,
750 : PPC64_TOC16_HA,
751 : PPC64_TOC,
752 : PPC64_ADDR16_DS,
753 : PPC64_ADDR16_LO_DS,
754 : PPC64_GOT16_DS,
755 : PPC64_GOT16_LO_DS,
756 : PPC64_TOC16_DS,
757 : PPC64_TOC16_LO_DS,
758 : PPC64_TLS,
759 : PPC64_DTPMOD64,
760 : PPC64_TPREL16,
761 : PPC64_TPREL16_LO,
762 : PPC64_TPREL16_HI,
763 : PPC64_TPREL16_HA,
764 : PPC64_TPREL64,
765 : PPC64_DTPREL16,
766 : PPC64_DTPREL16_LO,
767 : PPC64_DTPREL16_HI,
768 : PPC64_DTPREL16_HA,
769 : PPC64_DTPREL64,
770 : PPC64_GOT_TLSGD16,
771 : PPC64_GOT_TLSGD16_LO,
772 : PPC64_GOT_TLSGD16_HI,
773 : PPC64_GOT_TLSGD16_HA,
774 : PPC64_GOT_TLSLD16,
775 : PPC64_GOT_TLSLD16_LO,
776 : PPC64_GOT_TLSLD16_HI,
777 : PPC64_GOT_TLSLD16_HA,
778 : PPC64_GOT_TPREL16_DS,
779 : PPC64_GOT_TPREL16_LO_DS,
780 : PPC64_GOT_TPREL16_HI,
781 : PPC64_GOT_TPREL16_HA,
782 : PPC64_GOT_DTPREL16_DS,
783 : PPC64_GOT_DTPREL16_LO_DS,
784 : PPC64_GOT_DTPREL16_HI,
785 : PPC64_GOT_DTPREL16_HA,
786 : PPC64_TPREL16_DS,
787 : PPC64_TPREL16_LO_DS,
788 : PPC64_TPREL16_HIGHER,
789 : PPC64_TPREL16_HIGHERA,
790 : PPC64_TPREL16_HIGHEST,
791 : PPC64_TPREL16_HIGHESTA,
792 : PPC64_DTPREL16_DS,
793 : PPC64_DTPREL16_LO_DS,
794 : PPC64_DTPREL16_HIGHER,
795 : PPC64_DTPREL16_HIGHERA,
796 : PPC64_DTPREL16_HIGHEST,
797 : PPC64_DTPREL16_HIGHESTA,
798 : PPC64_TLSGD,
799 : PPC64_TLSLD,
800 : PPC64_REL16,
801 : PPC64_REL16_LO,
802 : PPC64_REL16_HI,
803 : PPC64_REL16_HA,
804 : SPARC_NONE,
805 : SPARC_8,
806 : SPARC_16,
807 : SPARC_32,
808 : SPARC_DISP8,
809 : SPARC_DISP16,
810 : SPARC_DISP32,
811 : SPARC_WDISP30,
812 : SPARC_WDISP22,
813 : SPARC_HI22,
814 : SPARC_22,
815 : SPARC_13,
816 : SPARC_LO10,
817 : SPARC_GOT10,
818 : SPARC_GOT13,
819 : SPARC_GOT22,
820 : SPARC_PC10,
821 : SPARC_PC22,
822 : SPARC_WPLT30,
823 : SPARC_COPY,
824 : SPARC_GLOB_DAT,
825 : SPARC_JMP_SLOT,
826 : SPARC_RELATIVE,
827 : SPARC_UA32,
828 : SPARC_PLT32,
829 : SPARC_HIPLT22,
830 : SPARC_LOPLT10,
831 : SPARC_PCPLT32,
832 : SPARC_PCPLT22,
833 : SPARC_PCPLT10,
834 : SPARC_10,
835 : SPARC_11,
836 : SPARC_64,
837 : SPARC_OLO10,
838 : SPARC_HH22,
839 : SPARC_HM10,
840 : SPARC_LM22,
841 : SPARC_PC_HH22,
842 : SPARC_PC_HM10,
843 : SPARC_PC_LM22,
844 : SPARC_WDISP16,
845 : SPARC_WDISP19,
846 : SPARC_7,
847 : SPARC_5,
848 : SPARC_6,
849 : SPARC_DISP64,
850 : SPARC_PLT64,
851 : SPARC_HIX22,
852 : SPARC_LOX10,
853 : SPARC_H44,
854 : SPARC_M44,
855 : SPARC_L44,
856 : SPARC_REGISTER,
857 : SPARC_UA64,
858 : SPARC_UA16,
859 : SPARC_TLS_GD_HI22,
860 : SPARC_TLS_GD_LO10,
861 : SPARC_TLS_GD_ADD,
862 : SPARC_TLS_GD_CALL,
863 : SPARC_TLS_LDM_HI22,
864 : SPARC_TLS_LDM_LO10,
865 : SPARC_TLS_LDM_ADD,
866 : SPARC_TLS_LDM_CALL,
867 : SPARC_TLS_LDO_HIX22,
868 : SPARC_TLS_LDO_LOX10,
869 : SPARC_TLS_LDO_ADD,
870 : SPARC_TLS_IE_HI22,
871 : SPARC_TLS_IE_LO10,
872 : SPARC_TLS_IE_LD,
873 : SPARC_TLS_IE_LDX,
874 : SPARC_TLS_IE_ADD,
875 : SPARC_TLS_LE_HIX22,
876 : SPARC_TLS_LE_LOX10,
877 : SPARC_TLS_DTPMOD32,
878 : SPARC_TLS_DTPMOD64,
879 : SPARC_TLS_DTPOFF32,
880 : SPARC_TLS_DTPOFF64,
881 : SPARC_TLS_TPOFF32,
882 : SPARC_TLS_TPOFF64,
883 : SPARC_GOTDATA_HIX22,
884 : SPARC_GOTDATA_LOX10,
885 : SPARC_GOTDATA_OP_HIX22,
886 : SPARC_GOTDATA_OP_LOX10,
887 : SPARC_GOTDATA_OP,
888 : SYSZ_NONE,
889 : SYSZ_8,
890 : SYSZ_12,
891 : SYSZ_16,
892 : SYSZ_32,
893 : SYSZ_PC32,
894 : SYSZ_GOT12,
895 : SYSZ_GOT32,
896 : SYSZ_PLT32,
897 : SYSZ_COPY,
898 : SYSZ_GLOB_DAT,
899 : SYSZ_JMP_SLOT,
900 : SYSZ_RELATIVE,
901 : SYSZ_GOTOFF,
902 : SYSZ_GOTPC,
903 : SYSZ_GOT16,
904 : SYSZ_PC16,
905 : SYSZ_PC16DBL,
906 : SYSZ_PLT16DBL,
907 : SYSZ_PC32DBL,
908 : SYSZ_PLT32DBL,
909 : SYSZ_GOTPCDBL,
910 : SYSZ_64,
911 : SYSZ_PC64,
912 : SYSZ_GOT64,
913 : SYSZ_PLT64,
914 : SYSZ_GOTENT,
915 : SYSZ_GOTOFF16,
916 : SYSZ_GOTOFF64,
917 : SYSZ_GOTPLT12,
918 : SYSZ_GOTPLT16,
919 : SYSZ_GOTPLT32,
920 : SYSZ_GOTPLT64,
921 : SYSZ_GOTPLTENT,
922 : SYSZ_PLTOFF16,
923 : SYSZ_PLTOFF32,
924 : SYSZ_PLTOFF64,
925 : SYSZ_TLS_LOAD,
926 : SYSZ_TLS_GDCALL,
927 : SYSZ_TLS_LDCALL,
928 : SYSZ_TLS_GD32,
929 : SYSZ_TLS_GD64,
930 : SYSZ_TLS_GOTIE12,
931 : SYSZ_TLS_GOTIE32,
932 : SYSZ_TLS_GOTIE64,
933 : SYSZ_TLS_LDM32,
934 : SYSZ_TLS_LDM64,
935 : SYSZ_TLS_IE32,
936 : SYSZ_TLS_IE64,
937 : SYSZ_TLS_IEENT,
938 : SYSZ_TLS_LE32,
939 : SYSZ_TLS_LE64,
940 : SYSZ_TLS_LDO32,
941 : SYSZ_TLS_LDO64,
942 : SYSZ_TLS_DTPMOD,
943 : SYSZ_TLS_DTPOFF,
944 : SYSZ_TLS_TPOFF,
945 : SYSZ_20,
946 : SYSZ_GOT20,
947 : SYSZ_GOTPLT20,
948 : SYSZ_TLS_GOTIE20,
949 : SYSZ_IRELATIVE,
950 : RISCV_NONE,
951 : RISCV_32,
952 : RISCV_64,
953 : RISCV_RELATIVE,
954 : RISCV_COPY,
955 : RISCV_JUMP_SLOT,
956 : RISCV_TLS_DTPMOD32,
957 : RISCV_TLS_DTPMOD64,
958 : RISCV_TLS_DTPREL32,
959 : RISCV_TLS_DTPREL64,
960 : RISCV_TLS_TPREL32,
961 : RISCV_TLS_TPREL64,
962 : RISCV_TLSDESC,
963 : RISCV_BRANCH,
964 : RISCV_JAL,
965 : RISCV_CALL,
966 : RISCV_CALL_PLT,
967 : RISCV_GOT_HI20,
968 : RISCV_TLS_GOT_HI20,
969 : RISCV_TLS_GD_HI20,
970 : RISCV_PCREL_HI20,
971 : RISCV_PCREL_LO12_I,
972 : RISCV_PCREL_LO12_S,
973 : RISCV_HI20,
974 : RISCV_LO12_I,
975 : RISCV_LO12_S,
976 : RISCV_TPREL_HI20,
977 : RISCV_TPREL_LO12_I,
978 : RISCV_TPREL_LO12_S,
979 : RISCV_TPREL_ADD,
980 : RISCV_ADD8,
981 : RISCV_ADD16,
982 : RISCV_ADD32,
983 : RISCV_ADD64,
984 : RISCV_SUB8,
985 : RISCV_SUB16,
986 : RISCV_SUB32,
987 : RISCV_SUB64,
988 : RISCV_GOT32_PCREL,
989 : RISCV_ALIGN,
990 : RISCV_RVC_BRANCH,
991 : RISCV_RVC_JUMP,
992 : RISCV_RVC_LUI,
993 : RISCV_RELAX,
994 : RISCV_SUB6,
995 : RISCV_SET6,
996 : RISCV_SET8,
997 : RISCV_SET16,
998 : RISCV_SET32,
999 : RISCV_32_PCREL,
1000 : RISCV_IRELATIVE,
1001 : RISCV_PLT32,
1002 : RISCV_SET_ULEB128,
1003 : RISCV_SUB_ULEB128,
1004 : RISCV_TLSDESC_HI20,
1005 : RISCV_TLSDESC_LOAD_LO12,
1006 : RISCV_TLSDESC_ADD_LO12,
1007 : RISCV_TLSDESC_CALL,
1008 : UNKNOWN(u32),
1009 : }
1010 :
1011 : impl Type {
1012 12960 : pub fn from_value(value: u32) -> Self {
1013 12960 : match value {
1014 0 : 0x08000000 => Type::X86_64_NONE,
1015 0 : 0x08000001 => Type::X86_64_64,
1016 0 : 0x08000002 => Type::X86_64_PC32,
1017 0 : 0x08000003 => Type::X86_64_GOT32,
1018 0 : 0x08000004 => Type::X86_64_PLT32,
1019 144 : 0x08000005 => Type::X86_64_COPY,
1020 192 : 0x08000006 => Type::X86_64_GLOB_DAT,
1021 3488 : 0x08000007 => Type::X86_64_JUMP_SLOT,
1022 2304 : 0x08000008 => Type::X86_64_RELATIVE,
1023 0 : 0x08000009 => Type::X86_64_GOTPCREL,
1024 0 : 0x0800000a => Type::X86_64_32,
1025 0 : 0x0800000b => Type::X86_64_32S,
1026 0 : 0x0800000c => Type::X86_64_16,
1027 0 : 0x0800000d => Type::X86_64_PC16,
1028 0 : 0x0800000e => Type::X86_64_8,
1029 0 : 0x0800000f => Type::X86_64_PC8,
1030 0 : 0x08000010 => Type::X86_64_DTPMOD64,
1031 0 : 0x08000011 => Type::X86_64_DTPOFF64,
1032 0 : 0x08000012 => Type::X86_64_TPOFF64,
1033 0 : 0x08000013 => Type::X86_64_TLSGD,
1034 0 : 0x08000014 => Type::X86_64_TLSLD,
1035 0 : 0x08000015 => Type::X86_64_DTPOFF32,
1036 0 : 0x08000016 => Type::X86_64_GOTTPOFF,
1037 0 : 0x08000017 => Type::X86_64_TPOFF32,
1038 0 : 0x08000018 => Type::X86_64_PC64,
1039 0 : 0x08000019 => Type::X86_64_GOTOFF64,
1040 0 : 0x0800001a => Type::X86_64_GOTPC32,
1041 0 : 0x0800001b => Type::X86_64_GOT64,
1042 0 : 0x0800001c => Type::X86_64_GOTPCREL64,
1043 0 : 0x0800001d => Type::X86_64_GOTPC64,
1044 0 : 0x0800001e => Type::X86_64_GOTPLT64,
1045 0 : 0x0800001f => Type::X86_64_PLTOFF64,
1046 0 : 0x08000020 => Type::X86_64_SIZE32,
1047 0 : 0x08000021 => Type::X86_64_SIZE64,
1048 0 : 0x08000022 => Type::X86_64_GOTPC32_TLSDESC,
1049 0 : 0x08000023 => Type::X86_64_TLSDESC_CALL,
1050 0 : 0x08000024 => Type::X86_64_TLSDESC,
1051 0 : 0x08000025 => Type::X86_64_IRELATIVE,
1052 0 : 0x08000026 => Type::X86_64_RELATIVE64,
1053 0 : 0x08000027 => Type::X86_64_PC32_BND,
1054 0 : 0x08000028 => Type::X86_64_PLT32_BND,
1055 0 : 0x08000029 => Type::X86_64_GOTPCRELX,
1056 0 : 0x0800002a => Type::X86_64_REX_GOTPCRELX,
1057 0 : 0x10000000 => Type::AARCH64_NONE,
1058 0 : 0x10000101 => Type::AARCH64_ABS64,
1059 0 : 0x10000102 => Type::AARCH64_ABS32,
1060 0 : 0x10000103 => Type::AARCH64_ABS16,
1061 0 : 0x10000104 => Type::AARCH64_PREL64,
1062 16 : 0x10000105 => Type::AARCH64_PREL32,
1063 0 : 0x10000106 => Type::AARCH64_PREL16,
1064 0 : 0x10000107 => Type::AARCH64_MOVW_UABS_G0,
1065 0 : 0x10000108 => Type::AARCH64_MOVW_UABS_G0_NC,
1066 0 : 0x10000109 => Type::AARCH64_MOVW_UABS_G1,
1067 0 : 0x1000010a => Type::AARCH64_MOVW_UABS_G1_NC,
1068 0 : 0x1000010b => Type::AARCH64_MOVW_UABS_G2,
1069 0 : 0x1000010c => Type::AARCH64_MOVW_UABS_G2_NC,
1070 0 : 0x1000010d => Type::AARCH64_MOVW_UABS_G3,
1071 0 : 0x1000010e => Type::AARCH64_MOVW_SABS_G0,
1072 0 : 0x1000010f => Type::AARCH64_MOVW_SABS_G1,
1073 0 : 0x10000110 => Type::AARCH64_MOVW_SABS_G2,
1074 0 : 0x10000111 => Type::AARCH64_LD_PREL_LO19,
1075 0 : 0x10000112 => Type::AARCH64_ADR_PREL_LO21,
1076 0 : 0x10000113 => Type::AARCH64_ADR_PREL_PG_HI21,
1077 0 : 0x10000114 => Type::AARCH64_ADR_PREL_PG_HI21_NC,
1078 0 : 0x10000115 => Type::AARCH64_ADD_ABS_LO12_NC,
1079 0 : 0x10000116 => Type::AARCH64_LDST8_ABS_LO12_NC,
1080 0 : 0x10000117 => Type::AARCH64_TSTBR14,
1081 0 : 0x10000118 => Type::AARCH64_CONDBR19,
1082 0 : 0x1000011a => Type::AARCH64_JUMP26,
1083 0 : 0x1000011b => Type::AARCH64_CALL26,
1084 0 : 0x1000011c => Type::AARCH64_LDST16_ABS_LO12_NC,
1085 0 : 0x1000011d => Type::AARCH64_LDST32_ABS_LO12_NC,
1086 0 : 0x1000011e => Type::AARCH64_LDST64_ABS_LO12_NC,
1087 0 : 0x1000011f => Type::AARCH64_MOVW_PREL_G0,
1088 0 : 0x10000120 => Type::AARCH64_MOVW_PREL_G0_NC,
1089 0 : 0x10000121 => Type::AARCH64_MOVW_PREL_G1,
1090 0 : 0x10000122 => Type::AARCH64_MOVW_PREL_G1_NC,
1091 0 : 0x10000123 => Type::AARCH64_MOVW_PREL_G2,
1092 0 : 0x10000124 => Type::AARCH64_MOVW_PREL_G2_NC,
1093 0 : 0x10000125 => Type::AARCH64_MOVW_PREL_G3,
1094 0 : 0x1000012b => Type::AARCH64_LDST128_ABS_LO12_NC,
1095 0 : 0x1000012c => Type::AARCH64_MOVW_GOTOFF_G0,
1096 0 : 0x1000012d => Type::AARCH64_MOVW_GOTOFF_G0_NC,
1097 0 : 0x1000012e => Type::AARCH64_MOVW_GOTOFF_G1,
1098 0 : 0x1000012f => Type::AARCH64_MOVW_GOTOFF_G1_NC,
1099 0 : 0x10000130 => Type::AARCH64_MOVW_GOTOFF_G2,
1100 0 : 0x10000131 => Type::AARCH64_MOVW_GOTOFF_G2_NC,
1101 0 : 0x10000132 => Type::AARCH64_MOVW_GOTOFF_G3,
1102 0 : 0x10000133 => Type::AARCH64_GOTREL64,
1103 0 : 0x10000134 => Type::AARCH64_GOTREL32,
1104 0 : 0x10000135 => Type::AARCH64_GOT_LD_PREL19,
1105 0 : 0x10000136 => Type::AARCH64_LD64_GOTOFF_LO15,
1106 0 : 0x10000137 => Type::AARCH64_ADR_GOT_PAGE,
1107 0 : 0x10000138 => Type::AARCH64_LD64_GOT_LO12_NC,
1108 0 : 0x10000139 => Type::AARCH64_LD64_GOTPAGE_LO15,
1109 0 : 0x10000200 => Type::AARCH64_TLSGD_ADR_PREL21,
1110 0 : 0x10000201 => Type::AARCH64_TLSGD_ADR_PAGE21,
1111 0 : 0x10000202 => Type::AARCH64_TLSGD_ADD_LO12_NC,
1112 0 : 0x10000203 => Type::AARCH64_TLSGD_MOVW_G1,
1113 0 : 0x10000204 => Type::AARCH64_TLSGD_MOVW_G0_NC,
1114 0 : 0x10000205 => Type::AARCH64_TLSLD_ADR_PREL21,
1115 0 : 0x10000206 => Type::AARCH64_TLSLD_ADR_PAGE21,
1116 0 : 0x10000207 => Type::AARCH64_TLSLD_ADD_LO12_NC,
1117 0 : 0x10000208 => Type::AARCH64_TLSLD_MOVW_G1,
1118 0 : 0x10000209 => Type::AARCH64_TLSLD_MOVW_G0_NC,
1119 0 : 0x1000020a => Type::AARCH64_TLSLD_LD_PREL19,
1120 0 : 0x1000020b => Type::AARCH64_TLSLD_MOVW_DTPREL_G2,
1121 0 : 0x1000020c => Type::AARCH64_TLSLD_MOVW_DTPREL_G1,
1122 0 : 0x1000020d => Type::AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
1123 0 : 0x1000020e => Type::AARCH64_TLSLD_MOVW_DTPREL_G0,
1124 0 : 0x1000020f => Type::AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
1125 0 : 0x10000210 => Type::AARCH64_TLSLD_ADD_DTPREL_HI12,
1126 0 : 0x10000211 => Type::AARCH64_TLSLD_ADD_DTPREL_LO12,
1127 0 : 0x10000212 => Type::AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
1128 0 : 0x10000213 => Type::AARCH64_TLSLD_LDST8_DTPREL_LO12,
1129 0 : 0x10000214 => Type::AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
1130 0 : 0x10000215 => Type::AARCH64_TLSLD_LDST16_DTPREL_LO12,
1131 0 : 0x10000216 => Type::AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
1132 0 : 0x10000217 => Type::AARCH64_TLSLD_LDST32_DTPREL_LO12,
1133 0 : 0x10000218 => Type::AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
1134 0 : 0x10000219 => Type::AARCH64_TLSLD_LDST64_DTPREL_LO12,
1135 0 : 0x1000021a => Type::AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
1136 0 : 0x1000021b => Type::AARCH64_TLSIE_MOVW_GOTTPREL_G1,
1137 0 : 0x1000021c => Type::AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
1138 0 : 0x1000021d => Type::AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
1139 0 : 0x1000021e => Type::AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
1140 0 : 0x1000021f => Type::AARCH64_TLSIE_LD_GOTTPREL_PREL19,
1141 0 : 0x10000220 => Type::AARCH64_TLSLE_MOVW_TPREL_G2,
1142 0 : 0x10000221 => Type::AARCH64_TLSLE_MOVW_TPREL_G1,
1143 0 : 0x10000222 => Type::AARCH64_TLSLE_MOVW_TPREL_G1_NC,
1144 0 : 0x10000223 => Type::AARCH64_TLSLE_MOVW_TPREL_G0,
1145 0 : 0x10000224 => Type::AARCH64_TLSLE_MOVW_TPREL_G0_NC,
1146 0 : 0x10000225 => Type::AARCH64_TLSLE_ADD_TPREL_HI12,
1147 0 : 0x10000226 => Type::AARCH64_TLSLE_ADD_TPREL_LO12,
1148 0 : 0x10000227 => Type::AARCH64_TLSLE_ADD_TPREL_LO12_NC,
1149 0 : 0x10000228 => Type::AARCH64_TLSLE_LDST8_TPREL_LO12,
1150 0 : 0x10000229 => Type::AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
1151 0 : 0x1000022a => Type::AARCH64_TLSLE_LDST16_TPREL_LO12,
1152 0 : 0x1000022b => Type::AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
1153 0 : 0x1000022c => Type::AARCH64_TLSLE_LDST32_TPREL_LO12,
1154 0 : 0x1000022d => Type::AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
1155 0 : 0x1000022e => Type::AARCH64_TLSLE_LDST64_TPREL_LO12,
1156 0 : 0x1000022f => Type::AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
1157 0 : 0x10000230 => Type::AARCH64_TLSDESC_LD_PREL19,
1158 0 : 0x10000231 => Type::AARCH64_TLSDESC_ADR_PREL21,
1159 0 : 0x10000232 => Type::AARCH64_TLSDESC_ADR_PAGE21,
1160 0 : 0x10000233 => Type::AARCH64_TLSDESC_LD64_LO12_NC,
1161 0 : 0x10000234 => Type::AARCH64_TLSDESC_ADD_LO12_NC,
1162 0 : 0x10000235 => Type::AARCH64_TLSDESC_OFF_G1,
1163 0 : 0x10000236 => Type::AARCH64_TLSDESC_OFF_G0_NC,
1164 0 : 0x10000237 => Type::AARCH64_TLSDESC_LDR,
1165 0 : 0x10000238 => Type::AARCH64_TLSDESC_ADD,
1166 0 : 0x10000239 => Type::AARCH64_TLSDESC_CALL,
1167 0 : 0x1000023a => Type::AARCH64_TLSLE_LDST128_TPREL_LO12,
1168 0 : 0x1000023b => Type::AARCH64_TLSLE_LDST128_TPREL_LO12_NC,
1169 0 : 0x1000023c => Type::AARCH64_TLSLD_LDST128_DTPREL_LO12,
1170 0 : 0x1000023d => Type::AARCH64_TLSLD_LDST128_DTPREL_LO12_NC,
1171 0 : 0x10000400 => Type::AARCH64_COPY,
1172 0 : 0x10000401 => Type::AARCH64_GLOB_DAT,
1173 0 : 0x10000402 => Type::AARCH64_JUMP_SLOT,
1174 0 : 0x10000403 => Type::AARCH64_RELATIVE,
1175 0 : 0x10000404 => Type::AARCH64_TLS_DTPREL64,
1176 0 : 0x10000405 => Type::AARCH64_TLS_DTPMOD64,
1177 0 : 0x10000406 => Type::AARCH64_TLS_TPREL64,
1178 0 : 0x10000407 => Type::AARCH64_TLSDESC,
1179 0 : 0x10000408 => Type::AARCH64_IRELATIVE,
1180 0 : 0x18000000 => Type::ARM_NONE,
1181 0 : 0x18000001 => Type::ARM_PC24,
1182 0 : 0x18000002 => Type::ARM_ABS32,
1183 0 : 0x18000003 => Type::ARM_REL32,
1184 0 : 0x18000004 => Type::ARM_LDR_PC_G0,
1185 0 : 0x18000005 => Type::ARM_ABS16,
1186 0 : 0x18000006 => Type::ARM_ABS12,
1187 0 : 0x18000007 => Type::ARM_THM_ABS5,
1188 0 : 0x18000008 => Type::ARM_ABS8,
1189 0 : 0x18000009 => Type::ARM_SBREL32,
1190 0 : 0x1800000a => Type::ARM_THM_CALL,
1191 0 : 0x1800000b => Type::ARM_THM_PC8,
1192 0 : 0x1800000c => Type::ARM_BREL_ADJ,
1193 0 : 0x1800000d => Type::ARM_TLS_DESC,
1194 0 : 0x1800000e => Type::ARM_THM_SWI8,
1195 0 : 0x1800000f => Type::ARM_XPC25,
1196 0 : 0x18000010 => Type::ARM_THM_XPC22,
1197 0 : 0x18000011 => Type::ARM_TLS_DTPMOD32,
1198 0 : 0x18000012 => Type::ARM_TLS_DTPOFF32,
1199 0 : 0x18000013 => Type::ARM_TLS_TPOFF32,
1200 0 : 0x18000014 => Type::ARM_COPY,
1201 0 : 0x18000015 => Type::ARM_GLOB_DAT,
1202 0 : 0x18000016 => Type::ARM_JUMP_SLOT,
1203 0 : 0x18000017 => Type::ARM_RELATIVE,
1204 0 : 0x18000018 => Type::ARM_GOTOFF32,
1205 0 : 0x18000019 => Type::ARM_BASE_PREL,
1206 0 : 0x1800001a => Type::ARM_GOT_BREL,
1207 0 : 0x1800001b => Type::ARM_PLT32,
1208 0 : 0x1800001c => Type::ARM_CALL,
1209 0 : 0x1800001d => Type::ARM_JUMP24,
1210 0 : 0x1800001e => Type::ARM_THM_JUMP24,
1211 0 : 0x1800001f => Type::ARM_BASE_ABS,
1212 0 : 0x18000020 => Type::ARM_ALU_PCREL_7_0,
1213 0 : 0x18000021 => Type::ARM_ALU_PCREL_15_8,
1214 0 : 0x18000022 => Type::ARM_ALU_PCREL_23_15,
1215 0 : 0x18000023 => Type::ARM_LDR_SBREL_11_0_NC,
1216 0 : 0x18000024 => Type::ARM_ALU_SBREL_19_12_NC,
1217 0 : 0x18000025 => Type::ARM_ALU_SBREL_27_20_CK,
1218 0 : 0x18000026 => Type::ARM_TARGET1,
1219 0 : 0x18000027 => Type::ARM_SBREL31,
1220 0 : 0x18000028 => Type::ARM_V4BX,
1221 0 : 0x18000029 => Type::ARM_TARGET2,
1222 0 : 0x1800002a => Type::ARM_PREL31,
1223 0 : 0x1800002b => Type::ARM_MOVW_ABS_NC,
1224 0 : 0x1800002c => Type::ARM_MOVT_ABS,
1225 0 : 0x1800002d => Type::ARM_MOVW_PREL_NC,
1226 0 : 0x1800002e => Type::ARM_MOVT_PREL,
1227 0 : 0x1800002f => Type::ARM_THM_MOVW_ABS_NC,
1228 0 : 0x18000030 => Type::ARM_THM_MOVT_ABS,
1229 0 : 0x18000031 => Type::ARM_THM_MOVW_PREL_NC,
1230 0 : 0x18000032 => Type::ARM_THM_MOVT_PREL,
1231 0 : 0x18000033 => Type::ARM_THM_JUMP19,
1232 0 : 0x18000034 => Type::ARM_THM_JUMP6,
1233 0 : 0x18000035 => Type::ARM_THM_ALU_PREL_11_0,
1234 0 : 0x18000036 => Type::ARM_THM_PC12,
1235 0 : 0x18000037 => Type::ARM_ABS32_NOI,
1236 0 : 0x18000038 => Type::ARM_REL32_NOI,
1237 0 : 0x18000039 => Type::ARM_ALU_PC_G0_NC,
1238 0 : 0x1800003a => Type::ARM_ALU_PC_G0,
1239 0 : 0x1800003b => Type::ARM_ALU_PC_G1_NC,
1240 0 : 0x1800003c => Type::ARM_ALU_PC_G1,
1241 0 : 0x1800003d => Type::ARM_ALU_PC_G2,
1242 0 : 0x1800003e => Type::ARM_LDR_PC_G1,
1243 0 : 0x1800003f => Type::ARM_LDR_PC_G2,
1244 0 : 0x18000040 => Type::ARM_LDRS_PC_G0,
1245 0 : 0x18000041 => Type::ARM_LDRS_PC_G1,
1246 0 : 0x18000042 => Type::ARM_LDRS_PC_G2,
1247 0 : 0x18000043 => Type::ARM_LDC_PC_G0,
1248 0 : 0x18000044 => Type::ARM_LDC_PC_G1,
1249 0 : 0x18000045 => Type::ARM_LDC_PC_G2,
1250 0 : 0x18000046 => Type::ARM_ALU_SB_G0_NC,
1251 0 : 0x18000047 => Type::ARM_ALU_SB_G0,
1252 0 : 0x18000048 => Type::ARM_ALU_SB_G1_NC,
1253 0 : 0x18000049 => Type::ARM_ALU_SB_G1,
1254 0 : 0x1800004a => Type::ARM_ALU_SB_G2,
1255 0 : 0x1800004b => Type::ARM_LDR_SB_G0,
1256 0 : 0x1800004c => Type::ARM_LDR_SB_G1,
1257 0 : 0x1800004d => Type::ARM_LDR_SB_G2,
1258 0 : 0x1800004e => Type::ARM_LDRS_SB_G0,
1259 0 : 0x1800004f => Type::ARM_LDRS_SB_G1,
1260 0 : 0x18000050 => Type::ARM_LDRS_SB_G2,
1261 0 : 0x18000051 => Type::ARM_LDC_SB_G0,
1262 0 : 0x18000052 => Type::ARM_LDC_SB_G1,
1263 0 : 0x18000053 => Type::ARM_LDC_SB_G2,
1264 0 : 0x18000054 => Type::ARM_MOVW_BREL_NC,
1265 0 : 0x18000055 => Type::ARM_MOVT_BREL,
1266 0 : 0x18000056 => Type::ARM_MOVW_BREL,
1267 0 : 0x18000057 => Type::ARM_THM_MOVW_BREL_NC,
1268 0 : 0x18000058 => Type::ARM_THM_MOVT_BREL,
1269 0 : 0x18000059 => Type::ARM_THM_MOVW_BREL,
1270 0 : 0x1800005a => Type::ARM_TLS_GOTDESC,
1271 0 : 0x1800005b => Type::ARM_TLS_CALL,
1272 0 : 0x1800005c => Type::ARM_TLS_DESCSEQ,
1273 0 : 0x1800005d => Type::ARM_THM_TLS_CALL,
1274 0 : 0x1800005e => Type::ARM_PLT32_ABS,
1275 0 : 0x1800005f => Type::ARM_GOT_ABS,
1276 0 : 0x18000060 => Type::ARM_GOT_PREL,
1277 0 : 0x18000061 => Type::ARM_GOT_BREL12,
1278 0 : 0x18000062 => Type::ARM_GOTOFF12,
1279 0 : 0x18000063 => Type::ARM_GOTRELAX,
1280 0 : 0x18000064 => Type::ARM_GNU_VTENTRY,
1281 0 : 0x18000065 => Type::ARM_GNU_VTINHERIT,
1282 0 : 0x18000066 => Type::ARM_THM_JUMP11,
1283 0 : 0x18000067 => Type::ARM_THM_JUMP8,
1284 0 : 0x18000068 => Type::ARM_TLS_GD32,
1285 0 : 0x18000069 => Type::ARM_TLS_LDM32,
1286 0 : 0x1800006a => Type::ARM_TLS_LDO32,
1287 0 : 0x1800006b => Type::ARM_TLS_IE32,
1288 0 : 0x1800006c => Type::ARM_TLS_LE32,
1289 0 : 0x1800006d => Type::ARM_TLS_LDO12,
1290 0 : 0x1800006e => Type::ARM_TLS_LE12,
1291 0 : 0x1800006f => Type::ARM_TLS_IE12GP,
1292 0 : 0x18000070 => Type::ARM_PRIVATE_0,
1293 0 : 0x18000071 => Type::ARM_PRIVATE_1,
1294 0 : 0x18000072 => Type::ARM_PRIVATE_2,
1295 0 : 0x18000073 => Type::ARM_PRIVATE_3,
1296 0 : 0x18000074 => Type::ARM_PRIVATE_4,
1297 0 : 0x18000075 => Type::ARM_PRIVATE_5,
1298 0 : 0x18000076 => Type::ARM_PRIVATE_6,
1299 0 : 0x18000077 => Type::ARM_PRIVATE_7,
1300 0 : 0x18000078 => Type::ARM_PRIVATE_8,
1301 0 : 0x18000079 => Type::ARM_PRIVATE_9,
1302 0 : 0x1800007a => Type::ARM_PRIVATE_10,
1303 0 : 0x1800007b => Type::ARM_PRIVATE_11,
1304 0 : 0x1800007c => Type::ARM_PRIVATE_12,
1305 0 : 0x1800007d => Type::ARM_PRIVATE_13,
1306 0 : 0x1800007e => Type::ARM_PRIVATE_14,
1307 0 : 0x1800007f => Type::ARM_PRIVATE_15,
1308 0 : 0x18000080 => Type::ARM_ME_TOO,
1309 0 : 0x18000081 => Type::ARM_THM_TLS_DESCSEQ16,
1310 0 : 0x18000082 => Type::ARM_THM_TLS_DESCSEQ32,
1311 0 : 0x180000a0 => Type::ARM_IRELATIVE,
1312 0 : 0x180000f9 => Type::ARM_RXPC25,
1313 0 : 0x180000fa => Type::ARM_RSBREL32,
1314 0 : 0x180000fb => Type::ARM_THM_RPC22,
1315 0 : 0x180000fc => Type::ARM_RREL32,
1316 0 : 0x180000fd => Type::ARM_RPC24,
1317 0 : 0x180000fe => Type::ARM_RBASE,
1318 0 : 0x20000000 => Type::HEX_NONE,
1319 0 : 0x20000001 => Type::HEX_B22_PCREL,
1320 0 : 0x20000002 => Type::HEX_B15_PCREL,
1321 0 : 0x20000003 => Type::HEX_B7_PCREL,
1322 0 : 0x20000004 => Type::HEX_LO16,
1323 0 : 0x20000005 => Type::HEX_HI16,
1324 0 : 0x20000006 => Type::HEX_32,
1325 0 : 0x20000007 => Type::HEX_16,
1326 0 : 0x20000008 => Type::HEX_8,
1327 0 : 0x20000009 => Type::HEX_GPREL16_0,
1328 0 : 0x2000000a => Type::HEX_GPREL16_1,
1329 0 : 0x2000000b => Type::HEX_GPREL16_2,
1330 0 : 0x2000000c => Type::HEX_GPREL16_3,
1331 0 : 0x2000000d => Type::HEX_HL16,
1332 0 : 0x2000000e => Type::HEX_B13_PCREL,
1333 0 : 0x2000000f => Type::HEX_B9_PCREL,
1334 0 : 0x20000010 => Type::HEX_B32_PCREL_X,
1335 0 : 0x20000011 => Type::HEX_32_6_X,
1336 0 : 0x20000012 => Type::HEX_B22_PCREL_X,
1337 0 : 0x20000013 => Type::HEX_B15_PCREL_X,
1338 0 : 0x20000014 => Type::HEX_B13_PCREL_X,
1339 0 : 0x20000015 => Type::HEX_B9_PCREL_X,
1340 0 : 0x20000016 => Type::HEX_B7_PCREL_X,
1341 0 : 0x20000017 => Type::HEX_16_X,
1342 0 : 0x20000018 => Type::HEX_12_X,
1343 0 : 0x20000019 => Type::HEX_11_X,
1344 0 : 0x2000001a => Type::HEX_10_X,
1345 0 : 0x2000001b => Type::HEX_9_X,
1346 0 : 0x2000001c => Type::HEX_8_X,
1347 0 : 0x2000001d => Type::HEX_7_X,
1348 0 : 0x2000001e => Type::HEX_6_X,
1349 0 : 0x2000001f => Type::HEX_32_PCREL,
1350 0 : 0x20000020 => Type::HEX_COPY,
1351 0 : 0x20000021 => Type::HEX_GLOB_DAT,
1352 0 : 0x20000022 => Type::HEX_JMP_SLOT,
1353 0 : 0x20000023 => Type::HEX_RELATIVE,
1354 0 : 0x20000024 => Type::HEX_PLT_B22_PCREL,
1355 0 : 0x20000025 => Type::HEX_GOTREL_LO16,
1356 0 : 0x20000026 => Type::HEX_GOTREL_HI16,
1357 0 : 0x20000027 => Type::HEX_GOTREL_32,
1358 0 : 0x20000028 => Type::HEX_GOT_LO16,
1359 0 : 0x20000029 => Type::HEX_GOT_HI16,
1360 0 : 0x2000002a => Type::HEX_GOT_32,
1361 0 : 0x2000002b => Type::HEX_GOT_16,
1362 0 : 0x2000002c => Type::HEX_DTPMOD_32,
1363 0 : 0x2000002d => Type::HEX_DTPREL_LO16,
1364 0 : 0x2000002e => Type::HEX_DTPREL_HI16,
1365 0 : 0x2000002f => Type::HEX_DTPREL_32,
1366 0 : 0x20000030 => Type::HEX_DTPREL_16,
1367 0 : 0x20000031 => Type::HEX_GD_PLT_B22_PCREL,
1368 0 : 0x20000032 => Type::HEX_GD_GOT_LO16,
1369 0 : 0x20000033 => Type::HEX_GD_GOT_HI16,
1370 0 : 0x20000034 => Type::HEX_GD_GOT_32,
1371 0 : 0x20000035 => Type::HEX_GD_GOT_16,
1372 0 : 0x20000036 => Type::HEX_IE_LO16,
1373 0 : 0x20000037 => Type::HEX_IE_HI16,
1374 0 : 0x20000038 => Type::HEX_IE_32,
1375 0 : 0x20000039 => Type::HEX_IE_GOT_LO16,
1376 0 : 0x2000003a => Type::HEX_IE_GOT_HI16,
1377 0 : 0x2000003b => Type::HEX_IE_GOT_32,
1378 0 : 0x2000003c => Type::HEX_IE_GOT_16,
1379 0 : 0x2000003d => Type::HEX_TPREL_LO16,
1380 0 : 0x2000003e => Type::HEX_TPREL_HI16,
1381 0 : 0x2000003f => Type::HEX_TPREL_32,
1382 0 : 0x20000040 => Type::HEX_TPREL_16,
1383 0 : 0x20000041 => Type::HEX_6_PCREL_X,
1384 0 : 0x20000042 => Type::HEX_GOTREL_32_6_X,
1385 0 : 0x20000043 => Type::HEX_GOTREL_16_X,
1386 0 : 0x20000044 => Type::HEX_GOTREL_11_X,
1387 0 : 0x20000045 => Type::HEX_GOT_32_6_X,
1388 0 : 0x20000046 => Type::HEX_GOT_16_X,
1389 0 : 0x20000047 => Type::HEX_GOT_11_X,
1390 0 : 0x20000048 => Type::HEX_DTPREL_32_6_X,
1391 0 : 0x20000049 => Type::HEX_DTPREL_16_X,
1392 0 : 0x2000004a => Type::HEX_DTPREL_11_X,
1393 0 : 0x2000004b => Type::HEX_GD_GOT_32_6_X,
1394 0 : 0x2000004c => Type::HEX_GD_GOT_16_X,
1395 0 : 0x2000004d => Type::HEX_GD_GOT_11_X,
1396 0 : 0x2000004e => Type::HEX_IE_32_6_X,
1397 0 : 0x2000004f => Type::HEX_IE_16_X,
1398 0 : 0x20000050 => Type::HEX_IE_GOT_32_6_X,
1399 0 : 0x20000051 => Type::HEX_IE_GOT_16_X,
1400 0 : 0x20000052 => Type::HEX_IE_GOT_11_X,
1401 0 : 0x20000053 => Type::HEX_TPREL_32_6_X,
1402 0 : 0x20000054 => Type::HEX_TPREL_16_X,
1403 0 : 0x20000055 => Type::HEX_TPREL_11_X,
1404 0 : 0x20000056 => Type::HEX_LD_PLT_B22_PCREL,
1405 0 : 0x20000057 => Type::HEX_LD_GOT_LO16,
1406 0 : 0x20000058 => Type::HEX_LD_GOT_HI16,
1407 0 : 0x20000059 => Type::HEX_LD_GOT_32,
1408 0 : 0x2000005a => Type::HEX_LD_GOT_16,
1409 0 : 0x2000005b => Type::HEX_LD_GOT_32_6_X,
1410 0 : 0x2000005c => Type::HEX_LD_GOT_16_X,
1411 0 : 0x2000005d => Type::HEX_LD_GOT_11_X,
1412 0 : 0x28000000 => Type::X86_NONE,
1413 0 : 0x28000001 => Type::X86_32,
1414 0 : 0x28000002 => Type::X86_PC32,
1415 0 : 0x28000003 => Type::X86_GOT32,
1416 0 : 0x28000004 => Type::X86_PLT32,
1417 0 : 0x28000005 => Type::X86_COPY,
1418 0 : 0x28000006 => Type::X86_GLOB_DAT,
1419 0 : 0x28000007 => Type::X86_JUMP_SLOT,
1420 0 : 0x28000008 => Type::X86_RELATIVE,
1421 0 : 0x28000009 => Type::X86_GOTOFF,
1422 0 : 0x2800000a => Type::X86_GOTPC,
1423 0 : 0x2800000b => Type::X86_32PLT,
1424 0 : 0x2800000e => Type::X86_TLS_TPOFF,
1425 0 : 0x2800000f => Type::X86_TLS_IE,
1426 0 : 0x28000010 => Type::X86_TLS_GOTIE,
1427 0 : 0x28000011 => Type::X86_TLS_LE,
1428 0 : 0x28000012 => Type::X86_TLS_GD,
1429 0 : 0x28000013 => Type::X86_TLS_LDM,
1430 0 : 0x28000014 => Type::X86_16,
1431 0 : 0x28000015 => Type::X86_PC16,
1432 0 : 0x28000016 => Type::X86_8,
1433 0 : 0x28000017 => Type::X86_PC8,
1434 0 : 0x28000018 => Type::X86_TLS_GD_32,
1435 0 : 0x28000019 => Type::X86_TLS_GD_PUSH,
1436 0 : 0x2800001a => Type::X86_TLS_GD_CALL,
1437 0 : 0x2800001b => Type::X86_TLS_GD_POP,
1438 0 : 0x2800001c => Type::X86_TLS_LDM_32,
1439 0 : 0x2800001d => Type::X86_TLS_LDM_PUSH,
1440 0 : 0x2800001e => Type::X86_TLS_LDM_CALL,
1441 0 : 0x2800001f => Type::X86_TLS_LDM_POP,
1442 0 : 0x28000020 => Type::X86_TLS_LDO_32,
1443 0 : 0x28000021 => Type::X86_TLS_IE_32,
1444 0 : 0x28000022 => Type::X86_TLS_LE_32,
1445 0 : 0x28000023 => Type::X86_TLS_DTPMOD32,
1446 0 : 0x28000024 => Type::X86_TLS_DTPOFF32,
1447 0 : 0x28000025 => Type::X86_TLS_TPOFF32,
1448 0 : 0x28000027 => Type::X86_TLS_GOTDESC,
1449 0 : 0x28000028 => Type::X86_TLS_DESC_CALL,
1450 0 : 0x28000029 => Type::X86_TLS_DESC,
1451 0 : 0x2800002a => Type::X86_IRELATIVE,
1452 0 : 0x30000000 => Type::LARCH_NONE,
1453 0 : 0x30000001 => Type::LARCH_32,
1454 32 : 0x30000002 => Type::LARCH_64,
1455 0 : 0x30000003 => Type::LARCH_RELATIVE,
1456 0 : 0x30000004 => Type::LARCH_COPY,
1457 0 : 0x30000005 => Type::LARCH_JUMP_SLOT,
1458 0 : 0x30000006 => Type::LARCH_TLS_DTPMOD32,
1459 0 : 0x30000007 => Type::LARCH_TLS_DTPMOD64,
1460 0 : 0x30000008 => Type::LARCH_TLS_DTPREL32,
1461 0 : 0x30000009 => Type::LARCH_TLS_DTPREL64,
1462 0 : 0x3000000a => Type::LARCH_TLS_TPREL32,
1463 0 : 0x3000000b => Type::LARCH_TLS_TPREL64,
1464 0 : 0x3000000c => Type::LARCH_IRELATIVE,
1465 0 : 0x30000014 => Type::LARCH_MARK_LA,
1466 0 : 0x30000015 => Type::LARCH_MARK_PCREL,
1467 0 : 0x30000016 => Type::LARCH_SOP_PUSH_PCREL,
1468 0 : 0x30000017 => Type::LARCH_SOP_PUSH_ABSOLUTE,
1469 0 : 0x30000018 => Type::LARCH_SOP_PUSH_DUP,
1470 0 : 0x30000019 => Type::LARCH_SOP_PUSH_GPREL,
1471 0 : 0x3000001a => Type::LARCH_SOP_PUSH_TLS_TPREL,
1472 0 : 0x3000001b => Type::LARCH_SOP_PUSH_TLS_GOT,
1473 0 : 0x3000001c => Type::LARCH_SOP_PUSH_TLS_GD,
1474 0 : 0x3000001d => Type::LARCH_SOP_PUSH_PLT_PCREL,
1475 0 : 0x3000001e => Type::LARCH_SOP_ASSERT,
1476 0 : 0x3000001f => Type::LARCH_SOP_NOT,
1477 0 : 0x30000020 => Type::LARCH_SOP_SUB,
1478 0 : 0x30000021 => Type::LARCH_SOP_SL,
1479 0 : 0x30000022 => Type::LARCH_SOP_SR,
1480 0 : 0x30000023 => Type::LARCH_SOP_ADD,
1481 0 : 0x30000024 => Type::LARCH_SOP_AND,
1482 0 : 0x30000025 => Type::LARCH_SOP_IF_ELSE,
1483 0 : 0x30000026 => Type::LARCH_SOP_POP_32_S_10_5,
1484 0 : 0x30000027 => Type::LARCH_SOP_POP_32_U_10_12,
1485 0 : 0x30000028 => Type::LARCH_SOP_POP_32_S_10_12,
1486 0 : 0x30000029 => Type::LARCH_SOP_POP_32_S_10_16,
1487 0 : 0x3000002a => Type::LARCH_SOP_POP_32_S_10_16_S2,
1488 0 : 0x3000002b => Type::LARCH_SOP_POP_32_S_5_20,
1489 0 : 0x3000002c => Type::LARCH_SOP_POP_32_S_0_5_10_16_S2,
1490 0 : 0x3000002d => Type::LARCH_SOP_POP_32_S_0_10_10_16_S2,
1491 0 : 0x3000002e => Type::LARCH_SOP_POP_32_U,
1492 0 : 0x3000002f => Type::LARCH_ADD8,
1493 0 : 0x30000030 => Type::LARCH_ADD16,
1494 0 : 0x30000031 => Type::LARCH_ADD24,
1495 0 : 0x30000032 => Type::LARCH_ADD32,
1496 0 : 0x30000033 => Type::LARCH_ADD64,
1497 0 : 0x30000034 => Type::LARCH_SUB8,
1498 0 : 0x30000035 => Type::LARCH_SUB16,
1499 0 : 0x30000036 => Type::LARCH_SUB24,
1500 0 : 0x30000037 => Type::LARCH_SUB32,
1501 0 : 0x30000038 => Type::LARCH_SUB64,
1502 0 : 0x30000039 => Type::LARCH_GNU_VTINHERIT,
1503 0 : 0x3000003a => Type::LARCH_GNU_VTENTRY,
1504 0 : 0x30000040 => Type::LARCH_B16,
1505 0 : 0x30000041 => Type::LARCH_B21,
1506 320 : 0x30000042 => Type::LARCH_B26,
1507 0 : 0x30000043 => Type::LARCH_ABS_HI20,
1508 0 : 0x30000044 => Type::LARCH_ABS_LO12,
1509 0 : 0x30000045 => Type::LARCH_ABS64_LO20,
1510 0 : 0x30000046 => Type::LARCH_ABS64_HI12,
1511 96 : 0x30000047 => Type::LARCH_PCALA_HI20,
1512 96 : 0x30000048 => Type::LARCH_PCALA_LO12,
1513 0 : 0x30000049 => Type::LARCH_PCALA64_LO20,
1514 0 : 0x3000004a => Type::LARCH_PCALA64_HI12,
1515 48 : 0x3000004b => Type::LARCH_GOT_PC_HI20,
1516 48 : 0x3000004c => Type::LARCH_GOT_PC_LO12,
1517 0 : 0x3000004d => Type::LARCH_GOT64_PC_LO20,
1518 0 : 0x3000004e => Type::LARCH_GOT64_PC_HI12,
1519 0 : 0x3000004f => Type::LARCH_GOT_HI20,
1520 0 : 0x30000050 => Type::LARCH_GOT_LO12,
1521 0 : 0x30000051 => Type::LARCH_GOT64_LO20,
1522 0 : 0x30000052 => Type::LARCH_GOT64_HI12,
1523 0 : 0x30000053 => Type::LARCH_TLS_LE_HI20,
1524 0 : 0x30000054 => Type::LARCH_TLS_LE_LO12,
1525 0 : 0x30000055 => Type::LARCH_TLS_LE64_LO20,
1526 0 : 0x30000056 => Type::LARCH_TLS_LE64_HI12,
1527 0 : 0x30000057 => Type::LARCH_TLS_IE_PC_HI20,
1528 0 : 0x30000058 => Type::LARCH_TLS_IE_PC_LO12,
1529 0 : 0x30000059 => Type::LARCH_TLS_IE64_PC_LO20,
1530 0 : 0x3000005a => Type::LARCH_TLS_IE64_PC_HI12,
1531 0 : 0x3000005b => Type::LARCH_TLS_IE_HI20,
1532 0 : 0x3000005c => Type::LARCH_TLS_IE_LO12,
1533 0 : 0x3000005d => Type::LARCH_TLS_IE64_LO20,
1534 0 : 0x3000005e => Type::LARCH_TLS_IE64_HI12,
1535 0 : 0x3000005f => Type::LARCH_TLS_LD_PC_HI20,
1536 0 : 0x30000060 => Type::LARCH_TLS_LD_HI20,
1537 0 : 0x30000061 => Type::LARCH_TLS_GD_PC_HI20,
1538 0 : 0x30000062 => Type::LARCH_TLS_GD_HI20,
1539 80 : 0x30000063 => Type::LARCH_32_PCREL,
1540 0 : 0x30000064 => Type::LARCH_RELAX,
1541 16 : 0x38000000 => Type::MIPS_NONE,
1542 0 : 0x38000001 => Type::MIPS_16,
1543 0 : 0x38000002 => Type::MIPS_32,
1544 6064 : 0x38000003 => Type::MIPS_REL32,
1545 0 : 0x38000004 => Type::MIPS_26,
1546 0 : 0x38000005 => Type::MIPS_HI16,
1547 0 : 0x38000006 => Type::MIPS_LO16,
1548 0 : 0x38000007 => Type::MIPS_GPREL16,
1549 0 : 0x38000008 => Type::MIPS_LITERAL,
1550 0 : 0x38000009 => Type::MIPS_GOT16,
1551 0 : 0x3800000a => Type::MIPS_PC16,
1552 0 : 0x3800000b => Type::MIPS_CALL16,
1553 0 : 0x3800000c => Type::MIPS_GPREL32,
1554 0 : 0x3800000d => Type::MIPS_UNUSED1,
1555 0 : 0x3800000e => Type::MIPS_UNUSED2,
1556 0 : 0x3800000f => Type::MIPS_UNUSED3,
1557 0 : 0x38000010 => Type::MIPS_SHIFT5,
1558 0 : 0x38000011 => Type::MIPS_SHIFT6,
1559 0 : 0x38000012 => Type::MIPS_64,
1560 0 : 0x38000013 => Type::MIPS_GOT_DISP,
1561 0 : 0x38000014 => Type::MIPS_GOT_PAGE,
1562 0 : 0x38000015 => Type::MIPS_GOT_OFST,
1563 0 : 0x38000016 => Type::MIPS_GOT_HI16,
1564 0 : 0x38000017 => Type::MIPS_GOT_LO16,
1565 0 : 0x38000018 => Type::MIPS_SUB,
1566 0 : 0x38000019 => Type::MIPS_INSERT_A,
1567 0 : 0x3800001a => Type::MIPS_INSERT_B,
1568 0 : 0x3800001b => Type::MIPS_DELETE,
1569 0 : 0x3800001c => Type::MIPS_HIGHER,
1570 0 : 0x3800001d => Type::MIPS_HIGHEST,
1571 0 : 0x3800001e => Type::MIPS_CALL_HI16,
1572 0 : 0x3800001f => Type::MIPS_CALL_LO16,
1573 0 : 0x38000020 => Type::MIPS_SCN_DISP,
1574 0 : 0x38000021 => Type::MIPS_REL16,
1575 0 : 0x38000022 => Type::MIPS_ADD_IMMEDIATE,
1576 0 : 0x38000023 => Type::MIPS_PJUMP,
1577 0 : 0x38000024 => Type::MIPS_RELGOT,
1578 0 : 0x38000025 => Type::MIPS_JALR,
1579 0 : 0x38000026 => Type::MIPS_TLS_DTPMOD32,
1580 0 : 0x38000027 => Type::MIPS_TLS_DTPREL32,
1581 0 : 0x38000028 => Type::MIPS_TLS_DTPMOD64,
1582 0 : 0x38000029 => Type::MIPS_TLS_DTPREL64,
1583 0 : 0x3800002a => Type::MIPS_TLS_GD,
1584 0 : 0x3800002b => Type::MIPS_TLS_LDM,
1585 0 : 0x3800002c => Type::MIPS_TLS_DTPREL_HI16,
1586 0 : 0x3800002d => Type::MIPS_TLS_DTPREL_LO16,
1587 0 : 0x3800002e => Type::MIPS_TLS_GOTTPREL,
1588 0 : 0x3800002f => Type::MIPS_TLS_TPREL32,
1589 0 : 0x38000030 => Type::MIPS_TLS_TPREL64,
1590 0 : 0x38000031 => Type::MIPS_TLS_TPREL_HI16,
1591 0 : 0x38000032 => Type::MIPS_TLS_TPREL_LO16,
1592 0 : 0x38000033 => Type::MIPS_GLOB_DAT,
1593 0 : 0x3800003c => Type::MIPS_PC21_S2,
1594 0 : 0x3800003d => Type::MIPS_PC26_S2,
1595 0 : 0x3800003e => Type::MIPS_PC18_S3,
1596 0 : 0x3800003f => Type::MIPS_PC19_S2,
1597 0 : 0x38000040 => Type::MIPS_PCHI16,
1598 0 : 0x38000041 => Type::MIPS_PCLO16,
1599 0 : 0x38000064 => Type::MIPS16_26,
1600 0 : 0x38000065 => Type::MIPS16_GPREL,
1601 0 : 0x38000066 => Type::MIPS16_GOT16,
1602 0 : 0x38000067 => Type::MIPS16_CALL16,
1603 0 : 0x38000068 => Type::MIPS16_HI16,
1604 0 : 0x38000069 => Type::MIPS16_LO16,
1605 0 : 0x3800006a => Type::MIPS16_TLS_GD,
1606 0 : 0x3800006b => Type::MIPS16_TLS_LDM,
1607 0 : 0x3800006c => Type::MIPS16_TLS_DTPREL_HI16,
1608 0 : 0x3800006d => Type::MIPS16_TLS_DTPREL_LO16,
1609 0 : 0x3800006e => Type::MIPS16_TLS_GOTTPREL,
1610 0 : 0x3800006f => Type::MIPS16_TLS_TPREL_HI16,
1611 0 : 0x38000070 => Type::MIPS16_TLS_TPREL_LO16,
1612 0 : 0x3800007e => Type::MIPS_COPY,
1613 16 : 0x3800007f => Type::MIPS_JUMP_SLOT,
1614 0 : 0x38000085 => Type::MICROMIPS_26_S1,
1615 0 : 0x38000086 => Type::MICROMIPS_HI16,
1616 0 : 0x38000087 => Type::MICROMIPS_LO16,
1617 0 : 0x38000088 => Type::MICROMIPS_GPREL16,
1618 0 : 0x38000089 => Type::MICROMIPS_LITERAL,
1619 0 : 0x3800008a => Type::MICROMIPS_GOT16,
1620 0 : 0x3800008b => Type::MICROMIPS_PC7_S1,
1621 0 : 0x3800008c => Type::MICROMIPS_PC10_S1,
1622 0 : 0x3800008d => Type::MICROMIPS_PC16_S1,
1623 0 : 0x3800008e => Type::MICROMIPS_CALL16,
1624 0 : 0x38000091 => Type::MICROMIPS_GOT_DISP,
1625 0 : 0x38000092 => Type::MICROMIPS_GOT_PAGE,
1626 0 : 0x38000093 => Type::MICROMIPS_GOT_OFST,
1627 0 : 0x38000094 => Type::MICROMIPS_GOT_HI16,
1628 0 : 0x38000095 => Type::MICROMIPS_GOT_LO16,
1629 0 : 0x38000096 => Type::MICROMIPS_SUB,
1630 0 : 0x38000097 => Type::MICROMIPS_HIGHER,
1631 0 : 0x38000098 => Type::MICROMIPS_HIGHEST,
1632 0 : 0x38000099 => Type::MICROMIPS_CALL_HI16,
1633 0 : 0x3800009a => Type::MICROMIPS_CALL_LO16,
1634 0 : 0x3800009b => Type::MICROMIPS_SCN_DISP,
1635 0 : 0x3800009c => Type::MICROMIPS_JALR,
1636 0 : 0x3800009d => Type::MICROMIPS_HI0_LO16,
1637 0 : 0x380000a2 => Type::MICROMIPS_TLS_GD,
1638 0 : 0x380000a3 => Type::MICROMIPS_TLS_LDM,
1639 0 : 0x380000a4 => Type::MICROMIPS_TLS_DTPREL_HI16,
1640 0 : 0x380000a5 => Type::MICROMIPS_TLS_DTPREL_LO16,
1641 0 : 0x380000a6 => Type::MICROMIPS_TLS_GOTTPREL,
1642 0 : 0x380000a9 => Type::MICROMIPS_TLS_TPREL_HI16,
1643 0 : 0x380000aa => Type::MICROMIPS_TLS_TPREL_LO16,
1644 0 : 0x380000ac => Type::MICROMIPS_GPREL7_S2,
1645 0 : 0x380000ad => Type::MICROMIPS_PC23_S2,
1646 0 : 0x380000ae => Type::MICROMIPS_PC21_S2,
1647 0 : 0x380000af => Type::MICROMIPS_PC26_S2,
1648 0 : 0x380000b0 => Type::MICROMIPS_PC18_S3,
1649 0 : 0x380000b1 => Type::MICROMIPS_PC19_S2,
1650 0 : 0x380000da => Type::MIPS_NUM,
1651 0 : 0x380000f8 => Type::MIPS_PC32,
1652 0 : 0x380000f9 => Type::MIPS_EH,
1653 0 : 0x40000000 => Type::PPC_NONE,
1654 0 : 0x40000001 => Type::PPC_ADDR32,
1655 0 : 0x40000002 => Type::PPC_ADDR24,
1656 0 : 0x40000003 => Type::PPC_ADDR16,
1657 0 : 0x40000004 => Type::PPC_ADDR16_LO,
1658 0 : 0x40000005 => Type::PPC_ADDR16_HI,
1659 0 : 0x40000006 => Type::PPC_ADDR16_HA,
1660 0 : 0x40000007 => Type::PPC_ADDR14,
1661 0 : 0x40000008 => Type::PPC_ADDR14_BRTAKEN,
1662 0 : 0x40000009 => Type::PPC_ADDR14_BRNTAKEN,
1663 0 : 0x4000000a => Type::PPC_REL24,
1664 0 : 0x4000000b => Type::PPC_REL14,
1665 0 : 0x4000000c => Type::PPC_REL14_BRTAKEN,
1666 0 : 0x4000000d => Type::PPC_REL14_BRNTAKEN,
1667 0 : 0x4000000e => Type::PPC_GOT16,
1668 0 : 0x4000000f => Type::PPC_GOT16_LO,
1669 0 : 0x40000010 => Type::PPC_GOT16_HI,
1670 0 : 0x40000011 => Type::PPC_GOT16_HA,
1671 0 : 0x40000012 => Type::PPC_PLTREL24,
1672 0 : 0x40000015 => Type::PPC_JMP_SLOT,
1673 0 : 0x40000016 => Type::PPC_RELATIVE,
1674 0 : 0x40000017 => Type::PPC_LOCAL24PC,
1675 0 : 0x4000001a => Type::PPC_REL32,
1676 0 : 0x40000043 => Type::PPC_TLS,
1677 0 : 0x40000044 => Type::PPC_DTPMOD32,
1678 0 : 0x40000045 => Type::PPC_TPREL16,
1679 0 : 0x40000046 => Type::PPC_TPREL16_LO,
1680 0 : 0x40000047 => Type::PPC_TPREL16_HI,
1681 0 : 0x40000048 => Type::PPC_TPREL16_HA,
1682 0 : 0x40000049 => Type::PPC_TPREL32,
1683 0 : 0x4000004a => Type::PPC_DTPREL16,
1684 0 : 0x4000004b => Type::PPC_DTPREL16_LO,
1685 0 : 0x4000004c => Type::PPC_DTPREL16_HI,
1686 0 : 0x4000004d => Type::PPC_DTPREL16_HA,
1687 0 : 0x4000004e => Type::PPC_DTPREL32,
1688 0 : 0x4000004f => Type::PPC_GOT_TLSGD16,
1689 0 : 0x40000050 => Type::PPC_GOT_TLSGD16_LO,
1690 0 : 0x40000051 => Type::PPC_GOT_TLSGD16_HI,
1691 0 : 0x40000052 => Type::PPC_GOT_TLSGD16_HA,
1692 0 : 0x40000053 => Type::PPC_GOT_TLSLD16,
1693 0 : 0x40000054 => Type::PPC_GOT_TLSLD16_LO,
1694 0 : 0x40000055 => Type::PPC_GOT_TLSLD16_HI,
1695 0 : 0x40000056 => Type::PPC_GOT_TLSLD16_HA,
1696 0 : 0x40000057 => Type::PPC_GOT_TPREL16,
1697 0 : 0x40000058 => Type::PPC_GOT_TPREL16_LO,
1698 0 : 0x40000059 => Type::PPC_GOT_TPREL16_HI,
1699 0 : 0x4000005a => Type::PPC_GOT_TPREL16_HA,
1700 0 : 0x4000005b => Type::PPC_GOT_DTPREL16,
1701 0 : 0x4000005c => Type::PPC_GOT_DTPREL16_LO,
1702 0 : 0x4000005d => Type::PPC_GOT_DTPREL16_HI,
1703 0 : 0x4000005e => Type::PPC_GOT_DTPREL16_HA,
1704 0 : 0x4000005f => Type::PPC_TLSGD,
1705 0 : 0x40000060 => Type::PPC_TLSLD,
1706 0 : 0x400000f9 => Type::PPC_REL16,
1707 0 : 0x400000fa => Type::PPC_REL16_LO,
1708 0 : 0x400000fb => Type::PPC_REL16_HI,
1709 0 : 0x400000fc => Type::PPC_REL16_HA,
1710 0 : 0x48000000 => Type::PPC64_NONE,
1711 0 : 0x48000001 => Type::PPC64_ADDR32,
1712 0 : 0x48000002 => Type::PPC64_ADDR24,
1713 0 : 0x48000003 => Type::PPC64_ADDR16,
1714 0 : 0x48000004 => Type::PPC64_ADDR16_LO,
1715 0 : 0x48000005 => Type::PPC64_ADDR16_HI,
1716 0 : 0x48000006 => Type::PPC64_ADDR16_HA,
1717 0 : 0x48000007 => Type::PPC64_ADDR14,
1718 0 : 0x48000008 => Type::PPC64_ADDR14_BRTAKEN,
1719 0 : 0x48000009 => Type::PPC64_ADDR14_BRNTAKEN,
1720 0 : 0x4800000a => Type::PPC64_REL24,
1721 0 : 0x4800000b => Type::PPC64_REL14,
1722 0 : 0x4800000c => Type::PPC64_REL14_BRTAKEN,
1723 0 : 0x4800000d => Type::PPC64_REL14_BRNTAKEN,
1724 0 : 0x4800000e => Type::PPC64_GOT16,
1725 0 : 0x4800000f => Type::PPC64_GOT16_LO,
1726 0 : 0x48000010 => Type::PPC64_GOT16_HI,
1727 0 : 0x48000011 => Type::PPC64_GOT16_HA,
1728 0 : 0x48000015 => Type::PPC64_JMP_SLOT,
1729 0 : 0x48000016 => Type::PPC64_RELATIVE,
1730 0 : 0x4800001a => Type::PPC64_REL32,
1731 0 : 0x48000026 => Type::PPC64_ADDR64,
1732 0 : 0x48000027 => Type::PPC64_ADDR16_HIGHER,
1733 0 : 0x48000028 => Type::PPC64_ADDR16_HIGHERA,
1734 0 : 0x48000029 => Type::PPC64_ADDR16_HIGHEST,
1735 0 : 0x4800002a => Type::PPC64_ADDR16_HIGHESTA,
1736 0 : 0x4800002c => Type::PPC64_REL64,
1737 0 : 0x4800002f => Type::PPC64_TOC16,
1738 0 : 0x48000030 => Type::PPC64_TOC16_LO,
1739 0 : 0x48000031 => Type::PPC64_TOC16_HI,
1740 0 : 0x48000032 => Type::PPC64_TOC16_HA,
1741 0 : 0x48000033 => Type::PPC64_TOC,
1742 0 : 0x48000038 => Type::PPC64_ADDR16_DS,
1743 0 : 0x48000039 => Type::PPC64_ADDR16_LO_DS,
1744 0 : 0x4800003a => Type::PPC64_GOT16_DS,
1745 0 : 0x4800003b => Type::PPC64_GOT16_LO_DS,
1746 0 : 0x4800003f => Type::PPC64_TOC16_DS,
1747 0 : 0x48000040 => Type::PPC64_TOC16_LO_DS,
1748 0 : 0x48000043 => Type::PPC64_TLS,
1749 0 : 0x48000044 => Type::PPC64_DTPMOD64,
1750 0 : 0x48000045 => Type::PPC64_TPREL16,
1751 0 : 0x48000046 => Type::PPC64_TPREL16_LO,
1752 0 : 0x48000047 => Type::PPC64_TPREL16_HI,
1753 0 : 0x48000048 => Type::PPC64_TPREL16_HA,
1754 0 : 0x48000049 => Type::PPC64_TPREL64,
1755 0 : 0x4800004a => Type::PPC64_DTPREL16,
1756 0 : 0x4800004b => Type::PPC64_DTPREL16_LO,
1757 0 : 0x4800004c => Type::PPC64_DTPREL16_HI,
1758 0 : 0x4800004d => Type::PPC64_DTPREL16_HA,
1759 0 : 0x4800004e => Type::PPC64_DTPREL64,
1760 0 : 0x4800004f => Type::PPC64_GOT_TLSGD16,
1761 0 : 0x48000050 => Type::PPC64_GOT_TLSGD16_LO,
1762 0 : 0x48000051 => Type::PPC64_GOT_TLSGD16_HI,
1763 0 : 0x48000052 => Type::PPC64_GOT_TLSGD16_HA,
1764 0 : 0x48000053 => Type::PPC64_GOT_TLSLD16,
1765 0 : 0x48000054 => Type::PPC64_GOT_TLSLD16_LO,
1766 0 : 0x48000055 => Type::PPC64_GOT_TLSLD16_HI,
1767 0 : 0x48000056 => Type::PPC64_GOT_TLSLD16_HA,
1768 0 : 0x48000057 => Type::PPC64_GOT_TPREL16_DS,
1769 0 : 0x48000058 => Type::PPC64_GOT_TPREL16_LO_DS,
1770 0 : 0x48000059 => Type::PPC64_GOT_TPREL16_HI,
1771 0 : 0x4800005a => Type::PPC64_GOT_TPREL16_HA,
1772 0 : 0x4800005b => Type::PPC64_GOT_DTPREL16_DS,
1773 0 : 0x4800005c => Type::PPC64_GOT_DTPREL16_LO_DS,
1774 0 : 0x4800005d => Type::PPC64_GOT_DTPREL16_HI,
1775 0 : 0x4800005e => Type::PPC64_GOT_DTPREL16_HA,
1776 0 : 0x4800005f => Type::PPC64_TPREL16_DS,
1777 0 : 0x48000060 => Type::PPC64_TPREL16_LO_DS,
1778 0 : 0x48000061 => Type::PPC64_TPREL16_HIGHER,
1779 0 : 0x48000062 => Type::PPC64_TPREL16_HIGHERA,
1780 0 : 0x48000063 => Type::PPC64_TPREL16_HIGHEST,
1781 0 : 0x48000064 => Type::PPC64_TPREL16_HIGHESTA,
1782 0 : 0x48000065 => Type::PPC64_DTPREL16_DS,
1783 0 : 0x48000066 => Type::PPC64_DTPREL16_LO_DS,
1784 0 : 0x48000067 => Type::PPC64_DTPREL16_HIGHER,
1785 0 : 0x48000068 => Type::PPC64_DTPREL16_HIGHERA,
1786 0 : 0x48000069 => Type::PPC64_DTPREL16_HIGHEST,
1787 0 : 0x4800006a => Type::PPC64_DTPREL16_HIGHESTA,
1788 0 : 0x4800006b => Type::PPC64_TLSGD,
1789 0 : 0x4800006c => Type::PPC64_TLSLD,
1790 0 : 0x480000f9 => Type::PPC64_REL16,
1791 0 : 0x480000fa => Type::PPC64_REL16_LO,
1792 0 : 0x480000fb => Type::PPC64_REL16_HI,
1793 0 : 0x480000fc => Type::PPC64_REL16_HA,
1794 0 : 0x50000000 => Type::SPARC_NONE,
1795 0 : 0x50000001 => Type::SPARC_8,
1796 0 : 0x50000002 => Type::SPARC_16,
1797 0 : 0x50000003 => Type::SPARC_32,
1798 0 : 0x50000004 => Type::SPARC_DISP8,
1799 0 : 0x50000005 => Type::SPARC_DISP16,
1800 0 : 0x50000006 => Type::SPARC_DISP32,
1801 0 : 0x50000007 => Type::SPARC_WDISP30,
1802 0 : 0x50000008 => Type::SPARC_WDISP22,
1803 0 : 0x50000009 => Type::SPARC_HI22,
1804 0 : 0x5000000a => Type::SPARC_22,
1805 0 : 0x5000000b => Type::SPARC_13,
1806 0 : 0x5000000c => Type::SPARC_LO10,
1807 0 : 0x5000000d => Type::SPARC_GOT10,
1808 0 : 0x5000000e => Type::SPARC_GOT13,
1809 0 : 0x5000000f => Type::SPARC_GOT22,
1810 0 : 0x50000010 => Type::SPARC_PC10,
1811 0 : 0x50000011 => Type::SPARC_PC22,
1812 0 : 0x50000012 => Type::SPARC_WPLT30,
1813 0 : 0x50000013 => Type::SPARC_COPY,
1814 0 : 0x50000014 => Type::SPARC_GLOB_DAT,
1815 0 : 0x50000015 => Type::SPARC_JMP_SLOT,
1816 0 : 0x50000016 => Type::SPARC_RELATIVE,
1817 0 : 0x50000017 => Type::SPARC_UA32,
1818 0 : 0x50000018 => Type::SPARC_PLT32,
1819 0 : 0x50000019 => Type::SPARC_HIPLT22,
1820 0 : 0x5000001a => Type::SPARC_LOPLT10,
1821 0 : 0x5000001b => Type::SPARC_PCPLT32,
1822 0 : 0x5000001c => Type::SPARC_PCPLT22,
1823 0 : 0x5000001d => Type::SPARC_PCPLT10,
1824 0 : 0x5000001e => Type::SPARC_10,
1825 0 : 0x5000001f => Type::SPARC_11,
1826 0 : 0x50000020 => Type::SPARC_64,
1827 0 : 0x50000021 => Type::SPARC_OLO10,
1828 0 : 0x50000022 => Type::SPARC_HH22,
1829 0 : 0x50000023 => Type::SPARC_HM10,
1830 0 : 0x50000024 => Type::SPARC_LM22,
1831 0 : 0x50000025 => Type::SPARC_PC_HH22,
1832 0 : 0x50000026 => Type::SPARC_PC_HM10,
1833 0 : 0x50000027 => Type::SPARC_PC_LM22,
1834 0 : 0x50000028 => Type::SPARC_WDISP16,
1835 0 : 0x50000029 => Type::SPARC_WDISP19,
1836 0 : 0x5000002b => Type::SPARC_7,
1837 0 : 0x5000002c => Type::SPARC_5,
1838 0 : 0x5000002d => Type::SPARC_6,
1839 0 : 0x5000002e => Type::SPARC_DISP64,
1840 0 : 0x5000002f => Type::SPARC_PLT64,
1841 0 : 0x50000030 => Type::SPARC_HIX22,
1842 0 : 0x50000031 => Type::SPARC_LOX10,
1843 0 : 0x50000032 => Type::SPARC_H44,
1844 0 : 0x50000033 => Type::SPARC_M44,
1845 0 : 0x50000034 => Type::SPARC_L44,
1846 0 : 0x50000035 => Type::SPARC_REGISTER,
1847 0 : 0x50000036 => Type::SPARC_UA64,
1848 0 : 0x50000037 => Type::SPARC_UA16,
1849 0 : 0x50000038 => Type::SPARC_TLS_GD_HI22,
1850 0 : 0x50000039 => Type::SPARC_TLS_GD_LO10,
1851 0 : 0x5000003a => Type::SPARC_TLS_GD_ADD,
1852 0 : 0x5000003b => Type::SPARC_TLS_GD_CALL,
1853 0 : 0x5000003c => Type::SPARC_TLS_LDM_HI22,
1854 0 : 0x5000003d => Type::SPARC_TLS_LDM_LO10,
1855 0 : 0x5000003e => Type::SPARC_TLS_LDM_ADD,
1856 0 : 0x5000003f => Type::SPARC_TLS_LDM_CALL,
1857 0 : 0x50000040 => Type::SPARC_TLS_LDO_HIX22,
1858 0 : 0x50000041 => Type::SPARC_TLS_LDO_LOX10,
1859 0 : 0x50000042 => Type::SPARC_TLS_LDO_ADD,
1860 0 : 0x50000043 => Type::SPARC_TLS_IE_HI22,
1861 0 : 0x50000044 => Type::SPARC_TLS_IE_LO10,
1862 0 : 0x50000045 => Type::SPARC_TLS_IE_LD,
1863 0 : 0x50000046 => Type::SPARC_TLS_IE_LDX,
1864 0 : 0x50000047 => Type::SPARC_TLS_IE_ADD,
1865 0 : 0x50000048 => Type::SPARC_TLS_LE_HIX22,
1866 0 : 0x50000049 => Type::SPARC_TLS_LE_LOX10,
1867 0 : 0x5000004a => Type::SPARC_TLS_DTPMOD32,
1868 0 : 0x5000004b => Type::SPARC_TLS_DTPMOD64,
1869 0 : 0x5000004c => Type::SPARC_TLS_DTPOFF32,
1870 0 : 0x5000004d => Type::SPARC_TLS_DTPOFF64,
1871 0 : 0x5000004e => Type::SPARC_TLS_TPOFF32,
1872 0 : 0x5000004f => Type::SPARC_TLS_TPOFF64,
1873 0 : 0x50000050 => Type::SPARC_GOTDATA_HIX22,
1874 0 : 0x50000051 => Type::SPARC_GOTDATA_LOX10,
1875 0 : 0x50000052 => Type::SPARC_GOTDATA_OP_HIX22,
1876 0 : 0x50000053 => Type::SPARC_GOTDATA_OP_LOX10,
1877 0 : 0x50000054 => Type::SPARC_GOTDATA_OP,
1878 0 : 0x58000000 => Type::SYSZ_NONE,
1879 0 : 0x58000001 => Type::SYSZ_8,
1880 0 : 0x58000002 => Type::SYSZ_12,
1881 0 : 0x58000003 => Type::SYSZ_16,
1882 0 : 0x58000004 => Type::SYSZ_32,
1883 0 : 0x58000005 => Type::SYSZ_PC32,
1884 0 : 0x58000006 => Type::SYSZ_GOT12,
1885 0 : 0x58000007 => Type::SYSZ_GOT32,
1886 0 : 0x58000008 => Type::SYSZ_PLT32,
1887 0 : 0x58000009 => Type::SYSZ_COPY,
1888 0 : 0x5800000a => Type::SYSZ_GLOB_DAT,
1889 0 : 0x5800000b => Type::SYSZ_JMP_SLOT,
1890 0 : 0x5800000c => Type::SYSZ_RELATIVE,
1891 0 : 0x5800000d => Type::SYSZ_GOTOFF,
1892 0 : 0x5800000e => Type::SYSZ_GOTPC,
1893 0 : 0x5800000f => Type::SYSZ_GOT16,
1894 0 : 0x58000010 => Type::SYSZ_PC16,
1895 0 : 0x58000011 => Type::SYSZ_PC16DBL,
1896 0 : 0x58000012 => Type::SYSZ_PLT16DBL,
1897 0 : 0x58000013 => Type::SYSZ_PC32DBL,
1898 0 : 0x58000014 => Type::SYSZ_PLT32DBL,
1899 0 : 0x58000015 => Type::SYSZ_GOTPCDBL,
1900 0 : 0x58000016 => Type::SYSZ_64,
1901 0 : 0x58000017 => Type::SYSZ_PC64,
1902 0 : 0x58000018 => Type::SYSZ_GOT64,
1903 0 : 0x58000019 => Type::SYSZ_PLT64,
1904 0 : 0x5800001a => Type::SYSZ_GOTENT,
1905 0 : 0x5800001b => Type::SYSZ_GOTOFF16,
1906 0 : 0x5800001c => Type::SYSZ_GOTOFF64,
1907 0 : 0x5800001d => Type::SYSZ_GOTPLT12,
1908 0 : 0x5800001e => Type::SYSZ_GOTPLT16,
1909 0 : 0x5800001f => Type::SYSZ_GOTPLT32,
1910 0 : 0x58000020 => Type::SYSZ_GOTPLT64,
1911 0 : 0x58000021 => Type::SYSZ_GOTPLTENT,
1912 0 : 0x58000022 => Type::SYSZ_PLTOFF16,
1913 0 : 0x58000023 => Type::SYSZ_PLTOFF32,
1914 0 : 0x58000024 => Type::SYSZ_PLTOFF64,
1915 0 : 0x58000025 => Type::SYSZ_TLS_LOAD,
1916 0 : 0x58000026 => Type::SYSZ_TLS_GDCALL,
1917 0 : 0x58000027 => Type::SYSZ_TLS_LDCALL,
1918 0 : 0x58000028 => Type::SYSZ_TLS_GD32,
1919 0 : 0x58000029 => Type::SYSZ_TLS_GD64,
1920 0 : 0x5800002a => Type::SYSZ_TLS_GOTIE12,
1921 0 : 0x5800002b => Type::SYSZ_TLS_GOTIE32,
1922 0 : 0x5800002c => Type::SYSZ_TLS_GOTIE64,
1923 0 : 0x5800002d => Type::SYSZ_TLS_LDM32,
1924 0 : 0x5800002e => Type::SYSZ_TLS_LDM64,
1925 0 : 0x5800002f => Type::SYSZ_TLS_IE32,
1926 0 : 0x58000030 => Type::SYSZ_TLS_IE64,
1927 0 : 0x58000031 => Type::SYSZ_TLS_IEENT,
1928 0 : 0x58000032 => Type::SYSZ_TLS_LE32,
1929 0 : 0x58000033 => Type::SYSZ_TLS_LE64,
1930 0 : 0x58000034 => Type::SYSZ_TLS_LDO32,
1931 0 : 0x58000035 => Type::SYSZ_TLS_LDO64,
1932 0 : 0x58000036 => Type::SYSZ_TLS_DTPMOD,
1933 0 : 0x58000037 => Type::SYSZ_TLS_DTPOFF,
1934 0 : 0x58000038 => Type::SYSZ_TLS_TPOFF,
1935 0 : 0x58000039 => Type::SYSZ_20,
1936 0 : 0x5800003a => Type::SYSZ_GOT20,
1937 0 : 0x5800003b => Type::SYSZ_GOTPLT20,
1938 0 : 0x5800003c => Type::SYSZ_TLS_GOTIE20,
1939 0 : 0x5800003d => Type::SYSZ_IRELATIVE,
1940 0 : 0x60000000 => Type::RISCV_NONE,
1941 0 : 0x60000001 => Type::RISCV_32,
1942 0 : 0x60000002 => Type::RISCV_64,
1943 0 : 0x60000003 => Type::RISCV_RELATIVE,
1944 0 : 0x60000004 => Type::RISCV_COPY,
1945 0 : 0x60000005 => Type::RISCV_JUMP_SLOT,
1946 0 : 0x60000006 => Type::RISCV_TLS_DTPMOD32,
1947 0 : 0x60000007 => Type::RISCV_TLS_DTPMOD64,
1948 0 : 0x60000008 => Type::RISCV_TLS_DTPREL32,
1949 0 : 0x60000009 => Type::RISCV_TLS_DTPREL64,
1950 0 : 0x6000000a => Type::RISCV_TLS_TPREL32,
1951 0 : 0x6000000b => Type::RISCV_TLS_TPREL64,
1952 0 : 0x6000000c => Type::RISCV_TLSDESC,
1953 0 : 0x60000010 => Type::RISCV_BRANCH,
1954 0 : 0x60000011 => Type::RISCV_JAL,
1955 0 : 0x60000012 => Type::RISCV_CALL,
1956 0 : 0x60000013 => Type::RISCV_CALL_PLT,
1957 0 : 0x60000014 => Type::RISCV_GOT_HI20,
1958 0 : 0x60000015 => Type::RISCV_TLS_GOT_HI20,
1959 0 : 0x60000016 => Type::RISCV_TLS_GD_HI20,
1960 0 : 0x60000017 => Type::RISCV_PCREL_HI20,
1961 0 : 0x60000018 => Type::RISCV_PCREL_LO12_I,
1962 0 : 0x60000019 => Type::RISCV_PCREL_LO12_S,
1963 0 : 0x6000001a => Type::RISCV_HI20,
1964 0 : 0x6000001b => Type::RISCV_LO12_I,
1965 0 : 0x6000001c => Type::RISCV_LO12_S,
1966 0 : 0x6000001d => Type::RISCV_TPREL_HI20,
1967 0 : 0x6000001e => Type::RISCV_TPREL_LO12_I,
1968 0 : 0x6000001f => Type::RISCV_TPREL_LO12_S,
1969 0 : 0x60000020 => Type::RISCV_TPREL_ADD,
1970 0 : 0x60000021 => Type::RISCV_ADD8,
1971 0 : 0x60000022 => Type::RISCV_ADD16,
1972 0 : 0x60000023 => Type::RISCV_ADD32,
1973 0 : 0x60000024 => Type::RISCV_ADD64,
1974 0 : 0x60000025 => Type::RISCV_SUB8,
1975 0 : 0x60000026 => Type::RISCV_SUB16,
1976 0 : 0x60000027 => Type::RISCV_SUB32,
1977 0 : 0x60000028 => Type::RISCV_SUB64,
1978 0 : 0x60000029 => Type::RISCV_GOT32_PCREL,
1979 0 : 0x6000002b => Type::RISCV_ALIGN,
1980 0 : 0x6000002c => Type::RISCV_RVC_BRANCH,
1981 0 : 0x6000002d => Type::RISCV_RVC_JUMP,
1982 0 : 0x6000002e => Type::RISCV_RVC_LUI,
1983 0 : 0x60000033 => Type::RISCV_RELAX,
1984 0 : 0x60000034 => Type::RISCV_SUB6,
1985 0 : 0x60000035 => Type::RISCV_SET6,
1986 0 : 0x60000036 => Type::RISCV_SET8,
1987 0 : 0x60000037 => Type::RISCV_SET16,
1988 0 : 0x60000038 => Type::RISCV_SET32,
1989 0 : 0x60000039 => Type::RISCV_32_PCREL,
1990 0 : 0x6000003a => Type::RISCV_IRELATIVE,
1991 0 : 0x6000003b => Type::RISCV_PLT32,
1992 0 : 0x6000003c => Type::RISCV_SET_ULEB128,
1993 0 : 0x6000003d => Type::RISCV_SUB_ULEB128,
1994 0 : 0x6000003e => Type::RISCV_TLSDESC_HI20,
1995 0 : 0x6000003f => Type::RISCV_TLSDESC_LOAD_LO12,
1996 0 : 0x60000040 => Type::RISCV_TLSDESC_ADD_LO12,
1997 0 : 0x60000041 => Type::RISCV_TLSDESC_CALL,
1998 0 : _ => Type::UNKNOWN(value),
1999 :
2000 : }
2001 12960 : }
2002 : }
2003 :
2004 : #[allow(non_camel_case_types)]
2005 12960 : #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
2006 : /// The *purpose* of a relocation defines how this relocation is used by the
2007 : /// loader.
2008 : pub enum Purpose {
2009 : NONE,
2010 : /// The relocation is associated with the PLT/GOT resolution
2011 : PLTGOT,
2012 : /// The relocation is used for regulard data/code relocation
2013 : DYNAMIC,
2014 : /// The relocation is used in an object file
2015 : OBJECT,
2016 : UNKNOWN(u32),
2017 : }
2018 :
2019 : impl Purpose {
2020 12960 : pub fn from_value(value: u32) -> Self {
2021 12960 : match value {
2022 0 : 0x00000000 => Purpose::NONE,
2023 3504 : 0x00000001 => Purpose::PLTGOT,
2024 8720 : 0x00000002 => Purpose::DYNAMIC,
2025 736 : 0x00000003 => Purpose::OBJECT,
2026 0 : _ => Purpose::UNKNOWN(value),
2027 :
2028 : }
2029 12960 : }
2030 : }
2031 :
2032 :
2033 : #[allow(non_camel_case_types)]
2034 12960 : #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
2035 : pub enum Encoding {
2036 : /// The relocation is using the regular Elf_Rel structure
2037 : REL,
2038 : /// The relocation is using the regular Elf_Rela structure
2039 : RELA,
2040 : /// The relocation is using the relative relocation format
2041 : RELR,
2042 : /// The relocation is using the packed Android-SLEB128 format
2043 : ANDROID_SLEB,
2044 : UNKNOWN(u32),
2045 : }
2046 :
2047 : impl Encoding {
2048 21680 : pub fn from_value(value: u32) -> Self {
2049 21680 : match value {
2050 12176 : 0x00000001 => Encoding::REL,
2051 9504 : 0x00000002 => Encoding::RELA,
2052 0 : 0x00000003 => Encoding::RELR,
2053 0 : 0x00000004 => Encoding::ANDROID_SLEB,
2054 0 : _ => Encoding::UNKNOWN(value),
2055 :
2056 : }
2057 21680 : }
2058 : }
2059 :
2060 : impl Relocation<'_> {
2061 : /// Additional value that can be involved in the relocation processing
2062 12960 : pub fn addend(&self) -> i64 {
2063 12960 : self.ptr.addend()
2064 12960 : }
2065 :
2066 : /// Type of the relocation
2067 12960 : pub fn get_type(&self) -> Type {
2068 12960 : Type::from_value(self.ptr.get_type())
2069 12960 : }
2070 :
2071 : /// Check if the relocation uses the explicit [`Relocation::addend`] field
2072 : /// (this is usually the case for 64 bits binaries)
2073 1320 : pub fn is_rela(&self) -> bool {
2074 1320 : self.ptr.is_rela()
2075 1320 : }
2076 :
2077 : /// Check if the relocation uses the implicit addend
2078 : /// (i.e. not present in the ELF structure)
2079 3040 : pub fn is_rel(&self) -> bool {
2080 3040 : self.ptr.is_rel()
2081 3040 : }
2082 :
2083 : /// Relocation info which contains, for instance, the symbol index
2084 12960 : pub fn info(&self) -> u32 {
2085 12960 : self.ptr.info()
2086 12960 : }
2087 :
2088 : /// Target architecture for this relocation
2089 12960 : pub fn architecture(&self) -> u32 {
2090 12960 : self.ptr.architecture()
2091 12960 : }
2092 :
2093 : /// The purpose of the relocation
2094 12960 : pub fn purpose(&self) -> Purpose {
2095 12960 : Purpose::from_value(self.ptr.purpose())
2096 12960 : }
2097 :
2098 : /// The encoding of the relocation
2099 21680 : pub fn encoding(&self) -> Encoding {
2100 21680 : Encoding::from_value(self.ptr.encoding())
2101 21680 : }
2102 :
2103 : /// Symbol associated with the relocation (if any)
2104 12960 : pub fn symbol(&self) -> Option<Symbol> {
2105 12960 : into_optional(self.ptr.symbol())
2106 12960 : }
2107 :
2108 : /// The section in which the relocation is applied (if any)
2109 12960 : pub fn section(&self) -> Option<Section> {
2110 12960 : into_optional(self.ptr.section())
2111 12960 : }
2112 :
2113 : /// The associated symbol table (if any)
2114 12960 : pub fn symbol_table(&self) -> Option<Section> {
2115 12960 : into_optional(self.ptr.symbol_table())
2116 12960 : }
2117 : }
2118 :
2119 : impl std::fmt::Debug for Relocation<'_> {
2120 12960 : fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2121 12960 : let base = self as &dyn generic::Relocation;
2122 12960 : f.debug_struct("Relocation")
2123 12960 : .field("base", &base)
2124 12960 : .field("addend", &self.addend())
2125 12960 : .field("type", &self.get_type())
2126 12960 : .field("info", &self.info())
2127 12960 : .field("architecture", &self.architecture())
2128 12960 : .field("purpose", &self.purpose())
2129 12960 : .field("encoding", &self.encoding())
2130 12960 : .field("symbol", &self.symbol())
2131 12960 : .field("section", &self.section())
2132 12960 : .field("symbol_table", &self.symbol_table())
2133 12960 : .finish()
2134 12960 : }
2135 : }
2136 :
2137 : impl FromFFI<ffi::ELF_Relocation> for Relocation<'_> {
2138 12976 : fn from_ffi(ptr: cxx::UniquePtr<ffi::ELF_Relocation>) -> Self {
2139 12976 : Relocation {
2140 12976 : ptr,
2141 12976 : _owner: PhantomData
2142 12976 : }
2143 12976 : }
2144 : }
2145 :
2146 : impl generic::Relocation for Relocation<'_> {
2147 25920 : fn as_generic(&self) -> &ffi::AbstractRelocation {
2148 25920 : self.ptr.as_ref().unwrap().as_ref()
2149 25920 : }
2150 : }
2151 :
2152 6480 : declare_iterator!(Relocations, Relocation<'a>, ffi::ELF_Relocation, ffi::ELF_Binary, ffi::ELF_Binary_it_relocations);
2153 1752 : declare_iterator!(PltGotRelocations, Relocation<'a>, ffi::ELF_Relocation, ffi::ELF_Binary, ffi::ELF_Binary_it_pltgot_relocations);
2154 4360 : declare_iterator!(DynamicRelocations, Relocation<'a>, ffi::ELF_Relocation, ffi::ELF_Binary, ffi::ELF_Binary_it_dynamic_relocations);
2155 368 : declare_iterator!(ObjectRelocations, Relocation<'a>, ffi::ELF_Relocation, ffi::ELF_Binary, ffi::ELF_Binary_it_object_relocations);
|