1*fae548d3Szrj /* This file defines standard ELF types, structures, and macros. 2*fae548d3Szrj Copyright (C) 1995-2020 Free Software Foundation, Inc. 3*fae548d3Szrj 4*fae548d3Szrj This file is part of libctf. 5*fae548d3Szrj 6*fae548d3Szrj libctf is free software; you can redistribute it and/or modify it under 7*fae548d3Szrj the terms of the GNU General Public License as published by the Free 8*fae548d3Szrj Software Foundation; either version 3, or (at your option) any later 9*fae548d3Szrj version. 10*fae548d3Szrj 11*fae548d3Szrj This program is distributed in the hope that it will be useful, but 12*fae548d3Szrj WITHOUT ANY WARRANTY; without even the implied warranty of 13*fae548d3Szrj MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14*fae548d3Szrj See the GNU General Public License for more details. 15*fae548d3Szrj 16*fae548d3Szrj You should have received a copy of the GNU General Public License 17*fae548d3Szrj along with this program; see the file COPYING. If not see 18*fae548d3Szrj <http://www.gnu.org/licenses/>. */ 19*fae548d3Szrj 20*fae548d3Szrj #ifndef _CTF_ELF_H 21*fae548d3Szrj #define _CTF_ELF_H 22*fae548d3Szrj 23*fae548d3Szrj #include "config.h" 24*fae548d3Szrj #include "ansidecl.h" 25*fae548d3Szrj #include <stdint.h> 26*fae548d3Szrj #include "elf/common.h" 27*fae548d3Szrj #include "elf/external.h" 28*fae548d3Szrj 29*fae548d3Szrj typedef uint32_t Elf32_Word; 30*fae548d3Szrj typedef uint32_t Elf64_Word; 31*fae548d3Szrj typedef uint32_t Elf32_Addr; 32*fae548d3Szrj typedef uint64_t Elf64_Addr; 33*fae548d3Szrj typedef uint64_t Elf64_Xword; 34*fae548d3Szrj typedef uint16_t Elf32_Section; 35*fae548d3Szrj typedef uint16_t Elf64_Section; 36*fae548d3Szrj 37*fae548d3Szrj #define SHN_EXTABS 0xFFF1 /* Associated symbol is absolute */ 38*fae548d3Szrj 39*fae548d3Szrj /* Symbol table entry. */ 40*fae548d3Szrj 41*fae548d3Szrj typedef struct 42*fae548d3Szrj { 43*fae548d3Szrj Elf32_Word st_name; /* Symbol name (string tbl index) */ 44*fae548d3Szrj Elf32_Addr st_value; /* Symbol value */ 45*fae548d3Szrj Elf32_Word st_size; /* Symbol size */ 46*fae548d3Szrj unsigned char st_info; /* Symbol type and binding */ 47*fae548d3Szrj unsigned char st_other; /* Symbol visibility */ 48*fae548d3Szrj Elf32_Section st_shndx; /* Section index */ 49*fae548d3Szrj } Elf32_Sym; 50*fae548d3Szrj 51*fae548d3Szrj typedef struct 52*fae548d3Szrj { 53*fae548d3Szrj Elf64_Word st_name; /* Symbol name (string tbl index) */ 54*fae548d3Szrj unsigned char st_info; /* Symbol type and binding */ 55*fae548d3Szrj unsigned char st_other; /* Symbol visibility */ 56*fae548d3Szrj Elf64_Section st_shndx; /* Section index */ 57*fae548d3Szrj Elf64_Addr st_value; /* Symbol value */ 58*fae548d3Szrj Elf64_Xword st_size; /* Symbol size */ 59*fae548d3Szrj } Elf64_Sym; 60*fae548d3Szrj 61*fae548d3Szrj #endif /* _CTF_ELF_H */ 62