xref: /netbsd-src/external/gpl3/binutils/dist/libctf/elf.h (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
16f4ced0bSchristos /* This file defines standard ELF types, structures, and macros.
2*cb63e24eSchristos    Copyright (C) 1995-2024 Free Software Foundation, Inc.
36f4ced0bSchristos 
46f4ced0bSchristos    This file is part of libctf.
56f4ced0bSchristos 
66f4ced0bSchristos    libctf is free software; you can redistribute it and/or modify it under
76f4ced0bSchristos    the terms of the GNU General Public License as published by the Free
86f4ced0bSchristos    Software Foundation; either version 3, or (at your option) any later
96f4ced0bSchristos    version.
106f4ced0bSchristos 
116f4ced0bSchristos    This program is distributed in the hope that it will be useful, but
126f4ced0bSchristos    WITHOUT ANY WARRANTY; without even the implied warranty of
136f4ced0bSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
146f4ced0bSchristos    See the GNU General Public License for more details.
156f4ced0bSchristos 
166f4ced0bSchristos    You should have received a copy of the GNU General Public License
176f4ced0bSchristos    along with this program; see the file COPYING.  If not see
186f4ced0bSchristos    <http://www.gnu.org/licenses/>.  */
196f4ced0bSchristos 
206f4ced0bSchristos #ifndef _CTF_ELF_H
216f4ced0bSchristos #define _CTF_ELF_H
226f4ced0bSchristos 
236f4ced0bSchristos #include "config.h"
246f4ced0bSchristos #include "ansidecl.h"
256f4ced0bSchristos #include <stdint.h>
266f4ced0bSchristos #include "elf/common.h"
276f4ced0bSchristos #include "elf/external.h"
286f4ced0bSchristos 
296f4ced0bSchristos typedef uint32_t Elf32_Word;
306f4ced0bSchristos typedef uint32_t Elf64_Word;
316f4ced0bSchristos typedef uint32_t Elf32_Addr;
326f4ced0bSchristos typedef uint64_t Elf64_Addr;
336f4ced0bSchristos typedef uint64_t Elf64_Xword;
346f4ced0bSchristos typedef uint16_t Elf32_Section;
356f4ced0bSchristos typedef uint16_t Elf64_Section;
366f4ced0bSchristos 
376f4ced0bSchristos #define SHN_EXTABS	0xFFF1		/* Associated symbol is absolute */
386f4ced0bSchristos 
396f4ced0bSchristos /* Symbol table entry.  */
406f4ced0bSchristos 
416f4ced0bSchristos typedef struct
426f4ced0bSchristos {
436f4ced0bSchristos   Elf32_Word	st_name;		/* Symbol name (string tbl index) */
446f4ced0bSchristos   Elf32_Addr	st_value;		/* Symbol value */
456f4ced0bSchristos   Elf32_Word	st_size;		/* Symbol size */
466f4ced0bSchristos   unsigned char	st_info;		/* Symbol type and binding */
476f4ced0bSchristos   unsigned char	st_other;		/* Symbol visibility */
486f4ced0bSchristos   Elf32_Section	st_shndx;		/* Section index */
496f4ced0bSchristos } Elf32_Sym;
506f4ced0bSchristos 
516f4ced0bSchristos typedef struct
526f4ced0bSchristos {
536f4ced0bSchristos   Elf64_Word	st_name;		/* Symbol name (string tbl index) */
546f4ced0bSchristos   unsigned char	st_info;		/* Symbol type and binding */
556f4ced0bSchristos   unsigned char st_other;		/* Symbol visibility */
566f4ced0bSchristos   Elf64_Section	st_shndx;		/* Section index */
576f4ced0bSchristos   Elf64_Addr	st_value;		/* Symbol value */
586f4ced0bSchristos   Elf64_Xword	st_size;		/* Symbol size */
596f4ced0bSchristos } Elf64_Sym;
606f4ced0bSchristos 
616f4ced0bSchristos #endif	/* _CTF_ELF_H */
62