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