Index: sys/arm/include/elf.h =================================================================== --- sys/arm/include/elf.h +++ sys/arm/include/elf.h @@ -53,6 +53,8 @@ __ElfType(Auxinfo); +#include + #define ELF_ARCH EM_ARM #define ELF_MACHINE_OK(x) ((x) == EM_ARM) @@ -61,40 +63,8 @@ * Relocation types. */ -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ - #define R_ARM_COUNT 33 /* Count of defined relocation types. */ - /* Define "machine" characteristics */ #define ELF_TARG_CLASS ELFCLASS32 #ifdef __ARMEB__ Index: sys/arm64/include/elf.h =================================================================== --- sys/arm64/include/elf.h +++ sys/arm64/include/elf.h @@ -64,41 +64,12 @@ __ElfType(Auxinfo); +#include + #define ELF_ARCH EM_AARCH64 #define ELF_MACHINE_OK(x) ((x) == (ELF_ARCH)) -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ - /* Define "machine" characteristics */ #if __ELF_WORD_SIZE == 64 #define ELF_TARG_CLASS ELFCLASS64 Index: sys/mips/include/elf.h =================================================================== --- sys/mips/include/elf.h +++ sys/mips/include/elf.h @@ -121,36 +121,7 @@ __ElfType(Auxinfo); -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused for i386). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ +#include #define ET_DYN_LOAD_ADDR 0x0120000 Index: sys/riscv/include/elf.h =================================================================== --- sys/riscv/include/elf.h +++ sys/riscv/include/elf.h @@ -61,41 +61,12 @@ __ElfType(Auxinfo); +#include + #define ELF_ARCH EM_RISCV #define ELF_MACHINE_OK(x) ((x) == (ELF_ARCH)) -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ - /* Define "machine" characteristics */ #define ELF_TARG_CLASS ELFCLASS64 #define ELF_TARG_DATA ELFDATA2LSB Index: sys/sparc64/include/elf.h =================================================================== --- sys/sparc64/include/elf.h +++ sys/sparc64/include/elf.h @@ -69,36 +69,7 @@ __ElfType(Auxinfo); -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ +#include /* Define "machine" characteristics */ #if __ELF_WORD_SIZE == 32 Index: sys/sys/_elf_auxargs.h =================================================================== --- sys/sys/_elf_auxargs.h +++ sys/sys/_elf_auxargs.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 1996-1997 John D. Polstra. * All rights reserved. * @@ -26,44 +28,8 @@ * $FreeBSD$ */ -#ifndef _MACHINE_ELF_H_ -#define _MACHINE_ELF_H_ - -/* - * ELF definitions for the RISC-V architecture. - */ - -#include /* Definitions common to all 32 bit architectures. */ -#include /* Definitions common to all 64 bit architectures. */ - -#define __ELF_WORD_SIZE 64 /* Used by */ -#include - -/* - * Auxiliary vector entries for passing information to the interpreter. - */ - -typedef struct { /* Auxiliary vector entry on initial stack */ - int a_type; /* Entry type. */ - union { - int a_val; /* Integer value. */ - } a_un; -} Elf32_Auxinfo; - -typedef struct { /* Auxiliary vector entry on initial stack */ - long a_type; /* Entry type. */ - union { - long a_val; /* Integer value. */ - void *a_ptr; /* Address. */ - void (*a_fcn)(void); /* Function pointer (not used). */ - } a_un; -} Elf64_Auxinfo; - -__ElfType(Auxinfo); - -#define ELF_ARCH EM_RISCV - -#define ELF_MACHINE_OK(x) ((x) == (ELF_ARCH)) +#ifndef _SYS_ELF_AUXARGS_H_ +#define _SYS_ELF_AUXARGS_H_ /* Values for a_type. */ #define AT_NULL 0 /* Terminates the vector. */ @@ -74,7 +40,7 @@ #define AT_PHNUM 5 /* Number of program header entries. */ #define AT_PAGESZ 6 /* Page size in bytes. */ #define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused). */ +#define AT_FLAGS 8 /* Flags. */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ #define AT_NOTELF 10 /* Program is not ELF ?? */ #define AT_UID 11 /* Real uid. */ @@ -82,7 +48,7 @@ #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ #define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ +#define AT_CANARY 16 /* Canary for SSP. */ #define AT_CANARYLEN 17 /* Length of the canary. */ #define AT_OSRELDATE 18 /* OSRELDATE. */ #define AT_NCPUS 19 /* Number of CPUs. */ @@ -96,13 +62,4 @@ #define AT_COUNT 27 /* Count of defined aux entry types. */ -/* Define "machine" characteristics */ -#define ELF_TARG_CLASS ELFCLASS64 -#define ELF_TARG_DATA ELFDATA2LSB -#define ELF_TARG_MACH EM_RISCV -#define ELF_TARG_VER 1 - -/* TODO: set correct value */ -#define ET_DYN_LOAD_ADDR 0x100000 - -#endif /* !_MACHINE_ELF_H_ */ +#endif /* !_SYS_ELF_AUXARGS_H_ */ Index: sys/x86/include/elf.h =================================================================== --- sys/x86/include/elf.h +++ sys/x86/include/elf.h @@ -77,36 +77,7 @@ __ElfType(Auxinfo); -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused for i386). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP. */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ +#include /* * Relocation types. @@ -165,36 +136,7 @@ __ElfType(Auxinfo); -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused for i386). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ +#include /* * Relocation types.