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