diff --git a/sys/alpha/include/elf.h b/sys/alpha/include/elf.h index 216bead1126..3972adb4825 100644 --- a/sys/alpha/include/elf.h +++ b/sys/alpha/include/elf.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elf.h,v 1.3 1998/06/28 00:50:35 dfr Exp $ + * $Id: elf.h,v 1.4 1998/08/17 08:05:55 dfr Exp $ */ #ifndef _MACHINE_ELF_H_ @@ -38,6 +38,8 @@ #define __ELF_WORD_SIZE 64 /* Used by */ #include +#define ELF_ARCH EM_ALPHA + #define ELF_MACHINE_OK(x) ((x) == EM_ALPHA) /* diff --git a/sys/amd64/include/elf.h b/sys/amd64/include/elf.h index 2c13a1f7e5d..5605b6fb3f8 100644 --- a/sys/amd64/include/elf.h +++ b/sys/amd64/include/elf.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elf.h,v 1.2 1997/08/30 18:59:48 peter Exp $ + * $Id: elf.h,v 1.3 1998/08/16 03:03:31 jdp Exp $ */ #ifndef _MACHINE_ELF_H_ @@ -38,6 +38,8 @@ #define __ELF_WORD_SIZE 32 /* Used by */ #include +#define ELF_ARCH EM_386 + /* * Auxiliary vector entries for passing information to the interpreter. * diff --git a/sys/i386/include/elf.h b/sys/i386/include/elf.h index 2c13a1f7e5d..5605b6fb3f8 100644 --- a/sys/i386/include/elf.h +++ b/sys/i386/include/elf.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elf.h,v 1.2 1997/08/30 18:59:48 peter Exp $ + * $Id: elf.h,v 1.3 1998/08/16 03:03:31 jdp Exp $ */ #ifndef _MACHINE_ELF_H_ @@ -38,6 +38,8 @@ #define __ELF_WORD_SIZE 32 /* Used by */ #include +#define ELF_ARCH EM_386 + /* * Auxiliary vector entries for passing information to the interpreter. * diff --git a/sys/sys/elf32.h b/sys/sys/elf32.h index a37fb952660..092a4c4126d 100644 --- a/sys/sys/elf32.h +++ b/sys/sys/elf32.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elf32.h,v 1.3 1998/07/07 23:32:55 jdp Exp $ + * $Id: elf32.h,v 1.4 1998/08/16 03:03:38 jdp Exp $ */ #ifndef _SYS_ELF32_H_ @@ -108,6 +108,21 @@ typedef struct { } d_un; } Elf32_Dyn; +/* + * 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 contents, again + * padded to a word boundary. The values of n_namesz and n_descsz do + * not include the padding. + */ + +typedef struct { + Elf32_Size n_namesz; /* Length of name. */ + Elf32_Size n_descsz; /* Length of descriptor. */ + Elf32_Word n_type; /* Type of this note. */ +} Elf32_Note; + /* * Relocation entries. */ diff --git a/sys/sys/elf64.h b/sys/sys/elf64.h index 888488bb038..35f22753708 100644 --- a/sys/sys/elf64.h +++ b/sys/sys/elf64.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elf64.h,v 1.5 1998/09/05 23:07:59 jb Exp $ + * $Id: elf64.h,v 1.6 1998/09/12 08:36:09 dfr Exp $ */ #ifndef _SYS_ELF64_H_ @@ -109,6 +109,21 @@ typedef struct { } d_un; } Elf64_Dyn; +/* + * 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 { + Elf64_Size n_namesz; /* Length of name. */ + Elf64_Size n_descsz; /* Length of descriptor. */ + Elf64_Word n_type; /* Type of this note. */ +} Elf64_Note; + /* * Relocation entries. */ diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index e9f846a1110..79cf5970d87 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elf_common.h,v 1.1 1998/08/16 03:03:38 jdp Exp $ + * $Id: elf_common.h,v 1.2 1998/09/08 20:38:06 jdp Exp $ */ #ifndef _SYS_ELF_COMMON_H_ @@ -179,6 +179,11 @@ #define DT_COUNT 24 /* Number of defined d_tag values. */ +/* Values for n_type. Used in core files. */ +#define NT_PRSTATUS 1 /* Process status. */ +#define NT_FPREGSET 2 /* Floating point registers. */ +#define NT_PRPSINFO 3 /* Process state info. */ + /* Symbol Binding - ELFNN_ST_BIND - st_info */ #define STB_LOCAL 0 /* Local symbol */ #define STB_GLOBAL 1 /* Global symbol */ diff --git a/sys/sys/elf_generic.h b/sys/sys/elf_generic.h index ca5092454bd..7ab479e23b2 100644 --- a/sys/sys/elf_generic.h +++ b/sys/sys/elf_generic.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: elf_generic.h,v 1.1 1998/08/16 03:03:38 jdp Exp $ */ #ifndef _SYS_ELF_GENERIC_H_ @@ -40,6 +40,16 @@ #error "__ELF_WORD_SIZE must be defined as 32 or 64" #endif +#define ELF_CLASS __CONCAT(ELFCLASS,__ELF_WORD_SIZE) + +#if BYTE_ORDER == LITTLE_ENDIAN +#define ELF_DATA ELFDATA2LSB +#elif BYTE_ORDER == BIG_ENDIAN +#define ELF_DATA ELFDATA2MSB +#else +#error "Unknown byte order" +#endif + #define __ElfN(x) __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x) #define __ELFN(x) __CONCAT(__CONCAT(__CONCAT(ELF,__ELF_WORD_SIZE),_),x) #define __ElfType(x) typedef __ElfN(x) __CONCAT(Elf_,x) @@ -54,6 +64,7 @@ __ElfType(Ehdr); __ElfType(Shdr); __ElfType(Phdr); __ElfType(Dyn); +__ElfType(Note); __ElfType(Rel); __ElfType(Rela); __ElfType(Sym);