elfdefinitions.m4 revision 1.4
1dnl $NetBSD: elfdefinitions.m4,v 1.4 2022/05/02 20:27:43 jkoshy Exp $ 2/*- 3 * Copyright (c) 2010,2021 Joseph Koshy 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27divert(-1) 28define(`VCSID_ELFDEFINITIONS_M4', 29 `Id: elfdefinitions.m4 3980 2022-05-02 19:50:00Z jkoshy') 30include(`elfconstants.m4')dnl 31 32define(`_',`ifelse(eval(len($1) <= 7),1, 33 `#define $1 $2', 34 `#define $1 $2')') 35divert(0)dnl 36 37/* 38 * WARNING: GENERATED FILE. DO NOT MODIFY. 39 * 40 * GENERATED FROM: VCSID_ELFDEFINITIONS_M4 41 * GENERATED FROM: VCSID_ELFCONSTANTS_M4 42 */ 43 44/* 45 * These definitions are based on: 46 * - The public specification of the ELF format as defined in the 47 * October 2009 draft of System V ABI. 48 * See: http://www.sco.com/developers/gabi/latest/ch4.intro.html 49 * - The May 1998 (version 1.5) draft of "The ELF-64 object format". 50 * - Processor-specific ELF ABI definitions for sparc, i386, amd64, mips, 51 * ia64, powerpc, and RISC-V processors. 52 * - The "Linkers and Libraries Guide", from Sun Microsystems. 53 */ 54 55#ifndef _SYS_ELFDEFINITIONS_H_ 56#define _SYS_ELFDEFINITIONS_H_ 57 58#include <stdint.h> 59 60/* 61 * Types of capabilities. 62 */ 63DEFINE_CAPABILITIES() 64 65/* 66 * Flags used with dynamic linking entries. 67 */ 68DEFINE_DYN_FLAGS() 69 70/* 71 * Dynamic linking entry types. 72 */ 73DEFINE_DYN_TYPES() 74 75/* Aliases for dynamic linking entry symbols. */ 76DEFINE_DYN_TYPE_ALIASES() 77 78/* 79 * Flags used in the executable header (field: e_flags). 80 */ 81DEFINE_EHDR_FLAGS() 82 83/* 84 * Offsets in the `ei_ident[]' field of an ELF executable header. 85 */ 86DEFINE_EI_OFFSETS() 87 88/* 89 * The ELF class of an object. 90 */ 91DEFINE_ELF_CLASSES() 92 93/* 94 * Endianness of data in an ELF object. 95 */ 96DEFINE_ELF_DATA_ENDIANNESSES() 97 98/* 99 * The magic numbers used in the initial four bytes of an ELF object. 100 * 101 * These numbers are: 0x7F, 'E', 'L' and 'F'. 102 */ 103DEFINE_ELF_MAGIC_VALUES() 104/* Additional magic-related constants. */ 105DEFINE_ELF_MAGIC_ADDITIONAL_CONSTANTS() 106 107/* 108 * ELF OS ABI field. 109 */ 110DEFINE_ELF_OSABIS() 111 112/* OS ABI Aliases. */ 113DEFINE_ELF_OSABI_ALIASES() 114 115/* 116 * ELF Machine types: (EM_*). 117 */ 118DEFINE_ELF_MACHINE_TYPES() 119/* Other synonyms. */ 120DEFINE_ELF_MACHINE_TYPE_SYNONYMS() 121 122/* 123 * ELF file types: (ET_*). 124 */ 125DEFINE_ELF_TYPES() 126 127/* ELF file format version numbers. */ 128DEFINE_ELF_FILE_VERSIONS() 129 130/* 131 * Flags for section groups. 132 */ 133DEFINE_GRP_FLAGS() 134 135/* 136 * Flags / mask for .gnu.versym sections. 137 */ 138DEFINE_VERSYMS() 139 140/* 141 * Flags used by program header table entries. 142 */ 143DEFINE_PHDR_FLAGS() 144 145/* 146 * Types of program header table entries. 147 */ 148DEFINE_PHDR_TYPES() 149/* synonyms. */ 150DEFINE_PHDR_TYPE_SYNONYMS() 151 152/* 153 * Section flags. 154 */ 155DEFINE_SECTION_FLAGS() 156 157/* 158 * Special section indices. 159 */ 160DEFINE_SECTION_INDICES() 161 162/* 163 * Section types. 164 */ 165DEFINE_SECTION_TYPES() 166/* Aliases for section types. */ 167DEFINE_SECTION_TYPE_ALIASES() 168 169#define PN_XNUM 0xFFFFU /* Use extended section numbering. */ 170 171/* 172 * Symbol binding information. 173 */ 174DEFINE_SYMBOL_BINDINGS() 175 176/* 177 * Symbol types 178 */ 179DEFINE_SYMBOL_TYPES() 180/* Additional constants related to symbol types. */ 181DEFINE_SYMBOL_TYPES_ADDITIONAL_CONSTANTS() 182 183/* 184 * Symbol binding. 185 */ 186DEFINE_SYMBOL_BINDING_KINDS() 187 188/* 189 * Symbol visibility. 190 */ 191DEFINE_SYMBOL_VISIBILITIES() 192 193/* 194 * Symbol flags. 195 */ 196DEFINE_SYMBOL_FLAGS() 197 198/* 199 * Versioning dependencies. 200 */ 201DEFINE_VERSIONING_DEPENDENCIES() 202 203/* 204 * Versioning flags. 205 */ 206DEFINE_VERSIONING_FLAGS() 207 208/* 209 * Versioning needs 210 */ 211DEFINE_VERSIONING_NEEDS() 212 213/* 214 * Versioning numbers. 215 */ 216DEFINE_VERSIONING_NUMBERS() 217 218/** 219 ** Relocation types. 220 **/ 221DEFINE_RELOCATIONS() 222 223/* 224 * MIPS ABI related. 225 */ 226DEFINE_MIPS_ABIS() 227 228/** 229 ** ELF Types. 230 **/ 231 232typedef uint32_t Elf32_Addr; /* Program address. */ 233typedef uint8_t Elf32_Byte; /* Unsigned tiny integer. */ 234typedef uint16_t Elf32_Half; /* Unsigned medium integer. */ 235typedef uint32_t Elf32_Off; /* File offset. */ 236typedef uint16_t Elf32_Section; /* Section index. */ 237typedef int32_t Elf32_Sword; /* Signed integer. */ 238typedef uint32_t Elf32_Word; /* Unsigned integer. */ 239typedef uint64_t Elf32_Lword; /* Unsigned long integer. */ 240 241typedef uint64_t Elf64_Addr; /* Program address. */ 242typedef uint8_t Elf64_Byte; /* Unsigned tiny integer. */ 243typedef uint16_t Elf64_Half; /* Unsigned medium integer. */ 244typedef uint64_t Elf64_Off; /* File offset. */ 245typedef uint16_t Elf64_Section; /* Section index. */ 246typedef int32_t Elf64_Sword; /* Signed integer. */ 247typedef uint32_t Elf64_Word; /* Unsigned integer. */ 248typedef uint64_t Elf64_Lword; /* Unsigned long integer. */ 249typedef uint64_t Elf64_Xword; /* Unsigned long integer. */ 250typedef int64_t Elf64_Sxword; /* Signed long integer. */ 251 252 253/* 254 * Capability descriptors. 255 */ 256 257/* 32-bit capability descriptor. */ 258typedef struct { 259 Elf32_Word c_tag; /* Type of entry. */ 260 union { 261 Elf32_Word c_val; /* Integer value. */ 262 Elf32_Addr c_ptr; /* Pointer value. */ 263 } c_un; 264} Elf32_Cap; 265 266/* 64-bit capability descriptor. */ 267typedef struct { 268 Elf64_Xword c_tag; /* Type of entry. */ 269 union { 270 Elf64_Xword c_val; /* Integer value. */ 271 Elf64_Addr c_ptr; /* Pointer value. */ 272 } c_un; 273} Elf64_Cap; 274 275/* 276 * MIPS .conflict section entries. 277 */ 278 279/* 32-bit entry. */ 280typedef struct { 281 Elf32_Addr c_index; 282} Elf32_Conflict; 283 284/* 64-bit entry. */ 285typedef struct { 286 Elf64_Addr c_index; 287} Elf64_Conflict; 288 289/* 290 * Dynamic section entries. 291 */ 292 293/* 32-bit entry. */ 294typedef struct { 295 Elf32_Sword d_tag; /* Type of entry. */ 296 union { 297 Elf32_Word d_val; /* Integer value. */ 298 Elf32_Addr d_ptr; /* Pointer value. */ 299 } d_un; 300} Elf32_Dyn; 301 302/* 64-bit entry. */ 303typedef struct { 304 Elf64_Sxword d_tag; /* Type of entry. */ 305 union { 306 Elf64_Xword d_val; /* Integer value. */ 307 Elf64_Addr d_ptr; /* Pointer value; */ 308 } d_un; 309} Elf64_Dyn; 310 311 312/* 313 * The executable header (EHDR). 314 */ 315 316/* 32 bit EHDR. */ 317typedef struct { 318 unsigned char e_ident[EI_NIDENT]; /* ELF identification. */ 319 Elf32_Half e_type; /* Object file type (ET_*). */ 320 Elf32_Half e_machine; /* Machine type (EM_*). */ 321 Elf32_Word e_version; /* File format version (EV_*). */ 322 Elf32_Addr e_entry; /* Start address. */ 323 Elf32_Off e_phoff; /* File offset to the PHDR table. */ 324 Elf32_Off e_shoff; /* File offset to the SHDRheader. */ 325 Elf32_Word e_flags; /* Flags (EF_*). */ 326 Elf32_Half e_ehsize; /* Elf header size in bytes. */ 327 Elf32_Half e_phentsize; /* PHDR table entry size in bytes. */ 328 Elf32_Half e_phnum; /* Number of PHDR entries. */ 329 Elf32_Half e_shentsize; /* SHDR table entry size in bytes. */ 330 Elf32_Half e_shnum; /* Number of SHDR entries. */ 331 Elf32_Half e_shstrndx; /* Index of section name string table. */ 332} Elf32_Ehdr; 333 334 335/* 64 bit EHDR. */ 336typedef struct { 337 unsigned char e_ident[EI_NIDENT]; /* ELF identification. */ 338 Elf64_Half e_type; /* Object file type (ET_*). */ 339 Elf64_Half e_machine; /* Machine type (EM_*). */ 340 Elf64_Word e_version; /* File format version (EV_*). */ 341 Elf64_Addr e_entry; /* Start address. */ 342 Elf64_Off e_phoff; /* File offset to the PHDR table. */ 343 Elf64_Off e_shoff; /* File offset to the SHDRheader. */ 344 Elf64_Word e_flags; /* Flags (EF_*). */ 345 Elf64_Half e_ehsize; /* Elf header size in bytes. */ 346 Elf64_Half e_phentsize; /* PHDR table entry size in bytes. */ 347 Elf64_Half e_phnum; /* Number of PHDR entries. */ 348 Elf64_Half e_shentsize; /* SHDR table entry size in bytes. */ 349 Elf64_Half e_shnum; /* Number of SHDR entries. */ 350 Elf64_Half e_shstrndx; /* Index of section name string table. */ 351} Elf64_Ehdr; 352 353 354/* 355 * Shared object information. 356 */ 357 358/* 32-bit entry. */ 359typedef struct { 360 Elf32_Word l_name; /* The name of a shared object. */ 361 Elf32_Word l_time_stamp; /* 32-bit timestamp. */ 362 Elf32_Word l_checksum; /* Checksum of visible symbols, sizes. */ 363 Elf32_Word l_version; /* Interface version string index. */ 364 Elf32_Word l_flags; /* Flags (LL_*). */ 365} Elf32_Lib; 366 367/* 64-bit entry. */ 368typedef struct { 369 Elf64_Word l_name; /* The name of a shared object. */ 370 Elf64_Word l_time_stamp; /* 32-bit timestamp. */ 371 Elf64_Word l_checksum; /* Checksum of visible symbols, sizes. */ 372 Elf64_Word l_version; /* Interface version string index. */ 373 Elf64_Word l_flags; /* Flags (LL_*). */ 374} Elf64_Lib; 375 376DEFINE_LL_FLAGS() 377 378/* 379 * Note tags 380 */ 381DEFINE_NOTE_ENTRY_TYPES() 382/* Aliases for the ABI tag. */ 383DEFINE_NOTE_ENTRY_ALIASES() 384 385/* 386 * Note descriptors. 387 */ 388 389typedef struct { 390 uint32_t n_namesz; /* Length of note's name. */ 391 uint32_t n_descsz; /* Length of note's value. */ 392 uint32_t n_type; /* Type of note. */ 393} Elf_Note; 394 395typedef Elf_Note Elf32_Nhdr; /* 32-bit note header. */ 396typedef Elf_Note Elf64_Nhdr; /* 64-bit note header. */ 397 398/* 399 * MIPS ELF options descriptor header. 400 */ 401 402typedef struct { 403 Elf64_Byte kind; /* Type of options. */ 404 Elf64_Byte size; /* Size of option descriptor. */ 405 Elf64_Half section; /* Index of section affected. */ 406 Elf64_Word info; /* Kind-specific information. */ 407} Elf_Options; 408 409/* 410 * Option kinds. 411 */ 412DEFINE_OPTION_KINDS() 413 414/* 415 * ODK_EXCEPTIONS info field masks. 416 */ 417DEFINE_OPTION_EXCEPTIONS() 418 419/* 420 * ODK_PAD info field masks. 421 */ 422DEFINE_OPTION_PADS() 423 424/* 425 * ODK_HWPATCH info field masks and ODK_HWAND/ODK_HWOR info field 426 * and hwp_flags[12] masks. 427 */ 428DEFINE_ODK_HWPATCH_MASKS() 429 430/* 431 * ODK_IDENT/ODK_GP_GROUP info field masks. 432 */ 433DEFINE_ODK_GP_MASKS() 434 435/* 436 * MIPS ELF register info descriptor. 437 */ 438 439/* 32 bit RegInfo entry. */ 440typedef struct { 441 Elf32_Word ri_gprmask; /* Mask of general register used. */ 442 Elf32_Word ri_cprmask[4]; /* Mask of coprocessor register used. */ 443 Elf32_Addr ri_gp_value; /* GP register value. */ 444} Elf32_RegInfo; 445 446/* 64 bit RegInfo entry. */ 447typedef struct { 448 Elf64_Word ri_gprmask; /* Mask of general register used. */ 449 Elf64_Word ri_pad; /* Padding. */ 450 Elf64_Word ri_cprmask[4]; /* Mask of coprocessor register used. */ 451 Elf64_Addr ri_gp_value; /* GP register value. */ 452} Elf64_RegInfo; 453 454/* 455 * Program Header Table (PHDR) entries. 456 */ 457 458/* 32 bit PHDR entry. */ 459typedef struct { 460 Elf32_Word p_type; /* Type of segment. */ 461 Elf32_Off p_offset; /* File offset to segment. */ 462 Elf32_Addr p_vaddr; /* Virtual address in memory. */ 463 Elf32_Addr p_paddr; /* Physical address (if relevant). */ 464 Elf32_Word p_filesz; /* Size of segment in file. */ 465 Elf32_Word p_memsz; /* Size of segment in memory. */ 466 Elf32_Word p_flags; /* Segment flags. */ 467 Elf32_Word p_align; /* Alignment constraints. */ 468} Elf32_Phdr; 469 470/* 64 bit PHDR entry. */ 471typedef struct { 472 Elf64_Word p_type; /* Type of segment. */ 473 Elf64_Word p_flags; /* Segment flags. */ 474 Elf64_Off p_offset; /* File offset to segment. */ 475 Elf64_Addr p_vaddr; /* Virtual address in memory. */ 476 Elf64_Addr p_paddr; /* Physical address (if relevant). */ 477 Elf64_Xword p_filesz; /* Size of segment in file. */ 478 Elf64_Xword p_memsz; /* Size of segment in memory. */ 479 Elf64_Xword p_align; /* Alignment constraints. */ 480} Elf64_Phdr; 481 482 483/* 484 * Move entries, for describing data in COMMON blocks in a compact 485 * manner. 486 */ 487 488/* 32-bit move entry. */ 489typedef struct { 490 Elf32_Lword m_value; /* Initialization value. */ 491 Elf32_Word m_info; /* Encoded size and index. */ 492 Elf32_Word m_poffset; /* Offset relative to symbol. */ 493 Elf32_Half m_repeat; /* Repeat count. */ 494 Elf32_Half m_stride; /* Number of units to skip. */ 495} Elf32_Move; 496 497/* 64-bit move entry. */ 498typedef struct { 499 Elf64_Lword m_value; /* Initialization value. */ 500 Elf64_Xword m_info; /* Encoded size and index. */ 501 Elf64_Xword m_poffset; /* Offset relative to symbol. */ 502 Elf64_Half m_repeat; /* Repeat count. */ 503 Elf64_Half m_stride; /* Number of units to skip. */ 504} Elf64_Move; 505 506#define ELF32_M_SYM(I) ((I) >> 8) 507#define ELF32_M_SIZE(I) ((unsigned char) (I)) 508#define ELF32_M_INFO(M, S) (((M) << 8) + (unsigned char) (S)) 509 510#define ELF64_M_SYM(I) ((I) >> 8) 511#define ELF64_M_SIZE(I) ((unsigned char) (I)) 512#define ELF64_M_INFO(M, S) (((M) << 8) + (unsigned char) (S)) 513 514/* 515 * Section Header Table (SHDR) entries. 516 */ 517 518/* 32 bit SHDR */ 519typedef struct { 520 Elf32_Word sh_name; /* index of section name */ 521 Elf32_Word sh_type; /* section type */ 522 Elf32_Word sh_flags; /* section flags */ 523 Elf32_Addr sh_addr; /* in-memory address of section */ 524 Elf32_Off sh_offset; /* file offset of section */ 525 Elf32_Word sh_size; /* section size in bytes */ 526 Elf32_Word sh_link; /* section header table link */ 527 Elf32_Word sh_info; /* extra information */ 528 Elf32_Word sh_addralign; /* alignment constraint */ 529 Elf32_Word sh_entsize; /* size for fixed-size entries */ 530} Elf32_Shdr; 531 532/* 64 bit SHDR */ 533typedef struct { 534 Elf64_Word sh_name; /* index of section name */ 535 Elf64_Word sh_type; /* section type */ 536 Elf64_Xword sh_flags; /* section flags */ 537 Elf64_Addr sh_addr; /* in-memory address of section */ 538 Elf64_Off sh_offset; /* file offset of section */ 539 Elf64_Xword sh_size; /* section size in bytes */ 540 Elf64_Word sh_link; /* section header table link */ 541 Elf64_Word sh_info; /* extra information */ 542 Elf64_Xword sh_addralign; /* alignment constraint */ 543 Elf64_Xword sh_entsize; /* size for fixed-size entries */ 544} Elf64_Shdr; 545 546 547/* 548 * Symbol table entries. 549 */ 550 551typedef struct { 552 Elf32_Word st_name; /* index of symbol's name */ 553 Elf32_Addr st_value; /* value for the symbol */ 554 Elf32_Word st_size; /* size of associated data */ 555 unsigned char st_info; /* type and binding attributes */ 556 unsigned char st_other; /* visibility */ 557 Elf32_Half st_shndx; /* index of related section */ 558} Elf32_Sym; 559 560typedef struct { 561 Elf64_Word st_name; /* index of symbol's name */ 562 unsigned char st_info; /* type and binding attributes */ 563 unsigned char st_other; /* visibility */ 564 Elf64_Half st_shndx; /* index of related section */ 565 Elf64_Addr st_value; /* value for the symbol */ 566 Elf64_Xword st_size; /* size of associated data */ 567} Elf64_Sym; 568 569#define ELF32_ST_BIND(I) ((I) >> 4) 570#define ELF32_ST_TYPE(I) ((I) & 0xFU) 571#define ELF32_ST_INFO(B,T) (((B) << 4) + ((T) & 0xF)) 572 573#define ELF64_ST_BIND(I) ((I) >> 4) 574#define ELF64_ST_TYPE(I) ((I) & 0xFU) 575#define ELF64_ST_INFO(B,T) (((B) << 4) + ((T) & 0xF)) 576 577#define ELF32_ST_VISIBILITY(O) ((O) & 0x3) 578#define ELF64_ST_VISIBILITY(O) ((O) & 0x3) 579 580/* 581 * Syminfo descriptors, containing additional symbol information. 582 */ 583 584/* 32-bit entry. */ 585typedef struct { 586 Elf32_Half si_boundto; /* Entry index with additional flags. */ 587 Elf32_Half si_flags; /* Flags. */ 588} Elf32_Syminfo; 589 590/* 64-bit entry. */ 591typedef struct { 592 Elf64_Half si_boundto; /* Entry index with additional flags. */ 593 Elf64_Half si_flags; /* Flags. */ 594} Elf64_Syminfo; 595 596/* 597 * Relocation descriptors. 598 */ 599 600typedef struct { 601 Elf32_Addr r_offset; /* location to apply relocation to */ 602 Elf32_Word r_info; /* type+section for relocation */ 603} Elf32_Rel; 604 605typedef struct { 606 Elf32_Addr r_offset; /* location to apply relocation to */ 607 Elf32_Word r_info; /* type+section for relocation */ 608 Elf32_Sword r_addend; /* constant addend */ 609} Elf32_Rela; 610 611typedef struct { 612 Elf64_Addr r_offset; /* location to apply relocation to */ 613 Elf64_Xword r_info; /* type+section for relocation */ 614} Elf64_Rel; 615 616typedef struct { 617 Elf64_Addr r_offset; /* location to apply relocation to */ 618 Elf64_Xword r_info; /* type+section for relocation */ 619 Elf64_Sxword r_addend; /* constant addend */ 620} Elf64_Rela; 621 622 623#define ELF32_R_SYM(I) ((I) >> 8) 624#define ELF32_R_TYPE(I) ((unsigned char) (I)) 625#define ELF32_R_INFO(S,T) (((S) << 8) + (unsigned char) (T)) 626 627#define ELF64_R_SYM(I) ((I) >> 32) 628#define ELF64_R_TYPE(I) ((I) & 0xFFFFFFFFUL) 629#define ELF64_R_INFO(S,T) \ 630 (((Elf64_Xword) (S) << 32) + ((T) & 0xFFFFFFFFUL)) 631 632/* 633 * Symbol versioning structures. 634 */ 635 636/* 32-bit structures. */ 637typedef struct 638{ 639 Elf32_Word vda_name; /* Index to name. */ 640 Elf32_Word vda_next; /* Offset to next entry. */ 641} Elf32_Verdaux; 642 643typedef struct 644{ 645 Elf32_Word vna_hash; /* Hash value of dependency name. */ 646 Elf32_Half vna_flags; /* Flags. */ 647 Elf32_Half vna_other; /* Unused. */ 648 Elf32_Word vna_name; /* Offset to dependency name. */ 649 Elf32_Word vna_next; /* Offset to next vernaux entry. */ 650} Elf32_Vernaux; 651 652typedef struct 653{ 654 Elf32_Half vd_version; /* Version information. */ 655 Elf32_Half vd_flags; /* Flags. */ 656 Elf32_Half vd_ndx; /* Index into the versym section. */ 657 Elf32_Half vd_cnt; /* Number of aux entries. */ 658 Elf32_Word vd_hash; /* Hash value of name. */ 659 Elf32_Word vd_aux; /* Offset to aux entries. */ 660 Elf32_Word vd_next; /* Offset to next version definition. */ 661} Elf32_Verdef; 662 663typedef struct 664{ 665 Elf32_Half vn_version; /* Version number. */ 666 Elf32_Half vn_cnt; /* Number of aux entries. */ 667 Elf32_Word vn_file; /* Offset of associated file name. */ 668 Elf32_Word vn_aux; /* Offset of vernaux array. */ 669 Elf32_Word vn_next; /* Offset of next verneed entry. */ 670} Elf32_Verneed; 671 672typedef Elf32_Half Elf32_Versym; 673 674/* 64-bit structures. */ 675 676typedef struct { 677 Elf64_Word vda_name; /* Index to name. */ 678 Elf64_Word vda_next; /* Offset to next entry. */ 679} Elf64_Verdaux; 680 681typedef struct { 682 Elf64_Word vna_hash; /* Hash value of dependency name. */ 683 Elf64_Half vna_flags; /* Flags. */ 684 Elf64_Half vna_other; /* Unused. */ 685 Elf64_Word vna_name; /* Offset to dependency name. */ 686 Elf64_Word vna_next; /* Offset to next vernaux entry. */ 687} Elf64_Vernaux; 688 689typedef struct { 690 Elf64_Half vd_version; /* Version information. */ 691 Elf64_Half vd_flags; /* Flags. */ 692 Elf64_Half vd_ndx; /* Index into the versym section. */ 693 Elf64_Half vd_cnt; /* Number of aux entries. */ 694 Elf64_Word vd_hash; /* Hash value of name. */ 695 Elf64_Word vd_aux; /* Offset to aux entries. */ 696 Elf64_Word vd_next; /* Offset to next version definition. */ 697} Elf64_Verdef; 698 699typedef struct { 700 Elf64_Half vn_version; /* Version number. */ 701 Elf64_Half vn_cnt; /* Number of aux entries. */ 702 Elf64_Word vn_file; /* Offset of associated file name. */ 703 Elf64_Word vn_aux; /* Offset of vernaux array. */ 704 Elf64_Word vn_next; /* Offset of next verneed entry. */ 705} Elf64_Verneed; 706 707typedef Elf64_Half Elf64_Versym; 708 709 710/* 711 * The header for GNU-style hash sections. 712 */ 713 714typedef struct { 715 uint32_t gh_nbuckets; /* Number of hash buckets. */ 716 uint32_t gh_symndx; /* First visible symbol in .dynsym. */ 717 uint32_t gh_maskwords; /* #maskwords used in bloom filter. */ 718 uint32_t gh_shift2; /* Bloom filter shift count. */ 719} Elf_GNU_Hash_Header; 720 721#endif /* _SYS_ELFDEFINITIONS_H_ */ 722