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