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