ldrELFCommon.h revision 31f081f300cba32a91281097d702b29efea261e8
/*-
* Copyright (c) 1998 John D. Polstra.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef ___internal_ldrELFCommon_h
#define ___internal_ldrELFCommon_h
/*
* ELF definitions that are independent of architecture or word size.
*/
/*
* Note header. The ".note" section contains an array of notes. Each
* begins with this header, aligned to a word boundary. Immediately
* following the note header is n_namesz bytes of name, padded to the
* next word boundary. Then comes n_descsz bytes of descriptor, again
* padded to a word boundary. The values of n_namesz and n_descsz do
* not include the padding.
*/
typedef struct {
} Elf_Note;
/* Indexes into the e_ident array. Keep synced with
#define EI_MAG0 0 /* Magic number, byte 0. */
/* Values for the magic number bytes. */
#define ELFMAG0 0x7f
#define ELFMAG1 'E'
#define ELFMAG2 'L'
#define ELFMAG3 'F'
/* Values for e_ident[EI_VERSION] and e_version. */
#define EV_NONE 0
#define EV_CURRENT 1
/* Values for e_ident[EI_CLASS]. */
#define ELFCLASSNONE 0 /* Unknown class. */
/* Values for e_ident[EI_DATA]. */
#define ELFDATANONE 0 /* Unknown data format. */
/* Values for e_ident[EI_OSABI]. */
#define ELFOSABI_SYSV 0 /* UNIX System V ABI */
/* e_ident */
/* Values for e_type. */
#define ET_NONE 0 /* Unknown type. */
/* Values for e_machine. */
#define EM_NONE 0 /* Unknown machine. */
/* Extensions. This list is not complete. */
/* Special section indexes. */
#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */
/* sh_type */
#define SHT_NULL 0 /* inactive */
/* Flags for sh_flags. */
/* Values for p_type. */
#define PT_NULL 0 /* Unused entry. */
/* Values for p_flags. */
/* Values for d_tag. */
#define DT_NULL 0 /* Terminating entry. */
library. */
name. */
non-writable segments. [sup] */
initialization functions */
termination functions */
initialization functions. */
terminationfunctions. */
library search path string. */
and less than DT_LOOS follow the rules for
the interpretation of the d_un union
as follows: even == 'd_ptr', even == 'd_val'
or none */
pre-initialization functions. */
pre-initialization functions. */
/* Values for DT_FLAGS */
make reference to the $ORIGIN substitution
string */
non-writable segments. */
process all relocations for the object
containing this entry before transferring
control to the program. */
executable contains code using a static
thread-local storage scheme. */
/* Values for n_type. Used in core files. */
#if defined(RT_OS_FREEBSD) /* (added by Ramshankar) */
#endif
/* VirtualBox specific NOTE sections (added by Ramshankar) */
#ifdef VBOX
#define NT_VBOXCORE 0xb00
#define NT_VBOXCPU 0xb01
#endif
/* Symbol Binding - ELFNN_ST_BIND - st_info */
#define STB_LOCAL 0 /* Local symbol */
/* Symbol type - ELFNN_ST_TYPE - st_info */
#define STT_NOTYPE 0 /* Unspecified type. */
/* Special symbol table indexes. */
#define STN_UNDEF 0 /* Undefined symbol index. */
#endif