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