18dffb485Schristos /* This file defines standard ELF types, structures, and macros. 2*12989c96Schristos Copyright (C) 1995-2024 Free Software Foundation, Inc. 38dffb485Schristos 48dffb485Schristos This file is part of libctf. 58dffb485Schristos 68dffb485Schristos libctf is free software; you can redistribute it and/or modify it under 78dffb485Schristos the terms of the GNU General Public License as published by the Free 88dffb485Schristos Software Foundation; either version 3, or (at your option) any later 98dffb485Schristos version. 108dffb485Schristos 118dffb485Schristos This program is distributed in the hope that it will be useful, but 128dffb485Schristos WITHOUT ANY WARRANTY; without even the implied warranty of 138dffb485Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 148dffb485Schristos See the GNU General Public License for more details. 158dffb485Schristos 168dffb485Schristos You should have received a copy of the GNU General Public License 178dffb485Schristos along with this program; see the file COPYING. If not see 188dffb485Schristos <http://www.gnu.org/licenses/>. */ 198dffb485Schristos 208dffb485Schristos #ifndef _CTF_ELF_H 218dffb485Schristos #define _CTF_ELF_H 228dffb485Schristos 238dffb485Schristos #include "config.h" 248dffb485Schristos #include "ansidecl.h" 258dffb485Schristos #include <stdint.h> 268dffb485Schristos #include "elf/common.h" 278dffb485Schristos #include "elf/external.h" 288dffb485Schristos 298dffb485Schristos typedef uint32_t Elf32_Word; 308dffb485Schristos typedef uint32_t Elf64_Word; 318dffb485Schristos typedef uint32_t Elf32_Addr; 328dffb485Schristos typedef uint64_t Elf64_Addr; 338dffb485Schristos typedef uint64_t Elf64_Xword; 348dffb485Schristos typedef uint16_t Elf32_Section; 358dffb485Schristos typedef uint16_t Elf64_Section; 368dffb485Schristos 378dffb485Schristos #define SHN_EXTABS 0xFFF1 /* Associated symbol is absolute */ 388dffb485Schristos 398dffb485Schristos /* Symbol table entry. */ 408dffb485Schristos 418dffb485Schristos typedef struct 428dffb485Schristos { 438dffb485Schristos Elf32_Word st_name; /* Symbol name (string tbl index) */ 448dffb485Schristos Elf32_Addr st_value; /* Symbol value */ 458dffb485Schristos Elf32_Word st_size; /* Symbol size */ 468dffb485Schristos unsigned char st_info; /* Symbol type and binding */ 478dffb485Schristos unsigned char st_other; /* Symbol visibility */ 488dffb485Schristos Elf32_Section st_shndx; /* Section index */ 498dffb485Schristos } Elf32_Sym; 508dffb485Schristos 518dffb485Schristos typedef struct 528dffb485Schristos { 538dffb485Schristos Elf64_Word st_name; /* Symbol name (string tbl index) */ 548dffb485Schristos unsigned char st_info; /* Symbol type and binding */ 558dffb485Schristos unsigned char st_other; /* Symbol visibility */ 568dffb485Schristos Elf64_Section st_shndx; /* Section index */ 578dffb485Schristos Elf64_Addr st_value; /* Symbol value */ 588dffb485Schristos Elf64_Xword st_size; /* Symbol size */ 598dffb485Schristos } Elf64_Sym; 608dffb485Schristos 618dffb485Schristos #endif /* _CTF_ELF_H */ 62