1 //! ELF definitions.
2 //!
3 //! These definitions are independent of read/write support, although we do implement
4 //! some traits useful for those.
5 //!
6 //! This module is the equivalent of /usr/include/elf.h, and is based heavily on it.
7 
8 #![allow(clippy::identity_op)]
9 
10 use crate::endian::{Endian, U32Bytes, U64Bytes, I32, I64, U16, U32, U64};
11 use crate::pod::Pod;
12 
13 /// The header at the start of every 32-bit ELF file.
14 #[derive(Debug, Clone, Copy)]
15 #[repr(C)]
16 pub struct FileHeader32<E: Endian> {
17     /// Magic number and other information.
18     pub e_ident: Ident,
19     /// Object file type. One of the `ET_*` constants.
20     pub e_type: U16<E>,
21     /// Architecture. One of the `EM_*` constants.
22     pub e_machine: U16<E>,
23     /// Object file version. Must be `EV_CURRENT`.
24     pub e_version: U32<E>,
25     /// Entry point virtual address.
26     pub e_entry: U32<E>,
27     /// Program header table file offset.
28     pub e_phoff: U32<E>,
29     /// Section header table file offset.
30     pub e_shoff: U32<E>,
31     /// Processor-specific flags.
32     ///
33     /// A combination of the `EF_*` constants.
34     pub e_flags: U32<E>,
35     /// Size in bytes of this header.
36     pub e_ehsize: U16<E>,
37     /// Program header table entry size.
38     pub e_phentsize: U16<E>,
39     /// Program header table entry count.
40     ///
41     /// If the count is greater than or equal to `PN_XNUM` then this field is set to
42     /// `PN_XNUM` and the count is stored in the `sh_info` field of section 0.
43     pub e_phnum: U16<E>,
44     /// Section header table entry size.
45     pub e_shentsize: U16<E>,
46     /// Section header table entry count.
47     ///
48     /// If the count is greater than or equal to `SHN_LORESERVE` then this field is set to
49     /// `0` and the count is stored in the `sh_size` field of section 0.
50     /// first section header.
51     pub e_shnum: U16<E>,
52     /// Section header string table index.
53     ///
54     /// If the index is greater than or equal to `SHN_LORESERVE` then this field is set to
55     /// `SHN_XINDEX` and the index is stored in the `sh_link` field of section 0.
56     pub e_shstrndx: U16<E>,
57 }
58 
59 /// The header at the start of every 64-bit ELF file.
60 #[derive(Debug, Clone, Copy)]
61 #[repr(C)]
62 pub struct FileHeader64<E: Endian> {
63     /// Magic number and other information.
64     pub e_ident: Ident,
65     /// Object file type. One of the `ET_*` constants.
66     pub e_type: U16<E>,
67     /// Architecture. One of the `EM_*` constants.
68     pub e_machine: U16<E>,
69     /// Object file version. Must be `EV_CURRENT`.
70     pub e_version: U32<E>,
71     /// Entry point virtual address.
72     pub e_entry: U64<E>,
73     /// Program header table file offset.
74     pub e_phoff: U64<E>,
75     /// Section header table file offset.
76     pub e_shoff: U64<E>,
77     /// Processor-specific flags.
78     ///
79     /// A combination of the `EF_*` constants.
80     pub e_flags: U32<E>,
81     /// Size in bytes of this header.
82     pub e_ehsize: U16<E>,
83     /// Program header table entry size.
84     pub e_phentsize: U16<E>,
85     /// Program header table entry count.
86     ///
87     /// If the count is greater than or equal to `PN_XNUM` then this field is set to
88     /// `PN_XNUM` and the count is stored in the `sh_info` field of section 0.
89     pub e_phnum: U16<E>,
90     /// Section header table entry size.
91     pub e_shentsize: U16<E>,
92     /// Section header table entry count.
93     ///
94     /// If the count is greater than or equal to `SHN_LORESERVE` then this field is set to
95     /// `0` and the count is stored in the `sh_size` field of section 0.
96     /// first section header.
97     pub e_shnum: U16<E>,
98     /// Section header string table index.
99     ///
100     /// If the index is greater than or equal to `SHN_LORESERVE` then this field is set to
101     /// `SHN_XINDEX` and the index is stored in the `sh_link` field of section 0.
102     pub e_shstrndx: U16<E>,
103 }
104 
105 /// Magic number and other information.
106 ///
107 /// Contained in the file header.
108 #[derive(Debug, Clone, Copy)]
109 #[repr(C)]
110 pub struct Ident {
111     /// Magic number. Must be `ELFMAG`.
112     pub magic: [u8; 4],
113     /// File class. One of the `ELFCLASS*` constants.
114     pub class: u8,
115     /// Data encoding. One of the `ELFDATA*` constants.
116     pub data: u8,
117     /// ELF version. Must be `EV_CURRENT`.
118     pub version: u8,
119     /// OS ABI identification. One of the `ELFOSABI*` constants.
120     pub os_abi: u8,
121     /// ABI version.
122     ///
123     /// The meaning of this field depends on the `os_abi` value.
124     pub abi_version: u8,
125     /// Padding bytes.
126     pub padding: [u8; 7],
127 }
128 
129 /// File identification bytes stored in `Ident::magic`.
130 pub const ELFMAG: [u8; 4] = [0x7f, b'E', b'L', b'F'];
131 
132 // Values for `Ident::class`.
133 /// Invalid class.
134 pub const ELFCLASSNONE: u8 = 0;
135 /// 32-bit object.
136 pub const ELFCLASS32: u8 = 1;
137 /// 64-bit object.
138 pub const ELFCLASS64: u8 = 2;
139 
140 // Values for `Ident::data`.
141 /// Invalid data encoding.
142 pub const ELFDATANONE: u8 = 0;
143 /// 2's complement, little endian.
144 pub const ELFDATA2LSB: u8 = 1;
145 /// 2's complement, big endian.
146 pub const ELFDATA2MSB: u8 = 2;
147 
148 // Values for `Ident::os_abi`.
149 /// UNIX System V ABI.
150 pub const ELFOSABI_NONE: u8 = 0;
151 /// UNIX System V ABI.
152 ///
153 /// Alias.
154 pub const ELFOSABI_SYSV: u8 = 0;
155 /// HP-UX.
156 pub const ELFOSABI_HPUX: u8 = 1;
157 /// NetBSD.
158 pub const ELFOSABI_NETBSD: u8 = 2;
159 /// Object uses GNU ELF extensions.
160 pub const ELFOSABI_GNU: u8 = 3;
161 /// Object uses GNU ELF extensions.
162 ///
163 /// Compatibility alias.
164 pub const ELFOSABI_LINUX: u8 = ELFOSABI_GNU;
165 /// Sun Solaris.
166 pub const ELFOSABI_SOLARIS: u8 = 6;
167 /// IBM AIX.
168 pub const ELFOSABI_AIX: u8 = 7;
169 /// SGI Irix.
170 pub const ELFOSABI_IRIX: u8 = 8;
171 /// FreeBSD.
172 pub const ELFOSABI_FREEBSD: u8 = 9;
173 /// Compaq TRU64 UNIX.
174 pub const ELFOSABI_TRU64: u8 = 10;
175 /// Novell Modesto.
176 pub const ELFOSABI_MODESTO: u8 = 11;
177 /// OpenBSD.
178 pub const ELFOSABI_OPENBSD: u8 = 12;
179 /// ARM EABI.
180 pub const ELFOSABI_ARM_AEABI: u8 = 64;
181 /// ARM.
182 pub const ELFOSABI_ARM: u8 = 97;
183 /// Standalone (embedded) application.
184 pub const ELFOSABI_STANDALONE: u8 = 255;
185 
186 // Values for `FileHeader*::e_type`.
187 /// No file type.
188 pub const ET_NONE: u16 = 0;
189 /// Relocatable file.
190 pub const ET_REL: u16 = 1;
191 /// Executable file.
192 pub const ET_EXEC: u16 = 2;
193 /// Shared object file.
194 pub const ET_DYN: u16 = 3;
195 /// Core file.
196 pub const ET_CORE: u16 = 4;
197 /// OS-specific range start.
198 pub const ET_LOOS: u16 = 0xfe00;
199 /// OS-specific range end.
200 pub const ET_HIOS: u16 = 0xfeff;
201 /// Processor-specific range start.
202 pub const ET_LOPROC: u16 = 0xff00;
203 /// Processor-specific range end.
204 pub const ET_HIPROC: u16 = 0xffff;
205 
206 // Values for `FileHeader*::e_machine`.
207 /// No machine
208 pub const EM_NONE: u16 = 0;
209 /// AT&T WE 32100
210 pub const EM_M32: u16 = 1;
211 /// SUN SPARC
212 pub const EM_SPARC: u16 = 2;
213 /// Intel 80386
214 pub const EM_386: u16 = 3;
215 /// Motorola m68k family
216 pub const EM_68K: u16 = 4;
217 /// Motorola m88k family
218 pub const EM_88K: u16 = 5;
219 /// Intel MCU
220 pub const EM_IAMCU: u16 = 6;
221 /// Intel 80860
222 pub const EM_860: u16 = 7;
223 /// MIPS R3000 big-endian
224 pub const EM_MIPS: u16 = 8;
225 /// IBM System/370
226 pub const EM_S370: u16 = 9;
227 /// MIPS R3000 little-endian
228 pub const EM_MIPS_RS3_LE: u16 = 10;
229 /// HPPA
230 pub const EM_PARISC: u16 = 15;
231 /// Fujitsu VPP500
232 pub const EM_VPP500: u16 = 17;
233 /// Sun's "v8plus"
234 pub const EM_SPARC32PLUS: u16 = 18;
235 /// Intel 80960
236 pub const EM_960: u16 = 19;
237 /// PowerPC
238 pub const EM_PPC: u16 = 20;
239 /// PowerPC 64-bit
240 pub const EM_PPC64: u16 = 21;
241 /// IBM S390
242 pub const EM_S390: u16 = 22;
243 /// IBM SPU/SPC
244 pub const EM_SPU: u16 = 23;
245 /// NEC V800 series
246 pub const EM_V800: u16 = 36;
247 /// Fujitsu FR20
248 pub const EM_FR20: u16 = 37;
249 /// TRW RH-32
250 pub const EM_RH32: u16 = 38;
251 /// Motorola RCE
252 pub const EM_RCE: u16 = 39;
253 /// ARM
254 pub const EM_ARM: u16 = 40;
255 /// Digital Alpha
256 pub const EM_FAKE_ALPHA: u16 = 41;
257 /// Hitachi SH
258 pub const EM_SH: u16 = 42;
259 /// SPARC v9 64-bit
260 pub const EM_SPARCV9: u16 = 43;
261 /// Siemens Tricore
262 pub const EM_TRICORE: u16 = 44;
263 /// Argonaut RISC Core
264 pub const EM_ARC: u16 = 45;
265 /// Hitachi H8/300
266 pub const EM_H8_300: u16 = 46;
267 /// Hitachi H8/300H
268 pub const EM_H8_300H: u16 = 47;
269 /// Hitachi H8S
270 pub const EM_H8S: u16 = 48;
271 /// Hitachi H8/500
272 pub const EM_H8_500: u16 = 49;
273 /// Intel Merced
274 pub const EM_IA_64: u16 = 50;
275 /// Stanford MIPS-X
276 pub const EM_MIPS_X: u16 = 51;
277 /// Motorola Coldfire
278 pub const EM_COLDFIRE: u16 = 52;
279 /// Motorola M68HC12
280 pub const EM_68HC12: u16 = 53;
281 /// Fujitsu MMA Multimedia Accelerator
282 pub const EM_MMA: u16 = 54;
283 /// Siemens PCP
284 pub const EM_PCP: u16 = 55;
285 /// Sony nCPU embeeded RISC
286 pub const EM_NCPU: u16 = 56;
287 /// Denso NDR1 microprocessor
288 pub const EM_NDR1: u16 = 57;
289 /// Motorola Start*Core processor
290 pub const EM_STARCORE: u16 = 58;
291 /// Toyota ME16 processor
292 pub const EM_ME16: u16 = 59;
293 /// STMicroelectronic ST100 processor
294 pub const EM_ST100: u16 = 60;
295 /// Advanced Logic Corp. Tinyj emb.fam
296 pub const EM_TINYJ: u16 = 61;
297 /// AMD x86-64 architecture
298 pub const EM_X86_64: u16 = 62;
299 /// Sony DSP Processor
300 pub const EM_PDSP: u16 = 63;
301 /// Digital PDP-10
302 pub const EM_PDP10: u16 = 64;
303 /// Digital PDP-11
304 pub const EM_PDP11: u16 = 65;
305 /// Siemens FX66 microcontroller
306 pub const EM_FX66: u16 = 66;
307 /// STMicroelectronics ST9+ 8/16 mc
308 pub const EM_ST9PLUS: u16 = 67;
309 /// STmicroelectronics ST7 8 bit mc
310 pub const EM_ST7: u16 = 68;
311 /// Motorola MC68HC16 microcontroller
312 pub const EM_68HC16: u16 = 69;
313 /// Motorola MC68HC11 microcontroller
314 pub const EM_68HC11: u16 = 70;
315 /// Motorola MC68HC08 microcontroller
316 pub const EM_68HC08: u16 = 71;
317 /// Motorola MC68HC05 microcontroller
318 pub const EM_68HC05: u16 = 72;
319 /// Silicon Graphics SVx
320 pub const EM_SVX: u16 = 73;
321 /// STMicroelectronics ST19 8 bit mc
322 pub const EM_ST19: u16 = 74;
323 /// Digital VAX
324 pub const EM_VAX: u16 = 75;
325 /// Axis Communications 32-bit emb.proc
326 pub const EM_CRIS: u16 = 76;
327 /// Infineon Technologies 32-bit emb.proc
328 pub const EM_JAVELIN: u16 = 77;
329 /// Element 14 64-bit DSP Processor
330 pub const EM_FIREPATH: u16 = 78;
331 /// LSI Logic 16-bit DSP Processor
332 pub const EM_ZSP: u16 = 79;
333 /// Donald Knuth's educational 64-bit proc
334 pub const EM_MMIX: u16 = 80;
335 /// Harvard University machine-independent object files
336 pub const EM_HUANY: u16 = 81;
337 /// SiTera Prism
338 pub const EM_PRISM: u16 = 82;
339 /// Atmel AVR 8-bit microcontroller
340 pub const EM_AVR: u16 = 83;
341 /// Fujitsu FR30
342 pub const EM_FR30: u16 = 84;
343 /// Mitsubishi D10V
344 pub const EM_D10V: u16 = 85;
345 /// Mitsubishi D30V
346 pub const EM_D30V: u16 = 86;
347 /// NEC v850
348 pub const EM_V850: u16 = 87;
349 /// Mitsubishi M32R
350 pub const EM_M32R: u16 = 88;
351 /// Matsushita MN10300
352 pub const EM_MN10300: u16 = 89;
353 /// Matsushita MN10200
354 pub const EM_MN10200: u16 = 90;
355 /// picoJava
356 pub const EM_PJ: u16 = 91;
357 /// OpenRISC 32-bit embedded processor
358 pub const EM_OPENRISC: u16 = 92;
359 /// ARC International ARCompact
360 pub const EM_ARC_COMPACT: u16 = 93;
361 /// Tensilica Xtensa Architecture
362 pub const EM_XTENSA: u16 = 94;
363 /// Alphamosaic VideoCore
364 pub const EM_VIDEOCORE: u16 = 95;
365 /// Thompson Multimedia General Purpose Proc
366 pub const EM_TMM_GPP: u16 = 96;
367 /// National Semi. 32000
368 pub const EM_NS32K: u16 = 97;
369 /// Tenor Network TPC
370 pub const EM_TPC: u16 = 98;
371 /// Trebia SNP 1000
372 pub const EM_SNP1K: u16 = 99;
373 /// STMicroelectronics ST200
374 pub const EM_ST200: u16 = 100;
375 /// Ubicom IP2xxx
376 pub const EM_IP2K: u16 = 101;
377 /// MAX processor
378 pub const EM_MAX: u16 = 102;
379 /// National Semi. CompactRISC
380 pub const EM_CR: u16 = 103;
381 /// Fujitsu F2MC16
382 pub const EM_F2MC16: u16 = 104;
383 /// Texas Instruments msp430
384 pub const EM_MSP430: u16 = 105;
385 /// Analog Devices Blackfin DSP
386 pub const EM_BLACKFIN: u16 = 106;
387 /// Seiko Epson S1C33 family
388 pub const EM_SE_C33: u16 = 107;
389 /// Sharp embedded microprocessor
390 pub const EM_SEP: u16 = 108;
391 /// Arca RISC
392 pub const EM_ARCA: u16 = 109;
393 /// PKU-Unity & MPRC Peking Uni. mc series
394 pub const EM_UNICORE: u16 = 110;
395 /// eXcess configurable cpu
396 pub const EM_EXCESS: u16 = 111;
397 /// Icera Semi. Deep Execution Processor
398 pub const EM_DXP: u16 = 112;
399 /// Altera Nios II
400 pub const EM_ALTERA_NIOS2: u16 = 113;
401 /// National Semi. CompactRISC CRX
402 pub const EM_CRX: u16 = 114;
403 /// Motorola XGATE
404 pub const EM_XGATE: u16 = 115;
405 /// Infineon C16x/XC16x
406 pub const EM_C166: u16 = 116;
407 /// Renesas M16C
408 pub const EM_M16C: u16 = 117;
409 /// Microchip Technology dsPIC30F
410 pub const EM_DSPIC30F: u16 = 118;
411 /// Freescale Communication Engine RISC
412 pub const EM_CE: u16 = 119;
413 /// Renesas M32C
414 pub const EM_M32C: u16 = 120;
415 /// Altium TSK3000
416 pub const EM_TSK3000: u16 = 131;
417 /// Freescale RS08
418 pub const EM_RS08: u16 = 132;
419 /// Analog Devices SHARC family
420 pub const EM_SHARC: u16 = 133;
421 /// Cyan Technology eCOG2
422 pub const EM_ECOG2: u16 = 134;
423 /// Sunplus S+core7 RISC
424 pub const EM_SCORE7: u16 = 135;
425 /// New Japan Radio (NJR) 24-bit DSP
426 pub const EM_DSP24: u16 = 136;
427 /// Broadcom VideoCore III
428 pub const EM_VIDEOCORE3: u16 = 137;
429 /// RISC for Lattice FPGA
430 pub const EM_LATTICEMICO32: u16 = 138;
431 /// Seiko Epson C17
432 pub const EM_SE_C17: u16 = 139;
433 /// Texas Instruments TMS320C6000 DSP
434 pub const EM_TI_C6000: u16 = 140;
435 /// Texas Instruments TMS320C2000 DSP
436 pub const EM_TI_C2000: u16 = 141;
437 /// Texas Instruments TMS320C55x DSP
438 pub const EM_TI_C5500: u16 = 142;
439 /// Texas Instruments App. Specific RISC
440 pub const EM_TI_ARP32: u16 = 143;
441 /// Texas Instruments Prog. Realtime Unit
442 pub const EM_TI_PRU: u16 = 144;
443 /// STMicroelectronics 64bit VLIW DSP
444 pub const EM_MMDSP_PLUS: u16 = 160;
445 /// Cypress M8C
446 pub const EM_CYPRESS_M8C: u16 = 161;
447 /// Renesas R32C
448 pub const EM_R32C: u16 = 162;
449 /// NXP Semi. TriMedia
450 pub const EM_TRIMEDIA: u16 = 163;
451 /// QUALCOMM Hexagon
452 pub const EM_HEXAGON: u16 = 164;
453 /// Intel 8051 and variants
454 pub const EM_8051: u16 = 165;
455 /// STMicroelectronics STxP7x
456 pub const EM_STXP7X: u16 = 166;
457 /// Andes Tech. compact code emb. RISC
458 pub const EM_NDS32: u16 = 167;
459 /// Cyan Technology eCOG1X
460 pub const EM_ECOG1X: u16 = 168;
461 /// Dallas Semi. MAXQ30 mc
462 pub const EM_MAXQ30: u16 = 169;
463 /// New Japan Radio (NJR) 16-bit DSP
464 pub const EM_XIMO16: u16 = 170;
465 /// M2000 Reconfigurable RISC
466 pub const EM_MANIK: u16 = 171;
467 /// Cray NV2 vector architecture
468 pub const EM_CRAYNV2: u16 = 172;
469 /// Renesas RX
470 pub const EM_RX: u16 = 173;
471 /// Imagination Tech. META
472 pub const EM_METAG: u16 = 174;
473 /// MCST Elbrus
474 pub const EM_MCST_ELBRUS: u16 = 175;
475 /// Cyan Technology eCOG16
476 pub const EM_ECOG16: u16 = 176;
477 /// National Semi. CompactRISC CR16
478 pub const EM_CR16: u16 = 177;
479 /// Freescale Extended Time Processing Unit
480 pub const EM_ETPU: u16 = 178;
481 /// Infineon Tech. SLE9X
482 pub const EM_SLE9X: u16 = 179;
483 /// Intel L10M
484 pub const EM_L10M: u16 = 180;
485 /// Intel K10M
486 pub const EM_K10M: u16 = 181;
487 /// ARM AARCH64
488 pub const EM_AARCH64: u16 = 183;
489 /// Amtel 32-bit microprocessor
490 pub const EM_AVR32: u16 = 185;
491 /// STMicroelectronics STM8
492 pub const EM_STM8: u16 = 186;
493 /// Tileta TILE64
494 pub const EM_TILE64: u16 = 187;
495 /// Tilera TILEPro
496 pub const EM_TILEPRO: u16 = 188;
497 /// Xilinx MicroBlaze
498 pub const EM_MICROBLAZE: u16 = 189;
499 /// NVIDIA CUDA
500 pub const EM_CUDA: u16 = 190;
501 /// Tilera TILE-Gx
502 pub const EM_TILEGX: u16 = 191;
503 /// CloudShield
504 pub const EM_CLOUDSHIELD: u16 = 192;
505 /// KIPO-KAIST Core-A 1st gen.
506 pub const EM_COREA_1ST: u16 = 193;
507 /// KIPO-KAIST Core-A 2nd gen.
508 pub const EM_COREA_2ND: u16 = 194;
509 /// Synopsys ARCompact V2
510 pub const EM_ARC_COMPACT2: u16 = 195;
511 /// Open8 RISC
512 pub const EM_OPEN8: u16 = 196;
513 /// Renesas RL78
514 pub const EM_RL78: u16 = 197;
515 /// Broadcom VideoCore V
516 pub const EM_VIDEOCORE5: u16 = 198;
517 /// Renesas 78KOR
518 pub const EM_78KOR: u16 = 199;
519 /// Freescale 56800EX DSC
520 pub const EM_56800EX: u16 = 200;
521 /// Beyond BA1
522 pub const EM_BA1: u16 = 201;
523 /// Beyond BA2
524 pub const EM_BA2: u16 = 202;
525 /// XMOS xCORE
526 pub const EM_XCORE: u16 = 203;
527 /// Microchip 8-bit PIC(r)
528 pub const EM_MCHP_PIC: u16 = 204;
529 /// KM211 KM32
530 pub const EM_KM32: u16 = 210;
531 /// KM211 KMX32
532 pub const EM_KMX32: u16 = 211;
533 /// KM211 KMX16
534 pub const EM_EMX16: u16 = 212;
535 /// KM211 KMX8
536 pub const EM_EMX8: u16 = 213;
537 /// KM211 KVARC
538 pub const EM_KVARC: u16 = 214;
539 /// Paneve CDP
540 pub const EM_CDP: u16 = 215;
541 /// Cognitive Smart Memory Processor
542 pub const EM_COGE: u16 = 216;
543 /// Bluechip CoolEngine
544 pub const EM_COOL: u16 = 217;
545 /// Nanoradio Optimized RISC
546 pub const EM_NORC: u16 = 218;
547 /// CSR Kalimba
548 pub const EM_CSR_KALIMBA: u16 = 219;
549 /// Zilog Z80
550 pub const EM_Z80: u16 = 220;
551 /// Controls and Data Services VISIUMcore
552 pub const EM_VISIUM: u16 = 221;
553 /// FTDI Chip FT32
554 pub const EM_FT32: u16 = 222;
555 /// Moxie processor
556 pub const EM_MOXIE: u16 = 223;
557 /// AMD GPU
558 pub const EM_AMDGPU: u16 = 224;
559 /// RISC-V
560 pub const EM_RISCV: u16 = 243;
561 /// Linux BPF -- in-kernel virtual machine
562 pub const EM_BPF: u16 = 247;
563 /// C-SKY
564 pub const EM_CSKY: u16 = 252;
565 /// Digital Alpha
566 pub const EM_ALPHA: u16 = 0x9026;
567 
568 // Values for `FileHeader*::e_version` and `Ident::version`.
569 /// Invalid ELF version.
570 pub const EV_NONE: u8 = 0;
571 /// Current ELF version.
572 pub const EV_CURRENT: u8 = 1;
573 
574 /// Section header.
575 #[derive(Debug, Clone, Copy)]
576 #[repr(C)]
577 pub struct SectionHeader32<E: Endian> {
578     /// Section name.
579     ///
580     /// This is an offset into the section header string table.
581     pub sh_name: U32<E>,
582     /// Section type. One of the `SHT_*` constants.
583     pub sh_type: U32<E>,
584     /// Section flags. A combination of the `SHF_*` constants.
585     pub sh_flags: U32<E>,
586     /// Section virtual address at execution.
587     pub sh_addr: U32<E>,
588     /// Section file offset.
589     pub sh_offset: U32<E>,
590     /// Section size in bytes.
591     pub sh_size: U32<E>,
592     /// Link to another section.
593     ///
594     /// The section relationship depends on the `sh_type` value.
595     pub sh_link: U32<E>,
596     /// Additional section information.
597     ///
598     /// The meaning of this field depends on the `sh_type` value.
599     pub sh_info: U32<E>,
600     /// Section alignment.
601     pub sh_addralign: U32<E>,
602     /// Entry size if the section holds a table.
603     pub sh_entsize: U32<E>,
604 }
605 
606 /// Section header.
607 #[derive(Debug, Clone, Copy)]
608 #[repr(C)]
609 pub struct SectionHeader64<E: Endian> {
610     /// Section name.
611     ///
612     /// This is an offset into the section header string table.
613     pub sh_name: U32<E>,
614     /// Section type. One of the `SHT_*` constants.
615     pub sh_type: U32<E>,
616     /// Section flags. A combination of the `SHF_*` constants.
617     pub sh_flags: U64<E>,
618     /// Section virtual address at execution.
619     pub sh_addr: U64<E>,
620     /// Section file offset.
621     pub sh_offset: U64<E>,
622     /// Section size in bytes.
623     pub sh_size: U64<E>,
624     /// Link to another section.
625     ///
626     /// The section relationship depends on the `sh_type` value.
627     pub sh_link: U32<E>,
628     /// Additional section information.
629     ///
630     /// The meaning of this field depends on the `sh_type` value.
631     pub sh_info: U32<E>,
632     /// Section alignment.
633     pub sh_addralign: U64<E>,
634     /// Entry size if the section holds a table.
635     pub sh_entsize: U64<E>,
636 }
637 
638 // Special values for section indices.
639 /// Undefined section.
640 pub const SHN_UNDEF: u16 = 0;
641 /// OS-specific range start.
642 /// Start of reserved section indices.
643 pub const SHN_LORESERVE: u16 = 0xff00;
644 /// Start of processor-specific section indices.
645 pub const SHN_LOPROC: u16 = 0xff00;
646 /// End of processor-specific section indices.
647 pub const SHN_HIPROC: u16 = 0xff1f;
648 /// Start of OS-specific section indices.
649 pub const SHN_LOOS: u16 = 0xff20;
650 /// End of OS-specific section indices.
651 pub const SHN_HIOS: u16 = 0xff3f;
652 /// Associated symbol is absolute.
653 pub const SHN_ABS: u16 = 0xfff1;
654 /// Associated symbol is common.
655 pub const SHN_COMMON: u16 = 0xfff2;
656 /// Section index is in the `SHT_SYMTAB_SHNDX` section.
657 pub const SHN_XINDEX: u16 = 0xffff;
658 /// End of reserved section indices.
659 pub const SHN_HIRESERVE: u16 = 0xffff;
660 
661 // Values for `SectionHeader*::sh_type`.
662 /// Section header table entry is unused.
663 pub const SHT_NULL: u32 = 0;
664 /// Program data.
665 pub const SHT_PROGBITS: u32 = 1;
666 /// Symbol table.
667 pub const SHT_SYMTAB: u32 = 2;
668 /// String table.
669 pub const SHT_STRTAB: u32 = 3;
670 /// Relocation entries with explicit addends.
671 pub const SHT_RELA: u32 = 4;
672 /// Symbol hash table.
673 pub const SHT_HASH: u32 = 5;
674 /// Dynamic linking information.
675 pub const SHT_DYNAMIC: u32 = 6;
676 /// Notes.
677 pub const SHT_NOTE: u32 = 7;
678 /// Program space with no data (bss).
679 pub const SHT_NOBITS: u32 = 8;
680 /// Relocation entries without explicit addends.
681 pub const SHT_REL: u32 = 9;
682 /// Reserved section type.
683 pub const SHT_SHLIB: u32 = 10;
684 /// Dynamic linker symbol table.
685 pub const SHT_DYNSYM: u32 = 11;
686 /// Array of constructors.
687 pub const SHT_INIT_ARRAY: u32 = 14;
688 /// Array of destructors.
689 pub const SHT_FINI_ARRAY: u32 = 15;
690 /// Array of pre-constructors.
691 pub const SHT_PREINIT_ARRAY: u32 = 16;
692 /// Section group.
693 pub const SHT_GROUP: u32 = 17;
694 /// Extended section indices for a symbol table.
695 pub const SHT_SYMTAB_SHNDX: u32 = 18;
696 /// Start of OS-specific section types.
697 pub const SHT_LOOS: u32 = 0x6000_0000;
698 /// Object attributes.
699 pub const SHT_GNU_ATTRIBUTES: u32 = 0x6fff_fff5;
700 /// GNU-style hash table.
701 pub const SHT_GNU_HASH: u32 = 0x6fff_fff6;
702 /// Prelink library list
703 pub const SHT_GNU_LIBLIST: u32 = 0x6fff_fff7;
704 /// Checksum for DSO content.
705 pub const SHT_CHECKSUM: u32 = 0x6fff_fff8;
706 /// Sun-specific low bound.
707 pub const SHT_LOSUNW: u32 = 0x6fff_fffa;
708 #[allow(missing_docs, non_upper_case_globals)]
709 pub const SHT_SUNW_move: u32 = 0x6fff_fffa;
710 #[allow(missing_docs)]
711 pub const SHT_SUNW_COMDAT: u32 = 0x6fff_fffb;
712 #[allow(missing_docs, non_upper_case_globals)]
713 pub const SHT_SUNW_syminfo: u32 = 0x6fff_fffc;
714 /// Version definition section.
715 #[allow(non_upper_case_globals)]
716 pub const SHT_GNU_VERDEF: u32 = 0x6fff_fffd;
717 /// Version needs section.
718 #[allow(non_upper_case_globals)]
719 pub const SHT_GNU_VERNEED: u32 = 0x6fff_fffe;
720 /// Version symbol table.
721 #[allow(non_upper_case_globals)]
722 pub const SHT_GNU_VERSYM: u32 = 0x6fff_ffff;
723 /// Sun-specific high bound.
724 pub const SHT_HISUNW: u32 = 0x6fff_ffff;
725 /// End of OS-specific section types.
726 pub const SHT_HIOS: u32 = 0x6fff_ffff;
727 /// Start of processor-specific section types.
728 pub const SHT_LOPROC: u32 = 0x7000_0000;
729 /// End of processor-specific section types.
730 pub const SHT_HIPROC: u32 = 0x7fff_ffff;
731 /// Start of application-specific section types.
732 pub const SHT_LOUSER: u32 = 0x8000_0000;
733 /// End of application-specific section types.
734 pub const SHT_HIUSER: u32 = 0x8fff_ffff;
735 
736 // Values for `SectionHeader*::sh_flags`.
737 /// Section is writable.
738 pub const SHF_WRITE: u32 = 1 << 0;
739 /// Section occupies memory during execution.
740 pub const SHF_ALLOC: u32 = 1 << 1;
741 /// Section is executable.
742 pub const SHF_EXECINSTR: u32 = 1 << 2;
743 /// Section may be be merged to eliminate duplication.
744 pub const SHF_MERGE: u32 = 1 << 4;
745 /// Section contains nul-terminated strings.
746 pub const SHF_STRINGS: u32 = 1 << 5;
747 /// The `sh_info` field contains a section header table index.
748 pub const SHF_INFO_LINK: u32 = 1 << 6;
749 /// Section has special ordering requirements when combining sections.
750 pub const SHF_LINK_ORDER: u32 = 1 << 7;
751 /// Section requires special OS-specific handling.
752 pub const SHF_OS_NONCONFORMING: u32 = 1 << 8;
753 /// Section is a member of a group.
754 pub const SHF_GROUP: u32 = 1 << 9;
755 /// Section holds thread-local storage.
756 pub const SHF_TLS: u32 = 1 << 10;
757 /// Section is compressed.
758 ///
759 /// Compressed sections begin with one of the `CompressionHeader*` headers.
760 pub const SHF_COMPRESSED: u32 = 1 << 11;
761 /// OS-specific section flags.
762 pub const SHF_MASKOS: u32 = 0x0ff0_0000;
763 /// Processor-specific section flags.
764 pub const SHF_MASKPROC: u32 = 0xf000_0000;
765 /// This section is excluded from the final executable or shared library.
766 pub const SHF_EXCLUDE: u32 = 0x8000_0000;
767 
768 /// Section compression header.
769 ///
770 /// Used when `SHF_COMPRESSED` is set.
771 ///
772 /// Note: this type currently allows for misaligned headers, but that may be
773 /// changed in a future version.
774 #[derive(Debug, Default, Clone, Copy)]
775 #[repr(C)]
776 pub struct CompressionHeader32<E: Endian> {
777     /// Compression format. One of the `ELFCOMPRESS_*` values.
778     pub ch_type: U32Bytes<E>,
779     /// Uncompressed data size.
780     pub ch_size: U32Bytes<E>,
781     /// Uncompressed data alignment.
782     pub ch_addralign: U32Bytes<E>,
783 }
784 
785 /// Section compression header.
786 ///
787 /// Used when `SHF_COMPRESSED` is set.
788 ///
789 /// Note: this type currently allows for misaligned headers, but that may be
790 /// changed in a future version.
791 #[derive(Debug, Default, Clone, Copy)]
792 #[repr(C)]
793 pub struct CompressionHeader64<E: Endian> {
794     /// Compression format. One of the `ELFCOMPRESS_*` values.
795     pub ch_type: U32Bytes<E>,
796     /// Reserved.
797     pub ch_reserved: U32Bytes<E>,
798     /// Uncompressed data size.
799     pub ch_size: U64Bytes<E>,
800     /// Uncompressed data alignment.
801     pub ch_addralign: U64Bytes<E>,
802 }
803 
804 /// ZLIB/DEFLATE algorithm.
805 pub const ELFCOMPRESS_ZLIB: u32 = 1;
806 /// Start of OS-specific compression types.
807 pub const ELFCOMPRESS_LOOS: u32 = 0x6000_0000;
808 /// End of OS-specific compression types.
809 pub const ELFCOMPRESS_HIOS: u32 = 0x6fff_ffff;
810 /// Start of processor-specific compression types.
811 pub const ELFCOMPRESS_LOPROC: u32 = 0x7000_0000;
812 /// End of processor-specific compression types.
813 pub const ELFCOMPRESS_HIPROC: u32 = 0x7fff_ffff;
814 
815 // Values for the flag entry for section groups.
816 /// Mark group as COMDAT.
817 pub const GRP_COMDAT: u32 = 1;
818 
819 /// Symbol table entry.
820 #[derive(Debug, Clone, Copy)]
821 #[repr(C)]
822 pub struct Sym32<E: Endian> {
823     /// Symbol name.
824     ///
825     /// This is an offset into the symbol string table.
826     pub st_name: U32<E>,
827     /// Symbol value.
828     pub st_value: U32<E>,
829     /// Symbol size.
830     pub st_size: U32<E>,
831     /// Symbol type and binding.
832     ///
833     /// Use the `st_type` and `st_bind` methods to access this value.
834     pub st_info: u8,
835     /// Symbol visibility.
836     ///
837     /// Use the `st_visibility` method to access this value.
838     pub st_other: u8,
839     /// Section index or one of the `SHN_*` values.
840     pub st_shndx: U16<E>,
841 }
842 
843 impl<E: Endian> Sym32<E> {
844     /// Get the `st_bind` component of the `st_info` field.
845     #[inline]
st_bind(&self) -> u8846     pub fn st_bind(&self) -> u8 {
847         self.st_info >> 4
848     }
849 
850     /// Get the `st_type` component of the `st_info` field.
851     #[inline]
st_type(&self) -> u8852     pub fn st_type(&self) -> u8 {
853         self.st_info & 0xf
854     }
855 
856     /// Set the `st_info` field given the `st_bind` and `st_type` components.
857     #[inline]
set_st_info(&mut self, st_bind: u8, st_type: u8)858     pub fn set_st_info(&mut self, st_bind: u8, st_type: u8) {
859         self.st_info = (st_bind << 4) + (st_type & 0xf);
860     }
861 
862     /// Get the `st_visibility` component of the `st_info` field.
863     #[inline]
st_visibility(&self) -> u8864     pub fn st_visibility(&self) -> u8 {
865         self.st_other & 0x3
866     }
867 }
868 
869 /// Symbol table entry.
870 #[derive(Debug, Clone, Copy)]
871 #[repr(C)]
872 pub struct Sym64<E: Endian> {
873     /// Symbol name.
874     ///
875     /// This is an offset into the symbol string table.
876     pub st_name: U32<E>,
877     /// Symbol type and binding.
878     ///
879     /// Use the `st_bind` and `st_type` methods to access this value.
880     pub st_info: u8,
881     /// Symbol visibility.
882     ///
883     /// Use the `st_visibility` method to access this value.
884     pub st_other: u8,
885     /// Section index or one of the `SHN_*` values.
886     pub st_shndx: U16<E>,
887     /// Symbol value.
888     pub st_value: U64<E>,
889     /// Symbol size.
890     pub st_size: U64<E>,
891 }
892 
893 impl<E: Endian> Sym64<E> {
894     /// Get the `st_bind` component of the `st_info` field.
895     #[inline]
st_bind(&self) -> u8896     pub fn st_bind(&self) -> u8 {
897         self.st_info >> 4
898     }
899 
900     /// Get the `st_type` component of the `st_info` field.
901     #[inline]
st_type(&self) -> u8902     pub fn st_type(&self) -> u8 {
903         self.st_info & 0xf
904     }
905 
906     /// Set the `st_info` field given the `st_bind` and `st_type` components.
907     #[inline]
set_st_info(&mut self, st_bind: u8, st_type: u8)908     pub fn set_st_info(&mut self, st_bind: u8, st_type: u8) {
909         self.st_info = (st_bind << 4) + (st_type & 0xf);
910     }
911 
912     /// Get the `st_visibility` component of the `st_info` field.
913     #[inline]
st_visibility(&self) -> u8914     pub fn st_visibility(&self) -> u8 {
915         self.st_other & 0x3
916     }
917 }
918 
919 /// Additional information about a `Sym32`.
920 #[derive(Debug, Clone, Copy)]
921 #[repr(C)]
922 pub struct Syminfo32<E: Endian> {
923     /// Direct bindings, symbol bound to.
924     pub si_boundto: U16<E>,
925     /// Per symbol flags.
926     pub si_flags: U16<E>,
927 }
928 
929 /// Additional information about a `Sym64`.
930 #[derive(Debug, Clone, Copy)]
931 #[repr(C)]
932 pub struct Syminfo64<E: Endian> {
933     /// Direct bindings, symbol bound to.
934     pub si_boundto: U16<E>,
935     /// Per symbol flags.
936     pub si_flags: U16<E>,
937 }
938 
939 // Values for `Syminfo*::si_boundto`.
940 /// Symbol bound to self
941 pub const SYMINFO_BT_SELF: u16 = 0xffff;
942 /// Symbol bound to parent
943 pub const SYMINFO_BT_PARENT: u16 = 0xfffe;
944 /// Beginning of reserved entries
945 pub const SYMINFO_BT_LOWRESERVE: u16 = 0xff00;
946 
947 // Values for `Syminfo*::si_flags`.
948 /// Direct bound symbol
949 pub const SYMINFO_FLG_DIRECT: u16 = 0x0001;
950 /// Pass-thru symbol for translator
951 pub const SYMINFO_FLG_PASSTHRU: u16 = 0x0002;
952 /// Symbol is a copy-reloc
953 pub const SYMINFO_FLG_COPY: u16 = 0x0004;
954 /// Symbol bound to object to be lazy loaded
955 pub const SYMINFO_FLG_LAZYLOAD: u16 = 0x0008;
956 
957 // Syminfo version values.
958 #[allow(missing_docs)]
959 pub const SYMINFO_NONE: u16 = 0;
960 #[allow(missing_docs)]
961 pub const SYMINFO_CURRENT: u16 = 1;
962 #[allow(missing_docs)]
963 pub const SYMINFO_NUM: u16 = 2;
964 
965 // Values for bind component of `Sym*::st_info`.
966 /// Local symbol.
967 pub const STB_LOCAL: u8 = 0;
968 /// Global symbol.
969 pub const STB_GLOBAL: u8 = 1;
970 /// Weak symbol.
971 pub const STB_WEAK: u8 = 2;
972 /// Start of OS-specific symbol binding.
973 pub const STB_LOOS: u8 = 10;
974 /// Unique symbol.
975 pub const STB_GNU_UNIQUE: u8 = 10;
976 /// End of OS-specific symbol binding.
977 pub const STB_HIOS: u8 = 12;
978 /// Start of processor-specific symbol binding.
979 pub const STB_LOPROC: u8 = 13;
980 /// End of processor-specific symbol binding.
981 pub const STB_HIPROC: u8 = 15;
982 
983 // Values for type component of `Sym*::st_info`.
984 /// Symbol type is unspecified.
985 pub const STT_NOTYPE: u8 = 0;
986 /// Symbol is a data object.
987 pub const STT_OBJECT: u8 = 1;
988 /// Symbol is a code object.
989 pub const STT_FUNC: u8 = 2;
990 /// Symbol is associated with a section.
991 pub const STT_SECTION: u8 = 3;
992 /// Symbol's name is a file name.
993 pub const STT_FILE: u8 = 4;
994 /// Symbol is a common data object.
995 pub const STT_COMMON: u8 = 5;
996 /// Symbol is a thread-local storage object.
997 pub const STT_TLS: u8 = 6;
998 /// Start of OS-specific symbol types.
999 pub const STT_LOOS: u8 = 10;
1000 /// Symbol is an indirect code object.
1001 pub const STT_GNU_IFUNC: u8 = 10;
1002 /// End of OS-specific symbol types.
1003 pub const STT_HIOS: u8 = 12;
1004 /// Start of processor-specific symbol types.
1005 pub const STT_LOPROC: u8 = 13;
1006 /// End of processor-specific symbol types.
1007 pub const STT_HIPROC: u8 = 15;
1008 
1009 // Values for visibility component of `Symbol*::st_other`.
1010 /// Default symbol visibility rules.
1011 pub const STV_DEFAULT: u8 = 0;
1012 /// Processor specific hidden class.
1013 pub const STV_INTERNAL: u8 = 1;
1014 /// Symbol is not visible to other components.
1015 pub const STV_HIDDEN: u8 = 2;
1016 /// Symbol is visible to other components, but is not preemptible.
1017 pub const STV_PROTECTED: u8 = 3;
1018 
1019 /// Relocation table entry without explicit addend.
1020 #[derive(Debug, Clone, Copy)]
1021 #[repr(C)]
1022 pub struct Rel32<E: Endian> {
1023     /// Relocation address.
1024     pub r_offset: U32<E>,
1025     /// Relocation type and symbol index.
1026     pub r_info: U32<E>,
1027 }
1028 
1029 impl<E: Endian> Rel32<E> {
1030     /// Get the `r_sym` component of the `r_info` field.
1031     #[inline]
r_sym(&self, endian: E) -> u321032     pub fn r_sym(&self, endian: E) -> u32 {
1033         self.r_info.get(endian) >> 8
1034     }
1035 
1036     /// Get the `r_type` component of the `r_info` field.
1037     #[inline]
r_type(&self, endian: E) -> u321038     pub fn r_type(&self, endian: E) -> u32 {
1039         self.r_info.get(endian) & 0xff
1040     }
1041 
1042     /// Calculate the `r_info` field given the `r_sym` and `r_type` components.
r_info(endian: E, r_sym: u32, r_type: u8) -> U32<E>1043     pub fn r_info(endian: E, r_sym: u32, r_type: u8) -> U32<E> {
1044         U32::new(endian, (r_sym << 8) | u32::from(r_type))
1045     }
1046 
1047     /// Set the `r_info` field given the `r_sym` and `r_type` components.
set_r_info(&mut self, endian: E, r_sym: u32, r_type: u8)1048     pub fn set_r_info(&mut self, endian: E, r_sym: u32, r_type: u8) {
1049         self.r_info = Self::r_info(endian, r_sym, r_type)
1050     }
1051 }
1052 
1053 /// Relocation table entry with explicit addend.
1054 #[derive(Debug, Clone, Copy)]
1055 #[repr(C)]
1056 pub struct Rela32<E: Endian> {
1057     /// Relocation address.
1058     pub r_offset: U32<E>,
1059     /// Relocation type and symbol index.
1060     pub r_info: U32<E>,
1061     /// Explicit addend.
1062     pub r_addend: I32<E>,
1063 }
1064 
1065 impl<E: Endian> Rela32<E> {
1066     /// Get the `r_sym` component of the `r_info` field.
1067     #[inline]
r_sym(&self, endian: E) -> u321068     pub fn r_sym(&self, endian: E) -> u32 {
1069         self.r_info.get(endian) >> 8
1070     }
1071 
1072     /// Get the `r_type` component of the `r_info` field.
1073     #[inline]
r_type(&self, endian: E) -> u321074     pub fn r_type(&self, endian: E) -> u32 {
1075         self.r_info.get(endian) & 0xff
1076     }
1077 
1078     /// Calculate the `r_info` field given the `r_sym` and `r_type` components.
r_info(endian: E, r_sym: u32, r_type: u8) -> U32<E>1079     pub fn r_info(endian: E, r_sym: u32, r_type: u8) -> U32<E> {
1080         U32::new(endian, (r_sym << 8) | u32::from(r_type))
1081     }
1082 
1083     /// Set the `r_info` field given the `r_sym` and `r_type` components.
set_r_info(&mut self, endian: E, r_sym: u32, r_type: u8)1084     pub fn set_r_info(&mut self, endian: E, r_sym: u32, r_type: u8) {
1085         self.r_info = Self::r_info(endian, r_sym, r_type)
1086     }
1087 }
1088 
1089 impl<E: Endian> From<Rel32<E>> for Rela32<E> {
from(rel: Rel32<E>) -> Self1090     fn from(rel: Rel32<E>) -> Self {
1091         Rela32 {
1092             r_offset: rel.r_offset,
1093             r_info: rel.r_info,
1094             r_addend: I32::default(),
1095         }
1096     }
1097 }
1098 
1099 /// Relocation table entry without explicit addend.
1100 #[derive(Debug, Clone, Copy)]
1101 #[repr(C)]
1102 pub struct Rel64<E: Endian> {
1103     /// Relocation address.
1104     pub r_offset: U64<E>,
1105     /// Relocation type and symbol index.
1106     pub r_info: U64<E>,
1107 }
1108 
1109 impl<E: Endian> Rel64<E> {
1110     /// Get the `r_sym` component of the `r_info` field.
1111     #[inline]
r_sym(&self, endian: E) -> u321112     pub fn r_sym(&self, endian: E) -> u32 {
1113         (self.r_info.get(endian) >> 32) as u32
1114     }
1115 
1116     /// Get the `r_type` component of the `r_info` field.
1117     #[inline]
r_type(&self, endian: E) -> u321118     pub fn r_type(&self, endian: E) -> u32 {
1119         (self.r_info.get(endian) & 0xffff_ffff) as u32
1120     }
1121 
1122     /// Calculate the `r_info` field given the `r_sym` and `r_type` components.
r_info(endian: E, r_sym: u32, r_type: u32) -> U64<E>1123     pub fn r_info(endian: E, r_sym: u32, r_type: u32) -> U64<E> {
1124         U64::new(endian, (u64::from(r_sym) << 32) | u64::from(r_type))
1125     }
1126 
1127     /// Set the `r_info` field given the `r_sym` and `r_type` components.
set_r_info(&mut self, endian: E, r_sym: u32, r_type: u32)1128     pub fn set_r_info(&mut self, endian: E, r_sym: u32, r_type: u32) {
1129         self.r_info = Self::r_info(endian, r_sym, r_type)
1130     }
1131 }
1132 
1133 impl<E: Endian> From<Rel64<E>> for Rela64<E> {
from(rel: Rel64<E>) -> Self1134     fn from(rel: Rel64<E>) -> Self {
1135         Rela64 {
1136             r_offset: rel.r_offset,
1137             r_info: rel.r_info,
1138             r_addend: I64::default(),
1139         }
1140     }
1141 }
1142 
1143 /// Relocation table entry with explicit addend.
1144 #[derive(Debug, Clone, Copy)]
1145 #[repr(C)]
1146 pub struct Rela64<E: Endian> {
1147     /// Relocation address.
1148     pub r_offset: U64<E>,
1149     /// Relocation type and symbol index.
1150     pub r_info: U64<E>,
1151     /// Explicit addend.
1152     pub r_addend: I64<E>,
1153 }
1154 
1155 impl<E: Endian> Rela64<E> {
get_r_info(&self, endian: E, is_mips64el: bool) -> u641156     pub(crate) fn get_r_info(&self, endian: E, is_mips64el: bool) -> u64 {
1157         let mut t = self.r_info.get(endian);
1158         if is_mips64el {
1159             t = (t << 32)
1160                 | ((t >> 8) & 0xff000000)
1161                 | ((t >> 24) & 0x00ff0000)
1162                 | ((t >> 40) & 0x0000ff00)
1163                 | ((t >> 56) & 0x000000ff);
1164         }
1165         t
1166     }
1167 
1168     /// Get the `r_sym` component of the `r_info` field.
1169     #[inline]
r_sym(&self, endian: E, is_mips64el: bool) -> u321170     pub fn r_sym(&self, endian: E, is_mips64el: bool) -> u32 {
1171         (self.get_r_info(endian, is_mips64el) >> 32) as u32
1172     }
1173 
1174     /// Get the `r_type` component of the `r_info` field.
1175     #[inline]
r_type(&self, endian: E, is_mips64el: bool) -> u321176     pub fn r_type(&self, endian: E, is_mips64el: bool) -> u32 {
1177         (self.get_r_info(endian, is_mips64el) & 0xffff_ffff) as u32
1178     }
1179 
1180     /// Calculate the `r_info` field given the `r_sym` and `r_type` components.
r_info(endian: E, is_mips64el: bool, r_sym: u32, r_type: u32) -> U64<E>1181     pub fn r_info(endian: E, is_mips64el: bool, r_sym: u32, r_type: u32) -> U64<E> {
1182         let mut t = (u64::from(r_sym) << 32) | u64::from(r_type);
1183         if is_mips64el {
1184             t = (t >> 32)
1185                 | ((t & 0xff000000) << 8)
1186                 | ((t & 0x00ff0000) << 24)
1187                 | ((t & 0x0000ff00) << 40)
1188                 | ((t & 0x000000ff) << 56);
1189         }
1190         U64::new(endian, t)
1191     }
1192 
1193     /// Set the `r_info` field given the `r_sym` and `r_type` components.
set_r_info(&mut self, endian: E, is_mips64el: bool, r_sym: u32, r_type: u32)1194     pub fn set_r_info(&mut self, endian: E, is_mips64el: bool, r_sym: u32, r_type: u32) {
1195         self.r_info = Self::r_info(endian, is_mips64el, r_sym, r_type);
1196     }
1197 }
1198 
1199 /// Program segment header.
1200 #[derive(Debug, Clone, Copy)]
1201 #[repr(C)]
1202 pub struct ProgramHeader32<E: Endian> {
1203     /// Segment type. One of the `PT_*` constants.
1204     pub p_type: U32<E>,
1205     /// Segment file offset.
1206     pub p_offset: U32<E>,
1207     /// Segment virtual address.
1208     pub p_vaddr: U32<E>,
1209     /// Segment physical address.
1210     pub p_paddr: U32<E>,
1211     /// Segment size in the file.
1212     pub p_filesz: U32<E>,
1213     /// Segment size in memory.
1214     pub p_memsz: U32<E>,
1215     /// Segment flags. A combination of the `PF_*` constants.
1216     pub p_flags: U32<E>,
1217     /// Segment alignment.
1218     pub p_align: U32<E>,
1219 }
1220 
1221 /// Program segment header.
1222 #[derive(Debug, Clone, Copy)]
1223 #[repr(C)]
1224 pub struct ProgramHeader64<E: Endian> {
1225     /// Segment type. One of the `PT_*` constants.
1226     pub p_type: U32<E>,
1227     /// Segment flags. A combination of the `PF_*` constants.
1228     pub p_flags: U32<E>,
1229     /// Segment file offset.
1230     pub p_offset: U64<E>,
1231     /// Segment virtual address.
1232     pub p_vaddr: U64<E>,
1233     /// Segment physical address.
1234     pub p_paddr: U64<E>,
1235     /// Segment size in the file.
1236     pub p_filesz: U64<E>,
1237     /// Segment size in memory.
1238     pub p_memsz: U64<E>,
1239     /// Segment alignment.
1240     pub p_align: U64<E>,
1241 }
1242 
1243 /// Special value for `FileHeader*::e_phnum`.
1244 ///
1245 /// This indicates that the real number of program headers is too large to fit into e_phnum.
1246 /// Instead the real value is in the field `sh_info` of section 0.
1247 pub const PN_XNUM: u16 = 0xffff;
1248 
1249 // Values for `ProgramHeader*::p_type`.
1250 /// Program header table entry is unused.
1251 pub const PT_NULL: u32 = 0;
1252 /// Loadable program segment.
1253 pub const PT_LOAD: u32 = 1;
1254 /// Dynamic linking information.
1255 pub const PT_DYNAMIC: u32 = 2;
1256 /// Program interpreter.
1257 pub const PT_INTERP: u32 = 3;
1258 /// Auxiliary information.
1259 pub const PT_NOTE: u32 = 4;
1260 /// Reserved.
1261 pub const PT_SHLIB: u32 = 5;
1262 /// Segment contains the program header table.
1263 pub const PT_PHDR: u32 = 6;
1264 /// Thread-local storage segment.
1265 pub const PT_TLS: u32 = 7;
1266 /// Start of OS-specific segment types.
1267 pub const PT_LOOS: u32 = 0x6000_0000;
1268 /// GCC `.eh_frame_hdr` segment.
1269 pub const PT_GNU_EH_FRAME: u32 = 0x6474_e550;
1270 /// Indicates stack executability.
1271 pub const PT_GNU_STACK: u32 = 0x6474_e551;
1272 /// Read-only after relocation.
1273 pub const PT_GNU_RELRO: u32 = 0x6474_e552;
1274 /// End of OS-specific segment types.
1275 pub const PT_HIOS: u32 = 0x6fff_ffff;
1276 /// Start of processor-specific segment types.
1277 pub const PT_LOPROC: u32 = 0x7000_0000;
1278 /// End of processor-specific segment types.
1279 pub const PT_HIPROC: u32 = 0x7fff_ffff;
1280 
1281 // Values for `ProgramHeader*::p_flags`.
1282 /// Segment is executable.
1283 pub const PF_X: u32 = 1 << 0;
1284 /// Segment is writable.
1285 pub const PF_W: u32 = 1 << 1;
1286 /// Segment is readable.
1287 pub const PF_R: u32 = 1 << 2;
1288 /// OS-specific segment flags.
1289 pub const PF_MASKOS: u32 = 0x0ff0_0000;
1290 /// Processor-specific segment flags.
1291 pub const PF_MASKPROC: u32 = 0xf000_0000;
1292 
1293 /// Note name for core files.
1294 pub static ELF_NOTE_CORE: &[u8] = b"CORE";
1295 /// Note name for linux core files.
1296 ///
1297 /// Notes in linux core files may also use `ELF_NOTE_CORE`.
1298 pub static ELF_NOTE_LINUX: &[u8] = b"LINUX";
1299 
1300 // Values for `NoteHeader*::n_type` in core files.
1301 //
1302 /// Contains copy of prstatus struct.
1303 pub const NT_PRSTATUS: u32 = 1;
1304 /// Contains copy of fpregset struct.
1305 pub const NT_PRFPREG: u32 = 2;
1306 /// Contains copy of fpregset struct.
1307 pub const NT_FPREGSET: u32 = 2;
1308 /// Contains copy of prpsinfo struct.
1309 pub const NT_PRPSINFO: u32 = 3;
1310 /// Contains copy of prxregset struct.
1311 pub const NT_PRXREG: u32 = 4;
1312 /// Contains copy of task structure.
1313 pub const NT_TASKSTRUCT: u32 = 4;
1314 /// String from sysinfo(SI_PLATFORM).
1315 pub const NT_PLATFORM: u32 = 5;
1316 /// Contains copy of auxv array.
1317 pub const NT_AUXV: u32 = 6;
1318 /// Contains copy of gwindows struct.
1319 pub const NT_GWINDOWS: u32 = 7;
1320 /// Contains copy of asrset struct.
1321 pub const NT_ASRS: u32 = 8;
1322 /// Contains copy of pstatus struct.
1323 pub const NT_PSTATUS: u32 = 10;
1324 /// Contains copy of psinfo struct.
1325 pub const NT_PSINFO: u32 = 13;
1326 /// Contains copy of prcred struct.
1327 pub const NT_PRCRED: u32 = 14;
1328 /// Contains copy of utsname struct.
1329 pub const NT_UTSNAME: u32 = 15;
1330 /// Contains copy of lwpstatus struct.
1331 pub const NT_LWPSTATUS: u32 = 16;
1332 /// Contains copy of lwpinfo struct.
1333 pub const NT_LWPSINFO: u32 = 17;
1334 /// Contains copy of fprxregset struct.
1335 pub const NT_PRFPXREG: u32 = 20;
1336 /// Contains copy of siginfo_t, size might increase.
1337 pub const NT_SIGINFO: u32 = 0x5349_4749;
1338 /// Contains information about mapped files.
1339 pub const NT_FILE: u32 = 0x4649_4c45;
1340 /// Contains copy of user_fxsr_struct.
1341 pub const NT_PRXFPREG: u32 = 0x46e6_2b7f;
1342 /// PowerPC Altivec/VMX registers.
1343 pub const NT_PPC_VMX: u32 = 0x100;
1344 /// PowerPC SPE/EVR registers.
1345 pub const NT_PPC_SPE: u32 = 0x101;
1346 /// PowerPC VSX registers.
1347 pub const NT_PPC_VSX: u32 = 0x102;
1348 /// Target Address Register.
1349 pub const NT_PPC_TAR: u32 = 0x103;
1350 /// Program Priority Register.
1351 pub const NT_PPC_PPR: u32 = 0x104;
1352 /// Data Stream Control Register.
1353 pub const NT_PPC_DSCR: u32 = 0x105;
1354 /// Event Based Branch Registers.
1355 pub const NT_PPC_EBB: u32 = 0x106;
1356 /// Performance Monitor Registers.
1357 pub const NT_PPC_PMU: u32 = 0x107;
1358 /// TM checkpointed GPR Registers.
1359 pub const NT_PPC_TM_CGPR: u32 = 0x108;
1360 /// TM checkpointed FPR Registers.
1361 pub const NT_PPC_TM_CFPR: u32 = 0x109;
1362 /// TM checkpointed VMX Registers.
1363 pub const NT_PPC_TM_CVMX: u32 = 0x10a;
1364 /// TM checkpointed VSX Registers.
1365 pub const NT_PPC_TM_CVSX: u32 = 0x10b;
1366 /// TM Special Purpose Registers.
1367 pub const NT_PPC_TM_SPR: u32 = 0x10c;
1368 /// TM checkpointed Target Address Register.
1369 pub const NT_PPC_TM_CTAR: u32 = 0x10d;
1370 /// TM checkpointed Program Priority Register.
1371 pub const NT_PPC_TM_CPPR: u32 = 0x10e;
1372 /// TM checkpointed Data Stream Control Register.
1373 pub const NT_PPC_TM_CDSCR: u32 = 0x10f;
1374 /// Memory Protection Keys registers.
1375 pub const NT_PPC_PKEY: u32 = 0x110;
1376 /// i386 TLS slots (struct user_desc).
1377 pub const NT_386_TLS: u32 = 0x200;
1378 /// x86 io permission bitmap (1=deny).
1379 pub const NT_386_IOPERM: u32 = 0x201;
1380 /// x86 extended state using xsave.
1381 pub const NT_X86_XSTATE: u32 = 0x202;
1382 /// s390 upper register halves.
1383 pub const NT_S390_HIGH_GPRS: u32 = 0x300;
1384 /// s390 timer register.
1385 pub const NT_S390_TIMER: u32 = 0x301;
1386 /// s390 TOD clock comparator register.
1387 pub const NT_S390_TODCMP: u32 = 0x302;
1388 /// s390 TOD programmable register.
1389 pub const NT_S390_TODPREG: u32 = 0x303;
1390 /// s390 control registers.
1391 pub const NT_S390_CTRS: u32 = 0x304;
1392 /// s390 prefix register.
1393 pub const NT_S390_PREFIX: u32 = 0x305;
1394 /// s390 breaking event address.
1395 pub const NT_S390_LAST_BREAK: u32 = 0x306;
1396 /// s390 system call restart data.
1397 pub const NT_S390_SYSTEM_CALL: u32 = 0x307;
1398 /// s390 transaction diagnostic block.
1399 pub const NT_S390_TDB: u32 = 0x308;
1400 /// s390 vector registers 0-15 upper half.
1401 pub const NT_S390_VXRS_LOW: u32 = 0x309;
1402 /// s390 vector registers 16-31.
1403 pub const NT_S390_VXRS_HIGH: u32 = 0x30a;
1404 /// s390 guarded storage registers.
1405 pub const NT_S390_GS_CB: u32 = 0x30b;
1406 /// s390 guarded storage broadcast control block.
1407 pub const NT_S390_GS_BC: u32 = 0x30c;
1408 /// s390 runtime instrumentation.
1409 pub const NT_S390_RI_CB: u32 = 0x30d;
1410 /// ARM VFP/NEON registers.
1411 pub const NT_ARM_VFP: u32 = 0x400;
1412 /// ARM TLS register.
1413 pub const NT_ARM_TLS: u32 = 0x401;
1414 /// ARM hardware breakpoint registers.
1415 pub const NT_ARM_HW_BREAK: u32 = 0x402;
1416 /// ARM hardware watchpoint registers.
1417 pub const NT_ARM_HW_WATCH: u32 = 0x403;
1418 /// ARM system call number.
1419 pub const NT_ARM_SYSTEM_CALL: u32 = 0x404;
1420 /// ARM Scalable Vector Extension registers.
1421 pub const NT_ARM_SVE: u32 = 0x405;
1422 /// Vmcore Device Dump Note.
1423 pub const NT_VMCOREDD: u32 = 0x700;
1424 /// MIPS DSP ASE registers.
1425 pub const NT_MIPS_DSP: u32 = 0x800;
1426 /// MIPS floating-point mode.
1427 pub const NT_MIPS_FP_MODE: u32 = 0x801;
1428 
1429 /// Note type for version string.
1430 ///
1431 /// This note may appear in object files.
1432 ///
1433 /// It must be handled as a special case because it has no descriptor, and instead
1434 /// uses the note name as the version string.
1435 pub const NT_VERSION: u32 = 1;
1436 
1437 /// Dynamic section entry.
1438 #[derive(Debug, Clone, Copy)]
1439 #[repr(C)]
1440 pub struct Dyn32<E: Endian> {
1441     /// Dynamic entry type.
1442     pub d_tag: U32<E>,
1443     /// Value (integer or address).
1444     pub d_val: U32<E>,
1445 }
1446 
1447 /// Dynamic section entry.
1448 #[derive(Debug, Clone, Copy)]
1449 #[repr(C)]
1450 pub struct Dyn64<E: Endian> {
1451     /// Dynamic entry type.
1452     pub d_tag: U64<E>,
1453     /// Value (integer or address).
1454     pub d_val: U64<E>,
1455 }
1456 
1457 // Values for `Dyn*::d_tag`.
1458 
1459 /// Marks end of dynamic section
1460 pub const DT_NULL: u32 = 0;
1461 /// Name of needed library
1462 pub const DT_NEEDED: u32 = 1;
1463 /// Size in bytes of PLT relocs
1464 pub const DT_PLTRELSZ: u32 = 2;
1465 /// Processor defined value
1466 pub const DT_PLTGOT: u32 = 3;
1467 /// Address of symbol hash table
1468 pub const DT_HASH: u32 = 4;
1469 /// Address of string table
1470 pub const DT_STRTAB: u32 = 5;
1471 /// Address of symbol table
1472 pub const DT_SYMTAB: u32 = 6;
1473 /// Address of Rela relocs
1474 pub const DT_RELA: u32 = 7;
1475 /// Total size of Rela relocs
1476 pub const DT_RELASZ: u32 = 8;
1477 /// Size of one Rela reloc
1478 pub const DT_RELAENT: u32 = 9;
1479 /// Size of string table
1480 pub const DT_STRSZ: u32 = 10;
1481 /// Size of one symbol table entry
1482 pub const DT_SYMENT: u32 = 11;
1483 /// Address of init function
1484 pub const DT_INIT: u32 = 12;
1485 /// Address of termination function
1486 pub const DT_FINI: u32 = 13;
1487 /// Name of shared object
1488 pub const DT_SONAME: u32 = 14;
1489 /// Library search path (deprecated)
1490 pub const DT_RPATH: u32 = 15;
1491 /// Start symbol search here
1492 pub const DT_SYMBOLIC: u32 = 16;
1493 /// Address of Rel relocs
1494 pub const DT_REL: u32 = 17;
1495 /// Total size of Rel relocs
1496 pub const DT_RELSZ: u32 = 18;
1497 /// Size of one Rel reloc
1498 pub const DT_RELENT: u32 = 19;
1499 /// Type of reloc in PLT
1500 pub const DT_PLTREL: u32 = 20;
1501 /// For debugging; unspecified
1502 pub const DT_DEBUG: u32 = 21;
1503 /// Reloc might modify .text
1504 pub const DT_TEXTREL: u32 = 22;
1505 /// Address of PLT relocs
1506 pub const DT_JMPREL: u32 = 23;
1507 /// Process relocations of object
1508 pub const DT_BIND_NOW: u32 = 24;
1509 /// Array with addresses of init fct
1510 pub const DT_INIT_ARRAY: u32 = 25;
1511 /// Array with addresses of fini fct
1512 pub const DT_FINI_ARRAY: u32 = 26;
1513 /// Size in bytes of DT_INIT_ARRAY
1514 pub const DT_INIT_ARRAYSZ: u32 = 27;
1515 /// Size in bytes of DT_FINI_ARRAY
1516 pub const DT_FINI_ARRAYSZ: u32 = 28;
1517 /// Library search path
1518 pub const DT_RUNPATH: u32 = 29;
1519 /// Flags for the object being loaded
1520 pub const DT_FLAGS: u32 = 30;
1521 /// Start of encoded range
1522 pub const DT_ENCODING: u32 = 32;
1523 /// Array with addresses of preinit fct
1524 pub const DT_PREINIT_ARRAY: u32 = 32;
1525 /// size in bytes of DT_PREINIT_ARRAY
1526 pub const DT_PREINIT_ARRAYSZ: u32 = 33;
1527 /// Address of SYMTAB_SHNDX section
1528 pub const DT_SYMTAB_SHNDX: u32 = 34;
1529 /// Start of OS-specific
1530 pub const DT_LOOS: u32 = 0x6000_000d;
1531 /// End of OS-specific
1532 pub const DT_HIOS: u32 = 0x6fff_f000;
1533 /// Start of processor-specific
1534 pub const DT_LOPROC: u32 = 0x7000_0000;
1535 /// End of processor-specific
1536 pub const DT_HIPROC: u32 = 0x7fff_ffff;
1537 
1538 // `DT_*` entries between `DT_VALRNGHI` & `DT_VALRNGLO` use `d_val` as a value.
1539 #[allow(missing_docs)]
1540 pub const DT_VALRNGLO: u32 = 0x6fff_fd00;
1541 /// Prelinking timestamp
1542 pub const DT_GNU_PRELINKED: u32 = 0x6fff_fdf5;
1543 /// Size of conflict section
1544 pub const DT_GNU_CONFLICTSZ: u32 = 0x6fff_fdf6;
1545 /// Size of library list
1546 pub const DT_GNU_LIBLISTSZ: u32 = 0x6fff_fdf7;
1547 #[allow(missing_docs)]
1548 pub const DT_CHECKSUM: u32 = 0x6fff_fdf8;
1549 #[allow(missing_docs)]
1550 pub const DT_PLTPADSZ: u32 = 0x6fff_fdf9;
1551 #[allow(missing_docs)]
1552 pub const DT_MOVEENT: u32 = 0x6fff_fdfa;
1553 #[allow(missing_docs)]
1554 pub const DT_MOVESZ: u32 = 0x6fff_fdfb;
1555 /// Feature selection (DTF_*).
1556 pub const DT_FEATURE_1: u32 = 0x6fff_fdfc;
1557 /// Flags for DT_* entries, affecting the following DT_* entry.
1558 pub const DT_POSFLAG_1: u32 = 0x6fff_fdfd;
1559 /// Size of syminfo table (in bytes)
1560 pub const DT_SYMINSZ: u32 = 0x6fff_fdfe;
1561 /// Entry size of syminfo
1562 pub const DT_SYMINENT: u32 = 0x6fff_fdff;
1563 #[allow(missing_docs)]
1564 pub const DT_VALRNGHI: u32 = 0x6fff_fdff;
1565 
1566 // `DT_*` entries between `DT_ADDRRNGHI` & `DT_ADDRRNGLO` use `d_val` as an address.
1567 //
1568 // If any adjustment is made to the ELF object after it has been
1569 // built these entries will need to be adjusted.
1570 #[allow(missing_docs)]
1571 pub const DT_ADDRRNGLO: u32 = 0x6fff_fe00;
1572 /// GNU-style hash table.
1573 pub const DT_GNU_HASH: u32 = 0x6fff_fef5;
1574 #[allow(missing_docs)]
1575 pub const DT_TLSDESC_PLT: u32 = 0x6fff_fef6;
1576 #[allow(missing_docs)]
1577 pub const DT_TLSDESC_GOT: u32 = 0x6fff_fef7;
1578 /// Start of conflict section
1579 pub const DT_GNU_CONFLICT: u32 = 0x6fff_fef8;
1580 /// Library list
1581 pub const DT_GNU_LIBLIST: u32 = 0x6fff_fef9;
1582 /// Configuration information.
1583 pub const DT_CONFIG: u32 = 0x6fff_fefa;
1584 /// Dependency auditing.
1585 pub const DT_DEPAUDIT: u32 = 0x6fff_fefb;
1586 /// Object auditing.
1587 pub const DT_AUDIT: u32 = 0x6fff_fefc;
1588 /// PLT padding.
1589 pub const DT_PLTPAD: u32 = 0x6fff_fefd;
1590 /// Move table.
1591 pub const DT_MOVETAB: u32 = 0x6fff_fefe;
1592 /// Syminfo table.
1593 pub const DT_SYMINFO: u32 = 0x6fff_feff;
1594 #[allow(missing_docs)]
1595 pub const DT_ADDRRNGHI: u32 = 0x6fff_feff;
1596 
1597 // The versioning entry types.  The next are defined as part of the
1598 // GNU extension.
1599 #[allow(missing_docs)]
1600 pub const DT_VERSYM: u32 = 0x6fff_fff0;
1601 #[allow(missing_docs)]
1602 pub const DT_RELACOUNT: u32 = 0x6fff_fff9;
1603 #[allow(missing_docs)]
1604 pub const DT_RELCOUNT: u32 = 0x6fff_fffa;
1605 /// State flags, see DF_1_* below.
1606 pub const DT_FLAGS_1: u32 = 0x6fff_fffb;
1607 /// Address of version definition table
1608 pub const DT_VERDEF: u32 = 0x6fff_fffc;
1609 /// Number of version definitions
1610 pub const DT_VERDEFNUM: u32 = 0x6fff_fffd;
1611 /// Address of table with needed versions
1612 pub const DT_VERNEED: u32 = 0x6fff_fffe;
1613 /// Number of needed versions
1614 pub const DT_VERNEEDNUM: u32 = 0x6fff_ffff;
1615 
1616 // Machine-independent extensions in the "processor-specific" range.
1617 /// Shared object to load before self
1618 pub const DT_AUXILIARY: u32 = 0x7fff_fffd;
1619 /// Shared object to get values from
1620 pub const DT_FILTER: u32 = 0x7fff_ffff;
1621 
1622 // Values of `Dyn*::d_val` in the `DT_FLAGS` entry.
1623 /// Object may use DF_ORIGIN
1624 pub const DF_ORIGIN: u32 = 0x0000_0001;
1625 /// Symbol resolutions starts here
1626 pub const DF_SYMBOLIC: u32 = 0x0000_0002;
1627 /// Object contains text relocations
1628 pub const DF_TEXTREL: u32 = 0x0000_0004;
1629 /// No lazy binding for this object
1630 pub const DF_BIND_NOW: u32 = 0x0000_0008;
1631 /// Module uses the static TLS model
1632 pub const DF_STATIC_TLS: u32 = 0x0000_0010;
1633 
1634 // Values of `Dyn*::d_val` in the `DT_FLAGS_1` entry.
1635 /// Set RTLD_NOW for this object.
1636 pub const DF_1_NOW: u32 = 0x0000_0001;
1637 /// Set RTLD_GLOBAL for this object.
1638 pub const DF_1_GLOBAL: u32 = 0x0000_0002;
1639 /// Set RTLD_GROUP for this object.
1640 pub const DF_1_GROUP: u32 = 0x0000_0004;
1641 /// Set RTLD_NODELETE for this object.
1642 pub const DF_1_NODELETE: u32 = 0x0000_0008;
1643 /// Trigger filtee loading at runtime.
1644 pub const DF_1_LOADFLTR: u32 = 0x0000_0010;
1645 /// Set RTLD_INITFIRST for this object.
1646 pub const DF_1_INITFIRST: u32 = 0x0000_0020;
1647 /// Set RTLD_NOOPEN for this object.
1648 pub const DF_1_NOOPEN: u32 = 0x0000_0040;
1649 /// $ORIGIN must be handled.
1650 pub const DF_1_ORIGIN: u32 = 0x0000_0080;
1651 /// Direct binding enabled.
1652 pub const DF_1_DIRECT: u32 = 0x0000_0100;
1653 #[allow(missing_docs)]
1654 pub const DF_1_TRANS: u32 = 0x0000_0200;
1655 /// Object is used to interpose.
1656 pub const DF_1_INTERPOSE: u32 = 0x0000_0400;
1657 /// Ignore default lib search path.
1658 pub const DF_1_NODEFLIB: u32 = 0x0000_0800;
1659 /// Object can't be dldump'ed.
1660 pub const DF_1_NODUMP: u32 = 0x0000_1000;
1661 /// Configuration alternative created.
1662 pub const DF_1_CONFALT: u32 = 0x0000_2000;
1663 /// Filtee terminates filters search.
1664 pub const DF_1_ENDFILTEE: u32 = 0x0000_4000;
1665 /// Disp reloc applied at build time.
1666 pub const DF_1_DISPRELDNE: u32 = 0x0000_8000;
1667 /// Disp reloc applied at run-time.
1668 pub const DF_1_DISPRELPND: u32 = 0x0001_0000;
1669 /// Object has no-direct binding.
1670 pub const DF_1_NODIRECT: u32 = 0x0002_0000;
1671 #[allow(missing_docs)]
1672 pub const DF_1_IGNMULDEF: u32 = 0x0004_0000;
1673 #[allow(missing_docs)]
1674 pub const DF_1_NOKSYMS: u32 = 0x0008_0000;
1675 #[allow(missing_docs)]
1676 pub const DF_1_NOHDR: u32 = 0x0010_0000;
1677 /// Object is modified after built.
1678 pub const DF_1_EDITED: u32 = 0x0020_0000;
1679 #[allow(missing_docs)]
1680 pub const DF_1_NORELOC: u32 = 0x0040_0000;
1681 /// Object has individual interposers.
1682 pub const DF_1_SYMINTPOSE: u32 = 0x0080_0000;
1683 /// Global auditing required.
1684 pub const DF_1_GLOBAUDIT: u32 = 0x0100_0000;
1685 /// Singleton symbols are used.
1686 pub const DF_1_SINGLETON: u32 = 0x0200_0000;
1687 #[allow(missing_docs)]
1688 pub const DF_1_STUB: u32 = 0x0400_0000;
1689 #[allow(missing_docs)]
1690 pub const DF_1_PIE: u32 = 0x0800_0000;
1691 
1692 /// Version symbol information
1693 #[derive(Debug, Clone, Copy)]
1694 #[repr(C)]
1695 pub struct Versym<E: Endian>(pub U16<E>);
1696 
1697 /// Version definition sections
1698 #[derive(Debug, Clone, Copy)]
1699 #[repr(C)]
1700 pub struct Verdef<E: Endian> {
1701     /// Version revision
1702     pub vd_version: U16<E>,
1703     /// Version information
1704     pub vd_flags: U16<E>,
1705     /// Version Index
1706     pub vd_ndx: U16<E>,
1707     /// Number of associated aux entries
1708     pub vd_cnt: U16<E>,
1709     /// Version name hash value
1710     pub vd_hash: U32<E>,
1711     /// Offset in bytes to verdaux array
1712     pub vd_aux: U32<E>,
1713     /// Offset in bytes to next verdef entry
1714     pub vd_next: U32<E>,
1715 }
1716 
1717 // Legal values for vd_version (version revision).
1718 /// No version
1719 pub const VER_DEF_NONE: u16 = 0;
1720 /// Current version
1721 pub const VER_DEF_CURRENT: u16 = 1;
1722 
1723 // Legal values for vd_flags and vna_flags (version information flags).
1724 /// Version definition of file itself
1725 pub const VER_FLG_BASE: u16 = 0x1;
1726 /// Weak version identifier
1727 pub const VER_FLG_WEAK: u16 = 0x2;
1728 
1729 // Versym symbol index values.
1730 /// Symbol is local.
1731 pub const VER_NDX_LOCAL: u16 = 0;
1732 /// Symbol is global.
1733 pub const VER_NDX_GLOBAL: u16 = 1;
1734 /// Symbol is hidden.
1735 pub const VER_NDX_HIDDEN: u16 = 0x8000;
1736 
1737 /// Auxiliary version information.
1738 #[derive(Debug, Clone, Copy)]
1739 #[repr(C)]
1740 pub struct Verdaux<E: Endian> {
1741     /// Version or dependency names
1742     pub vda_name: U32<E>,
1743     /// Offset in bytes to next verdaux
1744     pub vda_next: U32<E>,
1745 }
1746 
1747 /// Version dependency.
1748 #[derive(Debug, Clone, Copy)]
1749 #[repr(C)]
1750 pub struct Verneed<E: Endian> {
1751     /// Version of structure
1752     pub vn_version: U16<E>,
1753     /// Number of associated aux entries
1754     pub vn_cnt: U16<E>,
1755     /// Offset of filename for this dependency
1756     pub vn_file: U32<E>,
1757     /// Offset in bytes to vernaux array
1758     pub vn_aux: U32<E>,
1759     /// Offset in bytes to next verneed entry
1760     pub vn_next: U32<E>,
1761 }
1762 
1763 // Legal values for vn_version (version revision).
1764 /// No version
1765 pub const VER_NEED_NONE: u16 = 0;
1766 /// Current version
1767 pub const VER_NEED_CURRENT: u16 = 1;
1768 
1769 /// Auxiliary needed version information.
1770 #[derive(Debug, Clone, Copy)]
1771 #[repr(C)]
1772 pub struct Vernaux<E: Endian> {
1773     /// Hash value of dependency name
1774     pub vna_hash: U32<E>,
1775     /// Dependency specific information
1776     pub vna_flags: U16<E>,
1777     /// Version Index
1778     pub vna_other: U16<E>,
1779     /// Dependency name string offset
1780     pub vna_name: U32<E>,
1781     /// Offset in bytes to next vernaux entry
1782     pub vna_next: U32<E>,
1783 }
1784 
1785 // TODO: Elf*_auxv_t, AT_*
1786 
1787 /// Note section entry header.
1788 ///
1789 /// A note consists of a header followed by a variable length name and descriptor.
1790 #[derive(Debug, Clone, Copy)]
1791 #[repr(C)]
1792 pub struct NoteHeader32<E: Endian> {
1793     /// Length of the note's name.
1794     ///
1795     /// Some known names are defined by the `ELF_NOTE_*` constants.
1796     pub n_namesz: U32<E>,
1797     /// Length of the note's descriptor.
1798     ///
1799     /// The content of the descriptor depends on the note name and type.
1800     pub n_descsz: U32<E>,
1801     /// Type of the note.
1802     ///
1803     /// One of the `NT_*` constants. The note name determines which
1804     /// `NT_*` constants are valid.
1805     pub n_type: U32<E>,
1806 }
1807 
1808 /// Note section entry header.
1809 #[derive(Debug, Clone, Copy)]
1810 #[repr(C)]
1811 pub struct NoteHeader64<E: Endian> {
1812     /// Length of the note's name.
1813     ///
1814     /// Some known names are defined by the `ELF_NOTE_*` constants.
1815     pub n_namesz: U32<E>,
1816     /// Length of the note's descriptor.
1817     ///
1818     /// The content of the descriptor depends on the note name and type.
1819     pub n_descsz: U32<E>,
1820     /// Type of the note.
1821     ///
1822     /// One of the `NT_*` constants. The note name determines which
1823     /// `NT_*` constants are valid.
1824     pub n_type: U32<E>,
1825 }
1826 
1827 /// Solaris entries in the note section have this name.
1828 pub static ELF_NOTE_SOLARIS: &[u8] = b"SUNW Solaris";
1829 
1830 // Values for `n_type` when the name is `ELF_NOTE_SOLARIS`.
1831 /// Desired pagesize for the binary.
1832 pub const NT_SOLARIS_PAGESIZE_HINT: u32 = 1;
1833 
1834 /// GNU entries in the note section have this name.
1835 pub static ELF_NOTE_GNU: &[u8] = b"GNU";
1836 
1837 // Note types for `ELF_NOTE_GNU`.
1838 
1839 /// ABI information.
1840 ///
1841 /// The descriptor consists of words:
1842 /// - word 0: OS descriptor
1843 /// - word 1: major version of the ABI
1844 /// - word 2: minor version of the ABI
1845 /// - word 3: subminor version of the ABI
1846 pub const NT_GNU_ABI_TAG: u32 = 1;
1847 
1848 /// OS descriptor for `NT_GNU_ABI_TAG`.
1849 pub const ELF_NOTE_OS_LINUX: u32 = 0;
1850 /// OS descriptor for `NT_GNU_ABI_TAG`.
1851 pub const ELF_NOTE_OS_GNU: u32 = 1;
1852 /// OS descriptor for `NT_GNU_ABI_TAG`.
1853 pub const ELF_NOTE_OS_SOLARIS2: u32 = 2;
1854 /// OS descriptor for `NT_GNU_ABI_TAG`.
1855 pub const ELF_NOTE_OS_FREEBSD: u32 = 3;
1856 
1857 /// Synthetic hwcap information.
1858 ///
1859 /// The descriptor begins with two words:
1860 /// - word 0: number of entries
1861 /// - word 1: bitmask of enabled entries
1862 /// Then follow variable-length entries, one byte followed by a
1863 /// '\0'-terminated hwcap name string.  The byte gives the bit
1864 /// number to test if enabled, (1U << bit) & bitmask.  */
1865 pub const NT_GNU_HWCAP: u32 = 2;
1866 
1867 /// Build ID bits as generated by `ld --build-id`.
1868 ///
1869 /// The descriptor consists of any nonzero number of bytes.
1870 pub const NT_GNU_BUILD_ID: u32 = 3;
1871 
1872 /// Version note generated by GNU gold containing a version string.
1873 pub const NT_GNU_GOLD_VERSION: u32 = 4;
1874 
1875 /// Program property.
1876 pub const NT_GNU_PROPERTY_TYPE_0: u32 = 5;
1877 
1878 // TODO: GNU_PROPERTY_*
1879 // TODO: Elf*_Move
1880 
1881 /// Header of `SHT_HASH` section.
1882 #[derive(Debug, Clone, Copy)]
1883 #[repr(C)]
1884 pub struct HashHeader<E: Endian> {
1885     /// The number of hash buckets.
1886     pub bucket_count: U32<E>,
1887     /// The number of chain values.
1888     pub chain_count: U32<E>,
1889     // Array of hash bucket start indices.
1890     // buckets: U32<E>[bucket_count]
1891     // Array of hash chain links. An index of 0 terminates the chain.
1892     // chains: U32<E>[chain_count]
1893 }
1894 
1895 /// Calculate the SysV hash for a symbol name.
1896 ///
1897 /// Used for `SHT_HASH`.
hash(name: &[u8]) -> u321898 pub fn hash(name: &[u8]) -> u32 {
1899     let mut hash = 0u32;
1900     for byte in name {
1901         hash = hash.wrapping_mul(16).wrapping_add(u32::from(*byte));
1902         hash ^= (hash >> 24) & 0xf0;
1903     }
1904     hash & 0xfff_ffff
1905 }
1906 
1907 /// Header of `SHT_GNU_HASH` section.
1908 #[derive(Debug, Clone, Copy)]
1909 #[repr(C)]
1910 pub struct GnuHashHeader<E: Endian> {
1911     /// The number of hash buckets.
1912     pub bucket_count: U32<E>,
1913     /// The symbol table index of the first symbol in the hash.
1914     pub symbol_base: U32<E>,
1915     /// The number of words in the bloom filter.
1916     ///
1917     /// Must be a non-zero power of 2.
1918     pub bloom_count: U32<E>,
1919     /// The bit shift count for the bloom filter.
1920     pub bloom_shift: U32<E>,
1921     // Array of bloom filter words.
1922     // bloom_filters: U32<E>[bloom_count] or U64<E>[bloom_count]
1923     // Array of hash bucket start indices.
1924     // buckets: U32<E>[bucket_count]
1925     // Array of hash values, one for each symbol starting at symbol_base.
1926     // values: U32<E>[symbol_count]
1927 }
1928 
1929 /// Calculate the GNU hash for a symbol name.
1930 ///
1931 /// Used for `SHT_GNU_HASH`.
gnu_hash(name: &[u8]) -> u321932 pub fn gnu_hash(name: &[u8]) -> u32 {
1933     let mut hash = 5381u32;
1934     for byte in name {
1935         hash = hash.wrapping_mul(33).wrapping_add(u32::from(*byte));
1936     }
1937     hash
1938 }
1939 
1940 // Motorola 68k specific definitions.
1941 
1942 // m68k values for `Rel*::r_type`.
1943 
1944 /// No reloc
1945 pub const R_68K_NONE: u32 = 0;
1946 /// Direct 32 bit
1947 pub const R_68K_32: u32 = 1;
1948 /// Direct 16 bit
1949 pub const R_68K_16: u32 = 2;
1950 /// Direct 8 bit
1951 pub const R_68K_8: u32 = 3;
1952 /// PC relative 32 bit
1953 pub const R_68K_PC32: u32 = 4;
1954 /// PC relative 16 bit
1955 pub const R_68K_PC16: u32 = 5;
1956 /// PC relative 8 bit
1957 pub const R_68K_PC8: u32 = 6;
1958 /// 32 bit PC relative GOT entry
1959 pub const R_68K_GOT32: u32 = 7;
1960 /// 16 bit PC relative GOT entry
1961 pub const R_68K_GOT16: u32 = 8;
1962 /// 8 bit PC relative GOT entry
1963 pub const R_68K_GOT8: u32 = 9;
1964 /// 32 bit GOT offset
1965 pub const R_68K_GOT32O: u32 = 10;
1966 /// 16 bit GOT offset
1967 pub const R_68K_GOT16O: u32 = 11;
1968 /// 8 bit GOT offset
1969 pub const R_68K_GOT8O: u32 = 12;
1970 /// 32 bit PC relative PLT address
1971 pub const R_68K_PLT32: u32 = 13;
1972 /// 16 bit PC relative PLT address
1973 pub const R_68K_PLT16: u32 = 14;
1974 /// 8 bit PC relative PLT address
1975 pub const R_68K_PLT8: u32 = 15;
1976 /// 32 bit PLT offset
1977 pub const R_68K_PLT32O: u32 = 16;
1978 /// 16 bit PLT offset
1979 pub const R_68K_PLT16O: u32 = 17;
1980 /// 8 bit PLT offset
1981 pub const R_68K_PLT8O: u32 = 18;
1982 /// Copy symbol at runtime
1983 pub const R_68K_COPY: u32 = 19;
1984 /// Create GOT entry
1985 pub const R_68K_GLOB_DAT: u32 = 20;
1986 /// Create PLT entry
1987 pub const R_68K_JMP_SLOT: u32 = 21;
1988 /// Adjust by program base
1989 pub const R_68K_RELATIVE: u32 = 22;
1990 /// 32 bit GOT offset for GD
1991 pub const R_68K_TLS_GD32: u32 = 25;
1992 /// 16 bit GOT offset for GD
1993 pub const R_68K_TLS_GD16: u32 = 26;
1994 /// 8 bit GOT offset for GD
1995 pub const R_68K_TLS_GD8: u32 = 27;
1996 /// 32 bit GOT offset for LDM
1997 pub const R_68K_TLS_LDM32: u32 = 28;
1998 /// 16 bit GOT offset for LDM
1999 pub const R_68K_TLS_LDM16: u32 = 29;
2000 /// 8 bit GOT offset for LDM
2001 pub const R_68K_TLS_LDM8: u32 = 30;
2002 /// 32 bit module-relative offset
2003 pub const R_68K_TLS_LDO32: u32 = 31;
2004 /// 16 bit module-relative offset
2005 pub const R_68K_TLS_LDO16: u32 = 32;
2006 /// 8 bit module-relative offset
2007 pub const R_68K_TLS_LDO8: u32 = 33;
2008 /// 32 bit GOT offset for IE
2009 pub const R_68K_TLS_IE32: u32 = 34;
2010 /// 16 bit GOT offset for IE
2011 pub const R_68K_TLS_IE16: u32 = 35;
2012 /// 8 bit GOT offset for IE
2013 pub const R_68K_TLS_IE8: u32 = 36;
2014 /// 32 bit offset relative to static TLS block
2015 pub const R_68K_TLS_LE32: u32 = 37;
2016 /// 16 bit offset relative to static TLS block
2017 pub const R_68K_TLS_LE16: u32 = 38;
2018 /// 8 bit offset relative to static TLS block
2019 pub const R_68K_TLS_LE8: u32 = 39;
2020 /// 32 bit module number
2021 pub const R_68K_TLS_DTPMOD32: u32 = 40;
2022 /// 32 bit module-relative offset
2023 pub const R_68K_TLS_DTPREL32: u32 = 41;
2024 /// 32 bit TP-relative offset
2025 pub const R_68K_TLS_TPREL32: u32 = 42;
2026 
2027 // Intel 80386 specific definitions.
2028 
2029 // i386 values for `Rel*::r_type`.
2030 
2031 /// No reloc
2032 pub const R_386_NONE: u32 = 0;
2033 /// Direct 32 bit
2034 pub const R_386_32: u32 = 1;
2035 /// PC relative 32 bit
2036 pub const R_386_PC32: u32 = 2;
2037 /// 32 bit GOT entry
2038 pub const R_386_GOT32: u32 = 3;
2039 /// 32 bit PLT address
2040 pub const R_386_PLT32: u32 = 4;
2041 /// Copy symbol at runtime
2042 pub const R_386_COPY: u32 = 5;
2043 /// Create GOT entry
2044 pub const R_386_GLOB_DAT: u32 = 6;
2045 /// Create PLT entry
2046 pub const R_386_JMP_SLOT: u32 = 7;
2047 /// Adjust by program base
2048 pub const R_386_RELATIVE: u32 = 8;
2049 /// 32 bit offset to GOT
2050 pub const R_386_GOTOFF: u32 = 9;
2051 /// 32 bit PC relative offset to GOT
2052 pub const R_386_GOTPC: u32 = 10;
2053 /// Direct 32 bit PLT address
2054 pub const R_386_32PLT: u32 = 11;
2055 /// Offset in static TLS block
2056 pub const R_386_TLS_TPOFF: u32 = 14;
2057 /// Address of GOT entry for static TLS block offset
2058 pub const R_386_TLS_IE: u32 = 15;
2059 /// GOT entry for static TLS block offset
2060 pub const R_386_TLS_GOTIE: u32 = 16;
2061 /// Offset relative to static TLS block
2062 pub const R_386_TLS_LE: u32 = 17;
2063 /// Direct 32 bit for GNU version of general dynamic thread local data
2064 pub const R_386_TLS_GD: u32 = 18;
2065 /// Direct 32 bit for GNU version of local dynamic thread local data in LE code
2066 pub const R_386_TLS_LDM: u32 = 19;
2067 /// Direct 16 bit
2068 pub const R_386_16: u32 = 20;
2069 /// PC relative 16 bit
2070 pub const R_386_PC16: u32 = 21;
2071 /// Direct 8 bit
2072 pub const R_386_8: u32 = 22;
2073 /// PC relative 8 bit
2074 pub const R_386_PC8: u32 = 23;
2075 /// Direct 32 bit for general dynamic thread local data
2076 pub const R_386_TLS_GD_32: u32 = 24;
2077 /// Tag for pushl in GD TLS code
2078 pub const R_386_TLS_GD_PUSH: u32 = 25;
2079 /// Relocation for call to __tls_get_addr()
2080 pub const R_386_TLS_GD_CALL: u32 = 26;
2081 /// Tag for popl in GD TLS code
2082 pub const R_386_TLS_GD_POP: u32 = 27;
2083 /// Direct 32 bit for local dynamic thread local data in LE code
2084 pub const R_386_TLS_LDM_32: u32 = 28;
2085 /// Tag for pushl in LDM TLS code
2086 pub const R_386_TLS_LDM_PUSH: u32 = 29;
2087 /// Relocation for call to __tls_get_addr() in LDM code
2088 pub const R_386_TLS_LDM_CALL: u32 = 30;
2089 /// Tag for popl in LDM TLS code
2090 pub const R_386_TLS_LDM_POP: u32 = 31;
2091 /// Offset relative to TLS block
2092 pub const R_386_TLS_LDO_32: u32 = 32;
2093 /// GOT entry for negated static TLS block offset
2094 pub const R_386_TLS_IE_32: u32 = 33;
2095 /// Negated offset relative to static TLS block
2096 pub const R_386_TLS_LE_32: u32 = 34;
2097 /// ID of module containing symbol
2098 pub const R_386_TLS_DTPMOD32: u32 = 35;
2099 /// Offset in TLS block
2100 pub const R_386_TLS_DTPOFF32: u32 = 36;
2101 /// Negated offset in static TLS block
2102 pub const R_386_TLS_TPOFF32: u32 = 37;
2103 /// 32-bit symbol size
2104 pub const R_386_SIZE32: u32 = 38;
2105 /// GOT offset for TLS descriptor.
2106 pub const R_386_TLS_GOTDESC: u32 = 39;
2107 /// Marker of call through TLS descriptor for relaxation.
2108 pub const R_386_TLS_DESC_CALL: u32 = 40;
2109 /// TLS descriptor containing pointer to code and to argument, returning the TLS offset for the symbol.
2110 pub const R_386_TLS_DESC: u32 = 41;
2111 /// Adjust indirectly by program base
2112 pub const R_386_IRELATIVE: u32 = 42;
2113 /// Load from 32 bit GOT entry, relaxable.
2114 pub const R_386_GOT32X: u32 = 43;
2115 
2116 // SUN SPARC specific definitions.
2117 
2118 // SPARC values for `st_type` component of `Sym*::st_info`.
2119 
2120 /// Global register reserved to app.
2121 pub const STT_SPARC_REGISTER: u8 = 13;
2122 
2123 // SPARC values for `FileHeader64::e_flags`.
2124 
2125 #[allow(missing_docs)]
2126 pub const EF_SPARCV9_MM: u32 = 3;
2127 #[allow(missing_docs)]
2128 pub const EF_SPARCV9_TSO: u32 = 0;
2129 #[allow(missing_docs)]
2130 pub const EF_SPARCV9_PSO: u32 = 1;
2131 #[allow(missing_docs)]
2132 pub const EF_SPARCV9_RMO: u32 = 2;
2133 /// little endian data
2134 pub const EF_SPARC_LEDATA: u32 = 0x80_0000;
2135 #[allow(missing_docs)]
2136 pub const EF_SPARC_EXT_MASK: u32 = 0xFF_FF00;
2137 /// generic V8+ features
2138 pub const EF_SPARC_32PLUS: u32 = 0x00_0100;
2139 /// Sun UltraSPARC1 extensions
2140 pub const EF_SPARC_SUN_US1: u32 = 0x00_0200;
2141 /// HAL R1 extensions
2142 pub const EF_SPARC_HAL_R1: u32 = 0x00_0400;
2143 /// Sun UltraSPARCIII extensions
2144 pub const EF_SPARC_SUN_US3: u32 = 0x00_0800;
2145 
2146 // SPARC values for `Rel*::r_type`.
2147 
2148 /// No reloc
2149 pub const R_SPARC_NONE: u32 = 0;
2150 /// Direct 8 bit
2151 pub const R_SPARC_8: u32 = 1;
2152 /// Direct 16 bit
2153 pub const R_SPARC_16: u32 = 2;
2154 /// Direct 32 bit
2155 pub const R_SPARC_32: u32 = 3;
2156 /// PC relative 8 bit
2157 pub const R_SPARC_DISP8: u32 = 4;
2158 /// PC relative 16 bit
2159 pub const R_SPARC_DISP16: u32 = 5;
2160 /// PC relative 32 bit
2161 pub const R_SPARC_DISP32: u32 = 6;
2162 /// PC relative 30 bit shifted
2163 pub const R_SPARC_WDISP30: u32 = 7;
2164 /// PC relative 22 bit shifted
2165 pub const R_SPARC_WDISP22: u32 = 8;
2166 /// High 22 bit
2167 pub const R_SPARC_HI22: u32 = 9;
2168 /// Direct 22 bit
2169 pub const R_SPARC_22: u32 = 10;
2170 /// Direct 13 bit
2171 pub const R_SPARC_13: u32 = 11;
2172 /// Truncated 10 bit
2173 pub const R_SPARC_LO10: u32 = 12;
2174 /// Truncated 10 bit GOT entry
2175 pub const R_SPARC_GOT10: u32 = 13;
2176 /// 13 bit GOT entry
2177 pub const R_SPARC_GOT13: u32 = 14;
2178 /// 22 bit GOT entry shifted
2179 pub const R_SPARC_GOT22: u32 = 15;
2180 /// PC relative 10 bit truncated
2181 pub const R_SPARC_PC10: u32 = 16;
2182 /// PC relative 22 bit shifted
2183 pub const R_SPARC_PC22: u32 = 17;
2184 /// 30 bit PC relative PLT address
2185 pub const R_SPARC_WPLT30: u32 = 18;
2186 /// Copy symbol at runtime
2187 pub const R_SPARC_COPY: u32 = 19;
2188 /// Create GOT entry
2189 pub const R_SPARC_GLOB_DAT: u32 = 20;
2190 /// Create PLT entry
2191 pub const R_SPARC_JMP_SLOT: u32 = 21;
2192 /// Adjust by program base
2193 pub const R_SPARC_RELATIVE: u32 = 22;
2194 /// Direct 32 bit unaligned
2195 pub const R_SPARC_UA32: u32 = 23;
2196 
2197 // Sparc64 values for `Rel*::r_type`.
2198 
2199 /// Direct 32 bit ref to PLT entry
2200 pub const R_SPARC_PLT32: u32 = 24;
2201 /// High 22 bit PLT entry
2202 pub const R_SPARC_HIPLT22: u32 = 25;
2203 /// Truncated 10 bit PLT entry
2204 pub const R_SPARC_LOPLT10: u32 = 26;
2205 /// PC rel 32 bit ref to PLT entry
2206 pub const R_SPARC_PCPLT32: u32 = 27;
2207 /// PC rel high 22 bit PLT entry
2208 pub const R_SPARC_PCPLT22: u32 = 28;
2209 /// PC rel trunc 10 bit PLT entry
2210 pub const R_SPARC_PCPLT10: u32 = 29;
2211 /// Direct 10 bit
2212 pub const R_SPARC_10: u32 = 30;
2213 /// Direct 11 bit
2214 pub const R_SPARC_11: u32 = 31;
2215 /// Direct 64 bit
2216 pub const R_SPARC_64: u32 = 32;
2217 /// 10bit with secondary 13bit addend
2218 pub const R_SPARC_OLO10: u32 = 33;
2219 /// Top 22 bits of direct 64 bit
2220 pub const R_SPARC_HH22: u32 = 34;
2221 /// High middle 10 bits of ...
2222 pub const R_SPARC_HM10: u32 = 35;
2223 /// Low middle 22 bits of ...
2224 pub const R_SPARC_LM22: u32 = 36;
2225 /// Top 22 bits of pc rel 64 bit
2226 pub const R_SPARC_PC_HH22: u32 = 37;
2227 /// High middle 10 bit of ...
2228 pub const R_SPARC_PC_HM10: u32 = 38;
2229 /// Low miggle 22 bits of ...
2230 pub const R_SPARC_PC_LM22: u32 = 39;
2231 /// PC relative 16 bit shifted
2232 pub const R_SPARC_WDISP16: u32 = 40;
2233 /// PC relative 19 bit shifted
2234 pub const R_SPARC_WDISP19: u32 = 41;
2235 /// was part of v9 ABI but was removed
2236 pub const R_SPARC_GLOB_JMP: u32 = 42;
2237 /// Direct 7 bit
2238 pub const R_SPARC_7: u32 = 43;
2239 /// Direct 5 bit
2240 pub const R_SPARC_5: u32 = 44;
2241 /// Direct 6 bit
2242 pub const R_SPARC_6: u32 = 45;
2243 /// PC relative 64 bit
2244 pub const R_SPARC_DISP64: u32 = 46;
2245 /// Direct 64 bit ref to PLT entry
2246 pub const R_SPARC_PLT64: u32 = 47;
2247 /// High 22 bit complemented
2248 pub const R_SPARC_HIX22: u32 = 48;
2249 /// Truncated 11 bit complemented
2250 pub const R_SPARC_LOX10: u32 = 49;
2251 /// Direct high 12 of 44 bit
2252 pub const R_SPARC_H44: u32 = 50;
2253 /// Direct mid 22 of 44 bit
2254 pub const R_SPARC_M44: u32 = 51;
2255 /// Direct low 10 of 44 bit
2256 pub const R_SPARC_L44: u32 = 52;
2257 /// Global register usage
2258 pub const R_SPARC_REGISTER: u32 = 53;
2259 /// Direct 64 bit unaligned
2260 pub const R_SPARC_UA64: u32 = 54;
2261 /// Direct 16 bit unaligned
2262 pub const R_SPARC_UA16: u32 = 55;
2263 #[allow(missing_docs)]
2264 pub const R_SPARC_TLS_GD_HI22: u32 = 56;
2265 #[allow(missing_docs)]
2266 pub const R_SPARC_TLS_GD_LO10: u32 = 57;
2267 #[allow(missing_docs)]
2268 pub const R_SPARC_TLS_GD_ADD: u32 = 58;
2269 #[allow(missing_docs)]
2270 pub const R_SPARC_TLS_GD_CALL: u32 = 59;
2271 #[allow(missing_docs)]
2272 pub const R_SPARC_TLS_LDM_HI22: u32 = 60;
2273 #[allow(missing_docs)]
2274 pub const R_SPARC_TLS_LDM_LO10: u32 = 61;
2275 #[allow(missing_docs)]
2276 pub const R_SPARC_TLS_LDM_ADD: u32 = 62;
2277 #[allow(missing_docs)]
2278 pub const R_SPARC_TLS_LDM_CALL: u32 = 63;
2279 #[allow(missing_docs)]
2280 pub const R_SPARC_TLS_LDO_HIX22: u32 = 64;
2281 #[allow(missing_docs)]
2282 pub const R_SPARC_TLS_LDO_LOX10: u32 = 65;
2283 #[allow(missing_docs)]
2284 pub const R_SPARC_TLS_LDO_ADD: u32 = 66;
2285 #[allow(missing_docs)]
2286 pub const R_SPARC_TLS_IE_HI22: u32 = 67;
2287 #[allow(missing_docs)]
2288 pub const R_SPARC_TLS_IE_LO10: u32 = 68;
2289 #[allow(missing_docs)]
2290 pub const R_SPARC_TLS_IE_LD: u32 = 69;
2291 #[allow(missing_docs)]
2292 pub const R_SPARC_TLS_IE_LDX: u32 = 70;
2293 #[allow(missing_docs)]
2294 pub const R_SPARC_TLS_IE_ADD: u32 = 71;
2295 #[allow(missing_docs)]
2296 pub const R_SPARC_TLS_LE_HIX22: u32 = 72;
2297 #[allow(missing_docs)]
2298 pub const R_SPARC_TLS_LE_LOX10: u32 = 73;
2299 #[allow(missing_docs)]
2300 pub const R_SPARC_TLS_DTPMOD32: u32 = 74;
2301 #[allow(missing_docs)]
2302 pub const R_SPARC_TLS_DTPMOD64: u32 = 75;
2303 #[allow(missing_docs)]
2304 pub const R_SPARC_TLS_DTPOFF32: u32 = 76;
2305 #[allow(missing_docs)]
2306 pub const R_SPARC_TLS_DTPOFF64: u32 = 77;
2307 #[allow(missing_docs)]
2308 pub const R_SPARC_TLS_TPOFF32: u32 = 78;
2309 #[allow(missing_docs)]
2310 pub const R_SPARC_TLS_TPOFF64: u32 = 79;
2311 #[allow(missing_docs)]
2312 pub const R_SPARC_GOTDATA_HIX22: u32 = 80;
2313 #[allow(missing_docs)]
2314 pub const R_SPARC_GOTDATA_LOX10: u32 = 81;
2315 #[allow(missing_docs)]
2316 pub const R_SPARC_GOTDATA_OP_HIX22: u32 = 82;
2317 #[allow(missing_docs)]
2318 pub const R_SPARC_GOTDATA_OP_LOX10: u32 = 83;
2319 #[allow(missing_docs)]
2320 pub const R_SPARC_GOTDATA_OP: u32 = 84;
2321 #[allow(missing_docs)]
2322 pub const R_SPARC_H34: u32 = 85;
2323 #[allow(missing_docs)]
2324 pub const R_SPARC_SIZE32: u32 = 86;
2325 #[allow(missing_docs)]
2326 pub const R_SPARC_SIZE64: u32 = 87;
2327 #[allow(missing_docs)]
2328 pub const R_SPARC_WDISP10: u32 = 88;
2329 #[allow(missing_docs)]
2330 pub const R_SPARC_JMP_IREL: u32 = 248;
2331 #[allow(missing_docs)]
2332 pub const R_SPARC_IRELATIVE: u32 = 249;
2333 #[allow(missing_docs)]
2334 pub const R_SPARC_GNU_VTINHERIT: u32 = 250;
2335 #[allow(missing_docs)]
2336 pub const R_SPARC_GNU_VTENTRY: u32 = 251;
2337 #[allow(missing_docs)]
2338 pub const R_SPARC_REV32: u32 = 252;
2339 
2340 // Sparc64 values for `Dyn32::d_tag`.
2341 
2342 #[allow(missing_docs)]
2343 pub const DT_SPARC_REGISTER: u32 = 0x7000_0001;
2344 
2345 // MIPS R3000 specific definitions.
2346 
2347 // MIPS values for `FileHeader32::e_flags`.
2348 
2349 /// A .noreorder directive was used.
2350 pub const EF_MIPS_NOREORDER: u32 = 1;
2351 /// Contains PIC code.
2352 pub const EF_MIPS_PIC: u32 = 2;
2353 /// Uses PIC calling sequence.
2354 pub const EF_MIPS_CPIC: u32 = 4;
2355 #[allow(missing_docs)]
2356 pub const EF_MIPS_XGOT: u32 = 8;
2357 #[allow(missing_docs)]
2358 pub const EF_MIPS_64BIT_WHIRL: u32 = 16;
2359 #[allow(missing_docs)]
2360 pub const EF_MIPS_ABI2: u32 = 32;
2361 #[allow(missing_docs)]
2362 pub const EF_MIPS_ABI_ON32: u32 = 64;
2363 /// Uses FP64 (12 callee-saved).
2364 pub const EF_MIPS_FP64: u32 = 512;
2365 /// Uses IEEE 754-2008 NaN encoding.
2366 pub const EF_MIPS_NAN2008: u32 = 1024;
2367 /// MIPS architecture level.
2368 pub const EF_MIPS_ARCH: u32 = 0xf000_0000;
2369 
2370 // Legal values for MIPS architecture level.
2371 
2372 /// -mips1 code.
2373 pub const EF_MIPS_ARCH_1: u32 = 0x0000_0000;
2374 /// -mips2 code.
2375 pub const EF_MIPS_ARCH_2: u32 = 0x1000_0000;
2376 /// -mips3 code.
2377 pub const EF_MIPS_ARCH_3: u32 = 0x2000_0000;
2378 /// -mips4 code.
2379 pub const EF_MIPS_ARCH_4: u32 = 0x3000_0000;
2380 /// -mips5 code.
2381 pub const EF_MIPS_ARCH_5: u32 = 0x4000_0000;
2382 /// MIPS32 code.
2383 pub const EF_MIPS_ARCH_32: u32 = 0x5000_0000;
2384 /// MIPS64 code.
2385 pub const EF_MIPS_ARCH_64: u32 = 0x6000_0000;
2386 /// MIPS32r2 code.
2387 pub const EF_MIPS_ARCH_32R2: u32 = 0x7000_0000;
2388 /// MIPS64r2 code.
2389 pub const EF_MIPS_ARCH_64R2: u32 = 0x8000_0000;
2390 
2391 // MIPS values for `Sym32::st_shndx`.
2392 
2393 /// Allocated common symbols.
2394 pub const SHN_MIPS_ACOMMON: u16 = 0xff00;
2395 /// Allocated test symbols.
2396 pub const SHN_MIPS_TEXT: u16 = 0xff01;
2397 /// Allocated data symbols.
2398 pub const SHN_MIPS_DATA: u16 = 0xff02;
2399 /// Small common symbols.
2400 pub const SHN_MIPS_SCOMMON: u16 = 0xff03;
2401 /// Small undefined symbols.
2402 pub const SHN_MIPS_SUNDEFINED: u16 = 0xff04;
2403 
2404 // MIPS values for `SectionHeader32::sh_type`.
2405 
2406 /// Shared objects used in link.
2407 pub const SHT_MIPS_LIBLIST: u32 = 0x7000_0000;
2408 #[allow(missing_docs)]
2409 pub const SHT_MIPS_MSYM: u32 = 0x7000_0001;
2410 /// Conflicting symbols.
2411 pub const SHT_MIPS_CONFLICT: u32 = 0x7000_0002;
2412 /// Global data area sizes.
2413 pub const SHT_MIPS_GPTAB: u32 = 0x7000_0003;
2414 /// Reserved for SGI/MIPS compilers
2415 pub const SHT_MIPS_UCODE: u32 = 0x7000_0004;
2416 /// MIPS ECOFF debugging info.
2417 pub const SHT_MIPS_DEBUG: u32 = 0x7000_0005;
2418 /// Register usage information.
2419 pub const SHT_MIPS_REGINFO: u32 = 0x7000_0006;
2420 #[allow(missing_docs)]
2421 pub const SHT_MIPS_PACKAGE: u32 = 0x7000_0007;
2422 #[allow(missing_docs)]
2423 pub const SHT_MIPS_PACKSYM: u32 = 0x7000_0008;
2424 #[allow(missing_docs)]
2425 pub const SHT_MIPS_RELD: u32 = 0x7000_0009;
2426 #[allow(missing_docs)]
2427 pub const SHT_MIPS_IFACE: u32 = 0x7000_000b;
2428 #[allow(missing_docs)]
2429 pub const SHT_MIPS_CONTENT: u32 = 0x7000_000c;
2430 /// Miscellaneous options.
2431 pub const SHT_MIPS_OPTIONS: u32 = 0x7000_000d;
2432 #[allow(missing_docs)]
2433 pub const SHT_MIPS_SHDR: u32 = 0x7000_0010;
2434 #[allow(missing_docs)]
2435 pub const SHT_MIPS_FDESC: u32 = 0x7000_0011;
2436 #[allow(missing_docs)]
2437 pub const SHT_MIPS_EXTSYM: u32 = 0x7000_0012;
2438 #[allow(missing_docs)]
2439 pub const SHT_MIPS_DENSE: u32 = 0x7000_0013;
2440 #[allow(missing_docs)]
2441 pub const SHT_MIPS_PDESC: u32 = 0x7000_0014;
2442 #[allow(missing_docs)]
2443 pub const SHT_MIPS_LOCSYM: u32 = 0x7000_0015;
2444 #[allow(missing_docs)]
2445 pub const SHT_MIPS_AUXSYM: u32 = 0x7000_0016;
2446 #[allow(missing_docs)]
2447 pub const SHT_MIPS_OPTSYM: u32 = 0x7000_0017;
2448 #[allow(missing_docs)]
2449 pub const SHT_MIPS_LOCSTR: u32 = 0x7000_0018;
2450 #[allow(missing_docs)]
2451 pub const SHT_MIPS_LINE: u32 = 0x7000_0019;
2452 #[allow(missing_docs)]
2453 pub const SHT_MIPS_RFDESC: u32 = 0x7000_001a;
2454 #[allow(missing_docs)]
2455 pub const SHT_MIPS_DELTASYM: u32 = 0x7000_001b;
2456 #[allow(missing_docs)]
2457 pub const SHT_MIPS_DELTAINST: u32 = 0x7000_001c;
2458 #[allow(missing_docs)]
2459 pub const SHT_MIPS_DELTACLASS: u32 = 0x7000_001d;
2460 /// DWARF debugging information.
2461 pub const SHT_MIPS_DWARF: u32 = 0x7000_001e;
2462 #[allow(missing_docs)]
2463 pub const SHT_MIPS_DELTADECL: u32 = 0x7000_001f;
2464 #[allow(missing_docs)]
2465 pub const SHT_MIPS_SYMBOL_LIB: u32 = 0x7000_0020;
2466 /// Event section.
2467 pub const SHT_MIPS_EVENTS: u32 = 0x7000_0021;
2468 #[allow(missing_docs)]
2469 pub const SHT_MIPS_TRANSLATE: u32 = 0x7000_0022;
2470 #[allow(missing_docs)]
2471 pub const SHT_MIPS_PIXIE: u32 = 0x7000_0023;
2472 #[allow(missing_docs)]
2473 pub const SHT_MIPS_XLATE: u32 = 0x7000_0024;
2474 #[allow(missing_docs)]
2475 pub const SHT_MIPS_XLATE_DEBUG: u32 = 0x7000_0025;
2476 #[allow(missing_docs)]
2477 pub const SHT_MIPS_WHIRL: u32 = 0x7000_0026;
2478 #[allow(missing_docs)]
2479 pub const SHT_MIPS_EH_REGION: u32 = 0x7000_0027;
2480 #[allow(missing_docs)]
2481 pub const SHT_MIPS_XLATE_OLD: u32 = 0x7000_0028;
2482 #[allow(missing_docs)]
2483 pub const SHT_MIPS_PDR_EXCEPTION: u32 = 0x7000_0029;
2484 
2485 // MIPS values for `SectionHeader32::sh_flags`.
2486 
2487 /// Must be in global data area.
2488 pub const SHF_MIPS_GPREL: u32 = 0x1000_0000;
2489 #[allow(missing_docs)]
2490 pub const SHF_MIPS_MERGE: u32 = 0x2000_0000;
2491 #[allow(missing_docs)]
2492 pub const SHF_MIPS_ADDR: u32 = 0x4000_0000;
2493 #[allow(missing_docs)]
2494 pub const SHF_MIPS_STRINGS: u32 = 0x8000_0000;
2495 #[allow(missing_docs)]
2496 pub const SHF_MIPS_NOSTRIP: u32 = 0x0800_0000;
2497 #[allow(missing_docs)]
2498 pub const SHF_MIPS_LOCAL: u32 = 0x0400_0000;
2499 #[allow(missing_docs)]
2500 pub const SHF_MIPS_NAMES: u32 = 0x0200_0000;
2501 #[allow(missing_docs)]
2502 pub const SHF_MIPS_NODUPE: u32 = 0x0100_0000;
2503 
2504 // MIPS values for `Sym32::st_other`.
2505 
2506 #[allow(missing_docs)]
2507 pub const STO_MIPS_PLT: u8 = 0x8;
2508 /// Only valid for `STB_MIPS_SPLIT_COMMON`.
2509 pub const STO_MIPS_SC_ALIGN_UNUSED: u8 = 0xff;
2510 
2511 // MIPS values for `Sym32::st_info'.
2512 #[allow(missing_docs)]
2513 pub const STB_MIPS_SPLIT_COMMON: u8 = 13;
2514 
2515 // Entries found in sections of type `SHT_MIPS_GPTAB`.
2516 
2517 // TODO: Elf32_gptab, Elf32_RegInfo, Elf_Options
2518 
2519 // Values for `Elf_Options::kind`.
2520 
2521 /// Undefined.
2522 pub const ODK_NULL: u32 = 0;
2523 /// Register usage information.
2524 pub const ODK_REGINFO: u32 = 1;
2525 /// Exception processing options.
2526 pub const ODK_EXCEPTIONS: u32 = 2;
2527 /// Section padding options.
2528 pub const ODK_PAD: u32 = 3;
2529 /// Hardware workarounds performed
2530 pub const ODK_HWPATCH: u32 = 4;
2531 /// record the fill value used by the linker.
2532 pub const ODK_FILL: u32 = 5;
2533 /// reserve space for desktop tools to write.
2534 pub const ODK_TAGS: u32 = 6;
2535 /// HW workarounds.  'AND' bits when merging.
2536 pub const ODK_HWAND: u32 = 7;
2537 /// HW workarounds.  'OR' bits when merging.
2538 pub const ODK_HWOR: u32 = 8;
2539 
2540 // Values for `Elf_Options::info` for `ODK_EXCEPTIONS` entries.
2541 
2542 /// FPE's which MUST be enabled.
2543 pub const OEX_FPU_MIN: u32 = 0x1f;
2544 /// FPE's which MAY be enabled.
2545 pub const OEX_FPU_MAX: u32 = 0x1f00;
2546 /// page zero must be mapped.
2547 pub const OEX_PAGE0: u32 = 0x10000;
2548 /// Force sequential memory mode?
2549 pub const OEX_SMM: u32 = 0x20000;
2550 /// Force floating point debug mode?
2551 pub const OEX_FPDBUG: u32 = 0x40000;
2552 #[allow(missing_docs)]
2553 pub const OEX_PRECISEFP: u32 = OEX_FPDBUG;
2554 /// Dismiss invalid address faults?
2555 pub const OEX_DISMISS: u32 = 0x80000;
2556 
2557 #[allow(missing_docs)]
2558 pub const OEX_FPU_INVAL: u32 = 0x10;
2559 #[allow(missing_docs)]
2560 pub const OEX_FPU_DIV0: u32 = 0x08;
2561 #[allow(missing_docs)]
2562 pub const OEX_FPU_OFLO: u32 = 0x04;
2563 #[allow(missing_docs)]
2564 pub const OEX_FPU_UFLO: u32 = 0x02;
2565 #[allow(missing_docs)]
2566 pub const OEX_FPU_INEX: u32 = 0x01;
2567 
2568 // Masks for `Elf_Options::info` for an `ODK_HWPATCH` entry.  */
2569 /// R4000 end-of-page patch.
2570 pub const OHW_R4KEOP: u32 = 0x1;
2571 /// may need R8000 prefetch patch.
2572 pub const OHW_R8KPFETCH: u32 = 0x2;
2573 /// R5000 end-of-page patch.
2574 pub const OHW_R5KEOP: u32 = 0x4;
2575 /// R5000 cvt.[ds].l bug.  clean=1.
2576 pub const OHW_R5KCVTL: u32 = 0x8;
2577 
2578 #[allow(missing_docs)]
2579 pub const OPAD_PREFIX: u32 = 0x1;
2580 #[allow(missing_docs)]
2581 pub const OPAD_POSTFIX: u32 = 0x2;
2582 #[allow(missing_docs)]
2583 pub const OPAD_SYMBOL: u32 = 0x4;
2584 
2585 // Entries found in sections of type `SHT_MIPS_OPTIONS`.
2586 
2587 // TODO: Elf_Options_Hw
2588 
2589 // Masks for `ElfOptions::info` for `ODK_HWAND` and `ODK_HWOR` entries.
2590 
2591 #[allow(missing_docs)]
2592 pub const OHWA0_R4KEOP_CHECKED: u32 = 0x0000_0001;
2593 #[allow(missing_docs)]
2594 pub const OHWA1_R4KEOP_CLEAN: u32 = 0x0000_0002;
2595 
2596 // MIPS values for `Rel*::r_type`.
2597 
2598 /// No reloc
2599 pub const R_MIPS_NONE: u32 = 0;
2600 /// Direct 16 bit
2601 pub const R_MIPS_16: u32 = 1;
2602 /// Direct 32 bit
2603 pub const R_MIPS_32: u32 = 2;
2604 /// PC relative 32 bit
2605 pub const R_MIPS_REL32: u32 = 3;
2606 /// Direct 26 bit shifted
2607 pub const R_MIPS_26: u32 = 4;
2608 /// High 16 bit
2609 pub const R_MIPS_HI16: u32 = 5;
2610 /// Low 16 bit
2611 pub const R_MIPS_LO16: u32 = 6;
2612 /// GP relative 16 bit
2613 pub const R_MIPS_GPREL16: u32 = 7;
2614 /// 16 bit literal entry
2615 pub const R_MIPS_LITERAL: u32 = 8;
2616 /// 16 bit GOT entry
2617 pub const R_MIPS_GOT16: u32 = 9;
2618 /// PC relative 16 bit
2619 pub const R_MIPS_PC16: u32 = 10;
2620 /// 16 bit GOT entry for function
2621 pub const R_MIPS_CALL16: u32 = 11;
2622 /// GP relative 32 bit
2623 pub const R_MIPS_GPREL32: u32 = 12;
2624 
2625 #[allow(missing_docs)]
2626 pub const R_MIPS_SHIFT5: u32 = 16;
2627 #[allow(missing_docs)]
2628 pub const R_MIPS_SHIFT6: u32 = 17;
2629 #[allow(missing_docs)]
2630 pub const R_MIPS_64: u32 = 18;
2631 #[allow(missing_docs)]
2632 pub const R_MIPS_GOT_DISP: u32 = 19;
2633 #[allow(missing_docs)]
2634 pub const R_MIPS_GOT_PAGE: u32 = 20;
2635 #[allow(missing_docs)]
2636 pub const R_MIPS_GOT_OFST: u32 = 21;
2637 #[allow(missing_docs)]
2638 pub const R_MIPS_GOT_HI16: u32 = 22;
2639 #[allow(missing_docs)]
2640 pub const R_MIPS_GOT_LO16: u32 = 23;
2641 #[allow(missing_docs)]
2642 pub const R_MIPS_SUB: u32 = 24;
2643 #[allow(missing_docs)]
2644 pub const R_MIPS_INSERT_A: u32 = 25;
2645 #[allow(missing_docs)]
2646 pub const R_MIPS_INSERT_B: u32 = 26;
2647 #[allow(missing_docs)]
2648 pub const R_MIPS_DELETE: u32 = 27;
2649 #[allow(missing_docs)]
2650 pub const R_MIPS_HIGHER: u32 = 28;
2651 #[allow(missing_docs)]
2652 pub const R_MIPS_HIGHEST: u32 = 29;
2653 #[allow(missing_docs)]
2654 pub const R_MIPS_CALL_HI16: u32 = 30;
2655 #[allow(missing_docs)]
2656 pub const R_MIPS_CALL_LO16: u32 = 31;
2657 #[allow(missing_docs)]
2658 pub const R_MIPS_SCN_DISP: u32 = 32;
2659 #[allow(missing_docs)]
2660 pub const R_MIPS_REL16: u32 = 33;
2661 #[allow(missing_docs)]
2662 pub const R_MIPS_ADD_IMMEDIATE: u32 = 34;
2663 #[allow(missing_docs)]
2664 pub const R_MIPS_PJUMP: u32 = 35;
2665 #[allow(missing_docs)]
2666 pub const R_MIPS_RELGOT: u32 = 36;
2667 #[allow(missing_docs)]
2668 pub const R_MIPS_JALR: u32 = 37;
2669 /// Module number 32 bit
2670 pub const R_MIPS_TLS_DTPMOD32: u32 = 38;
2671 /// Module-relative offset 32 bit
2672 pub const R_MIPS_TLS_DTPREL32: u32 = 39;
2673 /// Module number 64 bit
2674 pub const R_MIPS_TLS_DTPMOD64: u32 = 40;
2675 /// Module-relative offset 64 bit
2676 pub const R_MIPS_TLS_DTPREL64: u32 = 41;
2677 /// 16 bit GOT offset for GD
2678 pub const R_MIPS_TLS_GD: u32 = 42;
2679 /// 16 bit GOT offset for LDM
2680 pub const R_MIPS_TLS_LDM: u32 = 43;
2681 /// Module-relative offset, high 16 bits
2682 pub const R_MIPS_TLS_DTPREL_HI16: u32 = 44;
2683 /// Module-relative offset, low 16 bits
2684 pub const R_MIPS_TLS_DTPREL_LO16: u32 = 45;
2685 /// 16 bit GOT offset for IE
2686 pub const R_MIPS_TLS_GOTTPREL: u32 = 46;
2687 /// TP-relative offset, 32 bit
2688 pub const R_MIPS_TLS_TPREL32: u32 = 47;
2689 /// TP-relative offset, 64 bit
2690 pub const R_MIPS_TLS_TPREL64: u32 = 48;
2691 /// TP-relative offset, high 16 bits
2692 pub const R_MIPS_TLS_TPREL_HI16: u32 = 49;
2693 /// TP-relative offset, low 16 bits
2694 pub const R_MIPS_TLS_TPREL_LO16: u32 = 50;
2695 #[allow(missing_docs)]
2696 pub const R_MIPS_GLOB_DAT: u32 = 51;
2697 #[allow(missing_docs)]
2698 pub const R_MIPS_COPY: u32 = 126;
2699 #[allow(missing_docs)]
2700 pub const R_MIPS_JUMP_SLOT: u32 = 127;
2701 
2702 // MIPS values for `ProgramHeader32::p_type`.
2703 
2704 /// Register usage information.
2705 pub const PT_MIPS_REGINFO: u32 = 0x7000_0000;
2706 /// Runtime procedure table.
2707 pub const PT_MIPS_RTPROC: u32 = 0x7000_0001;
2708 #[allow(missing_docs)]
2709 pub const PT_MIPS_OPTIONS: u32 = 0x7000_0002;
2710 /// FP mode requirement.
2711 pub const PT_MIPS_ABIFLAGS: u32 = 0x7000_0003;
2712 
2713 // MIPS values for `ProgramHeader32::p_flags`.
2714 
2715 #[allow(missing_docs)]
2716 pub const PF_MIPS_LOCAL: u32 = 0x1000_0000;
2717 
2718 // MIPS values for `Dyn32::d_tag`.
2719 
2720 /// Runtime linker interface version
2721 pub const DT_MIPS_RLD_VERSION: u32 = 0x7000_0001;
2722 /// Timestamp
2723 pub const DT_MIPS_TIME_STAMP: u32 = 0x7000_0002;
2724 /// Checksum
2725 pub const DT_MIPS_ICHECKSUM: u32 = 0x7000_0003;
2726 /// Version string (string tbl index)
2727 pub const DT_MIPS_IVERSION: u32 = 0x7000_0004;
2728 /// Flags
2729 pub const DT_MIPS_FLAGS: u32 = 0x7000_0005;
2730 /// Base address
2731 pub const DT_MIPS_BASE_ADDRESS: u32 = 0x7000_0006;
2732 #[allow(missing_docs)]
2733 pub const DT_MIPS_MSYM: u32 = 0x7000_0007;
2734 /// Address of CONFLICT section
2735 pub const DT_MIPS_CONFLICT: u32 = 0x7000_0008;
2736 /// Address of LIBLIST section
2737 pub const DT_MIPS_LIBLIST: u32 = 0x7000_0009;
2738 /// Number of local GOT entries
2739 pub const DT_MIPS_LOCAL_GOTNO: u32 = 0x7000_000a;
2740 /// Number of CONFLICT entries
2741 pub const DT_MIPS_CONFLICTNO: u32 = 0x7000_000b;
2742 /// Number of LIBLIST entries
2743 pub const DT_MIPS_LIBLISTNO: u32 = 0x7000_0010;
2744 /// Number of DYNSYM entries
2745 pub const DT_MIPS_SYMTABNO: u32 = 0x7000_0011;
2746 /// First external DYNSYM
2747 pub const DT_MIPS_UNREFEXTNO: u32 = 0x7000_0012;
2748 /// First GOT entry in DYNSYM
2749 pub const DT_MIPS_GOTSYM: u32 = 0x7000_0013;
2750 /// Number of GOT page table entries
2751 pub const DT_MIPS_HIPAGENO: u32 = 0x7000_0014;
2752 /// Address of run time loader map.
2753 pub const DT_MIPS_RLD_MAP: u32 = 0x7000_0016;
2754 /// Delta C++ class definition.
2755 pub const DT_MIPS_DELTA_CLASS: u32 = 0x7000_0017;
2756 /// Number of entries in DT_MIPS_DELTA_CLASS.
2757 pub const DT_MIPS_DELTA_CLASS_NO: u32 = 0x7000_0018;
2758 /// Delta C++ class instances.
2759 pub const DT_MIPS_DELTA_INSTANCE: u32 = 0x7000_0019;
2760 /// Number of entries in DT_MIPS_DELTA_INSTANCE.
2761 pub const DT_MIPS_DELTA_INSTANCE_NO: u32 = 0x7000_001a;
2762 /// Delta relocations.
2763 pub const DT_MIPS_DELTA_RELOC: u32 = 0x7000_001b;
2764 /// Number of entries in DT_MIPS_DELTA_RELOC.
2765 pub const DT_MIPS_DELTA_RELOC_NO: u32 = 0x7000_001c;
2766 /// Delta symbols that Delta relocations refer to.
2767 pub const DT_MIPS_DELTA_SYM: u32 = 0x7000_001d;
2768 /// Number of entries in DT_MIPS_DELTA_SYM.
2769 pub const DT_MIPS_DELTA_SYM_NO: u32 = 0x7000_001e;
2770 /// Delta symbols that hold the class declaration.
2771 pub const DT_MIPS_DELTA_CLASSSYM: u32 = 0x7000_0020;
2772 /// Number of entries in DT_MIPS_DELTA_CLASSSYM.
2773 pub const DT_MIPS_DELTA_CLASSSYM_NO: u32 = 0x7000_0021;
2774 /// Flags indicating for C++ flavor.
2775 pub const DT_MIPS_CXX_FLAGS: u32 = 0x7000_0022;
2776 #[allow(missing_docs)]
2777 pub const DT_MIPS_PIXIE_INIT: u32 = 0x7000_0023;
2778 #[allow(missing_docs)]
2779 pub const DT_MIPS_SYMBOL_LIB: u32 = 0x7000_0024;
2780 #[allow(missing_docs)]
2781 pub const DT_MIPS_LOCALPAGE_GOTIDX: u32 = 0x7000_0025;
2782 #[allow(missing_docs)]
2783 pub const DT_MIPS_LOCAL_GOTIDX: u32 = 0x7000_0026;
2784 #[allow(missing_docs)]
2785 pub const DT_MIPS_HIDDEN_GOTIDX: u32 = 0x7000_0027;
2786 #[allow(missing_docs)]
2787 pub const DT_MIPS_PROTECTED_GOTIDX: u32 = 0x7000_0028;
2788 /// Address of .options.
2789 pub const DT_MIPS_OPTIONS: u32 = 0x7000_0029;
2790 /// Address of .interface.
2791 pub const DT_MIPS_INTERFACE: u32 = 0x7000_002a;
2792 #[allow(missing_docs)]
2793 pub const DT_MIPS_DYNSTR_ALIGN: u32 = 0x7000_002b;
2794 /// Size of the .interface section.
2795 pub const DT_MIPS_INTERFACE_SIZE: u32 = 0x7000_002c;
2796 /// Address of rld_text_rsolve function stored in GOT.
2797 pub const DT_MIPS_RLD_TEXT_RESOLVE_ADDR: u32 = 0x7000_002d;
2798 /// Default suffix of dso to be added by rld on dlopen() calls.
2799 pub const DT_MIPS_PERF_SUFFIX: u32 = 0x7000_002e;
2800 /// (O32)Size of compact rel section.
2801 pub const DT_MIPS_COMPACT_SIZE: u32 = 0x7000_002f;
2802 /// GP value for aux GOTs.
2803 pub const DT_MIPS_GP_VALUE: u32 = 0x7000_0030;
2804 /// Address of aux .dynamic.
2805 pub const DT_MIPS_AUX_DYNAMIC: u32 = 0x7000_0031;
2806 /// The address of .got.plt in an executable using the new non-PIC ABI.
2807 pub const DT_MIPS_PLTGOT: u32 = 0x7000_0032;
2808 /// The base of the PLT in an executable using the new non-PIC ABI if that PLT is writable.  For a non-writable PLT, this is omitted or has a zero value.
2809 pub const DT_MIPS_RWPLT: u32 = 0x7000_0034;
2810 /// An alternative description of the classic MIPS RLD_MAP that is usable in a PIE as it stores a relative offset from the address of the tag rather than an absolute address.
2811 pub const DT_MIPS_RLD_MAP_REL: u32 = 0x7000_0035;
2812 
2813 // Values for `DT_MIPS_FLAGS` `Dyn32` entry.
2814 
2815 /// No flags
2816 pub const RHF_NONE: u32 = 0;
2817 /// Use quickstart
2818 pub const RHF_QUICKSTART: u32 = 1 << 0;
2819 /// Hash size not power of 2
2820 pub const RHF_NOTPOT: u32 = 1 << 1;
2821 /// Ignore LD_LIBRARY_PATH
2822 pub const RHF_NO_LIBRARY_REPLACEMENT: u32 = 1 << 2;
2823 #[allow(missing_docs)]
2824 pub const RHF_NO_MOVE: u32 = 1 << 3;
2825 #[allow(missing_docs)]
2826 pub const RHF_SGI_ONLY: u32 = 1 << 4;
2827 #[allow(missing_docs)]
2828 pub const RHF_GUARANTEE_INIT: u32 = 1 << 5;
2829 #[allow(missing_docs)]
2830 pub const RHF_DELTA_C_PLUS_PLUS: u32 = 1 << 6;
2831 #[allow(missing_docs)]
2832 pub const RHF_GUARANTEE_START_INIT: u32 = 1 << 7;
2833 #[allow(missing_docs)]
2834 pub const RHF_PIXIE: u32 = 1 << 8;
2835 #[allow(missing_docs)]
2836 pub const RHF_DEFAULT_DELAY_LOAD: u32 = 1 << 9;
2837 #[allow(missing_docs)]
2838 pub const RHF_REQUICKSTART: u32 = 1 << 10;
2839 #[allow(missing_docs)]
2840 pub const RHF_REQUICKSTARTED: u32 = 1 << 11;
2841 #[allow(missing_docs)]
2842 pub const RHF_CORD: u32 = 1 << 12;
2843 #[allow(missing_docs)]
2844 pub const RHF_NO_UNRES_UNDEF: u32 = 1 << 13;
2845 #[allow(missing_docs)]
2846 pub const RHF_RLD_ORDER_SAFE: u32 = 1 << 14;
2847 
2848 // Entries found in sections of type `SHT_MIPS_LIBLIST`.
2849 
2850 // TODO: Elf32_Lib, Elf64_Lib
2851 
2852 // Values for `Lib*::l_flags`.
2853 
2854 #[allow(missing_docs)]
2855 pub const LL_NONE: u32 = 0;
2856 /// Require exact match
2857 pub const LL_EXACT_MATCH: u32 = 1 << 0;
2858 /// Ignore interface version
2859 pub const LL_IGNORE_INT_VER: u32 = 1 << 1;
2860 #[allow(missing_docs)]
2861 pub const LL_REQUIRE_MINOR: u32 = 1 << 2;
2862 #[allow(missing_docs)]
2863 pub const LL_EXPORTS: u32 = 1 << 3;
2864 #[allow(missing_docs)]
2865 pub const LL_DELAY_LOAD: u32 = 1 << 4;
2866 #[allow(missing_docs)]
2867 pub const LL_DELTA: u32 = 1 << 5;
2868 
2869 // TODO: MIPS ABI flags
2870 
2871 // PA-RISC specific definitions.
2872 
2873 // PA-RISC values for `FileHeader32::e_flags`.
2874 
2875 /// Trap nil pointer dereference.
2876 pub const EF_PARISC_TRAPNIL: u32 = 0x0001_0000;
2877 /// Program uses arch. extensions.
2878 pub const EF_PARISC_EXT: u32 = 0x0002_0000;
2879 /// Program expects little endian.
2880 pub const EF_PARISC_LSB: u32 = 0x0004_0000;
2881 /// Program expects wide mode.
2882 pub const EF_PARISC_WIDE: u32 = 0x0008_0000;
2883 /// No kernel assisted branch prediction.
2884 pub const EF_PARISC_NO_KABP: u32 = 0x0010_0000;
2885 /// Allow lazy swapping.
2886 pub const EF_PARISC_LAZYSWAP: u32 = 0x0040_0000;
2887 /// Architecture version.
2888 pub const EF_PARISC_ARCH: u32 = 0x0000_ffff;
2889 
2890 // Values for `EF_PARISC_ARCH'.
2891 
2892 /// PA-RISC 1.0 big-endian.
2893 pub const EFA_PARISC_1_0: u32 = 0x020b;
2894 /// PA-RISC 1.1 big-endian.
2895 pub const EFA_PARISC_1_1: u32 = 0x0210;
2896 /// PA-RISC 2.0 big-endian.
2897 pub const EFA_PARISC_2_0: u32 = 0x0214;
2898 
2899 // PA-RISC values for `Sym*::st_shndx`.
2900 
2901 /// Section for tenatively declared symbols in ANSI C.
2902 pub const SHN_PARISC_ANSI_COMMON: u16 = 0xff00;
2903 /// Common blocks in huge model.
2904 pub const SHN_PARISC_HUGE_COMMON: u16 = 0xff01;
2905 
2906 // PA-RISC values for `SectionHeader32::sh_type`.
2907 
2908 /// Contains product specific ext.
2909 pub const SHT_PARISC_EXT: u32 = 0x7000_0000;
2910 /// Unwind information.
2911 pub const SHT_PARISC_UNWIND: u32 = 0x7000_0001;
2912 /// Debug info for optimized code.
2913 pub const SHT_PARISC_DOC: u32 = 0x7000_0002;
2914 
2915 // PA-RISC values for `SectionHeader32::sh_flags`.
2916 
2917 /// Section with short addressing.
2918 pub const SHF_PARISC_SHORT: u32 = 0x2000_0000;
2919 /// Section far from gp.
2920 pub const SHF_PARISC_HUGE: u32 = 0x4000_0000;
2921 /// Static branch prediction code.
2922 pub const SHF_PARISC_SBP: u32 = 0x8000_0000;
2923 
2924 // PA-RISC values for `st_type` component of `Sym32::st_info`.
2925 
2926 /// Millicode function entry point.
2927 pub const STT_PARISC_MILLICODE: u8 = 13;
2928 
2929 #[allow(missing_docs)]
2930 pub const STT_HP_OPAQUE: u8 = STT_LOOS + 0x1;
2931 #[allow(missing_docs)]
2932 pub const STT_HP_STUB: u8 = STT_LOOS + 0x2;
2933 
2934 // PA-RISC values for `Rel*::r_type`.
2935 
2936 /// No reloc.
2937 pub const R_PARISC_NONE: u32 = 0;
2938 /// Direct 32-bit reference.
2939 pub const R_PARISC_DIR32: u32 = 1;
2940 /// Left 21 bits of eff. address.
2941 pub const R_PARISC_DIR21L: u32 = 2;
2942 /// Right 17 bits of eff. address.
2943 pub const R_PARISC_DIR17R: u32 = 3;
2944 /// 17 bits of eff. address.
2945 pub const R_PARISC_DIR17F: u32 = 4;
2946 /// Right 14 bits of eff. address.
2947 pub const R_PARISC_DIR14R: u32 = 6;
2948 /// 32-bit rel. address.
2949 pub const R_PARISC_PCREL32: u32 = 9;
2950 /// Left 21 bits of rel. address.
2951 pub const R_PARISC_PCREL21L: u32 = 10;
2952 /// Right 17 bits of rel. address.
2953 pub const R_PARISC_PCREL17R: u32 = 11;
2954 /// 17 bits of rel. address.
2955 pub const R_PARISC_PCREL17F: u32 = 12;
2956 /// Right 14 bits of rel. address.
2957 pub const R_PARISC_PCREL14R: u32 = 14;
2958 /// Left 21 bits of rel. address.
2959 pub const R_PARISC_DPREL21L: u32 = 18;
2960 /// Right 14 bits of rel. address.
2961 pub const R_PARISC_DPREL14R: u32 = 22;
2962 /// GP-relative, left 21 bits.
2963 pub const R_PARISC_GPREL21L: u32 = 26;
2964 /// GP-relative, right 14 bits.
2965 pub const R_PARISC_GPREL14R: u32 = 30;
2966 /// LT-relative, left 21 bits.
2967 pub const R_PARISC_LTOFF21L: u32 = 34;
2968 /// LT-relative, right 14 bits.
2969 pub const R_PARISC_LTOFF14R: u32 = 38;
2970 /// 32 bits section rel. address.
2971 pub const R_PARISC_SECREL32: u32 = 41;
2972 /// No relocation, set segment base.
2973 pub const R_PARISC_SEGBASE: u32 = 48;
2974 /// 32 bits segment rel. address.
2975 pub const R_PARISC_SEGREL32: u32 = 49;
2976 /// PLT rel. address, left 21 bits.
2977 pub const R_PARISC_PLTOFF21L: u32 = 50;
2978 /// PLT rel. address, right 14 bits.
2979 pub const R_PARISC_PLTOFF14R: u32 = 54;
2980 /// 32 bits LT-rel. function pointer.
2981 pub const R_PARISC_LTOFF_FPTR32: u32 = 57;
2982 /// LT-rel. fct ptr, left 21 bits.
2983 pub const R_PARISC_LTOFF_FPTR21L: u32 = 58;
2984 /// LT-rel. fct ptr, right 14 bits.
2985 pub const R_PARISC_LTOFF_FPTR14R: u32 = 62;
2986 /// 64 bits function address.
2987 pub const R_PARISC_FPTR64: u32 = 64;
2988 /// 32 bits function address.
2989 pub const R_PARISC_PLABEL32: u32 = 65;
2990 /// Left 21 bits of fdesc address.
2991 pub const R_PARISC_PLABEL21L: u32 = 66;
2992 /// Right 14 bits of fdesc address.
2993 pub const R_PARISC_PLABEL14R: u32 = 70;
2994 /// 64 bits PC-rel. address.
2995 pub const R_PARISC_PCREL64: u32 = 72;
2996 /// 22 bits PC-rel. address.
2997 pub const R_PARISC_PCREL22F: u32 = 74;
2998 /// PC-rel. address, right 14 bits.
2999 pub const R_PARISC_PCREL14WR: u32 = 75;
3000 /// PC rel. address, right 14 bits.
3001 pub const R_PARISC_PCREL14DR: u32 = 76;
3002 /// 16 bits PC-rel. address.
3003 pub const R_PARISC_PCREL16F: u32 = 77;
3004 /// 16 bits PC-rel. address.
3005 pub const R_PARISC_PCREL16WF: u32 = 78;
3006 /// 16 bits PC-rel. address.
3007 pub const R_PARISC_PCREL16DF: u32 = 79;
3008 /// 64 bits of eff. address.
3009 pub const R_PARISC_DIR64: u32 = 80;
3010 /// 14 bits of eff. address.
3011 pub const R_PARISC_DIR14WR: u32 = 83;
3012 /// 14 bits of eff. address.
3013 pub const R_PARISC_DIR14DR: u32 = 84;
3014 /// 16 bits of eff. address.
3015 pub const R_PARISC_DIR16F: u32 = 85;
3016 /// 16 bits of eff. address.
3017 pub const R_PARISC_DIR16WF: u32 = 86;
3018 /// 16 bits of eff. address.
3019 pub const R_PARISC_DIR16DF: u32 = 87;
3020 /// 64 bits of GP-rel. address.
3021 pub const R_PARISC_GPREL64: u32 = 88;
3022 /// GP-rel. address, right 14 bits.
3023 pub const R_PARISC_GPREL14WR: u32 = 91;
3024 /// GP-rel. address, right 14 bits.
3025 pub const R_PARISC_GPREL14DR: u32 = 92;
3026 /// 16 bits GP-rel. address.
3027 pub const R_PARISC_GPREL16F: u32 = 93;
3028 /// 16 bits GP-rel. address.
3029 pub const R_PARISC_GPREL16WF: u32 = 94;
3030 /// 16 bits GP-rel. address.
3031 pub const R_PARISC_GPREL16DF: u32 = 95;
3032 /// 64 bits LT-rel. address.
3033 pub const R_PARISC_LTOFF64: u32 = 96;
3034 /// LT-rel. address, right 14 bits.
3035 pub const R_PARISC_LTOFF14WR: u32 = 99;
3036 /// LT-rel. address, right 14 bits.
3037 pub const R_PARISC_LTOFF14DR: u32 = 100;
3038 /// 16 bits LT-rel. address.
3039 pub const R_PARISC_LTOFF16F: u32 = 101;
3040 /// 16 bits LT-rel. address.
3041 pub const R_PARISC_LTOFF16WF: u32 = 102;
3042 /// 16 bits LT-rel. address.
3043 pub const R_PARISC_LTOFF16DF: u32 = 103;
3044 /// 64 bits section rel. address.
3045 pub const R_PARISC_SECREL64: u32 = 104;
3046 /// 64 bits segment rel. address.
3047 pub const R_PARISC_SEGREL64: u32 = 112;
3048 /// PLT-rel. address, right 14 bits.
3049 pub const R_PARISC_PLTOFF14WR: u32 = 115;
3050 /// PLT-rel. address, right 14 bits.
3051 pub const R_PARISC_PLTOFF14DR: u32 = 116;
3052 /// 16 bits LT-rel. address.
3053 pub const R_PARISC_PLTOFF16F: u32 = 117;
3054 /// 16 bits PLT-rel. address.
3055 pub const R_PARISC_PLTOFF16WF: u32 = 118;
3056 /// 16 bits PLT-rel. address.
3057 pub const R_PARISC_PLTOFF16DF: u32 = 119;
3058 /// 64 bits LT-rel. function ptr.
3059 pub const R_PARISC_LTOFF_FPTR64: u32 = 120;
3060 /// LT-rel. fct. ptr., right 14 bits.
3061 pub const R_PARISC_LTOFF_FPTR14WR: u32 = 123;
3062 /// LT-rel. fct. ptr., right 14 bits.
3063 pub const R_PARISC_LTOFF_FPTR14DR: u32 = 124;
3064 /// 16 bits LT-rel. function ptr.
3065 pub const R_PARISC_LTOFF_FPTR16F: u32 = 125;
3066 /// 16 bits LT-rel. function ptr.
3067 pub const R_PARISC_LTOFF_FPTR16WF: u32 = 126;
3068 /// 16 bits LT-rel. function ptr.
3069 pub const R_PARISC_LTOFF_FPTR16DF: u32 = 127;
3070 #[allow(missing_docs)]
3071 pub const R_PARISC_LORESERVE: u32 = 128;
3072 /// Copy relocation.
3073 pub const R_PARISC_COPY: u32 = 128;
3074 /// Dynamic reloc, imported PLT
3075 pub const R_PARISC_IPLT: u32 = 129;
3076 /// Dynamic reloc, exported PLT
3077 pub const R_PARISC_EPLT: u32 = 130;
3078 /// 32 bits TP-rel. address.
3079 pub const R_PARISC_TPREL32: u32 = 153;
3080 /// TP-rel. address, left 21 bits.
3081 pub const R_PARISC_TPREL21L: u32 = 154;
3082 /// TP-rel. address, right 14 bits.
3083 pub const R_PARISC_TPREL14R: u32 = 158;
3084 /// LT-TP-rel. address, left 21 bits.
3085 pub const R_PARISC_LTOFF_TP21L: u32 = 162;
3086 /// LT-TP-rel. address, right 14 bits.
3087 pub const R_PARISC_LTOFF_TP14R: u32 = 166;
3088 /// 14 bits LT-TP-rel. address.
3089 pub const R_PARISC_LTOFF_TP14F: u32 = 167;
3090 /// 64 bits TP-rel. address.
3091 pub const R_PARISC_TPREL64: u32 = 216;
3092 /// TP-rel. address, right 14 bits.
3093 pub const R_PARISC_TPREL14WR: u32 = 219;
3094 /// TP-rel. address, right 14 bits.
3095 pub const R_PARISC_TPREL14DR: u32 = 220;
3096 /// 16 bits TP-rel. address.
3097 pub const R_PARISC_TPREL16F: u32 = 221;
3098 /// 16 bits TP-rel. address.
3099 pub const R_PARISC_TPREL16WF: u32 = 222;
3100 /// 16 bits TP-rel. address.
3101 pub const R_PARISC_TPREL16DF: u32 = 223;
3102 /// 64 bits LT-TP-rel. address.
3103 pub const R_PARISC_LTOFF_TP64: u32 = 224;
3104 /// LT-TP-rel. address, right 14 bits.
3105 pub const R_PARISC_LTOFF_TP14WR: u32 = 227;
3106 /// LT-TP-rel. address, right 14 bits.
3107 pub const R_PARISC_LTOFF_TP14DR: u32 = 228;
3108 /// 16 bits LT-TP-rel. address.
3109 pub const R_PARISC_LTOFF_TP16F: u32 = 229;
3110 /// 16 bits LT-TP-rel. address.
3111 pub const R_PARISC_LTOFF_TP16WF: u32 = 230;
3112 /// 16 bits LT-TP-rel. address.
3113 pub const R_PARISC_LTOFF_TP16DF: u32 = 231;
3114 #[allow(missing_docs)]
3115 pub const R_PARISC_GNU_VTENTRY: u32 = 232;
3116 #[allow(missing_docs)]
3117 pub const R_PARISC_GNU_VTINHERIT: u32 = 233;
3118 /// GD 21-bit left.
3119 pub const R_PARISC_TLS_GD21L: u32 = 234;
3120 /// GD 14-bit right.
3121 pub const R_PARISC_TLS_GD14R: u32 = 235;
3122 /// GD call to __t_g_a.
3123 pub const R_PARISC_TLS_GDCALL: u32 = 236;
3124 /// LD module 21-bit left.
3125 pub const R_PARISC_TLS_LDM21L: u32 = 237;
3126 /// LD module 14-bit right.
3127 pub const R_PARISC_TLS_LDM14R: u32 = 238;
3128 /// LD module call to __t_g_a.
3129 pub const R_PARISC_TLS_LDMCALL: u32 = 239;
3130 /// LD offset 21-bit left.
3131 pub const R_PARISC_TLS_LDO21L: u32 = 240;
3132 /// LD offset 14-bit right.
3133 pub const R_PARISC_TLS_LDO14R: u32 = 241;
3134 /// DTP module 32-bit.
3135 pub const R_PARISC_TLS_DTPMOD32: u32 = 242;
3136 /// DTP module 64-bit.
3137 pub const R_PARISC_TLS_DTPMOD64: u32 = 243;
3138 /// DTP offset 32-bit.
3139 pub const R_PARISC_TLS_DTPOFF32: u32 = 244;
3140 /// DTP offset 32-bit.
3141 pub const R_PARISC_TLS_DTPOFF64: u32 = 245;
3142 #[allow(missing_docs)]
3143 pub const R_PARISC_TLS_LE21L: u32 = R_PARISC_TPREL21L;
3144 #[allow(missing_docs)]
3145 pub const R_PARISC_TLS_LE14R: u32 = R_PARISC_TPREL14R;
3146 #[allow(missing_docs)]
3147 pub const R_PARISC_TLS_IE21L: u32 = R_PARISC_LTOFF_TP21L;
3148 #[allow(missing_docs)]
3149 pub const R_PARISC_TLS_IE14R: u32 = R_PARISC_LTOFF_TP14R;
3150 #[allow(missing_docs)]
3151 pub const R_PARISC_TLS_TPREL32: u32 = R_PARISC_TPREL32;
3152 #[allow(missing_docs)]
3153 pub const R_PARISC_TLS_TPREL64: u32 = R_PARISC_TPREL64;
3154 #[allow(missing_docs)]
3155 pub const R_PARISC_HIRESERVE: u32 = 255;
3156 
3157 // PA-RISC values for `ProgramHeader*::p_type`.
3158 
3159 #[allow(missing_docs)]
3160 pub const PT_HP_TLS: u32 = PT_LOOS + 0x0;
3161 #[allow(missing_docs)]
3162 pub const PT_HP_CORE_NONE: u32 = PT_LOOS + 0x1;
3163 #[allow(missing_docs)]
3164 pub const PT_HP_CORE_VERSION: u32 = PT_LOOS + 0x2;
3165 #[allow(missing_docs)]
3166 pub const PT_HP_CORE_KERNEL: u32 = PT_LOOS + 0x3;
3167 #[allow(missing_docs)]
3168 pub const PT_HP_CORE_COMM: u32 = PT_LOOS + 0x4;
3169 #[allow(missing_docs)]
3170 pub const PT_HP_CORE_PROC: u32 = PT_LOOS + 0x5;
3171 #[allow(missing_docs)]
3172 pub const PT_HP_CORE_LOADABLE: u32 = PT_LOOS + 0x6;
3173 #[allow(missing_docs)]
3174 pub const PT_HP_CORE_STACK: u32 = PT_LOOS + 0x7;
3175 #[allow(missing_docs)]
3176 pub const PT_HP_CORE_SHM: u32 = PT_LOOS + 0x8;
3177 #[allow(missing_docs)]
3178 pub const PT_HP_CORE_MMF: u32 = PT_LOOS + 0x9;
3179 #[allow(missing_docs)]
3180 pub const PT_HP_PARALLEL: u32 = PT_LOOS + 0x10;
3181 #[allow(missing_docs)]
3182 pub const PT_HP_FASTBIND: u32 = PT_LOOS + 0x11;
3183 #[allow(missing_docs)]
3184 pub const PT_HP_OPT_ANNOT: u32 = PT_LOOS + 0x12;
3185 #[allow(missing_docs)]
3186 pub const PT_HP_HSL_ANNOT: u32 = PT_LOOS + 0x13;
3187 #[allow(missing_docs)]
3188 pub const PT_HP_STACK: u32 = PT_LOOS + 0x14;
3189 
3190 #[allow(missing_docs)]
3191 pub const PT_PARISC_ARCHEXT: u32 = 0x7000_0000;
3192 #[allow(missing_docs)]
3193 pub const PT_PARISC_UNWIND: u32 = 0x7000_0001;
3194 
3195 // PA-RISC values for `ProgramHeader*::p_flags`.
3196 
3197 #[allow(missing_docs)]
3198 pub const PF_PARISC_SBP: u32 = 0x0800_0000;
3199 
3200 #[allow(missing_docs)]
3201 pub const PF_HP_PAGE_SIZE: u32 = 0x0010_0000;
3202 #[allow(missing_docs)]
3203 pub const PF_HP_FAR_SHARED: u32 = 0x0020_0000;
3204 #[allow(missing_docs)]
3205 pub const PF_HP_NEAR_SHARED: u32 = 0x0040_0000;
3206 #[allow(missing_docs)]
3207 pub const PF_HP_CODE: u32 = 0x0100_0000;
3208 #[allow(missing_docs)]
3209 pub const PF_HP_MODIFY: u32 = 0x0200_0000;
3210 #[allow(missing_docs)]
3211 pub const PF_HP_LAZYSWAP: u32 = 0x0400_0000;
3212 #[allow(missing_docs)]
3213 pub const PF_HP_SBP: u32 = 0x0800_0000;
3214 
3215 // Alpha specific definitions.
3216 
3217 // Alpha values for `FileHeader64::e_flags`.
3218 
3219 /// All addresses must be < 2GB.
3220 pub const EF_ALPHA_32BIT: u32 = 1;
3221 /// Relocations for relaxing exist.
3222 pub const EF_ALPHA_CANRELAX: u32 = 2;
3223 
3224 // Alpha values for `SectionHeader64::sh_type`.
3225 
3226 // These two are primerily concerned with ECOFF debugging info.
3227 #[allow(missing_docs)]
3228 pub const SHT_ALPHA_DEBUG: u32 = 0x7000_0001;
3229 #[allow(missing_docs)]
3230 pub const SHT_ALPHA_REGINFO: u32 = 0x7000_0002;
3231 
3232 // Alpha values for `SectionHeader64::sh_flags`.
3233 
3234 #[allow(missing_docs)]
3235 pub const SHF_ALPHA_GPREL: u32 = 0x1000_0000;
3236 
3237 // Alpha values for `Sym64::st_other`.
3238 /// No PV required.
3239 pub const STO_ALPHA_NOPV: u8 = 0x80;
3240 /// PV only used for initial ldgp.
3241 pub const STO_ALPHA_STD_GPLOAD: u8 = 0x88;
3242 
3243 // Alpha values for `Rel64::r_type`.
3244 
3245 /// No reloc
3246 pub const R_ALPHA_NONE: u32 = 0;
3247 /// Direct 32 bit
3248 pub const R_ALPHA_REFLONG: u32 = 1;
3249 /// Direct 64 bit
3250 pub const R_ALPHA_REFQUAD: u32 = 2;
3251 /// GP relative 32 bit
3252 pub const R_ALPHA_GPREL32: u32 = 3;
3253 /// GP relative 16 bit w/optimization
3254 pub const R_ALPHA_LITERAL: u32 = 4;
3255 /// Optimization hint for LITERAL
3256 pub const R_ALPHA_LITUSE: u32 = 5;
3257 /// Add displacement to GP
3258 pub const R_ALPHA_GPDISP: u32 = 6;
3259 /// PC+4 relative 23 bit shifted
3260 pub const R_ALPHA_BRADDR: u32 = 7;
3261 /// PC+4 relative 16 bit shifted
3262 pub const R_ALPHA_HINT: u32 = 8;
3263 /// PC relative 16 bit
3264 pub const R_ALPHA_SREL16: u32 = 9;
3265 /// PC relative 32 bit
3266 pub const R_ALPHA_SREL32: u32 = 10;
3267 /// PC relative 64 bit
3268 pub const R_ALPHA_SREL64: u32 = 11;
3269 /// GP relative 32 bit, high 16 bits
3270 pub const R_ALPHA_GPRELHIGH: u32 = 17;
3271 /// GP relative 32 bit, low 16 bits
3272 pub const R_ALPHA_GPRELLOW: u32 = 18;
3273 /// GP relative 16 bit
3274 pub const R_ALPHA_GPREL16: u32 = 19;
3275 /// Copy symbol at runtime
3276 pub const R_ALPHA_COPY: u32 = 24;
3277 /// Create GOT entry
3278 pub const R_ALPHA_GLOB_DAT: u32 = 25;
3279 /// Create PLT entry
3280 pub const R_ALPHA_JMP_SLOT: u32 = 26;
3281 /// Adjust by program base
3282 pub const R_ALPHA_RELATIVE: u32 = 27;
3283 #[allow(missing_docs)]
3284 pub const R_ALPHA_TLS_GD_HI: u32 = 28;
3285 #[allow(missing_docs)]
3286 pub const R_ALPHA_TLSGD: u32 = 29;
3287 #[allow(missing_docs)]
3288 pub const R_ALPHA_TLS_LDM: u32 = 30;
3289 #[allow(missing_docs)]
3290 pub const R_ALPHA_DTPMOD64: u32 = 31;
3291 #[allow(missing_docs)]
3292 pub const R_ALPHA_GOTDTPREL: u32 = 32;
3293 #[allow(missing_docs)]
3294 pub const R_ALPHA_DTPREL64: u32 = 33;
3295 #[allow(missing_docs)]
3296 pub const R_ALPHA_DTPRELHI: u32 = 34;
3297 #[allow(missing_docs)]
3298 pub const R_ALPHA_DTPRELLO: u32 = 35;
3299 #[allow(missing_docs)]
3300 pub const R_ALPHA_DTPREL16: u32 = 36;
3301 #[allow(missing_docs)]
3302 pub const R_ALPHA_GOTTPREL: u32 = 37;
3303 #[allow(missing_docs)]
3304 pub const R_ALPHA_TPREL64: u32 = 38;
3305 #[allow(missing_docs)]
3306 pub const R_ALPHA_TPRELHI: u32 = 39;
3307 #[allow(missing_docs)]
3308 pub const R_ALPHA_TPRELLO: u32 = 40;
3309 #[allow(missing_docs)]
3310 pub const R_ALPHA_TPREL16: u32 = 41;
3311 
3312 // Magic values of the `R_ALPHA_LITUSE` relocation addend.
3313 #[allow(missing_docs)]
3314 pub const LITUSE_ALPHA_ADDR: u32 = 0;
3315 #[allow(missing_docs)]
3316 pub const LITUSE_ALPHA_BASE: u32 = 1;
3317 #[allow(missing_docs)]
3318 pub const LITUSE_ALPHA_BYTOFF: u32 = 2;
3319 #[allow(missing_docs)]
3320 pub const LITUSE_ALPHA_JSR: u32 = 3;
3321 #[allow(missing_docs)]
3322 pub const LITUSE_ALPHA_TLS_GD: u32 = 4;
3323 #[allow(missing_docs)]
3324 pub const LITUSE_ALPHA_TLS_LDM: u32 = 5;
3325 
3326 // Alpha values for `Dyn64::d_tag`.
3327 #[allow(missing_docs)]
3328 pub const DT_ALPHA_PLTRO: u32 = DT_LOPROC + 0;
3329 
3330 // PowerPC specific declarations.
3331 
3332 // PowerPC values for `FileHeader*::e_flags`.
3333 /// PowerPC embedded flag
3334 pub const EF_PPC_EMB: u32 = 0x8000_0000;
3335 
3336 // Cygnus local bits below .
3337 /// PowerPC -mrelocatable flag
3338 pub const EF_PPC_RELOCATABLE: u32 = 0x0001_0000;
3339 /// PowerPC -mrelocatable-lib flag
3340 pub const EF_PPC_RELOCATABLE_LIB: u32 = 0x0000_8000;
3341 
3342 // PowerPC values for `Rel*::r_type` defined by the ABIs.
3343 #[allow(missing_docs)]
3344 pub const R_PPC_NONE: u32 = 0;
3345 /// 32bit absolute address
3346 pub const R_PPC_ADDR32: u32 = 1;
3347 /// 26bit address, 2 bits ignored.
3348 pub const R_PPC_ADDR24: u32 = 2;
3349 /// 16bit absolute address
3350 pub const R_PPC_ADDR16: u32 = 3;
3351 /// lower 16bit of absolute address
3352 pub const R_PPC_ADDR16_LO: u32 = 4;
3353 /// high 16bit of absolute address
3354 pub const R_PPC_ADDR16_HI: u32 = 5;
3355 /// adjusted high 16bit
3356 pub const R_PPC_ADDR16_HA: u32 = 6;
3357 /// 16bit address, 2 bits ignored
3358 pub const R_PPC_ADDR14: u32 = 7;
3359 #[allow(missing_docs)]
3360 pub const R_PPC_ADDR14_BRTAKEN: u32 = 8;
3361 #[allow(missing_docs)]
3362 pub const R_PPC_ADDR14_BRNTAKEN: u32 = 9;
3363 /// PC relative 26 bit
3364 pub const R_PPC_REL24: u32 = 10;
3365 /// PC relative 16 bit
3366 pub const R_PPC_REL14: u32 = 11;
3367 #[allow(missing_docs)]
3368 pub const R_PPC_REL14_BRTAKEN: u32 = 12;
3369 #[allow(missing_docs)]
3370 pub const R_PPC_REL14_BRNTAKEN: u32 = 13;
3371 #[allow(missing_docs)]
3372 pub const R_PPC_GOT16: u32 = 14;
3373 #[allow(missing_docs)]
3374 pub const R_PPC_GOT16_LO: u32 = 15;
3375 #[allow(missing_docs)]
3376 pub const R_PPC_GOT16_HI: u32 = 16;
3377 #[allow(missing_docs)]
3378 pub const R_PPC_GOT16_HA: u32 = 17;
3379 #[allow(missing_docs)]
3380 pub const R_PPC_PLTREL24: u32 = 18;
3381 #[allow(missing_docs)]
3382 pub const R_PPC_COPY: u32 = 19;
3383 #[allow(missing_docs)]
3384 pub const R_PPC_GLOB_DAT: u32 = 20;
3385 #[allow(missing_docs)]
3386 pub const R_PPC_JMP_SLOT: u32 = 21;
3387 #[allow(missing_docs)]
3388 pub const R_PPC_RELATIVE: u32 = 22;
3389 #[allow(missing_docs)]
3390 pub const R_PPC_LOCAL24PC: u32 = 23;
3391 #[allow(missing_docs)]
3392 pub const R_PPC_UADDR32: u32 = 24;
3393 #[allow(missing_docs)]
3394 pub const R_PPC_UADDR16: u32 = 25;
3395 #[allow(missing_docs)]
3396 pub const R_PPC_REL32: u32 = 26;
3397 #[allow(missing_docs)]
3398 pub const R_PPC_PLT32: u32 = 27;
3399 #[allow(missing_docs)]
3400 pub const R_PPC_PLTREL32: u32 = 28;
3401 #[allow(missing_docs)]
3402 pub const R_PPC_PLT16_LO: u32 = 29;
3403 #[allow(missing_docs)]
3404 pub const R_PPC_PLT16_HI: u32 = 30;
3405 #[allow(missing_docs)]
3406 pub const R_PPC_PLT16_HA: u32 = 31;
3407 #[allow(missing_docs)]
3408 pub const R_PPC_SDAREL16: u32 = 32;
3409 #[allow(missing_docs)]
3410 pub const R_PPC_SECTOFF: u32 = 33;
3411 #[allow(missing_docs)]
3412 pub const R_PPC_SECTOFF_LO: u32 = 34;
3413 #[allow(missing_docs)]
3414 pub const R_PPC_SECTOFF_HI: u32 = 35;
3415 #[allow(missing_docs)]
3416 pub const R_PPC_SECTOFF_HA: u32 = 36;
3417 
3418 // PowerPC values for `Rel*::r_type` defined for the TLS access ABI.
3419 /// none    (sym+add)@tls
3420 pub const R_PPC_TLS: u32 = 67;
3421 /// word32  (sym+add)@dtpmod
3422 pub const R_PPC_DTPMOD32: u32 = 68;
3423 /// half16* (sym+add)@tprel
3424 pub const R_PPC_TPREL16: u32 = 69;
3425 /// half16  (sym+add)@tprel@l
3426 pub const R_PPC_TPREL16_LO: u32 = 70;
3427 /// half16  (sym+add)@tprel@h
3428 pub const R_PPC_TPREL16_HI: u32 = 71;
3429 /// half16  (sym+add)@tprel@ha
3430 pub const R_PPC_TPREL16_HA: u32 = 72;
3431 /// word32  (sym+add)@tprel
3432 pub const R_PPC_TPREL32: u32 = 73;
3433 /// half16*(sym+add)@dtprel
3434 pub const R_PPC_DTPREL16: u32 = 74;
3435 /// half16  (sym+add)@dtprel@l
3436 pub const R_PPC_DTPREL16_LO: u32 = 75;
3437 /// half16  (sym+add)@dtprel@h
3438 pub const R_PPC_DTPREL16_HI: u32 = 76;
3439 /// half16  (sym+add)@dtprel@ha
3440 pub const R_PPC_DTPREL16_HA: u32 = 77;
3441 /// word32  (sym+add)@dtprel
3442 pub const R_PPC_DTPREL32: u32 = 78;
3443 /// half16* (sym+add)@got@tlsgd
3444 pub const R_PPC_GOT_TLSGD16: u32 = 79;
3445 /// half16  (sym+add)@got@tlsgd@l
3446 pub const R_PPC_GOT_TLSGD16_LO: u32 = 80;
3447 /// half16  (sym+add)@got@tlsgd@h
3448 pub const R_PPC_GOT_TLSGD16_HI: u32 = 81;
3449 /// half16  (sym+add)@got@tlsgd@ha
3450 pub const R_PPC_GOT_TLSGD16_HA: u32 = 82;
3451 /// half16* (sym+add)@got@tlsld
3452 pub const R_PPC_GOT_TLSLD16: u32 = 83;
3453 /// half16  (sym+add)@got@tlsld@l
3454 pub const R_PPC_GOT_TLSLD16_LO: u32 = 84;
3455 /// half16  (sym+add)@got@tlsld@h
3456 pub const R_PPC_GOT_TLSLD16_HI: u32 = 85;
3457 /// half16  (sym+add)@got@tlsld@ha
3458 pub const R_PPC_GOT_TLSLD16_HA: u32 = 86;
3459 /// half16* (sym+add)@got@tprel
3460 pub const R_PPC_GOT_TPREL16: u32 = 87;
3461 /// half16  (sym+add)@got@tprel@l
3462 pub const R_PPC_GOT_TPREL16_LO: u32 = 88;
3463 /// half16  (sym+add)@got@tprel@h
3464 pub const R_PPC_GOT_TPREL16_HI: u32 = 89;
3465 /// half16  (sym+add)@got@tprel@ha
3466 pub const R_PPC_GOT_TPREL16_HA: u32 = 90;
3467 /// half16* (sym+add)@got@dtprel
3468 pub const R_PPC_GOT_DTPREL16: u32 = 91;
3469 /// half16* (sym+add)@got@dtprel@l
3470 pub const R_PPC_GOT_DTPREL16_LO: u32 = 92;
3471 /// half16* (sym+add)@got@dtprel@h
3472 pub const R_PPC_GOT_DTPREL16_HI: u32 = 93;
3473 /// half16* (sym+add)@got@dtprel@ha
3474 pub const R_PPC_GOT_DTPREL16_HA: u32 = 94;
3475 /// none    (sym+add)@tlsgd
3476 pub const R_PPC_TLSGD: u32 = 95;
3477 /// none    (sym+add)@tlsld
3478 pub const R_PPC_TLSLD: u32 = 96;
3479 
3480 // PowerPC values for `Rel*::r_type` from the Embedded ELF ABI.
3481 #[allow(missing_docs)]
3482 pub const R_PPC_EMB_NADDR32: u32 = 101;
3483 #[allow(missing_docs)]
3484 pub const R_PPC_EMB_NADDR16: u32 = 102;
3485 #[allow(missing_docs)]
3486 pub const R_PPC_EMB_NADDR16_LO: u32 = 103;
3487 #[allow(missing_docs)]
3488 pub const R_PPC_EMB_NADDR16_HI: u32 = 104;
3489 #[allow(missing_docs)]
3490 pub const R_PPC_EMB_NADDR16_HA: u32 = 105;
3491 #[allow(missing_docs)]
3492 pub const R_PPC_EMB_SDAI16: u32 = 106;
3493 #[allow(missing_docs)]
3494 pub const R_PPC_EMB_SDA2I16: u32 = 107;
3495 #[allow(missing_docs)]
3496 pub const R_PPC_EMB_SDA2REL: u32 = 108;
3497 /// 16 bit offset in SDA
3498 pub const R_PPC_EMB_SDA21: u32 = 109;
3499 #[allow(missing_docs)]
3500 pub const R_PPC_EMB_MRKREF: u32 = 110;
3501 #[allow(missing_docs)]
3502 pub const R_PPC_EMB_RELSEC16: u32 = 111;
3503 #[allow(missing_docs)]
3504 pub const R_PPC_EMB_RELST_LO: u32 = 112;
3505 #[allow(missing_docs)]
3506 pub const R_PPC_EMB_RELST_HI: u32 = 113;
3507 #[allow(missing_docs)]
3508 pub const R_PPC_EMB_RELST_HA: u32 = 114;
3509 #[allow(missing_docs)]
3510 pub const R_PPC_EMB_BIT_FLD: u32 = 115;
3511 /// 16 bit relative offset in SDA
3512 pub const R_PPC_EMB_RELSDA: u32 = 116;
3513 
3514 // Diab tool values for `Rel*::r_type`.
3515 /// like EMB_SDA21, but lower 16 bit
3516 pub const R_PPC_DIAB_SDA21_LO: u32 = 180;
3517 /// like EMB_SDA21, but high 16 bit
3518 pub const R_PPC_DIAB_SDA21_HI: u32 = 181;
3519 /// like EMB_SDA21, adjusted high 16
3520 pub const R_PPC_DIAB_SDA21_HA: u32 = 182;
3521 /// like EMB_RELSDA, but lower 16 bit
3522 pub const R_PPC_DIAB_RELSDA_LO: u32 = 183;
3523 /// like EMB_RELSDA, but high 16 bit
3524 pub const R_PPC_DIAB_RELSDA_HI: u32 = 184;
3525 /// like EMB_RELSDA, adjusted high 16
3526 pub const R_PPC_DIAB_RELSDA_HA: u32 = 185;
3527 
3528 /// GNU extension to support local ifunc.
3529 pub const R_PPC_IRELATIVE: u32 = 248;
3530 
3531 // GNU relocs used in PIC code sequences.
3532 /// half16   (sym+add-.)
3533 pub const R_PPC_REL16: u32 = 249;
3534 /// half16   (sym+add-.)@l
3535 pub const R_PPC_REL16_LO: u32 = 250;
3536 /// half16   (sym+add-.)@h
3537 pub const R_PPC_REL16_HI: u32 = 251;
3538 /// half16   (sym+add-.)@ha
3539 pub const R_PPC_REL16_HA: u32 = 252;
3540 
3541 /// This is a phony reloc to handle any old fashioned TOC16 references that may
3542 /// still be in object files.
3543 pub const R_PPC_TOC16: u32 = 255;
3544 
3545 // PowerPC specific values for `Dyn*::d_tag`.
3546 #[allow(missing_docs)]
3547 pub const DT_PPC_GOT: u32 = DT_LOPROC + 0;
3548 #[allow(missing_docs)]
3549 pub const DT_PPC_OPT: u32 = DT_LOPROC + 1;
3550 
3551 // PowerPC specific values for the `DT_PPC_OPT` entry.
3552 #[allow(missing_docs)]
3553 pub const PPC_OPT_TLS: u32 = 1;
3554 
3555 // PowerPC64 values for `Rel*::r_type` defined by the ABIs.
3556 #[allow(missing_docs)]
3557 pub const R_PPC64_NONE: u32 = R_PPC_NONE;
3558 /// 32bit absolute address
3559 pub const R_PPC64_ADDR32: u32 = R_PPC_ADDR32;
3560 /// 26bit address, word aligned
3561 pub const R_PPC64_ADDR24: u32 = R_PPC_ADDR24;
3562 /// 16bit absolute address
3563 pub const R_PPC64_ADDR16: u32 = R_PPC_ADDR16;
3564 /// lower 16bits of address
3565 pub const R_PPC64_ADDR16_LO: u32 = R_PPC_ADDR16_LO;
3566 /// high 16bits of address.
3567 pub const R_PPC64_ADDR16_HI: u32 = R_PPC_ADDR16_HI;
3568 /// adjusted high 16bits.
3569 pub const R_PPC64_ADDR16_HA: u32 = R_PPC_ADDR16_HA;
3570 /// 16bit address, word aligned
3571 pub const R_PPC64_ADDR14: u32 = R_PPC_ADDR14;
3572 #[allow(missing_docs)]
3573 pub const R_PPC64_ADDR14_BRTAKEN: u32 = R_PPC_ADDR14_BRTAKEN;
3574 #[allow(missing_docs)]
3575 pub const R_PPC64_ADDR14_BRNTAKEN: u32 = R_PPC_ADDR14_BRNTAKEN;
3576 /// PC-rel. 26 bit, word aligned
3577 pub const R_PPC64_REL24: u32 = R_PPC_REL24;
3578 /// PC relative 16 bit
3579 pub const R_PPC64_REL14: u32 = R_PPC_REL14;
3580 #[allow(missing_docs)]
3581 pub const R_PPC64_REL14_BRTAKEN: u32 = R_PPC_REL14_BRTAKEN;
3582 #[allow(missing_docs)]
3583 pub const R_PPC64_REL14_BRNTAKEN: u32 = R_PPC_REL14_BRNTAKEN;
3584 #[allow(missing_docs)]
3585 pub const R_PPC64_GOT16: u32 = R_PPC_GOT16;
3586 #[allow(missing_docs)]
3587 pub const R_PPC64_GOT16_LO: u32 = R_PPC_GOT16_LO;
3588 #[allow(missing_docs)]
3589 pub const R_PPC64_GOT16_HI: u32 = R_PPC_GOT16_HI;
3590 #[allow(missing_docs)]
3591 pub const R_PPC64_GOT16_HA: u32 = R_PPC_GOT16_HA;
3592 
3593 #[allow(missing_docs)]
3594 pub const R_PPC64_COPY: u32 = R_PPC_COPY;
3595 #[allow(missing_docs)]
3596 pub const R_PPC64_GLOB_DAT: u32 = R_PPC_GLOB_DAT;
3597 #[allow(missing_docs)]
3598 pub const R_PPC64_JMP_SLOT: u32 = R_PPC_JMP_SLOT;
3599 #[allow(missing_docs)]
3600 pub const R_PPC64_RELATIVE: u32 = R_PPC_RELATIVE;
3601 
3602 #[allow(missing_docs)]
3603 pub const R_PPC64_UADDR32: u32 = R_PPC_UADDR32;
3604 #[allow(missing_docs)]
3605 pub const R_PPC64_UADDR16: u32 = R_PPC_UADDR16;
3606 #[allow(missing_docs)]
3607 pub const R_PPC64_REL32: u32 = R_PPC_REL32;
3608 #[allow(missing_docs)]
3609 pub const R_PPC64_PLT32: u32 = R_PPC_PLT32;
3610 #[allow(missing_docs)]
3611 pub const R_PPC64_PLTREL32: u32 = R_PPC_PLTREL32;
3612 #[allow(missing_docs)]
3613 pub const R_PPC64_PLT16_LO: u32 = R_PPC_PLT16_LO;
3614 #[allow(missing_docs)]
3615 pub const R_PPC64_PLT16_HI: u32 = R_PPC_PLT16_HI;
3616 #[allow(missing_docs)]
3617 pub const R_PPC64_PLT16_HA: u32 = R_PPC_PLT16_HA;
3618 
3619 #[allow(missing_docs)]
3620 pub const R_PPC64_SECTOFF: u32 = R_PPC_SECTOFF;
3621 #[allow(missing_docs)]
3622 pub const R_PPC64_SECTOFF_LO: u32 = R_PPC_SECTOFF_LO;
3623 #[allow(missing_docs)]
3624 pub const R_PPC64_SECTOFF_HI: u32 = R_PPC_SECTOFF_HI;
3625 #[allow(missing_docs)]
3626 pub const R_PPC64_SECTOFF_HA: u32 = R_PPC_SECTOFF_HA;
3627 /// word30 (S + A - P) >> 2
3628 pub const R_PPC64_ADDR30: u32 = 37;
3629 /// doubleword64 S + A
3630 pub const R_PPC64_ADDR64: u32 = 38;
3631 /// half16 #higher(S + A)
3632 pub const R_PPC64_ADDR16_HIGHER: u32 = 39;
3633 /// half16 #highera(S + A)
3634 pub const R_PPC64_ADDR16_HIGHERA: u32 = 40;
3635 /// half16 #highest(S + A)
3636 pub const R_PPC64_ADDR16_HIGHEST: u32 = 41;
3637 /// half16 #highesta(S + A)
3638 pub const R_PPC64_ADDR16_HIGHESTA: u32 = 42;
3639 /// doubleword64 S + A
3640 pub const R_PPC64_UADDR64: u32 = 43;
3641 /// doubleword64 S + A - P
3642 pub const R_PPC64_REL64: u32 = 44;
3643 /// doubleword64 L + A
3644 pub const R_PPC64_PLT64: u32 = 45;
3645 /// doubleword64 L + A - P
3646 pub const R_PPC64_PLTREL64: u32 = 46;
3647 /// half16* S + A - .TOC
3648 pub const R_PPC64_TOC16: u32 = 47;
3649 /// half16 #lo(S + A - .TOC.)
3650 pub const R_PPC64_TOC16_LO: u32 = 48;
3651 /// half16 #hi(S + A - .TOC.)
3652 pub const R_PPC64_TOC16_HI: u32 = 49;
3653 /// half16 #ha(S + A - .TOC.)
3654 pub const R_PPC64_TOC16_HA: u32 = 50;
3655 /// doubleword64 .TOC
3656 pub const R_PPC64_TOC: u32 = 51;
3657 /// half16* M + A
3658 pub const R_PPC64_PLTGOT16: u32 = 52;
3659 /// half16 #lo(M + A)
3660 pub const R_PPC64_PLTGOT16_LO: u32 = 53;
3661 /// half16 #hi(M + A)
3662 pub const R_PPC64_PLTGOT16_HI: u32 = 54;
3663 /// half16 #ha(M + A)
3664 pub const R_PPC64_PLTGOT16_HA: u32 = 55;
3665 
3666 /// half16ds* (S + A) >> 2
3667 pub const R_PPC64_ADDR16_DS: u32 = 56;
3668 /// half16ds  #lo(S + A) >> 2
3669 pub const R_PPC64_ADDR16_LO_DS: u32 = 57;
3670 /// half16ds* (G + A) >> 2
3671 pub const R_PPC64_GOT16_DS: u32 = 58;
3672 /// half16ds  #lo(G + A) >> 2
3673 pub const R_PPC64_GOT16_LO_DS: u32 = 59;
3674 /// half16ds  #lo(L + A) >> 2
3675 pub const R_PPC64_PLT16_LO_DS: u32 = 60;
3676 /// half16ds* (R + A) >> 2
3677 pub const R_PPC64_SECTOFF_DS: u32 = 61;
3678 /// half16ds  #lo(R + A) >> 2
3679 pub const R_PPC64_SECTOFF_LO_DS: u32 = 62;
3680 /// half16ds* (S + A - .TOC.) >> 2
3681 pub const R_PPC64_TOC16_DS: u32 = 63;
3682 /// half16ds  #lo(S + A - .TOC.) >> 2
3683 pub const R_PPC64_TOC16_LO_DS: u32 = 64;
3684 /// half16ds* (M + A) >> 2
3685 pub const R_PPC64_PLTGOT16_DS: u32 = 65;
3686 /// half16ds  #lo(M + A) >> 2
3687 pub const R_PPC64_PLTGOT16_LO_DS: u32 = 66;
3688 
3689 // PowerPC64 values for `Rel*::r_type` defined for the TLS access ABI.
3690 /// none    (sym+add)@tls
3691 pub const R_PPC64_TLS: u32 = 67;
3692 /// doubleword64 (sym+add)@dtpmod
3693 pub const R_PPC64_DTPMOD64: u32 = 68;
3694 /// half16* (sym+add)@tprel
3695 pub const R_PPC64_TPREL16: u32 = 69;
3696 /// half16  (sym+add)@tprel@l
3697 pub const R_PPC64_TPREL16_LO: u32 = 70;
3698 /// half16  (sym+add)@tprel@h
3699 pub const R_PPC64_TPREL16_HI: u32 = 71;
3700 /// half16  (sym+add)@tprel@ha
3701 pub const R_PPC64_TPREL16_HA: u32 = 72;
3702 /// doubleword64 (sym+add)@tprel
3703 pub const R_PPC64_TPREL64: u32 = 73;
3704 /// half16* (sym+add)@dtprel
3705 pub const R_PPC64_DTPREL16: u32 = 74;
3706 /// half16  (sym+add)@dtprel@l
3707 pub const R_PPC64_DTPREL16_LO: u32 = 75;
3708 /// half16  (sym+add)@dtprel@h
3709 pub const R_PPC64_DTPREL16_HI: u32 = 76;
3710 /// half16  (sym+add)@dtprel@ha
3711 pub const R_PPC64_DTPREL16_HA: u32 = 77;
3712 /// doubleword64 (sym+add)@dtprel
3713 pub const R_PPC64_DTPREL64: u32 = 78;
3714 /// half16* (sym+add)@got@tlsgd
3715 pub const R_PPC64_GOT_TLSGD16: u32 = 79;
3716 /// half16  (sym+add)@got@tlsgd@l
3717 pub const R_PPC64_GOT_TLSGD16_LO: u32 = 80;
3718 /// half16  (sym+add)@got@tlsgd@h
3719 pub const R_PPC64_GOT_TLSGD16_HI: u32 = 81;
3720 /// half16  (sym+add)@got@tlsgd@ha
3721 pub const R_PPC64_GOT_TLSGD16_HA: u32 = 82;
3722 /// half16* (sym+add)@got@tlsld
3723 pub const R_PPC64_GOT_TLSLD16: u32 = 83;
3724 /// half16  (sym+add)@got@tlsld@l
3725 pub const R_PPC64_GOT_TLSLD16_LO: u32 = 84;
3726 /// half16  (sym+add)@got@tlsld@h
3727 pub const R_PPC64_GOT_TLSLD16_HI: u32 = 85;
3728 /// half16  (sym+add)@got@tlsld@ha
3729 pub const R_PPC64_GOT_TLSLD16_HA: u32 = 86;
3730 /// half16ds* (sym+add)@got@tprel
3731 pub const R_PPC64_GOT_TPREL16_DS: u32 = 87;
3732 /// half16ds (sym+add)@got@tprel@l
3733 pub const R_PPC64_GOT_TPREL16_LO_DS: u32 = 88;
3734 /// half16  (sym+add)@got@tprel@h
3735 pub const R_PPC64_GOT_TPREL16_HI: u32 = 89;
3736 /// half16  (sym+add)@got@tprel@ha
3737 pub const R_PPC64_GOT_TPREL16_HA: u32 = 90;
3738 /// half16ds* (sym+add)@got@dtprel
3739 pub const R_PPC64_GOT_DTPREL16_DS: u32 = 91;
3740 /// half16ds (sym+add)@got@dtprel@l
3741 pub const R_PPC64_GOT_DTPREL16_LO_DS: u32 = 92;
3742 /// half16  (sym+add)@got@dtprel@h
3743 pub const R_PPC64_GOT_DTPREL16_HI: u32 = 93;
3744 /// half16  (sym+add)@got@dtprel@ha
3745 pub const R_PPC64_GOT_DTPREL16_HA: u32 = 94;
3746 /// half16ds* (sym+add)@tprel
3747 pub const R_PPC64_TPREL16_DS: u32 = 95;
3748 /// half16ds (sym+add)@tprel@l
3749 pub const R_PPC64_TPREL16_LO_DS: u32 = 96;
3750 /// half16  (sym+add)@tprel@higher
3751 pub const R_PPC64_TPREL16_HIGHER: u32 = 97;
3752 /// half16  (sym+add)@tprel@highera
3753 pub const R_PPC64_TPREL16_HIGHERA: u32 = 98;
3754 /// half16  (sym+add)@tprel@highest
3755 pub const R_PPC64_TPREL16_HIGHEST: u32 = 99;
3756 /// half16  (sym+add)@tprel@highesta
3757 pub const R_PPC64_TPREL16_HIGHESTA: u32 = 100;
3758 /// half16ds* (sym+add)@dtprel
3759 pub const R_PPC64_DTPREL16_DS: u32 = 101;
3760 /// half16ds (sym+add)@dtprel@l
3761 pub const R_PPC64_DTPREL16_LO_DS: u32 = 102;
3762 /// half16  (sym+add)@dtprel@higher
3763 pub const R_PPC64_DTPREL16_HIGHER: u32 = 103;
3764 /// half16  (sym+add)@dtprel@highera
3765 pub const R_PPC64_DTPREL16_HIGHERA: u32 = 104;
3766 /// half16  (sym+add)@dtprel@highest
3767 pub const R_PPC64_DTPREL16_HIGHEST: u32 = 105;
3768 /// half16  (sym+add)@dtprel@highesta
3769 pub const R_PPC64_DTPREL16_HIGHESTA: u32 = 106;
3770 /// none    (sym+add)@tlsgd
3771 pub const R_PPC64_TLSGD: u32 = 107;
3772 /// none    (sym+add)@tlsld
3773 pub const R_PPC64_TLSLD: u32 = 108;
3774 /// none
3775 pub const R_PPC64_TOCSAVE: u32 = 109;
3776 
3777 // Added when HA and HI relocs were changed to report overflows.
3778 #[allow(missing_docs)]
3779 pub const R_PPC64_ADDR16_HIGH: u32 = 110;
3780 #[allow(missing_docs)]
3781 pub const R_PPC64_ADDR16_HIGHA: u32 = 111;
3782 #[allow(missing_docs)]
3783 pub const R_PPC64_TPREL16_HIGH: u32 = 112;
3784 #[allow(missing_docs)]
3785 pub const R_PPC64_TPREL16_HIGHA: u32 = 113;
3786 #[allow(missing_docs)]
3787 pub const R_PPC64_DTPREL16_HIGH: u32 = 114;
3788 #[allow(missing_docs)]
3789 pub const R_PPC64_DTPREL16_HIGHA: u32 = 115;
3790 
3791 /// GNU extension to support local ifunc.
3792 #[allow(missing_docs)]
3793 pub const R_PPC64_JMP_IREL: u32 = 247;
3794 /// GNU extension to support local ifunc.
3795 #[allow(missing_docs)]
3796 pub const R_PPC64_IRELATIVE: u32 = 248;
3797 /// half16   (sym+add-.)
3798 pub const R_PPC64_REL16: u32 = 249;
3799 /// half16   (sym+add-.)@l
3800 pub const R_PPC64_REL16_LO: u32 = 250;
3801 /// half16   (sym+add-.)@h
3802 pub const R_PPC64_REL16_HI: u32 = 251;
3803 /// half16   (sym+add-.)@ha
3804 pub const R_PPC64_REL16_HA: u32 = 252;
3805 
3806 // PowerPC64 values for `FileHeader64::e_flags.
3807 /// PowerPC64 bits specifying ABI.
3808 ///
3809 /// 1 for original function descriptor using ABI,
3810 /// 2 for revised ABI without function descriptors,
3811 /// 0 for unspecified or not using any features affected by the differences.
3812 pub const EF_PPC64_ABI: u32 = 3;
3813 
3814 // PowerPC64 values for `Dyn64::d_tag.
3815 #[allow(missing_docs)]
3816 pub const DT_PPC64_GLINK: u32 = DT_LOPROC + 0;
3817 #[allow(missing_docs)]
3818 pub const DT_PPC64_OPD: u32 = DT_LOPROC + 1;
3819 #[allow(missing_docs)]
3820 pub const DT_PPC64_OPDSZ: u32 = DT_LOPROC + 2;
3821 #[allow(missing_docs)]
3822 pub const DT_PPC64_OPT: u32 = DT_LOPROC + 3;
3823 
3824 // PowerPC64 bits for `DT_PPC64_OPT` entry.
3825 #[allow(missing_docs)]
3826 pub const PPC64_OPT_TLS: u32 = 1;
3827 #[allow(missing_docs)]
3828 pub const PPC64_OPT_MULTI_TOC: u32 = 2;
3829 #[allow(missing_docs)]
3830 pub const PPC64_OPT_LOCALENTRY: u32 = 4;
3831 
3832 // PowerPC64 values for `Sym64::st_other.
3833 #[allow(missing_docs)]
3834 pub const STO_PPC64_LOCAL_BIT: u8 = 5;
3835 #[allow(missing_docs)]
3836 pub const STO_PPC64_LOCAL_MASK: u8 = 7 << STO_PPC64_LOCAL_BIT;
3837 
3838 // ARM specific declarations.
3839 
3840 // ARM values for `FileHeader*::e_flags`.
3841 #[allow(missing_docs)]
3842 pub const EF_ARM_RELEXEC: u32 = 0x01;
3843 #[allow(missing_docs)]
3844 pub const EF_ARM_HASENTRY: u32 = 0x02;
3845 #[allow(missing_docs)]
3846 pub const EF_ARM_INTERWORK: u32 = 0x04;
3847 #[allow(missing_docs)]
3848 pub const EF_ARM_APCS_26: u32 = 0x08;
3849 #[allow(missing_docs)]
3850 pub const EF_ARM_APCS_FLOAT: u32 = 0x10;
3851 #[allow(missing_docs)]
3852 pub const EF_ARM_PIC: u32 = 0x20;
3853 /// 8-bit structure alignment is in use
3854 pub const EF_ARM_ALIGN8: u32 = 0x40;
3855 #[allow(missing_docs)]
3856 pub const EF_ARM_NEW_ABI: u32 = 0x80;
3857 #[allow(missing_docs)]
3858 pub const EF_ARM_OLD_ABI: u32 = 0x100;
3859 #[allow(missing_docs)]
3860 pub const EF_ARM_SOFT_FLOAT: u32 = 0x200;
3861 #[allow(missing_docs)]
3862 pub const EF_ARM_VFP_FLOAT: u32 = 0x400;
3863 #[allow(missing_docs)]
3864 pub const EF_ARM_MAVERICK_FLOAT: u32 = 0x800;
3865 
3866 /// NB conflicts with EF_ARM_SOFT_FLOAT
3867 pub const EF_ARM_ABI_FLOAT_SOFT: u32 = 0x200;
3868 /// NB conflicts with EF_ARM_VFP_FLOAT
3869 pub const EF_ARM_ABI_FLOAT_HARD: u32 = 0x400;
3870 
3871 // Other constants defined in the ARM ELF spec. version B-01.
3872 // NB. These conflict with values defined above.
3873 #[allow(missing_docs)]
3874 pub const EF_ARM_SYMSARESORTED: u32 = 0x04;
3875 #[allow(missing_docs)]
3876 pub const EF_ARM_DYNSYMSUSESEGIDX: u32 = 0x08;
3877 #[allow(missing_docs)]
3878 pub const EF_ARM_MAPSYMSFIRST: u32 = 0x10;
3879 
3880 // Constants defined in AAELF.
3881 #[allow(missing_docs)]
3882 pub const EF_ARM_BE8: u32 = 0x0080_0000;
3883 #[allow(missing_docs)]
3884 pub const EF_ARM_LE8: u32 = 0x0040_0000;
3885 
3886 #[allow(missing_docs)]
3887 pub const EF_ARM_EABIMASK: u32 = 0xff00_0000;
3888 #[allow(missing_docs)]
3889 pub const EF_ARM_EABI_UNKNOWN: u32 = 0x0000_0000;
3890 #[allow(missing_docs)]
3891 pub const EF_ARM_EABI_VER1: u32 = 0x0100_0000;
3892 #[allow(missing_docs)]
3893 pub const EF_ARM_EABI_VER2: u32 = 0x0200_0000;
3894 #[allow(missing_docs)]
3895 pub const EF_ARM_EABI_VER3: u32 = 0x0300_0000;
3896 #[allow(missing_docs)]
3897 pub const EF_ARM_EABI_VER4: u32 = 0x0400_0000;
3898 #[allow(missing_docs)]
3899 pub const EF_ARM_EABI_VER5: u32 = 0x0500_0000;
3900 
3901 // ARM Thumb values for `st_type` component of `Sym*::st_info`.
3902 /// A Thumb function.
3903 pub const STT_ARM_TFUNC: u8 = STT_LOPROC;
3904 /// A Thumb label.
3905 pub const STT_ARM_16BIT: u8 = STT_HIPROC;
3906 
3907 // ARM values for `SectionHeader*::sh_flags`.
3908 /// Section contains an entry point
3909 pub const SHF_ARM_ENTRYSECT: u32 = 0x1000_0000;
3910 /// Section may be multiply defined in the input to a link step.
3911 pub const SHF_ARM_COMDEF: u32 = 0x8000_0000;
3912 
3913 // ARM values for `ProgramHeader*::p_flags`.
3914 /// Segment contains the location addressed by the static base.
3915 pub const PF_ARM_SB: u32 = 0x1000_0000;
3916 /// Position-independent segment.
3917 pub const PF_ARM_PI: u32 = 0x2000_0000;
3918 /// Absolute segment.
3919 pub const PF_ARM_ABS: u32 = 0x4000_0000;
3920 
3921 // ARM values for `ProgramHeader*::p_type`.
3922 /// ARM unwind segment.
3923 pub const PT_ARM_EXIDX: u32 = PT_LOPROC + 1;
3924 
3925 // ARM values for `SectionHeader*::sh_type`.
3926 /// ARM unwind section.
3927 pub const SHT_ARM_EXIDX: u32 = SHT_LOPROC + 1;
3928 /// Preemption details.
3929 pub const SHT_ARM_PREEMPTMAP: u32 = SHT_LOPROC + 2;
3930 /// ARM attributes section.
3931 pub const SHT_ARM_ATTRIBUTES: u32 = SHT_LOPROC + 3;
3932 
3933 // AArch64 values for `Rel*::r_type`.
3934 
3935 /// No relocation.
3936 pub const R_AARCH64_NONE: u32 = 0;
3937 
3938 // ILP32 AArch64 relocs.
3939 /// Direct 32 bit.
3940 pub const R_AARCH64_P32_ABS32: u32 = 1;
3941 /// Copy symbol at runtime.
3942 pub const R_AARCH64_P32_COPY: u32 = 180;
3943 /// Create GOT entry.
3944 pub const R_AARCH64_P32_GLOB_DAT: u32 = 181;
3945 /// Create PLT entry.
3946 pub const R_AARCH64_P32_JUMP_SLOT: u32 = 182;
3947 /// Adjust by program base.
3948 pub const R_AARCH64_P32_RELATIVE: u32 = 183;
3949 /// Module number, 32 bit.
3950 pub const R_AARCH64_P32_TLS_DTPMOD: u32 = 184;
3951 /// Module-relative offset, 32 bit.
3952 pub const R_AARCH64_P32_TLS_DTPREL: u32 = 185;
3953 /// TP-relative offset, 32 bit.
3954 pub const R_AARCH64_P32_TLS_TPREL: u32 = 186;
3955 /// TLS Descriptor.
3956 pub const R_AARCH64_P32_TLSDESC: u32 = 187;
3957 /// STT_GNU_IFUNC relocation.
3958 pub const R_AARCH64_P32_IRELATIVE: u32 = 188;
3959 
3960 // LP64 AArch64 relocs.
3961 /// Direct 64 bit.
3962 pub const R_AARCH64_ABS64: u32 = 257;
3963 /// Direct 32 bit.
3964 pub const R_AARCH64_ABS32: u32 = 258;
3965 /// Direct 16-bit.
3966 pub const R_AARCH64_ABS16: u32 = 259;
3967 /// PC-relative 64-bit.
3968 pub const R_AARCH64_PREL64: u32 = 260;
3969 /// PC-relative 32-bit.
3970 pub const R_AARCH64_PREL32: u32 = 261;
3971 /// PC-relative 16-bit.
3972 pub const R_AARCH64_PREL16: u32 = 262;
3973 /// Dir. MOVZ imm. from bits 15:0.
3974 pub const R_AARCH64_MOVW_UABS_G0: u32 = 263;
3975 /// Likewise for MOVK; no check.
3976 pub const R_AARCH64_MOVW_UABS_G0_NC: u32 = 264;
3977 /// Dir. MOVZ imm. from bits 31:16.
3978 pub const R_AARCH64_MOVW_UABS_G1: u32 = 265;
3979 /// Likewise for MOVK; no check.
3980 pub const R_AARCH64_MOVW_UABS_G1_NC: u32 = 266;
3981 /// Dir. MOVZ imm. from bits 47:32.
3982 pub const R_AARCH64_MOVW_UABS_G2: u32 = 267;
3983 /// Likewise for MOVK; no check.
3984 pub const R_AARCH64_MOVW_UABS_G2_NC: u32 = 268;
3985 /// Dir. MOV{K,Z} imm. from 63:48.
3986 pub const R_AARCH64_MOVW_UABS_G3: u32 = 269;
3987 /// Dir. MOV{N,Z} imm. from 15:0.
3988 pub const R_AARCH64_MOVW_SABS_G0: u32 = 270;
3989 /// Dir. MOV{N,Z} imm. from 31:16.
3990 pub const R_AARCH64_MOVW_SABS_G1: u32 = 271;
3991 /// Dir. MOV{N,Z} imm. from 47:32.
3992 pub const R_AARCH64_MOVW_SABS_G2: u32 = 272;
3993 /// PC-rel. LD imm. from bits 20:2.
3994 pub const R_AARCH64_LD_PREL_LO19: u32 = 273;
3995 /// PC-rel. ADR imm. from bits 20:0.
3996 pub const R_AARCH64_ADR_PREL_LO21: u32 = 274;
3997 /// Page-rel. ADRP imm. from 32:12.
3998 pub const R_AARCH64_ADR_PREL_PG_HI21: u32 = 275;
3999 /// Likewise; no overflow check.
4000 pub const R_AARCH64_ADR_PREL_PG_HI21_NC: u32 = 276;
4001 /// Dir. ADD imm. from bits 11:0.
4002 pub const R_AARCH64_ADD_ABS_LO12_NC: u32 = 277;
4003 /// Likewise for LD/ST; no check.
4004 pub const R_AARCH64_LDST8_ABS_LO12_NC: u32 = 278;
4005 /// PC-rel. TBZ/TBNZ imm. from 15:2.
4006 pub const R_AARCH64_TSTBR14: u32 = 279;
4007 /// PC-rel. cond. br. imm. from 20:2.
4008 pub const R_AARCH64_CONDBR19: u32 = 280;
4009 /// PC-rel. B imm. from bits 27:2.
4010 pub const R_AARCH64_JUMP26: u32 = 282;
4011 /// Likewise for CALL.
4012 pub const R_AARCH64_CALL26: u32 = 283;
4013 /// Dir. ADD imm. from bits 11:1.
4014 pub const R_AARCH64_LDST16_ABS_LO12_NC: u32 = 284;
4015 /// Likewise for bits 11:2.
4016 pub const R_AARCH64_LDST32_ABS_LO12_NC: u32 = 285;
4017 /// Likewise for bits 11:3.
4018 pub const R_AARCH64_LDST64_ABS_LO12_NC: u32 = 286;
4019 /// PC-rel. MOV{N,Z} imm. from 15:0.
4020 pub const R_AARCH64_MOVW_PREL_G0: u32 = 287;
4021 /// Likewise for MOVK; no check.
4022 pub const R_AARCH64_MOVW_PREL_G0_NC: u32 = 288;
4023 /// PC-rel. MOV{N,Z} imm. from 31:16.
4024 pub const R_AARCH64_MOVW_PREL_G1: u32 = 289;
4025 /// Likewise for MOVK; no check.
4026 pub const R_AARCH64_MOVW_PREL_G1_NC: u32 = 290;
4027 /// PC-rel. MOV{N,Z} imm. from 47:32.
4028 pub const R_AARCH64_MOVW_PREL_G2: u32 = 291;
4029 /// Likewise for MOVK; no check.
4030 pub const R_AARCH64_MOVW_PREL_G2_NC: u32 = 292;
4031 /// PC-rel. MOV{N,Z} imm. from 63:48.
4032 pub const R_AARCH64_MOVW_PREL_G3: u32 = 293;
4033 /// Dir. ADD imm. from bits 11:4.
4034 pub const R_AARCH64_LDST128_ABS_LO12_NC: u32 = 299;
4035 /// GOT-rel. off. MOV{N,Z} imm. 15:0.
4036 pub const R_AARCH64_MOVW_GOTOFF_G0: u32 = 300;
4037 /// Likewise for MOVK; no check.
4038 pub const R_AARCH64_MOVW_GOTOFF_G0_NC: u32 = 301;
4039 /// GOT-rel. o. MOV{N,Z} imm. 31:16.
4040 pub const R_AARCH64_MOVW_GOTOFF_G1: u32 = 302;
4041 /// Likewise for MOVK; no check.
4042 pub const R_AARCH64_MOVW_GOTOFF_G1_NC: u32 = 303;
4043 /// GOT-rel. o. MOV{N,Z} imm. 47:32.
4044 pub const R_AARCH64_MOVW_GOTOFF_G2: u32 = 304;
4045 /// Likewise for MOVK; no check.
4046 pub const R_AARCH64_MOVW_GOTOFF_G2_NC: u32 = 305;
4047 /// GOT-rel. o. MOV{N,Z} imm. 63:48.
4048 pub const R_AARCH64_MOVW_GOTOFF_G3: u32 = 306;
4049 /// GOT-relative 64-bit.
4050 pub const R_AARCH64_GOTREL64: u32 = 307;
4051 /// GOT-relative 32-bit.
4052 pub const R_AARCH64_GOTREL32: u32 = 308;
4053 /// PC-rel. GOT off. load imm. 20:2.
4054 pub const R_AARCH64_GOT_LD_PREL19: u32 = 309;
4055 /// GOT-rel. off. LD/ST imm. 14:3.
4056 pub const R_AARCH64_LD64_GOTOFF_LO15: u32 = 310;
4057 /// P-page-rel. GOT off. ADRP 32:12.
4058 pub const R_AARCH64_ADR_GOT_PAGE: u32 = 311;
4059 /// Dir. GOT off. LD/ST imm. 11:3.
4060 pub const R_AARCH64_LD64_GOT_LO12_NC: u32 = 312;
4061 /// GOT-page-rel. GOT off. LD/ST 14:3
4062 pub const R_AARCH64_LD64_GOTPAGE_LO15: u32 = 313;
4063 /// PC-relative ADR imm. 20:0.
4064 pub const R_AARCH64_TLSGD_ADR_PREL21: u32 = 512;
4065 /// page-rel. ADRP imm. 32:12.
4066 pub const R_AARCH64_TLSGD_ADR_PAGE21: u32 = 513;
4067 /// direct ADD imm. from 11:0.
4068 pub const R_AARCH64_TLSGD_ADD_LO12_NC: u32 = 514;
4069 /// GOT-rel. MOV{N,Z} 31:16.
4070 pub const R_AARCH64_TLSGD_MOVW_G1: u32 = 515;
4071 /// GOT-rel. MOVK imm. 15:0.
4072 pub const R_AARCH64_TLSGD_MOVW_G0_NC: u32 = 516;
4073 /// Like 512; local dynamic model.
4074 pub const R_AARCH64_TLSLD_ADR_PREL21: u32 = 517;
4075 /// Like 513; local dynamic model.
4076 pub const R_AARCH64_TLSLD_ADR_PAGE21: u32 = 518;
4077 /// Like 514; local dynamic model.
4078 pub const R_AARCH64_TLSLD_ADD_LO12_NC: u32 = 519;
4079 /// Like 515; local dynamic model.
4080 pub const R_AARCH64_TLSLD_MOVW_G1: u32 = 520;
4081 /// Like 516; local dynamic model.
4082 pub const R_AARCH64_TLSLD_MOVW_G0_NC: u32 = 521;
4083 /// TLS PC-rel. load imm. 20:2.
4084 pub const R_AARCH64_TLSLD_LD_PREL19: u32 = 522;
4085 /// TLS DTP-rel. MOV{N,Z} 47:32.
4086 pub const R_AARCH64_TLSLD_MOVW_DTPREL_G2: u32 = 523;
4087 /// TLS DTP-rel. MOV{N,Z} 31:16.
4088 pub const R_AARCH64_TLSLD_MOVW_DTPREL_G1: u32 = 524;
4089 /// Likewise; MOVK; no check.
4090 pub const R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC: u32 = 525;
4091 /// TLS DTP-rel. MOV{N,Z} 15:0.
4092 pub const R_AARCH64_TLSLD_MOVW_DTPREL_G0: u32 = 526;
4093 /// Likewise; MOVK; no check.
4094 pub const R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC: u32 = 527;
4095 /// DTP-rel. ADD imm. from 23:12.
4096 pub const R_AARCH64_TLSLD_ADD_DTPREL_HI12: u32 = 528;
4097 /// DTP-rel. ADD imm. from 11:0.
4098 pub const R_AARCH64_TLSLD_ADD_DTPREL_LO12: u32 = 529;
4099 /// Likewise; no ovfl. check.
4100 pub const R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC: u32 = 530;
4101 /// DTP-rel. LD/ST imm. 11:0.
4102 pub const R_AARCH64_TLSLD_LDST8_DTPREL_LO12: u32 = 531;
4103 /// Likewise; no check.
4104 pub const R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC: u32 = 532;
4105 /// DTP-rel. LD/ST imm. 11:1.
4106 pub const R_AARCH64_TLSLD_LDST16_DTPREL_LO12: u32 = 533;
4107 /// Likewise; no check.
4108 pub const R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC: u32 = 534;
4109 /// DTP-rel. LD/ST imm. 11:2.
4110 pub const R_AARCH64_TLSLD_LDST32_DTPREL_LO12: u32 = 535;
4111 /// Likewise; no check.
4112 pub const R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC: u32 = 536;
4113 /// DTP-rel. LD/ST imm. 11:3.
4114 pub const R_AARCH64_TLSLD_LDST64_DTPREL_LO12: u32 = 537;
4115 /// Likewise; no check.
4116 pub const R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC: u32 = 538;
4117 /// GOT-rel. MOV{N,Z} 31:16.
4118 pub const R_AARCH64_TLSIE_MOVW_GOTTPREL_G1: u32 = 539;
4119 /// GOT-rel. MOVK 15:0.
4120 pub const R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: u32 = 540;
4121 /// Page-rel. ADRP 32:12.
4122 pub const R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: u32 = 541;
4123 /// Direct LD off. 11:3.
4124 pub const R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: u32 = 542;
4125 /// PC-rel. load imm. 20:2.
4126 pub const R_AARCH64_TLSIE_LD_GOTTPREL_PREL19: u32 = 543;
4127 /// TLS TP-rel. MOV{N,Z} 47:32.
4128 pub const R_AARCH64_TLSLE_MOVW_TPREL_G2: u32 = 544;
4129 /// TLS TP-rel. MOV{N,Z} 31:16.
4130 pub const R_AARCH64_TLSLE_MOVW_TPREL_G1: u32 = 545;
4131 /// Likewise; MOVK; no check.
4132 pub const R_AARCH64_TLSLE_MOVW_TPREL_G1_NC: u32 = 546;
4133 /// TLS TP-rel. MOV{N,Z} 15:0.
4134 pub const R_AARCH64_TLSLE_MOVW_TPREL_G0: u32 = 547;
4135 /// Likewise; MOVK; no check.
4136 pub const R_AARCH64_TLSLE_MOVW_TPREL_G0_NC: u32 = 548;
4137 /// TP-rel. ADD imm. 23:12.
4138 pub const R_AARCH64_TLSLE_ADD_TPREL_HI12: u32 = 549;
4139 /// TP-rel. ADD imm. 11:0.
4140 pub const R_AARCH64_TLSLE_ADD_TPREL_LO12: u32 = 550;
4141 /// Likewise; no ovfl. check.
4142 pub const R_AARCH64_TLSLE_ADD_TPREL_LO12_NC: u32 = 551;
4143 /// TP-rel. LD/ST off. 11:0.
4144 pub const R_AARCH64_TLSLE_LDST8_TPREL_LO12: u32 = 552;
4145 /// Likewise; no ovfl. check.
4146 pub const R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC: u32 = 553;
4147 /// TP-rel. LD/ST off. 11:1.
4148 pub const R_AARCH64_TLSLE_LDST16_TPREL_LO12: u32 = 554;
4149 /// Likewise; no check.
4150 pub const R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC: u32 = 555;
4151 /// TP-rel. LD/ST off. 11:2.
4152 pub const R_AARCH64_TLSLE_LDST32_TPREL_LO12: u32 = 556;
4153 /// Likewise; no check.
4154 pub const R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC: u32 = 557;
4155 /// TP-rel. LD/ST off. 11:3.
4156 pub const R_AARCH64_TLSLE_LDST64_TPREL_LO12: u32 = 558;
4157 /// Likewise; no check.
4158 pub const R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC: u32 = 559;
4159 /// PC-rel. load immediate 20:2.
4160 pub const R_AARCH64_TLSDESC_LD_PREL19: u32 = 560;
4161 /// PC-rel. ADR immediate 20:0.
4162 pub const R_AARCH64_TLSDESC_ADR_PREL21: u32 = 561;
4163 /// Page-rel. ADRP imm. 32:12.
4164 pub const R_AARCH64_TLSDESC_ADR_PAGE21: u32 = 562;
4165 /// Direct LD off. from 11:3.
4166 pub const R_AARCH64_TLSDESC_LD64_LO12: u32 = 563;
4167 /// Direct ADD imm. from 11:0.
4168 pub const R_AARCH64_TLSDESC_ADD_LO12: u32 = 564;
4169 /// GOT-rel. MOV{N,Z} imm. 31:16.
4170 pub const R_AARCH64_TLSDESC_OFF_G1: u32 = 565;
4171 /// GOT-rel. MOVK imm. 15:0; no ck.
4172 pub const R_AARCH64_TLSDESC_OFF_G0_NC: u32 = 566;
4173 /// Relax LDR.
4174 pub const R_AARCH64_TLSDESC_LDR: u32 = 567;
4175 /// Relax ADD.
4176 pub const R_AARCH64_TLSDESC_ADD: u32 = 568;
4177 /// Relax BLR.
4178 pub const R_AARCH64_TLSDESC_CALL: u32 = 569;
4179 /// TP-rel. LD/ST off. 11:4.
4180 pub const R_AARCH64_TLSLE_LDST128_TPREL_LO12: u32 = 570;
4181 /// Likewise; no check.
4182 pub const R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC: u32 = 571;
4183 /// DTP-rel. LD/ST imm. 11:4.
4184 pub const R_AARCH64_TLSLD_LDST128_DTPREL_LO12: u32 = 572;
4185 /// Likewise; no check.
4186 pub const R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC: u32 = 573;
4187 /// Copy symbol at runtime.
4188 pub const R_AARCH64_COPY: u32 = 1024;
4189 /// Create GOT entry.
4190 pub const R_AARCH64_GLOB_DAT: u32 = 1025;
4191 /// Create PLT entry.
4192 pub const R_AARCH64_JUMP_SLOT: u32 = 1026;
4193 /// Adjust by program base.
4194 pub const R_AARCH64_RELATIVE: u32 = 1027;
4195 /// Module number, 64 bit.
4196 pub const R_AARCH64_TLS_DTPMOD: u32 = 1028;
4197 /// Module-relative offset, 64 bit.
4198 pub const R_AARCH64_TLS_DTPREL: u32 = 1029;
4199 /// TP-relative offset, 64 bit.
4200 pub const R_AARCH64_TLS_TPREL: u32 = 1030;
4201 /// TLS Descriptor.
4202 pub const R_AARCH64_TLSDESC: u32 = 1031;
4203 /// STT_GNU_IFUNC relocation.
4204 pub const R_AARCH64_IRELATIVE: u32 = 1032;
4205 
4206 // AVR values for `Rel*::r_type`.
4207 
4208 /// Direct 32 bit
4209 pub const R_AVR_32: u32 = 1;
4210 /// Direct 16 bit
4211 pub const R_AVR_16: u32 = 4;
4212 
4213 // MSP430 values for `Rel*::r_type`.
4214 
4215 /// Direct 32 bit
4216 pub const R_MSP430_32: u32 = 1;
4217 /// Direct 16 bit
4218 pub const R_MSP430_16_BYTE: u32 = 5;
4219 
4220 // Hexagon values for `Rel*::r_type`.
4221 
4222 /// Direct 32 bit
4223 pub const R_HEX_32: u32 = 6;
4224 
4225 // ARM values for `Rel*::r_type`.
4226 
4227 /// No reloc
4228 pub const R_ARM_NONE: u32 = 0;
4229 /// Deprecated PC relative 26 bit branch.
4230 pub const R_ARM_PC24: u32 = 1;
4231 /// Direct 32 bit
4232 pub const R_ARM_ABS32: u32 = 2;
4233 /// PC relative 32 bit
4234 pub const R_ARM_REL32: u32 = 3;
4235 #[allow(missing_docs)]
4236 pub const R_ARM_PC13: u32 = 4;
4237 /// Direct 16 bit
4238 pub const R_ARM_ABS16: u32 = 5;
4239 /// Direct 12 bit
4240 pub const R_ARM_ABS12: u32 = 6;
4241 /// Direct & 0x7C (LDR, STR).
4242 pub const R_ARM_THM_ABS5: u32 = 7;
4243 /// Direct 8 bit
4244 pub const R_ARM_ABS8: u32 = 8;
4245 #[allow(missing_docs)]
4246 pub const R_ARM_SBREL32: u32 = 9;
4247 /// PC relative 24 bit (Thumb32 BL).
4248 pub const R_ARM_THM_PC22: u32 = 10;
4249 /// PC relative & 0x3FC (Thumb16 LDR, ADD, ADR).
4250 pub const R_ARM_THM_PC8: u32 = 11;
4251 #[allow(missing_docs)]
4252 pub const R_ARM_AMP_VCALL9: u32 = 12;
4253 /// Obsolete static relocation.
4254 pub const R_ARM_SWI24: u32 = 13;
4255 /// Dynamic relocation.
4256 pub const R_ARM_TLS_DESC: u32 = 13;
4257 /// Reserved.
4258 pub const R_ARM_THM_SWI8: u32 = 14;
4259 /// Reserved.
4260 pub const R_ARM_XPC25: u32 = 15;
4261 /// Reserved.
4262 pub const R_ARM_THM_XPC22: u32 = 16;
4263 /// ID of module containing symbol
4264 pub const R_ARM_TLS_DTPMOD32: u32 = 17;
4265 /// Offset in TLS block
4266 pub const R_ARM_TLS_DTPOFF32: u32 = 18;
4267 /// Offset in static TLS block
4268 pub const R_ARM_TLS_TPOFF32: u32 = 19;
4269 /// Copy symbol at runtime
4270 pub const R_ARM_COPY: u32 = 20;
4271 /// Create GOT entry
4272 pub const R_ARM_GLOB_DAT: u32 = 21;
4273 /// Create PLT entry
4274 pub const R_ARM_JUMP_SLOT: u32 = 22;
4275 /// Adjust by program base
4276 pub const R_ARM_RELATIVE: u32 = 23;
4277 /// 32 bit offset to GOT
4278 pub const R_ARM_GOTOFF: u32 = 24;
4279 /// 32 bit PC relative offset to GOT
4280 pub const R_ARM_GOTPC: u32 = 25;
4281 /// 32 bit GOT entry
4282 pub const R_ARM_GOT32: u32 = 26;
4283 /// Deprecated, 32 bit PLT address.
4284 pub const R_ARM_PLT32: u32 = 27;
4285 /// PC relative 24 bit (BL, BLX).
4286 pub const R_ARM_CALL: u32 = 28;
4287 /// PC relative 24 bit (B, BL<cond>).
4288 pub const R_ARM_JUMP24: u32 = 29;
4289 /// PC relative 24 bit (Thumb32 B.W).
4290 pub const R_ARM_THM_JUMP24: u32 = 30;
4291 /// Adjust by program base.
4292 pub const R_ARM_BASE_ABS: u32 = 31;
4293 /// Obsolete.
4294 pub const R_ARM_ALU_PCREL_7_0: u32 = 32;
4295 /// Obsolete.
4296 pub const R_ARM_ALU_PCREL_15_8: u32 = 33;
4297 /// Obsolete.
4298 pub const R_ARM_ALU_PCREL_23_15: u32 = 34;
4299 /// Deprecated, prog. base relative.
4300 pub const R_ARM_LDR_SBREL_11_0: u32 = 35;
4301 /// Deprecated, prog. base relative.
4302 pub const R_ARM_ALU_SBREL_19_12: u32 = 36;
4303 /// Deprecated, prog. base relative.
4304 pub const R_ARM_ALU_SBREL_27_20: u32 = 37;
4305 #[allow(missing_docs)]
4306 pub const R_ARM_TARGET1: u32 = 38;
4307 /// Program base relative.
4308 pub const R_ARM_SBREL31: u32 = 39;
4309 #[allow(missing_docs)]
4310 pub const R_ARM_V4BX: u32 = 40;
4311 #[allow(missing_docs)]
4312 pub const R_ARM_TARGET2: u32 = 41;
4313 /// 32 bit PC relative.
4314 pub const R_ARM_PREL31: u32 = 42;
4315 /// Direct 16-bit (MOVW).
4316 pub const R_ARM_MOVW_ABS_NC: u32 = 43;
4317 /// Direct high 16-bit (MOVT).
4318 pub const R_ARM_MOVT_ABS: u32 = 44;
4319 /// PC relative 16-bit (MOVW).
4320 pub const R_ARM_MOVW_PREL_NC: u32 = 45;
4321 /// PC relative (MOVT).
4322 pub const R_ARM_MOVT_PREL: u32 = 46;
4323 /// Direct 16 bit (Thumb32 MOVW).
4324 pub const R_ARM_THM_MOVW_ABS_NC: u32 = 47;
4325 /// Direct high 16 bit (Thumb32 MOVT).
4326 pub const R_ARM_THM_MOVT_ABS: u32 = 48;
4327 /// PC relative 16 bit (Thumb32 MOVW).
4328 pub const R_ARM_THM_MOVW_PREL_NC: u32 = 49;
4329 /// PC relative high 16 bit (Thumb32 MOVT).
4330 pub const R_ARM_THM_MOVT_PREL: u32 = 50;
4331 /// PC relative 20 bit (Thumb32 B<cond>.W).
4332 pub const R_ARM_THM_JUMP19: u32 = 51;
4333 /// PC relative X & 0x7E (Thumb16 CBZ, CBNZ).
4334 pub const R_ARM_THM_JUMP6: u32 = 52;
4335 /// PC relative 12 bit (Thumb32 ADR.W).
4336 pub const R_ARM_THM_ALU_PREL_11_0: u32 = 53;
4337 /// PC relative 12 bit (Thumb32 LDR{D,SB,H,SH}).
4338 pub const R_ARM_THM_PC12: u32 = 54;
4339 /// Direct 32-bit.
4340 pub const R_ARM_ABS32_NOI: u32 = 55;
4341 /// PC relative 32-bit.
4342 pub const R_ARM_REL32_NOI: u32 = 56;
4343 /// PC relative (ADD, SUB).
4344 pub const R_ARM_ALU_PC_G0_NC: u32 = 57;
4345 /// PC relative (ADD, SUB).
4346 pub const R_ARM_ALU_PC_G0: u32 = 58;
4347 /// PC relative (ADD, SUB).
4348 pub const R_ARM_ALU_PC_G1_NC: u32 = 59;
4349 /// PC relative (ADD, SUB).
4350 pub const R_ARM_ALU_PC_G1: u32 = 60;
4351 /// PC relative (ADD, SUB).
4352 pub const R_ARM_ALU_PC_G2: u32 = 61;
4353 /// PC relative (LDR,STR,LDRB,STRB).
4354 pub const R_ARM_LDR_PC_G1: u32 = 62;
4355 /// PC relative (LDR,STR,LDRB,STRB).
4356 pub const R_ARM_LDR_PC_G2: u32 = 63;
4357 /// PC relative (STR{D,H}, LDR{D,SB,H,SH}).
4358 pub const R_ARM_LDRS_PC_G0: u32 = 64;
4359 /// PC relative (STR{D,H}, LDR{D,SB,H,SH}).
4360 pub const R_ARM_LDRS_PC_G1: u32 = 65;
4361 /// PC relative (STR{D,H}, LDR{D,SB,H,SH}).
4362 pub const R_ARM_LDRS_PC_G2: u32 = 66;
4363 /// PC relative (LDC, STC).
4364 pub const R_ARM_LDC_PC_G0: u32 = 67;
4365 /// PC relative (LDC, STC).
4366 pub const R_ARM_LDC_PC_G1: u32 = 68;
4367 /// PC relative (LDC, STC).
4368 pub const R_ARM_LDC_PC_G2: u32 = 69;
4369 /// Program base relative (ADD,SUB).
4370 pub const R_ARM_ALU_SB_G0_NC: u32 = 70;
4371 /// Program base relative (ADD,SUB).
4372 pub const R_ARM_ALU_SB_G0: u32 = 71;
4373 /// Program base relative (ADD,SUB).
4374 pub const R_ARM_ALU_SB_G1_NC: u32 = 72;
4375 /// Program base relative (ADD,SUB).
4376 pub const R_ARM_ALU_SB_G1: u32 = 73;
4377 /// Program base relative (ADD,SUB).
4378 pub const R_ARM_ALU_SB_G2: u32 = 74;
4379 /// Program base relative (LDR, STR, LDRB, STRB).
4380 pub const R_ARM_LDR_SB_G0: u32 = 75;
4381 /// Program base relative (LDR, STR, LDRB, STRB).
4382 pub const R_ARM_LDR_SB_G1: u32 = 76;
4383 /// Program base relative (LDR, STR, LDRB, STRB).
4384 pub const R_ARM_LDR_SB_G2: u32 = 77;
4385 /// Program base relative (LDR, STR, LDRB, STRB).
4386 pub const R_ARM_LDRS_SB_G0: u32 = 78;
4387 /// Program base relative (LDR, STR, LDRB, STRB).
4388 pub const R_ARM_LDRS_SB_G1: u32 = 79;
4389 /// Program base relative (LDR, STR, LDRB, STRB).
4390 pub const R_ARM_LDRS_SB_G2: u32 = 80;
4391 /// Program base relative (LDC,STC).
4392 pub const R_ARM_LDC_SB_G0: u32 = 81;
4393 /// Program base relative (LDC,STC).
4394 pub const R_ARM_LDC_SB_G1: u32 = 82;
4395 /// Program base relative (LDC,STC).
4396 pub const R_ARM_LDC_SB_G2: u32 = 83;
4397 /// Program base relative 16 bit (MOVW).
4398 pub const R_ARM_MOVW_BREL_NC: u32 = 84;
4399 /// Program base relative high 16 bit (MOVT).
4400 pub const R_ARM_MOVT_BREL: u32 = 85;
4401 /// Program base relative 16 bit (MOVW).
4402 pub const R_ARM_MOVW_BREL: u32 = 86;
4403 /// Program base relative 16 bit (Thumb32 MOVW).
4404 pub const R_ARM_THM_MOVW_BREL_NC: u32 = 87;
4405 /// Program base relative high 16 bit (Thumb32 MOVT).
4406 pub const R_ARM_THM_MOVT_BREL: u32 = 88;
4407 /// Program base relative 16 bit (Thumb32 MOVW).
4408 pub const R_ARM_THM_MOVW_BREL: u32 = 89;
4409 #[allow(missing_docs)]
4410 pub const R_ARM_TLS_GOTDESC: u32 = 90;
4411 #[allow(missing_docs)]
4412 pub const R_ARM_TLS_CALL: u32 = 91;
4413 /// TLS relaxation.
4414 pub const R_ARM_TLS_DESCSEQ: u32 = 92;
4415 #[allow(missing_docs)]
4416 pub const R_ARM_THM_TLS_CALL: u32 = 93;
4417 #[allow(missing_docs)]
4418 pub const R_ARM_PLT32_ABS: u32 = 94;
4419 /// GOT entry.
4420 pub const R_ARM_GOT_ABS: u32 = 95;
4421 /// PC relative GOT entry.
4422 pub const R_ARM_GOT_PREL: u32 = 96;
4423 /// GOT entry relative to GOT origin (LDR).
4424 pub const R_ARM_GOT_BREL12: u32 = 97;
4425 /// 12 bit, GOT entry relative to GOT origin (LDR, STR).
4426 pub const R_ARM_GOTOFF12: u32 = 98;
4427 #[allow(missing_docs)]
4428 pub const R_ARM_GOTRELAX: u32 = 99;
4429 #[allow(missing_docs)]
4430 pub const R_ARM_GNU_VTENTRY: u32 = 100;
4431 #[allow(missing_docs)]
4432 pub const R_ARM_GNU_VTINHERIT: u32 = 101;
4433 /// PC relative & 0xFFE (Thumb16 B).
4434 pub const R_ARM_THM_PC11: u32 = 102;
4435 /// PC relative & 0x1FE (Thumb16 B/B<cond>).
4436 pub const R_ARM_THM_PC9: u32 = 103;
4437 /// PC-rel 32 bit for global dynamic thread local data
4438 pub const R_ARM_TLS_GD32: u32 = 104;
4439 /// PC-rel 32 bit for local dynamic thread local data
4440 pub const R_ARM_TLS_LDM32: u32 = 105;
4441 /// 32 bit offset relative to TLS block
4442 pub const R_ARM_TLS_LDO32: u32 = 106;
4443 /// PC-rel 32 bit for GOT entry of static TLS block offset
4444 pub const R_ARM_TLS_IE32: u32 = 107;
4445 /// 32 bit offset relative to static TLS block
4446 pub const R_ARM_TLS_LE32: u32 = 108;
4447 /// 12 bit relative to TLS block (LDR, STR).
4448 pub const R_ARM_TLS_LDO12: u32 = 109;
4449 /// 12 bit relative to static TLS block (LDR, STR).
4450 pub const R_ARM_TLS_LE12: u32 = 110;
4451 /// 12 bit GOT entry relative to GOT origin (LDR).
4452 pub const R_ARM_TLS_IE12GP: u32 = 111;
4453 /// Obsolete.
4454 pub const R_ARM_ME_TOO: u32 = 128;
4455 #[allow(missing_docs)]
4456 pub const R_ARM_THM_TLS_DESCSEQ: u32 = 129;
4457 #[allow(missing_docs)]
4458 pub const R_ARM_THM_TLS_DESCSEQ16: u32 = 129;
4459 #[allow(missing_docs)]
4460 pub const R_ARM_THM_TLS_DESCSEQ32: u32 = 130;
4461 /// GOT entry relative to GOT origin, 12 bit (Thumb32 LDR).
4462 pub const R_ARM_THM_GOT_BREL12: u32 = 131;
4463 #[allow(missing_docs)]
4464 pub const R_ARM_IRELATIVE: u32 = 160;
4465 #[allow(missing_docs)]
4466 pub const R_ARM_RXPC25: u32 = 249;
4467 #[allow(missing_docs)]
4468 pub const R_ARM_RSBREL32: u32 = 250;
4469 #[allow(missing_docs)]
4470 pub const R_ARM_THM_RPC22: u32 = 251;
4471 #[allow(missing_docs)]
4472 pub const R_ARM_RREL32: u32 = 252;
4473 #[allow(missing_docs)]
4474 pub const R_ARM_RABS22: u32 = 253;
4475 #[allow(missing_docs)]
4476 pub const R_ARM_RPC24: u32 = 254;
4477 #[allow(missing_docs)]
4478 pub const R_ARM_RBASE: u32 = 255;
4479 
4480 // C-SKY values for `Rel*::r_type`.
4481 /// no reloc
4482 pub const R_CKCORE_NONE: u32 = 0;
4483 /// direct 32 bit (S + A)
4484 pub const R_CKCORE_ADDR32: u32 = 1;
4485 /// disp ((S + A - P) >> 2) & 0xff
4486 pub const R_CKCORE_PCRELIMM8BY4: u32 = 2;
4487 /// disp ((S + A - P) >> 1) & 0x7ff
4488 pub const R_CKCORE_PCRELIMM11BY2: u32 = 3;
4489 /// 32-bit rel (S + A - P)
4490 pub const R_CKCORE_PCREL32: u32 = 5;
4491 /// disp ((S + A - P) >>1) & 0x7ff
4492 pub const R_CKCORE_PCRELJSR_IMM11BY2: u32 = 6;
4493 /// 32 bit adjust program base(B + A)
4494 pub const R_CKCORE_RELATIVE: u32 = 9;
4495 /// 32 bit adjust by program base
4496 pub const R_CKCORE_COPY: u32 = 10;
4497 /// off between got and sym (S)
4498 pub const R_CKCORE_GLOB_DAT: u32 = 11;
4499 /// PLT entry (S)
4500 pub const R_CKCORE_JUMP_SLOT: u32 = 12;
4501 /// offset to GOT (S + A - GOT)
4502 pub const R_CKCORE_GOTOFF: u32 = 13;
4503 /// PC offset to GOT (GOT + A - P)
4504 pub const R_CKCORE_GOTPC: u32 = 14;
4505 /// 32 bit GOT entry (G)
4506 pub const R_CKCORE_GOT32: u32 = 15;
4507 /// 32 bit PLT entry (G)
4508 pub const R_CKCORE_PLT32: u32 = 16;
4509 /// GOT entry in GLOB_DAT (GOT + G)
4510 pub const R_CKCORE_ADDRGOT: u32 = 17;
4511 /// PLT entry in GLOB_DAT (GOT + G)
4512 pub const R_CKCORE_ADDRPLT: u32 = 18;
4513 /// ((S + A - P) >> 1) & 0x3ff_ffff
4514 pub const R_CKCORE_PCREL_IMM26BY2: u32 = 19;
4515 /// disp ((S + A - P) >> 1) & 0xffff
4516 pub const R_CKCORE_PCREL_IMM16BY2: u32 = 20;
4517 /// disp ((S + A - P) >> 2) & 0xffff
4518 pub const R_CKCORE_PCREL_IMM16BY4: u32 = 21;
4519 /// disp ((S + A - P) >> 1) & 0x3ff
4520 pub const R_CKCORE_PCREL_IMM10BY2: u32 = 22;
4521 /// disp ((S + A - P) >> 2) & 0x3ff
4522 pub const R_CKCORE_PCREL_IMM10BY4: u32 = 23;
4523 /// high & low 16 bit ADDR, ((S + A) >> 16) & 0xffff
4524 pub const R_CKCORE_ADDR_HI16: u32 = 24;
4525 /// (S + A) & 0xffff
4526 pub const R_CKCORE_ADDR_LO16: u32 = 25;
4527 /// high & low 16 bit GOTPC, ((GOT + A - P) >> 16) & 0xffff
4528 pub const R_CKCORE_GOTPC_HI16: u32 = 26;
4529 /// (GOT + A - P) & 0xffff
4530 pub const R_CKCORE_GOTPC_LO16: u32 = 27;
4531 /// high & low 16 bit GOTOFF, ((S + A - GOT) >> 16) & 0xffff
4532 pub const R_CKCORE_GOTOFF_HI16: u32 = 28;
4533 /// (S + A - GOT) & 0xffff
4534 pub const R_CKCORE_GOTOFF_LO16: u32 = 29;
4535 /// 12 bit disp GOT entry (G)
4536 pub const R_CKCORE_GOT12: u32 = 30;
4537 /// high & low 16 bit GOT, (G >> 16) & 0xffff
4538 pub const R_CKCORE_GOT_HI16: u32 = 31;
4539 /// (G & 0xffff)
4540 pub const R_CKCORE_GOT_LO16: u32 = 32;
4541 /// 12 bit disp PLT entry (G)
4542 pub const R_CKCORE_PLT12: u32 = 33;
4543 /// high & low 16 bit PLT, (G >> 16) & 0xffff
4544 pub const R_CKCORE_PLT_HI16: u32 = 34;
4545 /// G & 0xffff
4546 pub const R_CKCORE_PLT_LO16: u32 = 35;
4547 /// high & low 16 bit ADDRGOT, (GOT + G * 4) & 0xffff
4548 pub const R_CKCORE_ADDRGOT_HI16: u32 = 36;
4549 /// (GOT + G * 4) & 0xffff
4550 pub const R_CKCORE_ADDRGOT_LO16: u32 = 37;
4551 /// high & low 16 bit ADDRPLT, ((GOT + G * 4) >> 16) & 0xFFFF
4552 pub const R_CKCORE_ADDRPLT_HI16: u32 = 38;
4553 /// (GOT+G*4) & 0xffff
4554 pub const R_CKCORE_ADDRPLT_LO16: u32 = 39;
4555 /// disp ((S+A-P) >>1) & x3ff_ffff
4556 pub const R_CKCORE_PCREL_JSR_IMM26BY2: u32 = 40;
4557 /// (S+A-BTEXT) & 0xffff
4558 pub const R_CKCORE_TOFFSET_LO16: u32 = 41;
4559 /// (S+A-BTEXT) & 0xffff
4560 pub const R_CKCORE_DOFFSET_LO16: u32 = 42;
4561 /// disp ((S+A-P) >>1) & 0x3ffff
4562 pub const R_CKCORE_PCREL_IMM18BY2: u32 = 43;
4563 /// disp (S+A-BDATA) & 0x3ffff
4564 pub const R_CKCORE_DOFFSET_IMM18: u32 = 44;
4565 /// disp ((S+A-BDATA)>>1) & 0x3ffff
4566 pub const R_CKCORE_DOFFSET_IMM18BY2: u32 = 45;
4567 /// disp ((S+A-BDATA)>>2) & 0x3ffff
4568 pub const R_CKCORE_DOFFSET_IMM18BY4: u32 = 46;
4569 /// disp (G >> 2)
4570 pub const R_CKCORE_GOT_IMM18BY4: u32 = 48;
4571 /// disp (G >> 2)
4572 pub const R_CKCORE_PLT_IMM18BY4: u32 = 49;
4573 /// disp ((S+A-P) >>2) & 0x7f
4574 pub const R_CKCORE_PCREL_IMM7BY4: u32 = 50;
4575 /// 32 bit offset to TLS block
4576 pub const R_CKCORE_TLS_LE32: u32 = 51;
4577 #[allow(missing_docs)]
4578 pub const R_CKCORE_TLS_IE32: u32 = 52;
4579 #[allow(missing_docs)]
4580 pub const R_CKCORE_TLS_GD32: u32 = 53;
4581 #[allow(missing_docs)]
4582 pub const R_CKCORE_TLS_LDM32: u32 = 54;
4583 #[allow(missing_docs)]
4584 pub const R_CKCORE_TLS_LDO32: u32 = 55;
4585 #[allow(missing_docs)]
4586 pub const R_CKCORE_TLS_DTPMOD32: u32 = 56;
4587 #[allow(missing_docs)]
4588 pub const R_CKCORE_TLS_DTPOFF32: u32 = 57;
4589 #[allow(missing_docs)]
4590 pub const R_CKCORE_TLS_TPOFF32: u32 = 58;
4591 
4592 // C-SKY values for `FileHeader*::e_flags`.
4593 #[allow(missing_docs)]
4594 pub const EF_CSKY_ABIMASK: u32 = 0xF000_0000;
4595 #[allow(missing_docs)]
4596 pub const EF_CSKY_OTHER: u32 = 0x0FFF_0000;
4597 #[allow(missing_docs)]
4598 pub const EF_CSKY_PROCESSOR: u32 = 0x0000_FFFF;
4599 
4600 #[allow(missing_docs)]
4601 pub const EF_CSKY_ABIV1: u32 = 0x1000_0000;
4602 #[allow(missing_docs)]
4603 pub const EF_CSKY_ABIV2: u32 = 0x2000_0000;
4604 
4605 // C-SKY values for `SectionHeader*::sh_type`.
4606 /// C-SKY attributes section.
4607 pub const SHT_CSKY_ATTRIBUTES: u32 = SHT_LOPROC + 1;
4608 
4609 // IA-64 specific declarations.
4610 
4611 // IA-64 values for `FileHeader64::e_flags`.
4612 /// os-specific flags
4613 pub const EF_IA_64_MASKOS: u32 = 0x0000_000f;
4614 /// 64-bit ABI
4615 pub const EF_IA_64_ABI64: u32 = 0x0000_0010;
4616 /// arch. version mask
4617 pub const EF_IA_64_ARCH: u32 = 0xff00_0000;
4618 
4619 // IA-64 values for `ProgramHeader64::p_type`.
4620 /// arch extension bits
4621 pub const PT_IA_64_ARCHEXT: u32 = PT_LOPROC + 0;
4622 /// ia64 unwind bits
4623 pub const PT_IA_64_UNWIND: u32 = PT_LOPROC + 1;
4624 #[allow(missing_docs)]
4625 pub const PT_IA_64_HP_OPT_ANOT: u32 = PT_LOOS + 0x12;
4626 #[allow(missing_docs)]
4627 pub const PT_IA_64_HP_HSL_ANOT: u32 = PT_LOOS + 0x13;
4628 #[allow(missing_docs)]
4629 pub const PT_IA_64_HP_STACK: u32 = PT_LOOS + 0x14;
4630 
4631 // IA-64 values for `ProgramHeader64::p_flags`.
4632 /// spec insns w/o recovery
4633 pub const PF_IA_64_NORECOV: u32 = 0x8000_0000;
4634 
4635 // IA-64 values for `SectionHeader64::sh_type`.
4636 /// extension bits
4637 pub const SHT_IA_64_EXT: u32 = SHT_LOPROC + 0;
4638 /// unwind bits
4639 pub const SHT_IA_64_UNWIND: u32 = SHT_LOPROC + 1;
4640 
4641 // IA-64 values for `SectionHeader64::sh_flags`.
4642 /// section near gp
4643 pub const SHF_IA_64_SHORT: u32 = 0x1000_0000;
4644 /// spec insns w/o recovery
4645 pub const SHF_IA_64_NORECOV: u32 = 0x2000_0000;
4646 
4647 // IA-64 values for `Dyn64::d_tag`.
4648 #[allow(missing_docs)]
4649 pub const DT_IA_64_PLT_RESERVE: u32 = DT_LOPROC + 0;
4650 
4651 // IA-64 values for `Rel*::r_type`.
4652 /// none
4653 pub const R_IA64_NONE: u32 = 0x00;
4654 /// symbol + addend, add imm14
4655 pub const R_IA64_IMM14: u32 = 0x21;
4656 /// symbol + addend, add imm22
4657 pub const R_IA64_IMM22: u32 = 0x22;
4658 /// symbol + addend, mov imm64
4659 pub const R_IA64_IMM64: u32 = 0x23;
4660 /// symbol + addend, data4 MSB
4661 pub const R_IA64_DIR32MSB: u32 = 0x24;
4662 /// symbol + addend, data4 LSB
4663 pub const R_IA64_DIR32LSB: u32 = 0x25;
4664 /// symbol + addend, data8 MSB
4665 pub const R_IA64_DIR64MSB: u32 = 0x26;
4666 /// symbol + addend, data8 LSB
4667 pub const R_IA64_DIR64LSB: u32 = 0x27;
4668 /// @gprel(sym + add), add imm22
4669 pub const R_IA64_GPREL22: u32 = 0x2a;
4670 /// @gprel(sym + add), mov imm64
4671 pub const R_IA64_GPREL64I: u32 = 0x2b;
4672 /// @gprel(sym + add), data4 MSB
4673 pub const R_IA64_GPREL32MSB: u32 = 0x2c;
4674 /// @gprel(sym + add), data4 LSB
4675 pub const R_IA64_GPREL32LSB: u32 = 0x2d;
4676 /// @gprel(sym + add), data8 MSB
4677 pub const R_IA64_GPREL64MSB: u32 = 0x2e;
4678 /// @gprel(sym + add), data8 LSB
4679 pub const R_IA64_GPREL64LSB: u32 = 0x2f;
4680 /// @ltoff(sym + add), add imm22
4681 pub const R_IA64_LTOFF22: u32 = 0x32;
4682 /// @ltoff(sym + add), mov imm64
4683 pub const R_IA64_LTOFF64I: u32 = 0x33;
4684 /// @pltoff(sym + add), add imm22
4685 pub const R_IA64_PLTOFF22: u32 = 0x3a;
4686 /// @pltoff(sym + add), mov imm64
4687 pub const R_IA64_PLTOFF64I: u32 = 0x3b;
4688 /// @pltoff(sym + add), data8 MSB
4689 pub const R_IA64_PLTOFF64MSB: u32 = 0x3e;
4690 /// @pltoff(sym + add), data8 LSB
4691 pub const R_IA64_PLTOFF64LSB: u32 = 0x3f;
4692 /// @fptr(sym + add), mov imm64
4693 pub const R_IA64_FPTR64I: u32 = 0x43;
4694 /// @fptr(sym + add), data4 MSB
4695 pub const R_IA64_FPTR32MSB: u32 = 0x44;
4696 /// @fptr(sym + add), data4 LSB
4697 pub const R_IA64_FPTR32LSB: u32 = 0x45;
4698 /// @fptr(sym + add), data8 MSB
4699 pub const R_IA64_FPTR64MSB: u32 = 0x46;
4700 /// @fptr(sym + add), data8 LSB
4701 pub const R_IA64_FPTR64LSB: u32 = 0x47;
4702 /// @pcrel(sym + add), brl
4703 pub const R_IA64_PCREL60B: u32 = 0x48;
4704 /// @pcrel(sym + add), ptb, call
4705 pub const R_IA64_PCREL21B: u32 = 0x49;
4706 /// @pcrel(sym + add), chk.s
4707 pub const R_IA64_PCREL21M: u32 = 0x4a;
4708 /// @pcrel(sym + add), fchkf
4709 pub const R_IA64_PCREL21F: u32 = 0x4b;
4710 /// @pcrel(sym + add), data4 MSB
4711 pub const R_IA64_PCREL32MSB: u32 = 0x4c;
4712 /// @pcrel(sym + add), data4 LSB
4713 pub const R_IA64_PCREL32LSB: u32 = 0x4d;
4714 /// @pcrel(sym + add), data8 MSB
4715 pub const R_IA64_PCREL64MSB: u32 = 0x4e;
4716 /// @pcrel(sym + add), data8 LSB
4717 pub const R_IA64_PCREL64LSB: u32 = 0x4f;
4718 /// @ltoff(@fptr(s+a)), imm22
4719 pub const R_IA64_LTOFF_FPTR22: u32 = 0x52;
4720 /// @ltoff(@fptr(s+a)), imm64
4721 pub const R_IA64_LTOFF_FPTR64I: u32 = 0x53;
4722 /// @ltoff(@fptr(s+a)), data4 MSB
4723 pub const R_IA64_LTOFF_FPTR32MSB: u32 = 0x54;
4724 /// @ltoff(@fptr(s+a)), data4 LSB
4725 pub const R_IA64_LTOFF_FPTR32LSB: u32 = 0x55;
4726 /// @ltoff(@fptr(s+a)), data8 MSB
4727 pub const R_IA64_LTOFF_FPTR64MSB: u32 = 0x56;
4728 /// @ltoff(@fptr(s+a)), data8 LSB
4729 pub const R_IA64_LTOFF_FPTR64LSB: u32 = 0x57;
4730 /// @segrel(sym + add), data4 MSB
4731 pub const R_IA64_SEGREL32MSB: u32 = 0x5c;
4732 /// @segrel(sym + add), data4 LSB
4733 pub const R_IA64_SEGREL32LSB: u32 = 0x5d;
4734 /// @segrel(sym + add), data8 MSB
4735 pub const R_IA64_SEGREL64MSB: u32 = 0x5e;
4736 /// @segrel(sym + add), data8 LSB
4737 pub const R_IA64_SEGREL64LSB: u32 = 0x5f;
4738 /// @secrel(sym + add), data4 MSB
4739 pub const R_IA64_SECREL32MSB: u32 = 0x64;
4740 /// @secrel(sym + add), data4 LSB
4741 pub const R_IA64_SECREL32LSB: u32 = 0x65;
4742 /// @secrel(sym + add), data8 MSB
4743 pub const R_IA64_SECREL64MSB: u32 = 0x66;
4744 /// @secrel(sym + add), data8 LSB
4745 pub const R_IA64_SECREL64LSB: u32 = 0x67;
4746 /// data 4 + REL
4747 pub const R_IA64_REL32MSB: u32 = 0x6c;
4748 /// data 4 + REL
4749 pub const R_IA64_REL32LSB: u32 = 0x6d;
4750 /// data 8 + REL
4751 pub const R_IA64_REL64MSB: u32 = 0x6e;
4752 /// data 8 + REL
4753 pub const R_IA64_REL64LSB: u32 = 0x6f;
4754 /// symbol + addend, data4 MSB
4755 pub const R_IA64_LTV32MSB: u32 = 0x74;
4756 /// symbol + addend, data4 LSB
4757 pub const R_IA64_LTV32LSB: u32 = 0x75;
4758 /// symbol + addend, data8 MSB
4759 pub const R_IA64_LTV64MSB: u32 = 0x76;
4760 /// symbol + addend, data8 LSB
4761 pub const R_IA64_LTV64LSB: u32 = 0x77;
4762 /// @pcrel(sym + add), 21bit inst
4763 pub const R_IA64_PCREL21BI: u32 = 0x79;
4764 /// @pcrel(sym + add), 22bit inst
4765 pub const R_IA64_PCREL22: u32 = 0x7a;
4766 /// @pcrel(sym + add), 64bit inst
4767 pub const R_IA64_PCREL64I: u32 = 0x7b;
4768 /// dynamic reloc, imported PLT, MSB
4769 pub const R_IA64_IPLTMSB: u32 = 0x80;
4770 /// dynamic reloc, imported PLT, LSB
4771 pub const R_IA64_IPLTLSB: u32 = 0x81;
4772 /// copy relocation
4773 pub const R_IA64_COPY: u32 = 0x84;
4774 /// Addend and symbol difference
4775 pub const R_IA64_SUB: u32 = 0x85;
4776 /// LTOFF22, relaxable.
4777 pub const R_IA64_LTOFF22X: u32 = 0x86;
4778 /// Use of LTOFF22X.
4779 pub const R_IA64_LDXMOV: u32 = 0x87;
4780 /// @tprel(sym + add), imm14
4781 pub const R_IA64_TPREL14: u32 = 0x91;
4782 /// @tprel(sym + add), imm22
4783 pub const R_IA64_TPREL22: u32 = 0x92;
4784 /// @tprel(sym + add), imm64
4785 pub const R_IA64_TPREL64I: u32 = 0x93;
4786 /// @tprel(sym + add), data8 MSB
4787 pub const R_IA64_TPREL64MSB: u32 = 0x96;
4788 /// @tprel(sym + add), data8 LSB
4789 pub const R_IA64_TPREL64LSB: u32 = 0x97;
4790 /// @ltoff(@tprel(s+a)), imm2
4791 pub const R_IA64_LTOFF_TPREL22: u32 = 0x9a;
4792 /// @dtpmod(sym + add), data8 MSB
4793 pub const R_IA64_DTPMOD64MSB: u32 = 0xa6;
4794 /// @dtpmod(sym + add), data8 LSB
4795 pub const R_IA64_DTPMOD64LSB: u32 = 0xa7;
4796 /// @ltoff(@dtpmod(sym + add)), imm22
4797 pub const R_IA64_LTOFF_DTPMOD22: u32 = 0xaa;
4798 /// @dtprel(sym + add), imm14
4799 pub const R_IA64_DTPREL14: u32 = 0xb1;
4800 /// @dtprel(sym + add), imm22
4801 pub const R_IA64_DTPREL22: u32 = 0xb2;
4802 /// @dtprel(sym + add), imm64
4803 pub const R_IA64_DTPREL64I: u32 = 0xb3;
4804 /// @dtprel(sym + add), data4 MSB
4805 pub const R_IA64_DTPREL32MSB: u32 = 0xb4;
4806 /// @dtprel(sym + add), data4 LSB
4807 pub const R_IA64_DTPREL32LSB: u32 = 0xb5;
4808 /// @dtprel(sym + add), data8 MSB
4809 pub const R_IA64_DTPREL64MSB: u32 = 0xb6;
4810 /// @dtprel(sym + add), data8 LSB
4811 pub const R_IA64_DTPREL64LSB: u32 = 0xb7;
4812 /// @ltoff(@dtprel(s+a)), imm22
4813 pub const R_IA64_LTOFF_DTPREL22: u32 = 0xba;
4814 
4815 // SH specific declarations.
4816 
4817 // SH values `FileHeader*::e_flags`.
4818 #[allow(missing_docs)]
4819 pub const EF_SH_MACH_MASK: u32 = 0x1f;
4820 #[allow(missing_docs)]
4821 pub const EF_SH_UNKNOWN: u32 = 0x0;
4822 #[allow(missing_docs)]
4823 pub const EF_SH1: u32 = 0x1;
4824 #[allow(missing_docs)]
4825 pub const EF_SH2: u32 = 0x2;
4826 #[allow(missing_docs)]
4827 pub const EF_SH3: u32 = 0x3;
4828 #[allow(missing_docs)]
4829 pub const EF_SH_DSP: u32 = 0x4;
4830 #[allow(missing_docs)]
4831 pub const EF_SH3_DSP: u32 = 0x5;
4832 #[allow(missing_docs)]
4833 pub const EF_SH4AL_DSP: u32 = 0x6;
4834 #[allow(missing_docs)]
4835 pub const EF_SH3E: u32 = 0x8;
4836 #[allow(missing_docs)]
4837 pub const EF_SH4: u32 = 0x9;
4838 #[allow(missing_docs)]
4839 pub const EF_SH2E: u32 = 0xb;
4840 #[allow(missing_docs)]
4841 pub const EF_SH4A: u32 = 0xc;
4842 #[allow(missing_docs)]
4843 pub const EF_SH2A: u32 = 0xd;
4844 #[allow(missing_docs)]
4845 pub const EF_SH4_NOFPU: u32 = 0x10;
4846 #[allow(missing_docs)]
4847 pub const EF_SH4A_NOFPU: u32 = 0x11;
4848 #[allow(missing_docs)]
4849 pub const EF_SH4_NOMMU_NOFPU: u32 = 0x12;
4850 #[allow(missing_docs)]
4851 pub const EF_SH2A_NOFPU: u32 = 0x13;
4852 #[allow(missing_docs)]
4853 pub const EF_SH3_NOMMU: u32 = 0x14;
4854 #[allow(missing_docs)]
4855 pub const EF_SH2A_SH4_NOFPU: u32 = 0x15;
4856 #[allow(missing_docs)]
4857 pub const EF_SH2A_SH3_NOFPU: u32 = 0x16;
4858 #[allow(missing_docs)]
4859 pub const EF_SH2A_SH4: u32 = 0x17;
4860 #[allow(missing_docs)]
4861 pub const EF_SH2A_SH3E: u32 = 0x18;
4862 
4863 // SH values `Rel*::r_type`.
4864 #[allow(missing_docs)]
4865 pub const R_SH_NONE: u32 = 0;
4866 #[allow(missing_docs)]
4867 pub const R_SH_DIR32: u32 = 1;
4868 #[allow(missing_docs)]
4869 pub const R_SH_REL32: u32 = 2;
4870 #[allow(missing_docs)]
4871 pub const R_SH_DIR8WPN: u32 = 3;
4872 #[allow(missing_docs)]
4873 pub const R_SH_IND12W: u32 = 4;
4874 #[allow(missing_docs)]
4875 pub const R_SH_DIR8WPL: u32 = 5;
4876 #[allow(missing_docs)]
4877 pub const R_SH_DIR8WPZ: u32 = 6;
4878 #[allow(missing_docs)]
4879 pub const R_SH_DIR8BP: u32 = 7;
4880 #[allow(missing_docs)]
4881 pub const R_SH_DIR8W: u32 = 8;
4882 #[allow(missing_docs)]
4883 pub const R_SH_DIR8L: u32 = 9;
4884 #[allow(missing_docs)]
4885 pub const R_SH_SWITCH16: u32 = 25;
4886 #[allow(missing_docs)]
4887 pub const R_SH_SWITCH32: u32 = 26;
4888 #[allow(missing_docs)]
4889 pub const R_SH_USES: u32 = 27;
4890 #[allow(missing_docs)]
4891 pub const R_SH_COUNT: u32 = 28;
4892 #[allow(missing_docs)]
4893 pub const R_SH_ALIGN: u32 = 29;
4894 #[allow(missing_docs)]
4895 pub const R_SH_CODE: u32 = 30;
4896 #[allow(missing_docs)]
4897 pub const R_SH_DATA: u32 = 31;
4898 #[allow(missing_docs)]
4899 pub const R_SH_LABEL: u32 = 32;
4900 #[allow(missing_docs)]
4901 pub const R_SH_SWITCH8: u32 = 33;
4902 #[allow(missing_docs)]
4903 pub const R_SH_GNU_VTINHERIT: u32 = 34;
4904 #[allow(missing_docs)]
4905 pub const R_SH_GNU_VTENTRY: u32 = 35;
4906 #[allow(missing_docs)]
4907 pub const R_SH_TLS_GD_32: u32 = 144;
4908 #[allow(missing_docs)]
4909 pub const R_SH_TLS_LD_32: u32 = 145;
4910 #[allow(missing_docs)]
4911 pub const R_SH_TLS_LDO_32: u32 = 146;
4912 #[allow(missing_docs)]
4913 pub const R_SH_TLS_IE_32: u32 = 147;
4914 #[allow(missing_docs)]
4915 pub const R_SH_TLS_LE_32: u32 = 148;
4916 #[allow(missing_docs)]
4917 pub const R_SH_TLS_DTPMOD32: u32 = 149;
4918 #[allow(missing_docs)]
4919 pub const R_SH_TLS_DTPOFF32: u32 = 150;
4920 #[allow(missing_docs)]
4921 pub const R_SH_TLS_TPOFF32: u32 = 151;
4922 #[allow(missing_docs)]
4923 pub const R_SH_GOT32: u32 = 160;
4924 #[allow(missing_docs)]
4925 pub const R_SH_PLT32: u32 = 161;
4926 #[allow(missing_docs)]
4927 pub const R_SH_COPY: u32 = 162;
4928 #[allow(missing_docs)]
4929 pub const R_SH_GLOB_DAT: u32 = 163;
4930 #[allow(missing_docs)]
4931 pub const R_SH_JMP_SLOT: u32 = 164;
4932 #[allow(missing_docs)]
4933 pub const R_SH_RELATIVE: u32 = 165;
4934 #[allow(missing_docs)]
4935 pub const R_SH_GOTOFF: u32 = 166;
4936 #[allow(missing_docs)]
4937 pub const R_SH_GOTPC: u32 = 167;
4938 
4939 // S/390 specific definitions.
4940 
4941 // S/390 values `FileHeader*::e_flags`.
4942 
4943 /// High GPRs kernel facility needed.
4944 pub const EF_S390_HIGH_GPRS: u32 = 0x0000_0001;
4945 
4946 // S/390 values `Rel*::r_type`.
4947 
4948 /// No reloc.
4949 pub const R_390_NONE: u32 = 0;
4950 /// Direct 8 bit.
4951 pub const R_390_8: u32 = 1;
4952 /// Direct 12 bit.
4953 pub const R_390_12: u32 = 2;
4954 /// Direct 16 bit.
4955 pub const R_390_16: u32 = 3;
4956 /// Direct 32 bit.
4957 pub const R_390_32: u32 = 4;
4958 /// PC relative 32 bit.
4959 pub const R_390_PC32: u32 = 5;
4960 /// 12 bit GOT offset.
4961 pub const R_390_GOT12: u32 = 6;
4962 /// 32 bit GOT offset.
4963 pub const R_390_GOT32: u32 = 7;
4964 /// 32 bit PC relative PLT address.
4965 pub const R_390_PLT32: u32 = 8;
4966 /// Copy symbol at runtime.
4967 pub const R_390_COPY: u32 = 9;
4968 /// Create GOT entry.
4969 pub const R_390_GLOB_DAT: u32 = 10;
4970 /// Create PLT entry.
4971 pub const R_390_JMP_SLOT: u32 = 11;
4972 /// Adjust by program base.
4973 pub const R_390_RELATIVE: u32 = 12;
4974 /// 32 bit offset to GOT.
4975 pub const R_390_GOTOFF32: u32 = 13;
4976 /// 32 bit PC relative offset to GOT.
4977 pub const R_390_GOTPC: u32 = 14;
4978 /// 16 bit GOT offset.
4979 pub const R_390_GOT16: u32 = 15;
4980 /// PC relative 16 bit.
4981 pub const R_390_PC16: u32 = 16;
4982 /// PC relative 16 bit shifted by 1.
4983 pub const R_390_PC16DBL: u32 = 17;
4984 /// 16 bit PC rel. PLT shifted by 1.
4985 pub const R_390_PLT16DBL: u32 = 18;
4986 /// PC relative 32 bit shifted by 1.
4987 pub const R_390_PC32DBL: u32 = 19;
4988 /// 32 bit PC rel. PLT shifted by 1.
4989 pub const R_390_PLT32DBL: u32 = 20;
4990 /// 32 bit PC rel. GOT shifted by 1.
4991 pub const R_390_GOTPCDBL: u32 = 21;
4992 /// Direct 64 bit.
4993 pub const R_390_64: u32 = 22;
4994 /// PC relative 64 bit.
4995 pub const R_390_PC64: u32 = 23;
4996 /// 64 bit GOT offset.
4997 pub const R_390_GOT64: u32 = 24;
4998 /// 64 bit PC relative PLT address.
4999 pub const R_390_PLT64: u32 = 25;
5000 /// 32 bit PC rel. to GOT entry >> 1.
5001 pub const R_390_GOTENT: u32 = 26;
5002 /// 16 bit offset to GOT.
5003 pub const R_390_GOTOFF16: u32 = 27;
5004 /// 64 bit offset to GOT.
5005 pub const R_390_GOTOFF64: u32 = 28;
5006 /// 12 bit offset to jump slot.
5007 pub const R_390_GOTPLT12: u32 = 29;
5008 /// 16 bit offset to jump slot.
5009 pub const R_390_GOTPLT16: u32 = 30;
5010 /// 32 bit offset to jump slot.
5011 pub const R_390_GOTPLT32: u32 = 31;
5012 /// 64 bit offset to jump slot.
5013 pub const R_390_GOTPLT64: u32 = 32;
5014 /// 32 bit rel. offset to jump slot.
5015 pub const R_390_GOTPLTENT: u32 = 33;
5016 /// 16 bit offset from GOT to PLT.
5017 pub const R_390_PLTOFF16: u32 = 34;
5018 /// 32 bit offset from GOT to PLT.
5019 pub const R_390_PLTOFF32: u32 = 35;
5020 /// 16 bit offset from GOT to PLT.
5021 pub const R_390_PLTOFF64: u32 = 36;
5022 /// Tag for load insn in TLS code.
5023 pub const R_390_TLS_LOAD: u32 = 37;
5024 /// Tag for function call in general dynamic TLS code.
5025 pub const R_390_TLS_GDCALL: u32 = 38;
5026 /// Tag for function call in local dynamic TLS code.
5027 pub const R_390_TLS_LDCALL: u32 = 39;
5028 /// Direct 32 bit for general dynamic thread local data.
5029 pub const R_390_TLS_GD32: u32 = 40;
5030 /// Direct 64 bit for general dynamic thread local data.
5031 pub const R_390_TLS_GD64: u32 = 41;
5032 /// 12 bit GOT offset for static TLS block offset.
5033 pub const R_390_TLS_GOTIE12: u32 = 42;
5034 /// 32 bit GOT offset for static TLS block offset.
5035 pub const R_390_TLS_GOTIE32: u32 = 43;
5036 /// 64 bit GOT offset for static TLS block offset.
5037 pub const R_390_TLS_GOTIE64: u32 = 44;
5038 /// Direct 32 bit for local dynamic thread local data in LE code.
5039 pub const R_390_TLS_LDM32: u32 = 45;
5040 /// Direct 64 bit for local dynamic thread local data in LE code.
5041 pub const R_390_TLS_LDM64: u32 = 46;
5042 /// 32 bit address of GOT entry for negated static TLS block offset.
5043 pub const R_390_TLS_IE32: u32 = 47;
5044 /// 64 bit address of GOT entry for negated static TLS block offset.
5045 pub const R_390_TLS_IE64: u32 = 48;
5046 /// 32 bit rel. offset to GOT entry for negated static TLS block offset.
5047 pub const R_390_TLS_IEENT: u32 = 49;
5048 /// 32 bit negated offset relative to static TLS block.
5049 pub const R_390_TLS_LE32: u32 = 50;
5050 /// 64 bit negated offset relative to static TLS block.
5051 pub const R_390_TLS_LE64: u32 = 51;
5052 /// 32 bit offset relative to TLS block.
5053 pub const R_390_TLS_LDO32: u32 = 52;
5054 /// 64 bit offset relative to TLS block.
5055 pub const R_390_TLS_LDO64: u32 = 53;
5056 /// ID of module containing symbol.
5057 pub const R_390_TLS_DTPMOD: u32 = 54;
5058 /// Offset in TLS block.
5059 pub const R_390_TLS_DTPOFF: u32 = 55;
5060 /// Negated offset in static TLS block.
5061 pub const R_390_TLS_TPOFF: u32 = 56;
5062 /// Direct 20 bit.
5063 pub const R_390_20: u32 = 57;
5064 /// 20 bit GOT offset.
5065 pub const R_390_GOT20: u32 = 58;
5066 /// 20 bit offset to jump slot.
5067 pub const R_390_GOTPLT20: u32 = 59;
5068 /// 20 bit GOT offset for static TLS block offset.
5069 pub const R_390_TLS_GOTIE20: u32 = 60;
5070 /// STT_GNU_IFUNC relocation.
5071 pub const R_390_IRELATIVE: u32 = 61;
5072 
5073 // CRIS values `Rel*::r_type`.
5074 #[allow(missing_docs)]
5075 pub const R_CRIS_NONE: u32 = 0;
5076 #[allow(missing_docs)]
5077 pub const R_CRIS_8: u32 = 1;
5078 #[allow(missing_docs)]
5079 pub const R_CRIS_16: u32 = 2;
5080 #[allow(missing_docs)]
5081 pub const R_CRIS_32: u32 = 3;
5082 #[allow(missing_docs)]
5083 pub const R_CRIS_8_PCREL: u32 = 4;
5084 #[allow(missing_docs)]
5085 pub const R_CRIS_16_PCREL: u32 = 5;
5086 #[allow(missing_docs)]
5087 pub const R_CRIS_32_PCREL: u32 = 6;
5088 #[allow(missing_docs)]
5089 pub const R_CRIS_GNU_VTINHERIT: u32 = 7;
5090 #[allow(missing_docs)]
5091 pub const R_CRIS_GNU_VTENTRY: u32 = 8;
5092 #[allow(missing_docs)]
5093 pub const R_CRIS_COPY: u32 = 9;
5094 #[allow(missing_docs)]
5095 pub const R_CRIS_GLOB_DAT: u32 = 10;
5096 #[allow(missing_docs)]
5097 pub const R_CRIS_JUMP_SLOT: u32 = 11;
5098 #[allow(missing_docs)]
5099 pub const R_CRIS_RELATIVE: u32 = 12;
5100 #[allow(missing_docs)]
5101 pub const R_CRIS_16_GOT: u32 = 13;
5102 #[allow(missing_docs)]
5103 pub const R_CRIS_32_GOT: u32 = 14;
5104 #[allow(missing_docs)]
5105 pub const R_CRIS_16_GOTPLT: u32 = 15;
5106 #[allow(missing_docs)]
5107 pub const R_CRIS_32_GOTPLT: u32 = 16;
5108 #[allow(missing_docs)]
5109 pub const R_CRIS_32_GOTREL: u32 = 17;
5110 #[allow(missing_docs)]
5111 pub const R_CRIS_32_PLT_GOTREL: u32 = 18;
5112 #[allow(missing_docs)]
5113 pub const R_CRIS_32_PLT_PCREL: u32 = 19;
5114 
5115 // AMD x86-64 values `Rel*::r_type`.
5116 /// No reloc
5117 pub const R_X86_64_NONE: u32 = 0;
5118 /// Direct 64 bit
5119 pub const R_X86_64_64: u32 = 1;
5120 /// PC relative 32 bit signed
5121 pub const R_X86_64_PC32: u32 = 2;
5122 /// 32 bit GOT entry
5123 pub const R_X86_64_GOT32: u32 = 3;
5124 /// 32 bit PLT address
5125 pub const R_X86_64_PLT32: u32 = 4;
5126 /// Copy symbol at runtime
5127 pub const R_X86_64_COPY: u32 = 5;
5128 /// Create GOT entry
5129 pub const R_X86_64_GLOB_DAT: u32 = 6;
5130 /// Create PLT entry
5131 pub const R_X86_64_JUMP_SLOT: u32 = 7;
5132 /// Adjust by program base
5133 pub const R_X86_64_RELATIVE: u32 = 8;
5134 /// 32 bit signed PC relative offset to GOT
5135 pub const R_X86_64_GOTPCREL: u32 = 9;
5136 /// Direct 32 bit zero extended
5137 pub const R_X86_64_32: u32 = 10;
5138 /// Direct 32 bit sign extended
5139 pub const R_X86_64_32S: u32 = 11;
5140 /// Direct 16 bit zero extended
5141 pub const R_X86_64_16: u32 = 12;
5142 /// 16 bit sign extended pc relative
5143 pub const R_X86_64_PC16: u32 = 13;
5144 /// Direct 8 bit sign extended
5145 pub const R_X86_64_8: u32 = 14;
5146 /// 8 bit sign extended pc relative
5147 pub const R_X86_64_PC8: u32 = 15;
5148 /// ID of module containing symbol
5149 pub const R_X86_64_DTPMOD64: u32 = 16;
5150 /// Offset in module's TLS block
5151 pub const R_X86_64_DTPOFF64: u32 = 17;
5152 /// Offset in initial TLS block
5153 pub const R_X86_64_TPOFF64: u32 = 18;
5154 /// 32 bit signed PC relative offset to two GOT entries for GD symbol
5155 pub const R_X86_64_TLSGD: u32 = 19;
5156 /// 32 bit signed PC relative offset to two GOT entries for LD symbol
5157 pub const R_X86_64_TLSLD: u32 = 20;
5158 /// Offset in TLS block
5159 pub const R_X86_64_DTPOFF32: u32 = 21;
5160 /// 32 bit signed PC relative offset to GOT entry for IE symbol
5161 pub const R_X86_64_GOTTPOFF: u32 = 22;
5162 /// Offset in initial TLS block
5163 pub const R_X86_64_TPOFF32: u32 = 23;
5164 /// PC relative 64 bit
5165 pub const R_X86_64_PC64: u32 = 24;
5166 /// 64 bit offset to GOT
5167 pub const R_X86_64_GOTOFF64: u32 = 25;
5168 /// 32 bit signed pc relative offset to GOT
5169 pub const R_X86_64_GOTPC32: u32 = 26;
5170 /// 64-bit GOT entry offset
5171 pub const R_X86_64_GOT64: u32 = 27;
5172 /// 64-bit PC relative offset to GOT entry
5173 pub const R_X86_64_GOTPCREL64: u32 = 28;
5174 /// 64-bit PC relative offset to GOT
5175 pub const R_X86_64_GOTPC64: u32 = 29;
5176 /// like GOT64, says PLT entry needed
5177 pub const R_X86_64_GOTPLT64: u32 = 30;
5178 /// 64-bit GOT relative offset to PLT entry
5179 pub const R_X86_64_PLTOFF64: u32 = 31;
5180 /// Size of symbol plus 32-bit addend
5181 pub const R_X86_64_SIZE32: u32 = 32;
5182 /// Size of symbol plus 64-bit addend
5183 pub const R_X86_64_SIZE64: u32 = 33;
5184 /// GOT offset for TLS descriptor.
5185 pub const R_X86_64_GOTPC32_TLSDESC: u32 = 34;
5186 /// Marker for call through TLS descriptor.
5187 pub const R_X86_64_TLSDESC_CALL: u32 = 35;
5188 /// TLS descriptor.
5189 pub const R_X86_64_TLSDESC: u32 = 36;
5190 /// Adjust indirectly by program base
5191 pub const R_X86_64_IRELATIVE: u32 = 37;
5192 /// 64-bit adjust by program base
5193 pub const R_X86_64_RELATIVE64: u32 = 38;
5194 // 39 Reserved was R_X86_64_PC32_BND
5195 // 40 Reserved was R_X86_64_PLT32_BND
5196 /// Load from 32 bit signed pc relative offset to GOT entry without REX prefix, relaxable.
5197 pub const R_X86_64_GOTPCRELX: u32 = 41;
5198 /// Load from 32 bit signed pc relative offset to GOT entry with REX prefix, relaxable.
5199 pub const R_X86_64_REX_GOTPCRELX: u32 = 42;
5200 
5201 // AMD x86-64 values `SectionHeader*::sh_type`.
5202 /// Unwind information.
5203 pub const SHT_X86_64_UNWIND: u32 = 0x7000_0001;
5204 
5205 // AM33 values `Rel*::r_type`.
5206 /// No reloc.
5207 pub const R_MN10300_NONE: u32 = 0;
5208 /// Direct 32 bit.
5209 pub const R_MN10300_32: u32 = 1;
5210 /// Direct 16 bit.
5211 pub const R_MN10300_16: u32 = 2;
5212 /// Direct 8 bit.
5213 pub const R_MN10300_8: u32 = 3;
5214 /// PC-relative 32-bit.
5215 pub const R_MN10300_PCREL32: u32 = 4;
5216 /// PC-relative 16-bit signed.
5217 pub const R_MN10300_PCREL16: u32 = 5;
5218 /// PC-relative 8-bit signed.
5219 pub const R_MN10300_PCREL8: u32 = 6;
5220 /// Ancient C++ vtable garbage...
5221 pub const R_MN10300_GNU_VTINHERIT: u32 = 7;
5222 /// ... collection annotation.
5223 pub const R_MN10300_GNU_VTENTRY: u32 = 8;
5224 /// Direct 24 bit.
5225 pub const R_MN10300_24: u32 = 9;
5226 /// 32-bit PCrel offset to GOT.
5227 pub const R_MN10300_GOTPC32: u32 = 10;
5228 /// 16-bit PCrel offset to GOT.
5229 pub const R_MN10300_GOTPC16: u32 = 11;
5230 /// 32-bit offset from GOT.
5231 pub const R_MN10300_GOTOFF32: u32 = 12;
5232 /// 24-bit offset from GOT.
5233 pub const R_MN10300_GOTOFF24: u32 = 13;
5234 /// 16-bit offset from GOT.
5235 pub const R_MN10300_GOTOFF16: u32 = 14;
5236 /// 32-bit PCrel to PLT entry.
5237 pub const R_MN10300_PLT32: u32 = 15;
5238 /// 16-bit PCrel to PLT entry.
5239 pub const R_MN10300_PLT16: u32 = 16;
5240 /// 32-bit offset to GOT entry.
5241 pub const R_MN10300_GOT32: u32 = 17;
5242 /// 24-bit offset to GOT entry.
5243 pub const R_MN10300_GOT24: u32 = 18;
5244 /// 16-bit offset to GOT entry.
5245 pub const R_MN10300_GOT16: u32 = 19;
5246 /// Copy symbol at runtime.
5247 pub const R_MN10300_COPY: u32 = 20;
5248 /// Create GOT entry.
5249 pub const R_MN10300_GLOB_DAT: u32 = 21;
5250 /// Create PLT entry.
5251 pub const R_MN10300_JMP_SLOT: u32 = 22;
5252 /// Adjust by program base.
5253 pub const R_MN10300_RELATIVE: u32 = 23;
5254 /// 32-bit offset for global dynamic.
5255 pub const R_MN10300_TLS_GD: u32 = 24;
5256 /// 32-bit offset for local dynamic.
5257 pub const R_MN10300_TLS_LD: u32 = 25;
5258 /// Module-relative offset.
5259 pub const R_MN10300_TLS_LDO: u32 = 26;
5260 /// GOT offset for static TLS block offset.
5261 pub const R_MN10300_TLS_GOTIE: u32 = 27;
5262 /// GOT address for static TLS block offset.
5263 pub const R_MN10300_TLS_IE: u32 = 28;
5264 /// Offset relative to static TLS block.
5265 pub const R_MN10300_TLS_LE: u32 = 29;
5266 /// ID of module containing symbol.
5267 pub const R_MN10300_TLS_DTPMOD: u32 = 30;
5268 /// Offset in module TLS block.
5269 pub const R_MN10300_TLS_DTPOFF: u32 = 31;
5270 /// Offset in static TLS block.
5271 pub const R_MN10300_TLS_TPOFF: u32 = 32;
5272 /// Adjustment for next reloc as needed by linker relaxation.
5273 pub const R_MN10300_SYM_DIFF: u32 = 33;
5274 /// Alignment requirement for linker relaxation.
5275 pub const R_MN10300_ALIGN: u32 = 34;
5276 
5277 // M32R values `Rel32::r_type`.
5278 /// No reloc.
5279 pub const R_M32R_NONE: u32 = 0;
5280 /// Direct 16 bit.
5281 pub const R_M32R_16: u32 = 1;
5282 /// Direct 32 bit.
5283 pub const R_M32R_32: u32 = 2;
5284 /// Direct 24 bit.
5285 pub const R_M32R_24: u32 = 3;
5286 /// PC relative 10 bit shifted.
5287 pub const R_M32R_10_PCREL: u32 = 4;
5288 /// PC relative 18 bit shifted.
5289 pub const R_M32R_18_PCREL: u32 = 5;
5290 /// PC relative 26 bit shifted.
5291 pub const R_M32R_26_PCREL: u32 = 6;
5292 /// High 16 bit with unsigned low.
5293 pub const R_M32R_HI16_ULO: u32 = 7;
5294 /// High 16 bit with signed low.
5295 pub const R_M32R_HI16_SLO: u32 = 8;
5296 /// Low 16 bit.
5297 pub const R_M32R_LO16: u32 = 9;
5298 /// 16 bit offset in SDA.
5299 pub const R_M32R_SDA16: u32 = 10;
5300 #[allow(missing_docs)]
5301 pub const R_M32R_GNU_VTINHERIT: u32 = 11;
5302 #[allow(missing_docs)]
5303 pub const R_M32R_GNU_VTENTRY: u32 = 12;
5304 // M32R values `Rela32::r_type`.
5305 /// Direct 16 bit.
5306 pub const R_M32R_16_RELA: u32 = 33;
5307 /// Direct 32 bit.
5308 pub const R_M32R_32_RELA: u32 = 34;
5309 /// Direct 24 bit.
5310 pub const R_M32R_24_RELA: u32 = 35;
5311 /// PC relative 10 bit shifted.
5312 pub const R_M32R_10_PCREL_RELA: u32 = 36;
5313 /// PC relative 18 bit shifted.
5314 pub const R_M32R_18_PCREL_RELA: u32 = 37;
5315 /// PC relative 26 bit shifted.
5316 pub const R_M32R_26_PCREL_RELA: u32 = 38;
5317 /// High 16 bit with unsigned low
5318 pub const R_M32R_HI16_ULO_RELA: u32 = 39;
5319 /// High 16 bit with signed low
5320 pub const R_M32R_HI16_SLO_RELA: u32 = 40;
5321 /// Low 16 bit
5322 pub const R_M32R_LO16_RELA: u32 = 41;
5323 /// 16 bit offset in SDA
5324 pub const R_M32R_SDA16_RELA: u32 = 42;
5325 #[allow(missing_docs)]
5326 pub const R_M32R_RELA_GNU_VTINHERIT: u32 = 43;
5327 #[allow(missing_docs)]
5328 pub const R_M32R_RELA_GNU_VTENTRY: u32 = 44;
5329 /// PC relative 32 bit.
5330 pub const R_M32R_REL32: u32 = 45;
5331 
5332 /// 24 bit GOT entry
5333 pub const R_M32R_GOT24: u32 = 48;
5334 /// 26 bit PC relative to PLT shifted
5335 pub const R_M32R_26_PLTREL: u32 = 49;
5336 /// Copy symbol at runtime
5337 pub const R_M32R_COPY: u32 = 50;
5338 /// Create GOT entry
5339 pub const R_M32R_GLOB_DAT: u32 = 51;
5340 /// Create PLT entry
5341 pub const R_M32R_JMP_SLOT: u32 = 52;
5342 /// Adjust by program base
5343 pub const R_M32R_RELATIVE: u32 = 53;
5344 /// 24 bit offset to GOT
5345 pub const R_M32R_GOTOFF: u32 = 54;
5346 /// 24 bit PC relative offset to GOT
5347 pub const R_M32R_GOTPC24: u32 = 55;
5348 /// High 16 bit GOT entry with unsigned low
5349 pub const R_M32R_GOT16_HI_ULO: u32 = 56;
5350 /// High 16 bit GOT entry with signed low
5351 pub const R_M32R_GOT16_HI_SLO: u32 = 57;
5352 /// Low 16 bit GOT entry
5353 pub const R_M32R_GOT16_LO: u32 = 58;
5354 /// High 16 bit PC relative offset to GOT with unsigned low
5355 pub const R_M32R_GOTPC_HI_ULO: u32 = 59;
5356 /// High 16 bit PC relative offset to GOT with signed low
5357 pub const R_M32R_GOTPC_HI_SLO: u32 = 60;
5358 /// Low 16 bit PC relative offset to GOT
5359 pub const R_M32R_GOTPC_LO: u32 = 61;
5360 /// High 16 bit offset to GOT with unsigned low
5361 pub const R_M32R_GOTOFF_HI_ULO: u32 = 62;
5362 /// High 16 bit offset to GOT with signed low
5363 pub const R_M32R_GOTOFF_HI_SLO: u32 = 63;
5364 /// Low 16 bit offset to GOT
5365 pub const R_M32R_GOTOFF_LO: u32 = 64;
5366 /// Keep this the last entry.
5367 pub const R_M32R_NUM: u32 = 256;
5368 
5369 // MicroBlaze values `Rel*::r_type`.
5370 /// No reloc.
5371 pub const R_MICROBLAZE_NONE: u32 = 0;
5372 /// Direct 32 bit.
5373 pub const R_MICROBLAZE_32: u32 = 1;
5374 /// PC relative 32 bit.
5375 pub const R_MICROBLAZE_32_PCREL: u32 = 2;
5376 /// PC relative 64 bit.
5377 pub const R_MICROBLAZE_64_PCREL: u32 = 3;
5378 /// Low 16 bits of PCREL32.
5379 pub const R_MICROBLAZE_32_PCREL_LO: u32 = 4;
5380 /// Direct 64 bit.
5381 pub const R_MICROBLAZE_64: u32 = 5;
5382 /// Low 16 bit.
5383 pub const R_MICROBLAZE_32_LO: u32 = 6;
5384 /// Read-only small data area.
5385 pub const R_MICROBLAZE_SRO32: u32 = 7;
5386 /// Read-write small data area.
5387 pub const R_MICROBLAZE_SRW32: u32 = 8;
5388 /// No reloc.
5389 pub const R_MICROBLAZE_64_NONE: u32 = 9;
5390 /// Symbol Op Symbol relocation.
5391 pub const R_MICROBLAZE_32_SYM_OP_SYM: u32 = 10;
5392 /// GNU C++ vtable hierarchy.
5393 pub const R_MICROBLAZE_GNU_VTINHERIT: u32 = 11;
5394 /// GNU C++ vtable member usage.
5395 pub const R_MICROBLAZE_GNU_VTENTRY: u32 = 12;
5396 /// PC-relative GOT offset.
5397 pub const R_MICROBLAZE_GOTPC_64: u32 = 13;
5398 /// GOT entry offset.
5399 pub const R_MICROBLAZE_GOT_64: u32 = 14;
5400 /// PLT offset (PC-relative).
5401 pub const R_MICROBLAZE_PLT_64: u32 = 15;
5402 /// Adjust by program base.
5403 pub const R_MICROBLAZE_REL: u32 = 16;
5404 /// Create PLT entry.
5405 pub const R_MICROBLAZE_JUMP_SLOT: u32 = 17;
5406 /// Create GOT entry.
5407 pub const R_MICROBLAZE_GLOB_DAT: u32 = 18;
5408 /// 64 bit offset to GOT.
5409 pub const R_MICROBLAZE_GOTOFF_64: u32 = 19;
5410 /// 32 bit offset to GOT.
5411 pub const R_MICROBLAZE_GOTOFF_32: u32 = 20;
5412 /// Runtime copy.
5413 pub const R_MICROBLAZE_COPY: u32 = 21;
5414 /// TLS Reloc.
5415 pub const R_MICROBLAZE_TLS: u32 = 22;
5416 /// TLS General Dynamic.
5417 pub const R_MICROBLAZE_TLSGD: u32 = 23;
5418 /// TLS Local Dynamic.
5419 pub const R_MICROBLAZE_TLSLD: u32 = 24;
5420 /// TLS Module ID.
5421 pub const R_MICROBLAZE_TLSDTPMOD32: u32 = 25;
5422 /// TLS Offset Within TLS Block.
5423 pub const R_MICROBLAZE_TLSDTPREL32: u32 = 26;
5424 /// TLS Offset Within TLS Block.
5425 pub const R_MICROBLAZE_TLSDTPREL64: u32 = 27;
5426 /// TLS Offset From Thread Pointer.
5427 pub const R_MICROBLAZE_TLSGOTTPREL32: u32 = 28;
5428 /// TLS Offset From Thread Pointer.
5429 pub const R_MICROBLAZE_TLSTPREL32: u32 = 29;
5430 
5431 // Nios II values `Dyn::d_tag`.
5432 /// Address of _gp.
5433 pub const DT_NIOS2_GP: u32 = 0x7000_0002;
5434 
5435 // Nios II values `Rel*::r_type`.
5436 /// No reloc.
5437 pub const R_NIOS2_NONE: u32 = 0;
5438 /// Direct signed 16 bit.
5439 pub const R_NIOS2_S16: u32 = 1;
5440 /// Direct unsigned 16 bit.
5441 pub const R_NIOS2_U16: u32 = 2;
5442 /// PC relative 16 bit.
5443 pub const R_NIOS2_PCREL16: u32 = 3;
5444 /// Direct call.
5445 pub const R_NIOS2_CALL26: u32 = 4;
5446 /// 5 bit constant expression.
5447 pub const R_NIOS2_IMM5: u32 = 5;
5448 /// 5 bit expression, shift 22.
5449 pub const R_NIOS2_CACHE_OPX: u32 = 6;
5450 /// 6 bit constant expression.
5451 pub const R_NIOS2_IMM6: u32 = 7;
5452 /// 8 bit constant expression.
5453 pub const R_NIOS2_IMM8: u32 = 8;
5454 /// High 16 bit.
5455 pub const R_NIOS2_HI16: u32 = 9;
5456 /// Low 16 bit.
5457 pub const R_NIOS2_LO16: u32 = 10;
5458 /// High 16 bit, adjusted.
5459 pub const R_NIOS2_HIADJ16: u32 = 11;
5460 /// 32 bit symbol value + addend.
5461 pub const R_NIOS2_BFD_RELOC_32: u32 = 12;
5462 /// 16 bit symbol value + addend.
5463 pub const R_NIOS2_BFD_RELOC_16: u32 = 13;
5464 /// 8 bit symbol value + addend.
5465 pub const R_NIOS2_BFD_RELOC_8: u32 = 14;
5466 /// 16 bit GP pointer offset.
5467 pub const R_NIOS2_GPREL: u32 = 15;
5468 /// GNU C++ vtable hierarchy.
5469 pub const R_NIOS2_GNU_VTINHERIT: u32 = 16;
5470 /// GNU C++ vtable member usage.
5471 pub const R_NIOS2_GNU_VTENTRY: u32 = 17;
5472 /// Unconditional branch.
5473 pub const R_NIOS2_UJMP: u32 = 18;
5474 /// Conditional branch.
5475 pub const R_NIOS2_CJMP: u32 = 19;
5476 /// Indirect call through register.
5477 pub const R_NIOS2_CALLR: u32 = 20;
5478 /// Alignment requirement for linker relaxation.
5479 pub const R_NIOS2_ALIGN: u32 = 21;
5480 /// 16 bit GOT entry.
5481 pub const R_NIOS2_GOT16: u32 = 22;
5482 /// 16 bit GOT entry for function.
5483 pub const R_NIOS2_CALL16: u32 = 23;
5484 /// %lo of offset to GOT pointer.
5485 pub const R_NIOS2_GOTOFF_LO: u32 = 24;
5486 /// %hiadj of offset to GOT pointer.
5487 pub const R_NIOS2_GOTOFF_HA: u32 = 25;
5488 /// %lo of PC relative offset.
5489 pub const R_NIOS2_PCREL_LO: u32 = 26;
5490 /// %hiadj of PC relative offset.
5491 pub const R_NIOS2_PCREL_HA: u32 = 27;
5492 /// 16 bit GOT offset for TLS GD.
5493 pub const R_NIOS2_TLS_GD16: u32 = 28;
5494 /// 16 bit GOT offset for TLS LDM.
5495 pub const R_NIOS2_TLS_LDM16: u32 = 29;
5496 /// 16 bit module relative offset.
5497 pub const R_NIOS2_TLS_LDO16: u32 = 30;
5498 /// 16 bit GOT offset for TLS IE.
5499 pub const R_NIOS2_TLS_IE16: u32 = 31;
5500 /// 16 bit LE TP-relative offset.
5501 pub const R_NIOS2_TLS_LE16: u32 = 32;
5502 /// Module number.
5503 pub const R_NIOS2_TLS_DTPMOD: u32 = 33;
5504 /// Module-relative offset.
5505 pub const R_NIOS2_TLS_DTPREL: u32 = 34;
5506 /// TP-relative offset.
5507 pub const R_NIOS2_TLS_TPREL: u32 = 35;
5508 /// Copy symbol at runtime.
5509 pub const R_NIOS2_COPY: u32 = 36;
5510 /// Create GOT entry.
5511 pub const R_NIOS2_GLOB_DAT: u32 = 37;
5512 /// Create PLT entry.
5513 pub const R_NIOS2_JUMP_SLOT: u32 = 38;
5514 /// Adjust by program base.
5515 pub const R_NIOS2_RELATIVE: u32 = 39;
5516 /// 16 bit offset to GOT pointer.
5517 pub const R_NIOS2_GOTOFF: u32 = 40;
5518 /// Direct call in .noat section.
5519 pub const R_NIOS2_CALL26_NOAT: u32 = 41;
5520 /// %lo() of GOT entry.
5521 pub const R_NIOS2_GOT_LO: u32 = 42;
5522 /// %hiadj() of GOT entry.
5523 pub const R_NIOS2_GOT_HA: u32 = 43;
5524 /// %lo() of function GOT entry.
5525 pub const R_NIOS2_CALL_LO: u32 = 44;
5526 /// %hiadj() of function GOT entry.
5527 pub const R_NIOS2_CALL_HA: u32 = 45;
5528 
5529 // TILEPro values `Rel*::r_type`.
5530 /// No reloc
5531 pub const R_TILEPRO_NONE: u32 = 0;
5532 /// Direct 32 bit
5533 pub const R_TILEPRO_32: u32 = 1;
5534 /// Direct 16 bit
5535 pub const R_TILEPRO_16: u32 = 2;
5536 /// Direct 8 bit
5537 pub const R_TILEPRO_8: u32 = 3;
5538 /// PC relative 32 bit
5539 pub const R_TILEPRO_32_PCREL: u32 = 4;
5540 /// PC relative 16 bit
5541 pub const R_TILEPRO_16_PCREL: u32 = 5;
5542 /// PC relative 8 bit
5543 pub const R_TILEPRO_8_PCREL: u32 = 6;
5544 /// Low 16 bit
5545 pub const R_TILEPRO_LO16: u32 = 7;
5546 /// High 16 bit
5547 pub const R_TILEPRO_HI16: u32 = 8;
5548 /// High 16 bit, adjusted
5549 pub const R_TILEPRO_HA16: u32 = 9;
5550 /// Copy relocation
5551 pub const R_TILEPRO_COPY: u32 = 10;
5552 /// Create GOT entry
5553 pub const R_TILEPRO_GLOB_DAT: u32 = 11;
5554 /// Create PLT entry
5555 pub const R_TILEPRO_JMP_SLOT: u32 = 12;
5556 /// Adjust by program base
5557 pub const R_TILEPRO_RELATIVE: u32 = 13;
5558 /// X1 pipe branch offset
5559 pub const R_TILEPRO_BROFF_X1: u32 = 14;
5560 /// X1 pipe jump offset
5561 pub const R_TILEPRO_JOFFLONG_X1: u32 = 15;
5562 /// X1 pipe jump offset to PLT
5563 pub const R_TILEPRO_JOFFLONG_X1_PLT: u32 = 16;
5564 /// X0 pipe 8-bit
5565 pub const R_TILEPRO_IMM8_X0: u32 = 17;
5566 /// Y0 pipe 8-bit
5567 pub const R_TILEPRO_IMM8_Y0: u32 = 18;
5568 /// X1 pipe 8-bit
5569 pub const R_TILEPRO_IMM8_X1: u32 = 19;
5570 /// Y1 pipe 8-bit
5571 pub const R_TILEPRO_IMM8_Y1: u32 = 20;
5572 /// X1 pipe mtspr
5573 pub const R_TILEPRO_MT_IMM15_X1: u32 = 21;
5574 /// X1 pipe mfspr
5575 pub const R_TILEPRO_MF_IMM15_X1: u32 = 22;
5576 /// X0 pipe 16-bit
5577 pub const R_TILEPRO_IMM16_X0: u32 = 23;
5578 /// X1 pipe 16-bit
5579 pub const R_TILEPRO_IMM16_X1: u32 = 24;
5580 /// X0 pipe low 16-bit
5581 pub const R_TILEPRO_IMM16_X0_LO: u32 = 25;
5582 /// X1 pipe low 16-bit
5583 pub const R_TILEPRO_IMM16_X1_LO: u32 = 26;
5584 /// X0 pipe high 16-bit
5585 pub const R_TILEPRO_IMM16_X0_HI: u32 = 27;
5586 /// X1 pipe high 16-bit
5587 pub const R_TILEPRO_IMM16_X1_HI: u32 = 28;
5588 /// X0 pipe high 16-bit, adjusted
5589 pub const R_TILEPRO_IMM16_X0_HA: u32 = 29;
5590 /// X1 pipe high 16-bit, adjusted
5591 pub const R_TILEPRO_IMM16_X1_HA: u32 = 30;
5592 /// X0 pipe PC relative 16 bit
5593 pub const R_TILEPRO_IMM16_X0_PCREL: u32 = 31;
5594 /// X1 pipe PC relative 16 bit
5595 pub const R_TILEPRO_IMM16_X1_PCREL: u32 = 32;
5596 /// X0 pipe PC relative low 16 bit
5597 pub const R_TILEPRO_IMM16_X0_LO_PCREL: u32 = 33;
5598 /// X1 pipe PC relative low 16 bit
5599 pub const R_TILEPRO_IMM16_X1_LO_PCREL: u32 = 34;
5600 /// X0 pipe PC relative high 16 bit
5601 pub const R_TILEPRO_IMM16_X0_HI_PCREL: u32 = 35;
5602 /// X1 pipe PC relative high 16 bit
5603 pub const R_TILEPRO_IMM16_X1_HI_PCREL: u32 = 36;
5604 /// X0 pipe PC relative ha() 16 bit
5605 pub const R_TILEPRO_IMM16_X0_HA_PCREL: u32 = 37;
5606 /// X1 pipe PC relative ha() 16 bit
5607 pub const R_TILEPRO_IMM16_X1_HA_PCREL: u32 = 38;
5608 /// X0 pipe 16-bit GOT offset
5609 pub const R_TILEPRO_IMM16_X0_GOT: u32 = 39;
5610 /// X1 pipe 16-bit GOT offset
5611 pub const R_TILEPRO_IMM16_X1_GOT: u32 = 40;
5612 /// X0 pipe low 16-bit GOT offset
5613 pub const R_TILEPRO_IMM16_X0_GOT_LO: u32 = 41;
5614 /// X1 pipe low 16-bit GOT offset
5615 pub const R_TILEPRO_IMM16_X1_GOT_LO: u32 = 42;
5616 /// X0 pipe high 16-bit GOT offset
5617 pub const R_TILEPRO_IMM16_X0_GOT_HI: u32 = 43;
5618 /// X1 pipe high 16-bit GOT offset
5619 pub const R_TILEPRO_IMM16_X1_GOT_HI: u32 = 44;
5620 /// X0 pipe ha() 16-bit GOT offset
5621 pub const R_TILEPRO_IMM16_X0_GOT_HA: u32 = 45;
5622 /// X1 pipe ha() 16-bit GOT offset
5623 pub const R_TILEPRO_IMM16_X1_GOT_HA: u32 = 46;
5624 /// X0 pipe mm "start"
5625 pub const R_TILEPRO_MMSTART_X0: u32 = 47;
5626 /// X0 pipe mm "end"
5627 pub const R_TILEPRO_MMEND_X0: u32 = 48;
5628 /// X1 pipe mm "start"
5629 pub const R_TILEPRO_MMSTART_X1: u32 = 49;
5630 /// X1 pipe mm "end"
5631 pub const R_TILEPRO_MMEND_X1: u32 = 50;
5632 /// X0 pipe shift amount
5633 pub const R_TILEPRO_SHAMT_X0: u32 = 51;
5634 /// X1 pipe shift amount
5635 pub const R_TILEPRO_SHAMT_X1: u32 = 52;
5636 /// Y0 pipe shift amount
5637 pub const R_TILEPRO_SHAMT_Y0: u32 = 53;
5638 /// Y1 pipe shift amount
5639 pub const R_TILEPRO_SHAMT_Y1: u32 = 54;
5640 /// X1 pipe destination 8-bit
5641 pub const R_TILEPRO_DEST_IMM8_X1: u32 = 55;
5642 // Relocs 56-59 are currently not defined.
5643 /// "jal" for TLS GD
5644 pub const R_TILEPRO_TLS_GD_CALL: u32 = 60;
5645 /// X0 pipe "addi" for TLS GD
5646 pub const R_TILEPRO_IMM8_X0_TLS_GD_ADD: u32 = 61;
5647 /// X1 pipe "addi" for TLS GD
5648 pub const R_TILEPRO_IMM8_X1_TLS_GD_ADD: u32 = 62;
5649 /// Y0 pipe "addi" for TLS GD
5650 pub const R_TILEPRO_IMM8_Y0_TLS_GD_ADD: u32 = 63;
5651 /// Y1 pipe "addi" for TLS GD
5652 pub const R_TILEPRO_IMM8_Y1_TLS_GD_ADD: u32 = 64;
5653 /// "lw_tls" for TLS IE
5654 pub const R_TILEPRO_TLS_IE_LOAD: u32 = 65;
5655 /// X0 pipe 16-bit TLS GD offset
5656 pub const R_TILEPRO_IMM16_X0_TLS_GD: u32 = 66;
5657 /// X1 pipe 16-bit TLS GD offset
5658 pub const R_TILEPRO_IMM16_X1_TLS_GD: u32 = 67;
5659 /// X0 pipe low 16-bit TLS GD offset
5660 pub const R_TILEPRO_IMM16_X0_TLS_GD_LO: u32 = 68;
5661 /// X1 pipe low 16-bit TLS GD offset
5662 pub const R_TILEPRO_IMM16_X1_TLS_GD_LO: u32 = 69;
5663 /// X0 pipe high 16-bit TLS GD offset
5664 pub const R_TILEPRO_IMM16_X0_TLS_GD_HI: u32 = 70;
5665 /// X1 pipe high 16-bit TLS GD offset
5666 pub const R_TILEPRO_IMM16_X1_TLS_GD_HI: u32 = 71;
5667 /// X0 pipe ha() 16-bit TLS GD offset
5668 pub const R_TILEPRO_IMM16_X0_TLS_GD_HA: u32 = 72;
5669 /// X1 pipe ha() 16-bit TLS GD offset
5670 pub const R_TILEPRO_IMM16_X1_TLS_GD_HA: u32 = 73;
5671 /// X0 pipe 16-bit TLS IE offset
5672 pub const R_TILEPRO_IMM16_X0_TLS_IE: u32 = 74;
5673 /// X1 pipe 16-bit TLS IE offset
5674 pub const R_TILEPRO_IMM16_X1_TLS_IE: u32 = 75;
5675 /// X0 pipe low 16-bit TLS IE offset
5676 pub const R_TILEPRO_IMM16_X0_TLS_IE_LO: u32 = 76;
5677 /// X1 pipe low 16-bit TLS IE offset
5678 pub const R_TILEPRO_IMM16_X1_TLS_IE_LO: u32 = 77;
5679 /// X0 pipe high 16-bit TLS IE offset
5680 pub const R_TILEPRO_IMM16_X0_TLS_IE_HI: u32 = 78;
5681 /// X1 pipe high 16-bit TLS IE offset
5682 pub const R_TILEPRO_IMM16_X1_TLS_IE_HI: u32 = 79;
5683 /// X0 pipe ha() 16-bit TLS IE offset
5684 pub const R_TILEPRO_IMM16_X0_TLS_IE_HA: u32 = 80;
5685 /// X1 pipe ha() 16-bit TLS IE offset
5686 pub const R_TILEPRO_IMM16_X1_TLS_IE_HA: u32 = 81;
5687 /// ID of module containing symbol
5688 pub const R_TILEPRO_TLS_DTPMOD32: u32 = 82;
5689 /// Offset in TLS block
5690 pub const R_TILEPRO_TLS_DTPOFF32: u32 = 83;
5691 /// Offset in static TLS block
5692 pub const R_TILEPRO_TLS_TPOFF32: u32 = 84;
5693 /// X0 pipe 16-bit TLS LE offset
5694 pub const R_TILEPRO_IMM16_X0_TLS_LE: u32 = 85;
5695 /// X1 pipe 16-bit TLS LE offset
5696 pub const R_TILEPRO_IMM16_X1_TLS_LE: u32 = 86;
5697 /// X0 pipe low 16-bit TLS LE offset
5698 pub const R_TILEPRO_IMM16_X0_TLS_LE_LO: u32 = 87;
5699 /// X1 pipe low 16-bit TLS LE offset
5700 pub const R_TILEPRO_IMM16_X1_TLS_LE_LO: u32 = 88;
5701 /// X0 pipe high 16-bit TLS LE offset
5702 pub const R_TILEPRO_IMM16_X0_TLS_LE_HI: u32 = 89;
5703 /// X1 pipe high 16-bit TLS LE offset
5704 pub const R_TILEPRO_IMM16_X1_TLS_LE_HI: u32 = 90;
5705 /// X0 pipe ha() 16-bit TLS LE offset
5706 pub const R_TILEPRO_IMM16_X0_TLS_LE_HA: u32 = 91;
5707 /// X1 pipe ha() 16-bit TLS LE offset
5708 pub const R_TILEPRO_IMM16_X1_TLS_LE_HA: u32 = 92;
5709 
5710 /// GNU C++ vtable hierarchy
5711 pub const R_TILEPRO_GNU_VTINHERIT: u32 = 128;
5712 /// GNU C++ vtable member usage
5713 pub const R_TILEPRO_GNU_VTENTRY: u32 = 129;
5714 
5715 // TILE-Gx values `Rel*::r_type`.
5716 /// No reloc
5717 pub const R_TILEGX_NONE: u32 = 0;
5718 /// Direct 64 bit
5719 pub const R_TILEGX_64: u32 = 1;
5720 /// Direct 32 bit
5721 pub const R_TILEGX_32: u32 = 2;
5722 /// Direct 16 bit
5723 pub const R_TILEGX_16: u32 = 3;
5724 /// Direct 8 bit
5725 pub const R_TILEGX_8: u32 = 4;
5726 /// PC relative 64 bit
5727 pub const R_TILEGX_64_PCREL: u32 = 5;
5728 /// PC relative 32 bit
5729 pub const R_TILEGX_32_PCREL: u32 = 6;
5730 /// PC relative 16 bit
5731 pub const R_TILEGX_16_PCREL: u32 = 7;
5732 /// PC relative 8 bit
5733 pub const R_TILEGX_8_PCREL: u32 = 8;
5734 /// hword 0 16-bit
5735 pub const R_TILEGX_HW0: u32 = 9;
5736 /// hword 1 16-bit
5737 pub const R_TILEGX_HW1: u32 = 10;
5738 /// hword 2 16-bit
5739 pub const R_TILEGX_HW2: u32 = 11;
5740 /// hword 3 16-bit
5741 pub const R_TILEGX_HW3: u32 = 12;
5742 /// last hword 0 16-bit
5743 pub const R_TILEGX_HW0_LAST: u32 = 13;
5744 /// last hword 1 16-bit
5745 pub const R_TILEGX_HW1_LAST: u32 = 14;
5746 /// last hword 2 16-bit
5747 pub const R_TILEGX_HW2_LAST: u32 = 15;
5748 /// Copy relocation
5749 pub const R_TILEGX_COPY: u32 = 16;
5750 /// Create GOT entry
5751 pub const R_TILEGX_GLOB_DAT: u32 = 17;
5752 /// Create PLT entry
5753 pub const R_TILEGX_JMP_SLOT: u32 = 18;
5754 /// Adjust by program base
5755 pub const R_TILEGX_RELATIVE: u32 = 19;
5756 /// X1 pipe branch offset
5757 pub const R_TILEGX_BROFF_X1: u32 = 20;
5758 /// X1 pipe jump offset
5759 pub const R_TILEGX_JUMPOFF_X1: u32 = 21;
5760 /// X1 pipe jump offset to PLT
5761 pub const R_TILEGX_JUMPOFF_X1_PLT: u32 = 22;
5762 /// X0 pipe 8-bit
5763 pub const R_TILEGX_IMM8_X0: u32 = 23;
5764 /// Y0 pipe 8-bit
5765 pub const R_TILEGX_IMM8_Y0: u32 = 24;
5766 /// X1 pipe 8-bit
5767 pub const R_TILEGX_IMM8_X1: u32 = 25;
5768 /// Y1 pipe 8-bit
5769 pub const R_TILEGX_IMM8_Y1: u32 = 26;
5770 /// X1 pipe destination 8-bit
5771 pub const R_TILEGX_DEST_IMM8_X1: u32 = 27;
5772 /// X1 pipe mtspr
5773 pub const R_TILEGX_MT_IMM14_X1: u32 = 28;
5774 /// X1 pipe mfspr
5775 pub const R_TILEGX_MF_IMM14_X1: u32 = 29;
5776 /// X0 pipe mm "start"
5777 pub const R_TILEGX_MMSTART_X0: u32 = 30;
5778 /// X0 pipe mm "end"
5779 pub const R_TILEGX_MMEND_X0: u32 = 31;
5780 /// X0 pipe shift amount
5781 pub const R_TILEGX_SHAMT_X0: u32 = 32;
5782 /// X1 pipe shift amount
5783 pub const R_TILEGX_SHAMT_X1: u32 = 33;
5784 /// Y0 pipe shift amount
5785 pub const R_TILEGX_SHAMT_Y0: u32 = 34;
5786 /// Y1 pipe shift amount
5787 pub const R_TILEGX_SHAMT_Y1: u32 = 35;
5788 /// X0 pipe hword 0
5789 pub const R_TILEGX_IMM16_X0_HW0: u32 = 36;
5790 /// X1 pipe hword 0
5791 pub const R_TILEGX_IMM16_X1_HW0: u32 = 37;
5792 /// X0 pipe hword 1
5793 pub const R_TILEGX_IMM16_X0_HW1: u32 = 38;
5794 /// X1 pipe hword 1
5795 pub const R_TILEGX_IMM16_X1_HW1: u32 = 39;
5796 /// X0 pipe hword 2
5797 pub const R_TILEGX_IMM16_X0_HW2: u32 = 40;
5798 /// X1 pipe hword 2
5799 pub const R_TILEGX_IMM16_X1_HW2: u32 = 41;
5800 /// X0 pipe hword 3
5801 pub const R_TILEGX_IMM16_X0_HW3: u32 = 42;
5802 /// X1 pipe hword 3
5803 pub const R_TILEGX_IMM16_X1_HW3: u32 = 43;
5804 /// X0 pipe last hword 0
5805 pub const R_TILEGX_IMM16_X0_HW0_LAST: u32 = 44;
5806 /// X1 pipe last hword 0
5807 pub const R_TILEGX_IMM16_X1_HW0_LAST: u32 = 45;
5808 /// X0 pipe last hword 1
5809 pub const R_TILEGX_IMM16_X0_HW1_LAST: u32 = 46;
5810 /// X1 pipe last hword 1
5811 pub const R_TILEGX_IMM16_X1_HW1_LAST: u32 = 47;
5812 /// X0 pipe last hword 2
5813 pub const R_TILEGX_IMM16_X0_HW2_LAST: u32 = 48;
5814 /// X1 pipe last hword 2
5815 pub const R_TILEGX_IMM16_X1_HW2_LAST: u32 = 49;
5816 /// X0 pipe PC relative hword 0
5817 pub const R_TILEGX_IMM16_X0_HW0_PCREL: u32 = 50;
5818 /// X1 pipe PC relative hword 0
5819 pub const R_TILEGX_IMM16_X1_HW0_PCREL: u32 = 51;
5820 /// X0 pipe PC relative hword 1
5821 pub const R_TILEGX_IMM16_X0_HW1_PCREL: u32 = 52;
5822 /// X1 pipe PC relative hword 1
5823 pub const R_TILEGX_IMM16_X1_HW1_PCREL: u32 = 53;
5824 /// X0 pipe PC relative hword 2
5825 pub const R_TILEGX_IMM16_X0_HW2_PCREL: u32 = 54;
5826 /// X1 pipe PC relative hword 2
5827 pub const R_TILEGX_IMM16_X1_HW2_PCREL: u32 = 55;
5828 /// X0 pipe PC relative hword 3
5829 pub const R_TILEGX_IMM16_X0_HW3_PCREL: u32 = 56;
5830 /// X1 pipe PC relative hword 3
5831 pub const R_TILEGX_IMM16_X1_HW3_PCREL: u32 = 57;
5832 /// X0 pipe PC-rel last hword 0
5833 pub const R_TILEGX_IMM16_X0_HW0_LAST_PCREL: u32 = 58;
5834 /// X1 pipe PC-rel last hword 0
5835 pub const R_TILEGX_IMM16_X1_HW0_LAST_PCREL: u32 = 59;
5836 /// X0 pipe PC-rel last hword 1
5837 pub const R_TILEGX_IMM16_X0_HW1_LAST_PCREL: u32 = 60;
5838 /// X1 pipe PC-rel last hword 1
5839 pub const R_TILEGX_IMM16_X1_HW1_LAST_PCREL: u32 = 61;
5840 /// X0 pipe PC-rel last hword 2
5841 pub const R_TILEGX_IMM16_X0_HW2_LAST_PCREL: u32 = 62;
5842 /// X1 pipe PC-rel last hword 2
5843 pub const R_TILEGX_IMM16_X1_HW2_LAST_PCREL: u32 = 63;
5844 /// X0 pipe hword 0 GOT offset
5845 pub const R_TILEGX_IMM16_X0_HW0_GOT: u32 = 64;
5846 /// X1 pipe hword 0 GOT offset
5847 pub const R_TILEGX_IMM16_X1_HW0_GOT: u32 = 65;
5848 /// X0 pipe PC-rel PLT hword 0
5849 pub const R_TILEGX_IMM16_X0_HW0_PLT_PCREL: u32 = 66;
5850 /// X1 pipe PC-rel PLT hword 0
5851 pub const R_TILEGX_IMM16_X1_HW0_PLT_PCREL: u32 = 67;
5852 /// X0 pipe PC-rel PLT hword 1
5853 pub const R_TILEGX_IMM16_X0_HW1_PLT_PCREL: u32 = 68;
5854 /// X1 pipe PC-rel PLT hword 1
5855 pub const R_TILEGX_IMM16_X1_HW1_PLT_PCREL: u32 = 69;
5856 /// X0 pipe PC-rel PLT hword 2
5857 pub const R_TILEGX_IMM16_X0_HW2_PLT_PCREL: u32 = 70;
5858 /// X1 pipe PC-rel PLT hword 2
5859 pub const R_TILEGX_IMM16_X1_HW2_PLT_PCREL: u32 = 71;
5860 /// X0 pipe last hword 0 GOT offset
5861 pub const R_TILEGX_IMM16_X0_HW0_LAST_GOT: u32 = 72;
5862 /// X1 pipe last hword 0 GOT offset
5863 pub const R_TILEGX_IMM16_X1_HW0_LAST_GOT: u32 = 73;
5864 /// X0 pipe last hword 1 GOT offset
5865 pub const R_TILEGX_IMM16_X0_HW1_LAST_GOT: u32 = 74;
5866 /// X1 pipe last hword 1 GOT offset
5867 pub const R_TILEGX_IMM16_X1_HW1_LAST_GOT: u32 = 75;
5868 /// X0 pipe PC-rel PLT hword 3
5869 pub const R_TILEGX_IMM16_X0_HW3_PLT_PCREL: u32 = 76;
5870 /// X1 pipe PC-rel PLT hword 3
5871 pub const R_TILEGX_IMM16_X1_HW3_PLT_PCREL: u32 = 77;
5872 /// X0 pipe hword 0 TLS GD offset
5873 pub const R_TILEGX_IMM16_X0_HW0_TLS_GD: u32 = 78;
5874 /// X1 pipe hword 0 TLS GD offset
5875 pub const R_TILEGX_IMM16_X1_HW0_TLS_GD: u32 = 79;
5876 /// X0 pipe hword 0 TLS LE offset
5877 pub const R_TILEGX_IMM16_X0_HW0_TLS_LE: u32 = 80;
5878 /// X1 pipe hword 0 TLS LE offset
5879 pub const R_TILEGX_IMM16_X1_HW0_TLS_LE: u32 = 81;
5880 /// X0 pipe last hword 0 LE off
5881 pub const R_TILEGX_IMM16_X0_HW0_LAST_TLS_LE: u32 = 82;
5882 /// X1 pipe last hword 0 LE off
5883 pub const R_TILEGX_IMM16_X1_HW0_LAST_TLS_LE: u32 = 83;
5884 /// X0 pipe last hword 1 LE off
5885 pub const R_TILEGX_IMM16_X0_HW1_LAST_TLS_LE: u32 = 84;
5886 /// X1 pipe last hword 1 LE off
5887 pub const R_TILEGX_IMM16_X1_HW1_LAST_TLS_LE: u32 = 85;
5888 /// X0 pipe last hword 0 GD off
5889 pub const R_TILEGX_IMM16_X0_HW0_LAST_TLS_GD: u32 = 86;
5890 /// X1 pipe last hword 0 GD off
5891 pub const R_TILEGX_IMM16_X1_HW0_LAST_TLS_GD: u32 = 87;
5892 /// X0 pipe last hword 1 GD off
5893 pub const R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD: u32 = 88;
5894 /// X1 pipe last hword 1 GD off
5895 pub const R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD: u32 = 89;
5896 // Relocs 90-91 are currently not defined.
5897 /// X0 pipe hword 0 TLS IE offset
5898 pub const R_TILEGX_IMM16_X0_HW0_TLS_IE: u32 = 92;
5899 /// X1 pipe hword 0 TLS IE offset
5900 pub const R_TILEGX_IMM16_X1_HW0_TLS_IE: u32 = 93;
5901 /// X0 pipe PC-rel PLT last hword 0
5902 pub const R_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL: u32 = 94;
5903 /// X1 pipe PC-rel PLT last hword 0
5904 pub const R_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL: u32 = 95;
5905 /// X0 pipe PC-rel PLT last hword 1
5906 pub const R_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL: u32 = 96;
5907 /// X1 pipe PC-rel PLT last hword 1
5908 pub const R_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL: u32 = 97;
5909 /// X0 pipe PC-rel PLT last hword 2
5910 pub const R_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL: u32 = 98;
5911 /// X1 pipe PC-rel PLT last hword 2
5912 pub const R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL: u32 = 99;
5913 /// X0 pipe last hword 0 IE off
5914 pub const R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE: u32 = 100;
5915 /// X1 pipe last hword 0 IE off
5916 pub const R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE: u32 = 101;
5917 /// X0 pipe last hword 1 IE off
5918 pub const R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE: u32 = 102;
5919 /// X1 pipe last hword 1 IE off
5920 pub const R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE: u32 = 103;
5921 // Relocs 104-105 are currently not defined.
5922 /// 64-bit ID of symbol's module
5923 pub const R_TILEGX_TLS_DTPMOD64: u32 = 106;
5924 /// 64-bit offset in TLS block
5925 pub const R_TILEGX_TLS_DTPOFF64: u32 = 107;
5926 /// 64-bit offset in static TLS block
5927 pub const R_TILEGX_TLS_TPOFF64: u32 = 108;
5928 /// 32-bit ID of symbol's module
5929 pub const R_TILEGX_TLS_DTPMOD32: u32 = 109;
5930 /// 32-bit offset in TLS block
5931 pub const R_TILEGX_TLS_DTPOFF32: u32 = 110;
5932 /// 32-bit offset in static TLS block
5933 pub const R_TILEGX_TLS_TPOFF32: u32 = 111;
5934 /// "jal" for TLS GD
5935 pub const R_TILEGX_TLS_GD_CALL: u32 = 112;
5936 /// X0 pipe "addi" for TLS GD
5937 pub const R_TILEGX_IMM8_X0_TLS_GD_ADD: u32 = 113;
5938 /// X1 pipe "addi" for TLS GD
5939 pub const R_TILEGX_IMM8_X1_TLS_GD_ADD: u32 = 114;
5940 /// Y0 pipe "addi" for TLS GD
5941 pub const R_TILEGX_IMM8_Y0_TLS_GD_ADD: u32 = 115;
5942 /// Y1 pipe "addi" for TLS GD
5943 pub const R_TILEGX_IMM8_Y1_TLS_GD_ADD: u32 = 116;
5944 /// "ld_tls" for TLS IE
5945 pub const R_TILEGX_TLS_IE_LOAD: u32 = 117;
5946 /// X0 pipe "addi" for TLS GD/IE
5947 pub const R_TILEGX_IMM8_X0_TLS_ADD: u32 = 118;
5948 /// X1 pipe "addi" for TLS GD/IE
5949 pub const R_TILEGX_IMM8_X1_TLS_ADD: u32 = 119;
5950 /// Y0 pipe "addi" for TLS GD/IE
5951 pub const R_TILEGX_IMM8_Y0_TLS_ADD: u32 = 120;
5952 /// Y1 pipe "addi" for TLS GD/IE
5953 pub const R_TILEGX_IMM8_Y1_TLS_ADD: u32 = 121;
5954 
5955 /// GNU C++ vtable hierarchy
5956 pub const R_TILEGX_GNU_VTINHERIT: u32 = 128;
5957 /// GNU C++ vtable member usage
5958 pub const R_TILEGX_GNU_VTENTRY: u32 = 129;
5959 
5960 // RISC-V values `FileHeader*::e_flags`.
5961 #[allow(missing_docs)]
5962 pub const EF_RISCV_RVC: u32 = 0x0001;
5963 #[allow(missing_docs)]
5964 pub const EF_RISCV_FLOAT_ABI: u32 = 0x0006;
5965 #[allow(missing_docs)]
5966 pub const EF_RISCV_FLOAT_ABI_SOFT: u32 = 0x0000;
5967 #[allow(missing_docs)]
5968 pub const EF_RISCV_FLOAT_ABI_SINGLE: u32 = 0x0002;
5969 #[allow(missing_docs)]
5970 pub const EF_RISCV_FLOAT_ABI_DOUBLE: u32 = 0x0004;
5971 #[allow(missing_docs)]
5972 pub const EF_RISCV_FLOAT_ABI_QUAD: u32 = 0x0006;
5973 
5974 // RISC-V values `Rel*::r_type`.
5975 #[allow(missing_docs)]
5976 pub const R_RISCV_NONE: u32 = 0;
5977 #[allow(missing_docs)]
5978 pub const R_RISCV_32: u32 = 1;
5979 #[allow(missing_docs)]
5980 pub const R_RISCV_64: u32 = 2;
5981 #[allow(missing_docs)]
5982 pub const R_RISCV_RELATIVE: u32 = 3;
5983 #[allow(missing_docs)]
5984 pub const R_RISCV_COPY: u32 = 4;
5985 #[allow(missing_docs)]
5986 pub const R_RISCV_JUMP_SLOT: u32 = 5;
5987 #[allow(missing_docs)]
5988 pub const R_RISCV_TLS_DTPMOD32: u32 = 6;
5989 #[allow(missing_docs)]
5990 pub const R_RISCV_TLS_DTPMOD64: u32 = 7;
5991 #[allow(missing_docs)]
5992 pub const R_RISCV_TLS_DTPREL32: u32 = 8;
5993 #[allow(missing_docs)]
5994 pub const R_RISCV_TLS_DTPREL64: u32 = 9;
5995 #[allow(missing_docs)]
5996 pub const R_RISCV_TLS_TPREL32: u32 = 10;
5997 #[allow(missing_docs)]
5998 pub const R_RISCV_TLS_TPREL64: u32 = 11;
5999 #[allow(missing_docs)]
6000 pub const R_RISCV_BRANCH: u32 = 16;
6001 #[allow(missing_docs)]
6002 pub const R_RISCV_JAL: u32 = 17;
6003 #[allow(missing_docs)]
6004 pub const R_RISCV_CALL: u32 = 18;
6005 #[allow(missing_docs)]
6006 pub const R_RISCV_CALL_PLT: u32 = 19;
6007 #[allow(missing_docs)]
6008 pub const R_RISCV_GOT_HI20: u32 = 20;
6009 #[allow(missing_docs)]
6010 pub const R_RISCV_TLS_GOT_HI20: u32 = 21;
6011 #[allow(missing_docs)]
6012 pub const R_RISCV_TLS_GD_HI20: u32 = 22;
6013 #[allow(missing_docs)]
6014 pub const R_RISCV_PCREL_HI20: u32 = 23;
6015 #[allow(missing_docs)]
6016 pub const R_RISCV_PCREL_LO12_I: u32 = 24;
6017 #[allow(missing_docs)]
6018 pub const R_RISCV_PCREL_LO12_S: u32 = 25;
6019 #[allow(missing_docs)]
6020 pub const R_RISCV_HI20: u32 = 26;
6021 #[allow(missing_docs)]
6022 pub const R_RISCV_LO12_I: u32 = 27;
6023 #[allow(missing_docs)]
6024 pub const R_RISCV_LO12_S: u32 = 28;
6025 #[allow(missing_docs)]
6026 pub const R_RISCV_TPREL_HI20: u32 = 29;
6027 #[allow(missing_docs)]
6028 pub const R_RISCV_TPREL_LO12_I: u32 = 30;
6029 #[allow(missing_docs)]
6030 pub const R_RISCV_TPREL_LO12_S: u32 = 31;
6031 #[allow(missing_docs)]
6032 pub const R_RISCV_TPREL_ADD: u32 = 32;
6033 #[allow(missing_docs)]
6034 pub const R_RISCV_ADD8: u32 = 33;
6035 #[allow(missing_docs)]
6036 pub const R_RISCV_ADD16: u32 = 34;
6037 #[allow(missing_docs)]
6038 pub const R_RISCV_ADD32: u32 = 35;
6039 #[allow(missing_docs)]
6040 pub const R_RISCV_ADD64: u32 = 36;
6041 #[allow(missing_docs)]
6042 pub const R_RISCV_SUB8: u32 = 37;
6043 #[allow(missing_docs)]
6044 pub const R_RISCV_SUB16: u32 = 38;
6045 #[allow(missing_docs)]
6046 pub const R_RISCV_SUB32: u32 = 39;
6047 #[allow(missing_docs)]
6048 pub const R_RISCV_SUB64: u32 = 40;
6049 #[allow(missing_docs)]
6050 pub const R_RISCV_GNU_VTINHERIT: u32 = 41;
6051 #[allow(missing_docs)]
6052 pub const R_RISCV_GNU_VTENTRY: u32 = 42;
6053 #[allow(missing_docs)]
6054 pub const R_RISCV_ALIGN: u32 = 43;
6055 #[allow(missing_docs)]
6056 pub const R_RISCV_RVC_BRANCH: u32 = 44;
6057 #[allow(missing_docs)]
6058 pub const R_RISCV_RVC_JUMP: u32 = 45;
6059 #[allow(missing_docs)]
6060 pub const R_RISCV_RVC_LUI: u32 = 46;
6061 #[allow(missing_docs)]
6062 pub const R_RISCV_GPREL_I: u32 = 47;
6063 #[allow(missing_docs)]
6064 pub const R_RISCV_GPREL_S: u32 = 48;
6065 #[allow(missing_docs)]
6066 pub const R_RISCV_TPREL_I: u32 = 49;
6067 #[allow(missing_docs)]
6068 pub const R_RISCV_TPREL_S: u32 = 50;
6069 #[allow(missing_docs)]
6070 pub const R_RISCV_RELAX: u32 = 51;
6071 #[allow(missing_docs)]
6072 pub const R_RISCV_SUB6: u32 = 52;
6073 #[allow(missing_docs)]
6074 pub const R_RISCV_SET6: u32 = 53;
6075 #[allow(missing_docs)]
6076 pub const R_RISCV_SET8: u32 = 54;
6077 #[allow(missing_docs)]
6078 pub const R_RISCV_SET16: u32 = 55;
6079 #[allow(missing_docs)]
6080 pub const R_RISCV_SET32: u32 = 56;
6081 #[allow(missing_docs)]
6082 pub const R_RISCV_32_PCREL: u32 = 57;
6083 
6084 // BPF values `Rel*::r_type`.
6085 /// No reloc
6086 pub const R_BPF_NONE: u32 = 0;
6087 #[allow(missing_docs)]
6088 pub const R_BPF_64_64: u32 = 1;
6089 #[allow(missing_docs)]
6090 pub const R_BPF_64_32: u32 = 10;
6091 
6092 // Imagination Meta values `Rel*::r_type`.
6093 
6094 #[allow(missing_docs)]
6095 pub const R_METAG_HIADDR16: u32 = 0;
6096 #[allow(missing_docs)]
6097 pub const R_METAG_LOADDR16: u32 = 1;
6098 /// 32bit absolute address
6099 pub const R_METAG_ADDR32: u32 = 2;
6100 /// No reloc
6101 pub const R_METAG_NONE: u32 = 3;
6102 #[allow(missing_docs)]
6103 pub const R_METAG_RELBRANCH: u32 = 4;
6104 #[allow(missing_docs)]
6105 pub const R_METAG_GETSETOFF: u32 = 5;
6106 
6107 // Backward compatability
6108 #[allow(missing_docs)]
6109 pub const R_METAG_REG32OP1: u32 = 6;
6110 #[allow(missing_docs)]
6111 pub const R_METAG_REG32OP2: u32 = 7;
6112 #[allow(missing_docs)]
6113 pub const R_METAG_REG32OP3: u32 = 8;
6114 #[allow(missing_docs)]
6115 pub const R_METAG_REG16OP1: u32 = 9;
6116 #[allow(missing_docs)]
6117 pub const R_METAG_REG16OP2: u32 = 10;
6118 #[allow(missing_docs)]
6119 pub const R_METAG_REG16OP3: u32 = 11;
6120 #[allow(missing_docs)]
6121 pub const R_METAG_REG32OP4: u32 = 12;
6122 
6123 #[allow(missing_docs)]
6124 pub const R_METAG_HIOG: u32 = 13;
6125 #[allow(missing_docs)]
6126 pub const R_METAG_LOOG: u32 = 14;
6127 
6128 #[allow(missing_docs)]
6129 pub const R_METAG_REL8: u32 = 15;
6130 #[allow(missing_docs)]
6131 pub const R_METAG_REL16: u32 = 16;
6132 
6133 #[allow(missing_docs)]
6134 pub const R_METAG_GNU_VTINHERIT: u32 = 30;
6135 #[allow(missing_docs)]
6136 pub const R_METAG_GNU_VTENTRY: u32 = 31;
6137 
6138 // PIC relocations
6139 #[allow(missing_docs)]
6140 pub const R_METAG_HI16_GOTOFF: u32 = 32;
6141 #[allow(missing_docs)]
6142 pub const R_METAG_LO16_GOTOFF: u32 = 33;
6143 #[allow(missing_docs)]
6144 pub const R_METAG_GETSET_GOTOFF: u32 = 34;
6145 #[allow(missing_docs)]
6146 pub const R_METAG_GETSET_GOT: u32 = 35;
6147 #[allow(missing_docs)]
6148 pub const R_METAG_HI16_GOTPC: u32 = 36;
6149 #[allow(missing_docs)]
6150 pub const R_METAG_LO16_GOTPC: u32 = 37;
6151 #[allow(missing_docs)]
6152 pub const R_METAG_HI16_PLT: u32 = 38;
6153 #[allow(missing_docs)]
6154 pub const R_METAG_LO16_PLT: u32 = 39;
6155 #[allow(missing_docs)]
6156 pub const R_METAG_RELBRANCH_PLT: u32 = 40;
6157 #[allow(missing_docs)]
6158 pub const R_METAG_GOTOFF: u32 = 41;
6159 #[allow(missing_docs)]
6160 pub const R_METAG_PLT: u32 = 42;
6161 #[allow(missing_docs)]
6162 pub const R_METAG_COPY: u32 = 43;
6163 #[allow(missing_docs)]
6164 pub const R_METAG_JMP_SLOT: u32 = 44;
6165 #[allow(missing_docs)]
6166 pub const R_METAG_RELATIVE: u32 = 45;
6167 #[allow(missing_docs)]
6168 pub const R_METAG_GLOB_DAT: u32 = 46;
6169 
6170 // TLS relocations
6171 #[allow(missing_docs)]
6172 pub const R_METAG_TLS_GD: u32 = 47;
6173 #[allow(missing_docs)]
6174 pub const R_METAG_TLS_LDM: u32 = 48;
6175 #[allow(missing_docs)]
6176 pub const R_METAG_TLS_LDO_HI16: u32 = 49;
6177 #[allow(missing_docs)]
6178 pub const R_METAG_TLS_LDO_LO16: u32 = 50;
6179 #[allow(missing_docs)]
6180 pub const R_METAG_TLS_LDO: u32 = 51;
6181 #[allow(missing_docs)]
6182 pub const R_METAG_TLS_IE: u32 = 52;
6183 #[allow(missing_docs)]
6184 pub const R_METAG_TLS_IENONPIC: u32 = 53;
6185 #[allow(missing_docs)]
6186 pub const R_METAG_TLS_IENONPIC_HI16: u32 = 54;
6187 #[allow(missing_docs)]
6188 pub const R_METAG_TLS_IENONPIC_LO16: u32 = 55;
6189 #[allow(missing_docs)]
6190 pub const R_METAG_TLS_TPOFF: u32 = 56;
6191 #[allow(missing_docs)]
6192 pub const R_METAG_TLS_DTPMOD: u32 = 57;
6193 #[allow(missing_docs)]
6194 pub const R_METAG_TLS_DTPOFF: u32 = 58;
6195 #[allow(missing_docs)]
6196 pub const R_METAG_TLS_LE: u32 = 59;
6197 #[allow(missing_docs)]
6198 pub const R_METAG_TLS_LE_HI16: u32 = 60;
6199 #[allow(missing_docs)]
6200 pub const R_METAG_TLS_LE_LO16: u32 = 61;
6201 
6202 // NDS32 values `Rel*::r_type`.
6203 #[allow(missing_docs)]
6204 pub const R_NDS32_NONE: u32 = 0;
6205 #[allow(missing_docs)]
6206 pub const R_NDS32_32_RELA: u32 = 20;
6207 #[allow(missing_docs)]
6208 pub const R_NDS32_COPY: u32 = 39;
6209 #[allow(missing_docs)]
6210 pub const R_NDS32_GLOB_DAT: u32 = 40;
6211 #[allow(missing_docs)]
6212 pub const R_NDS32_JMP_SLOT: u32 = 41;
6213 #[allow(missing_docs)]
6214 pub const R_NDS32_RELATIVE: u32 = 42;
6215 #[allow(missing_docs)]
6216 pub const R_NDS32_TLS_TPOFF: u32 = 102;
6217 #[allow(missing_docs)]
6218 pub const R_NDS32_TLS_DESC: u32 = 119;
6219 
6220 unsafe_impl_endian_pod!(
6221     FileHeader32,
6222     FileHeader64,
6223     SectionHeader32,
6224     SectionHeader64,
6225     CompressionHeader32,
6226     CompressionHeader64,
6227     Sym32,
6228     Sym64,
6229     Syminfo32,
6230     Syminfo64,
6231     Rel32,
6232     Rel64,
6233     Rela32,
6234     Rela64,
6235     ProgramHeader32,
6236     ProgramHeader64,
6237     Dyn32,
6238     Dyn64,
6239     Versym,
6240     Verdef,
6241     Verdaux,
6242     Verneed,
6243     Vernaux,
6244     NoteHeader32,
6245     NoteHeader64,
6246     HashHeader,
6247     GnuHashHeader,
6248 );
6249