/* This file defines standard ELF types, structures, and macros.
Copyright (C) 1995-1999,2000,2001,2002,2008,2009 Free Software Foundation, Inc.
This file was part of the GNU C Library.
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef GRUB_ELF_H
/* Standard ELF types. */
/* Type for a 16-bit quantity. */
/* Types for signed and unsigned 32-bit quantities. */
/* Types for signed and unsigned 64-bit quantities. */
/* Type of addresses. */
/* Type of file offsets. */
/* Type for section indices, which are 16-bit quantities. */
/* Type for version symbol information. */
/* The ELF file header. This appears at the start of every ELF file. */
typedef struct
{
} Elf32_Ehdr;
typedef struct
{
} Elf64_Ehdr;
/* Fields in the e_ident array. The EI_* macros are indices into the
array. The macros under each EI_* macro are the values the byte
may have. */
/* Conglomeration of the identification bytes, for easy testing as a word. */
/* Value must be EV_CURRENT */
/* Legal values for e_type (object file type). */
/* Legal values for e_machine (architecture). */
/* If it is necessary to assign new unofficial EM_* values, please
pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
chances of collision with official or non-GNU unofficial values. */
/* Legal values for e_version (version). */
/* Section header. */
typedef struct
{
} Elf32_Shdr;
typedef struct
{
} Elf64_Shdr;
/* Special section indices. */
/* Legal values for sh_type (section type). */
/* Legal values for sh_flags (section flags). */
required */
/* Section group handling. */
/* Symbol table entry. */
typedef struct
{
} Elf32_Sym;
typedef struct
{
} Elf64_Sym;
/* The syminfo section if available contains additional information about
every dynamic symbol. */
typedef struct
{
typedef struct
{
/* Possible values for si_boundto. */
/* Possible bitmasks for si_flags. */
loaded */
/* Syminfo version values. */
#define SYMINFO_NONE 0
/* How to extract and insert information held in the st_info field. */
/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */
/* Legal values for ST_BIND subfield of st_info (symbol binding). */
/* Legal values for ST_TYPE subfield of st_info (symbol type). */
/* Symbol table indices are found in the hash buckets and chain table
of a symbol hash table section. This special index value indicates
the end of a chain, meaning no further symbols are found in that bucket. */
/* How to extract and insert information held in the st_other field. */
/* For ELF64 the definitions are the same. */
/* Symbol visibility specification encoded in the st_other field. */
/* Relocation table entry without addend (in section of type SHT_REL). */
typedef struct
{
} Elf32_Rel;
/* I have seen two different definitions of the Elf64_Rel and
Elf64_Rela structures, so we'll leave them out until Novell (or
whoever) gets their act together. */
/* The following, at least, is used on Sparc v9, MIPS, and Alpha. */
typedef struct
{
} Elf64_Rel;
/* Relocation table entry with addend (in section of type SHT_RELA). */
typedef struct
{
} Elf32_Rela;
typedef struct
{
} Elf64_Rela;
/* How to extract and insert information held in the r_info field. */
/* Program segment header. */
typedef struct
{
} Elf32_Phdr;
typedef struct
{
} Elf64_Phdr;
/* Legal values for p_type (segment type). */
/* Legal values for p_flags (segment flags). */
/* Legal values for note segment descriptor types for core files. */
/* Legal values for the note segment descriptor types for object files. */
/* Dynamic section entry. */
typedef struct
{
union
{
} d_un;
} Elf32_Dyn;
typedef struct
{
union
{
} d_un;
} Elf64_Dyn;
/* Legal values for d_tag (dynamic entry type). */
/* DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the
Dyn.d_un.d_val field of the Elf*_Dyn structure. This follows Sun's
approach. */
the following DT_* entry. */
/* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
If any adjustment is made to the ELF object after it has been
built these entries will need to be adjusted. */
/* The versioning entry types. The next are defined as part of the
GNU extension. */
/* These were chosen by Sun. */
table */
versions */
/* Sun added these machine-independent extensions in the "processor-specific"
range. Be compatible. */
/* Values of `d_un.d_val' in the DT_FLAGS entry. */
/* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1
entry in the dynamic section. */
/* Flags for the feature selection in DT_FEATURE_1. */
/* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. */
generally available. */
/* Version definition sections. */
typedef struct
{
entry */
} Elf32_Verdef;
typedef struct
{
entry */
} Elf64_Verdef;
/* Legal values for vd_version (version revision). */
/* Legal values for vd_flags (version information flags). */
/* Versym symbol index values. */
/* Auxiliary version information. */
typedef struct
{
entry */
typedef struct
{
entry */
/* Version dependency section. */
typedef struct
{
dependency */
entry */
typedef struct
{
dependency */
entry */
/* Legal values for vn_version (version revision). */
/* Auxiliary needed version information. */
typedef struct
{
entry */
typedef struct
{
entry */
/* Legal values for vna_flags. */
/* Auxiliary vector. */
/* This vector is normally only used by the program interpreter. The
usual definition in an ABI supplement uses the name auxv_t. The
vector is not usually defined in a standard <elf.h> file, but it
can't hurt. We rename it to avoid conflicts. The sizes of these
types are an arrangement between the exec server and the program
interpreter, so we don't fully specify them here. */
typedef struct
{
union
{
} a_un;
} Elf32_auxv_t;
typedef struct
{
union
{
} a_un;
} Elf64_auxv_t;
/* Legal values for a_type (entry type). */
/* Some more special a_type values describing the hardware. */
processor capabilities. */
/* This entry gives some information about the FPU initialization
performed by the kernel. */
/* Cache block sizes. */
/* A special ignored value for PPC, used by the kernel to control the
interpretation of the AUXV. Must be > 16. */
/* Note section contents. Each entry in the note section begins with
a header of a fixed form. */
typedef struct
{
} Elf32_Nhdr;
typedef struct
{
} Elf64_Nhdr;
/* Known names of notes. */
/* Solaris entries in the note section have this name. */
/* Note entries for GNU systems have this name. */
/* Defined types of notes for Solaris. */
/* Value of descriptor (one word) is desired pagesize for the binary. */
/* Defined note types for GNU systems. */
/* ABI information. The descriptor consists of words:
word 0: OS descriptor
word 1: major version of the ABI
word 2: minor version of the ABI
word 3: subminor version of the ABI
*/
/* Known OSes. These value can appear in word 0 of an ELF_NOTE_ABI
note section entry. */
#define ELF_NOTE_OS_LINUX 0
/* Move records. */
typedef struct
{
} Elf32_Move;
typedef struct
{
} Elf64_Move;
/* Macro to construct move records. */
/* Motorola 68k specific definitions. */
/* Values for Elf32_Ehdr.e_flags. */
/* m68k relocs. */
/* Keep this the last entry. */
/* Intel 80386 specific definitions. */
/* i386 relocs. */
block offset */
offset */
block */
general dynamic thread local data */
local dynamic thread local data
in LE code */
thread local data */
__tls_get_addr() */
thread local data in LE code */
__tls_get_addr() in LDM code */
block offset */
TLS block */
/* Keep this the last entry. */
/* SUN SPARC specific definitions. */
/* x86_64 specific definitions. */
#define R_X86_64_NONE 0
/* Legal values for ST_TYPE subfield of st_info (symbol type). */
/* Values for Elf64_Ehdr.e_flags. */
#define EF_SPARCV9_TSO 0
/* SPARC relocs. */
/* Additional Sparc64 relocs. */
/* Keep this the last entry. */
/* For Sparc64, legal values for d_tag of Elf64_Dyn. */
/* Bits present in AT_HWCAP, primarily for Sparc32. */
/* MIPS R3000 specific definitions. */
/* Legal values for e_flags field of Elf32_Ehdr. */
/* Legal values for MIPS architecture level. */
/* The following are non-official names and should not be used. */
/* Special section indices. */
/* Legal values for sh_type field of Elf32_Shdr. */
/* Legal values for sh_flags field of Elf32_Shdr. */
/* Symbol tables. */
/* MIPS specific values for `st_other'. */
/* MIPS specific values for `st_info'. */
/* Entries found in sections of type SHT_MIPS_GPTAB. */
typedef union
{
struct
{
struct
{
} Elf32_gptab;
/* Entry found in sections of type SHT_MIPS_REGINFO. */
typedef struct
{
/* Entries found in sections of type SHT_MIPS_OPTIONS. */
typedef struct
{
variable part of descriptor. */
0 for global options. */
} Elf_Options;
/* Values for `kind' field in Elf_Options. */
/* Values for `info' in Elf_Options for ODK_EXCEPTIONS entries. */
/* Masks for `info' in Elf_Options for an ODK_HWPATCH entry. */
/* Entry found in `.options' section. */
typedef struct
{
/* Masks for `info' in ElfOptions for ODK_HWAND and ODK_HWOR entries. */
/* MIPS relocs. */
/* Keep this the last entry. */
/* Legal values for p_type field of Elf32_Phdr. */
/* Special program header types. */
/* Legal values for d_tag field of Elf32_Dyn. */
DT_MIPS_DELTA_CLASS. */
DT_MIPS_DELTA_INSTANCE. */
DT_MIPS_DELTA_RELOC. */
relocations refer to. */
DT_MIPS_DELTA_SYM. */
class declaration. */
DT_MIPS_DELTA_CLASSSYM. */
function stored in GOT. */
by rld on dlopen() calls. */
/* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */
/* Entries found in sections of type SHT_MIPS_LIBLIST. */
typedef struct
{
} Elf32_Lib;
typedef struct
{
} Elf64_Lib;
/* Legal values for l_flags. */
#define LL_NONE 0
/* Entries found in sections of type SHT_MIPS_CONFLICT. */
/* HPPA specific definitions. */
/* Legal values for e_flags field of Elf32_Ehdr. */
prediction. */
/* Defined values for `e_flags & EF_PARISC_ARCH' are: */
/* Additional section indices. */
symbols in ANSI C. */
/* Legal values for sh_type field of Elf32_Shdr. */
/* Legal values for sh_flags field of Elf32_Shdr. */
/* Legal values for ST_TYPE subfield of st_info (symbol type). */
/* HPPA relocs. */
/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */
/* Legal values for p_flags field of Elf32_Phdr/Elf64_Phdr. */
/* Alpha specific definitions. */
/* Legal values for e_flags field of Elf64_Ehdr. */
/* Legal values for sh_type field of Elf64_Shdr. */
/* These two are primarily concerned with ECOFF debugging info. */
/* Legal values for sh_flags field of Elf64_Shdr. */
/* Legal values for st_other field of Elf64_Sym. */
/* Alpha relocs. */
/* Keep this the last entry. */
/* Magic values of the LITUSE relocation addend. */
#define LITUSE_ALPHA_ADDR 0
/* PowerPC specific declarations */
/* Values for Elf32/64_Ehdr.e_flags. */
/* Cygnus local bits below */
flag */
/* PowerPC relocations defined by the ABIs */
#define R_PPC_NONE 0
/* Keep this the last entry. */
/* PowerPC64 relocations defined by the ABIs */
/* Keep this the last entry. */
/* The remaining relocs are from the Embedded ELF ABI, and are not
in the SVR4 ELF ABI. */
/* Diab tool relocations. */
/* This is a phony reloc to handle any old fashioned TOC16 references
that may still be in object files. */
/* PowerPC64 specific values for the Dyn d_tag field. */
/* ARM specific declarations */
/* Processor specific flags for the ELF header e_flags field. */
/* Other constants defined in the ARM ELF spec. version B-01. */
/* NB. These conflict with values defined above. */
/* Additional symbol types for Thumb */
/* ARM-specific values for sh_flags */
in the input to a link step */
/* ARM-specific program header flags */
addressed by the static base */
/* ARM relocs. */
/* Keep this the last entry. */
/* IA-64 specific declarations. */
/* Processor specific flags for the Ehdr e_flags field. */
/* Processor specific values for the Phdr p_type field. */
/* Processor specific flags for the Phdr p_flags field. */
/* Processor specific values for the Shdr sh_type field. */
/* Processor specific flags for the Shdr sh_flags field. */
/* Processor specific values for the Dyn d_tag field. */
/* IA-64 relocations. */
/* SH specific declarations */
/* SH relocs. */
#define R_SH_NONE 0
/* Keep this the last entry. */
/* Additional s390 relocs */
/* Keep this the last entry. */
/* CRIS relocations. */
#define R_CRIS_NONE 0
/* AMD x86-64 relocations. */
offset to GOT */
to two GOT entries for GD symbol */
to two GOT entries for LD symbol */
to GOT entry for IE symbol */
#if GRUB_TARGET_WORDSIZE == 32
#endif /* GRUB_TARGET_WORDSIZE == 64 */
#endif /* ! GRUB_ELF_H */