Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Oct 2018 22:24:32 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r339625 - in head/sys: arm/include arm64/include mips/include powerpc/include riscv/include sparc64/include sys x86/include
Message-ID:  <201810222224.w9MMOWtJ060163@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Mon Oct 22 22:24:32 2018
New Revision: 339625
URL: https://svnweb.freebsd.org/changeset/base/339625

Log:
  Consolidate identical ELF auxargs type defintions.
  
  All platforms except powerpc use the same values and powerpc shares a
  majority of them.
  
  Go ahead and declare AT_NOTELF, AT_UID, and AT_EUID in favor of the
  unused AT_DCACHEBSIZE, AT_ICACHEBSIZE, and AT_UCACHEBSIZE for powerpc.
  
  Reviewed by:	jhb, imp
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D17397

Modified:
  head/sys/arm/include/elf.h
  head/sys/arm64/include/elf.h
  head/sys/mips/include/elf.h
  head/sys/powerpc/include/elf.h
  head/sys/riscv/include/elf.h
  head/sys/sparc64/include/elf.h
  head/sys/sys/elf_common.h
  head/sys/x86/include/elf.h

Modified: head/sys/arm/include/elf.h
==============================================================================
--- head/sys/arm/include/elf.h	Mon Oct 22 22:13:00 2018	(r339624)
+++ head/sys/arm/include/elf.h	Mon Oct 22 22:24:32 2018	(r339625)
@@ -61,39 +61,7 @@ __ElfType(Auxinfo);
  * 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

Modified: head/sys/arm64/include/elf.h
==============================================================================
--- head/sys/arm64/include/elf.h	Mon Oct 22 22:13:00 2018	(r339624)
+++ head/sys/arm64/include/elf.h	Mon Oct 22 22:24:32 2018	(r339625)
@@ -68,37 +68,6 @@ __ElfType(Auxinfo);
 
 #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

Modified: head/sys/mips/include/elf.h
==============================================================================
--- head/sys/mips/include/elf.h	Mon Oct 22 22:13:00 2018	(r339624)
+++ head/sys/mips/include/elf.h	Mon Oct 22 22:24:32 2018	(r339625)
@@ -121,37 +121,6 @@ typedef struct {	/* Auxiliary vector entry on initial 
 
 __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. */
-
 #define	ET_DYN_LOAD_ADDR 0x0120000
 
 /*

Modified: head/sys/powerpc/include/elf.h
==============================================================================
--- head/sys/powerpc/include/elf.h	Mon Oct 22 22:13:00 2018	(r339624)
+++ head/sys/powerpc/include/elf.h	Mon Oct 22 22:24:32 2018	(r339625)
@@ -90,35 +90,6 @@ typedef struct {	/* Auxiliary vector entry on initial 
 
 __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 PowerPC). */
-#define	AT_ENTRY	9	/* Where interpreter should transfer control. */
-#define	AT_DCACHEBSIZE	10	/* Data cache block size for the processor. */
-#define	AT_ICACHEBSIZE	11	/* Instruction cache block size for the uP. */
-#define	AT_UCACHEBSIZE	12	/* Cache block size, or `0' if cache not unified. */
-#define	AT_EXECPATH	13	/* Path to the executable. */
-#define	AT_CANARY	14	/* Canary for SSP */
-#define	AT_CANARYLEN	15	/* Length of the canary. */
-#define	AT_OSRELDATE	16	/* OSRELDATE. */
-#define	AT_NCPUS	17	/* Number of CPUs. */
-#define	AT_PAGESIZES	18	/* Pagesizes. */
-#define	AT_PAGESIZESLEN	19	/* Number of pagesizes. */
-#define	AT_STACKPROT	21	/* Initial stack protection. */
-#define	AT_TIMEKEEP	22	/* Pointer to timehands. */
-#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. */
-
 /*
  * Relocation types.
  */

Modified: head/sys/riscv/include/elf.h
==============================================================================
--- head/sys/riscv/include/elf.h	Mon Oct 22 22:13:00 2018	(r339624)
+++ head/sys/riscv/include/elf.h	Mon Oct 22 22:24:32 2018	(r339625)
@@ -65,37 +65,6 @@ __ElfType(Auxinfo);
 
 #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

Modified: head/sys/sparc64/include/elf.h
==============================================================================
--- head/sys/sparc64/include/elf.h	Mon Oct 22 22:13:00 2018	(r339624)
+++ head/sys/sparc64/include/elf.h	Mon Oct 22 22:24:32 2018	(r339625)
@@ -69,37 +69,6 @@ typedef struct {	/* Auxiliary vector entry on initial 
 
 __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. */
-
 /* Define "machine" characteristics */
 #if __ELF_WORD_SIZE == 32
 #define	ELF_TARG_CLASS  ELFCLASS32

Modified: head/sys/sys/elf_common.h
==============================================================================
--- head/sys/sys/elf_common.h	Mon Oct 22 22:13:00 2018	(r339624)
+++ head/sys/sys/elf_common.h	Mon Oct 22 22:24:32 2018	(r339625)
@@ -880,6 +880,50 @@ typedef struct {
 #define	ELFCOMPRESS_LOPROC	0x70000000	/* Processor-specific */
 #define	ELFCOMPRESS_HIPROC	0x7fffffff
 
+/* 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. */
+#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. */
+#ifndef __powerpc__
+#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. */
+#else /* defined(__powerpc__) */
+#define	AT_EXECPATH	13
+#define	AT_CANARY	14
+#define	AT_CANARYLEN	15
+#define	AT_OSRELDATE	16
+#define	AT_NCPUS	17
+#define	AT_PAGESIZES	18
+#define	AT_PAGESIZESLEN	19
+#define	AT_STACKPROT	21
+#endif /* defined(__powerpc__) */
+#define	AT_TIMEKEEP	22	/* Pointer to timehands. */
+#ifndef __powerpc__
+#define	AT_STACKPROT	23	/* Initial stack protection. */
+#endif
+#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. */
+
 /*
  * Relocation types.
  *

Modified: head/sys/x86/include/elf.h
==============================================================================
--- head/sys/x86/include/elf.h	Mon Oct 22 22:13:00 2018	(r339624)
+++ head/sys/x86/include/elf.h	Mon Oct 22 22:24:32 2018	(r339625)
@@ -77,37 +77,6 @@ typedef struct {
 
 __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. */
-
 /*
  * Relocation types.
  */
@@ -164,37 +133,6 @@ typedef struct {	/* Auxiliary vector entry on initial 
 } Elf64_Auxinfo;
 
 __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. */
 
 /*
  * Relocation types.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810222224.w9MMOWtJ060163>