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