submitted-auxv
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Sat, 2 Dec 2017 10:07:17 +0000 (10:07 +0000)
committerAurelien Jarno <aurel32@debian.org>
Sat, 2 Dec 2017 10:07:17 +0000 (10:07 +0000)
Gbp-Pq: Topic kfreebsd
Gbp-Pq: Name submitted-auxv.diff

bits/auxv.h [new file with mode: 0644]
elf/elf.h
misc/Makefile
misc/getauxval.c
misc/sys/auxv.h
sysdeps/generic/ldsodefs.h

diff --git a/bits/auxv.h b/bits/auxv.h
new file mode 100644 (file)
index 0000000..76701c3
--- /dev/null
@@ -0,0 +1,76 @@
+/* Copyright (C) 1995-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Legal values for a_type (entry type).  */
+
+#define AT_NULL                0               /* End of vector */
+#define AT_IGNORE      1               /* Entry should be ignored */
+#define AT_EXECFD      2               /* File descriptor of program */
+#define AT_PHDR                3               /* Program headers for program */
+#define AT_PHENT       4               /* Size of program header entry */
+#define AT_PHNUM       5               /* Number of program headers */
+#define AT_PAGESZ      6               /* System page size */
+#define AT_BASE                7               /* Base address of interpreter */
+#define AT_FLAGS       8               /* Flags */
+#define AT_ENTRY       9               /* Entry point of program */
+#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_CLKTCK      17              /* Frequency of times() */
+
+/* Some more special a_type values describing the hardware.  */
+#define AT_PLATFORM    15              /* String identifying platform.  */
+#define AT_HWCAP       16              /* Machine-dependent hints about
+                                          processor capabilities.  */
+
+/* This entry gives some information about the FPU initialization
+   performed by the kernel.  */
+#define AT_FPUCW       18              /* Used FPU control word.  */
+
+/* Cache block sizes.  */
+#define AT_DCACHEBSIZE 19              /* Data cache block size.  */
+#define AT_ICACHEBSIZE 20              /* Instruction cache block size.  */
+#define AT_UCACHEBSIZE 21              /* Unified cache block size.  */
+
+/* A special ignored value for PPC, used by the kernel to control the
+   interpretation of the AUXV. Must be > 16.  */
+#define AT_IGNOREPPC   22              /* Entry should be ignored.  */
+
+#define        AT_SECURE       23              /* Boolean, was exec setuid-like?  */
+
+#define AT_BASE_PLATFORM 24            /* String identifying real platforms.*/
+
+#define AT_RANDOM      25              /* Address of 16 random bytes.  */
+
+#define AT_HWCAP2      26              /* More machine-dependent hints about
+                                          processor capabilities.  */
+
+#define AT_EXECFN      31              /* Filename of executable.  */
+
+/* Pointer to the global system page used for system calls and other
+   nice things.  */
+#define AT_SYSINFO     32
+#define AT_SYSINFO_EHDR        33
+
+/* Shapes of the caches.  Bits 0-3 contains associativity; bits 4-7 contains
+   log2 of line size; mask those to get cache size.  */
+#define AT_L1I_CACHESHAPE      34
+#define AT_L1D_CACHESHAPE      35
+#define AT_L2_CACHESHAPE       36
+#define AT_L3_CACHESHAPE       37
index 6d3b356f14dd3aac53370c26d63ab631c438c3a3..0a16a9a4501a4affa644c0af8ba4f345abca67e1 100644 (file)
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -1110,66 +1110,7 @@ typedef struct
     } a_un;
 } Elf64_auxv_t;
 
-/* Legal values for a_type (entry type).  */
-
-#define AT_NULL                0               /* End of vector */
-#define AT_IGNORE      1               /* Entry should be ignored */
-#define AT_EXECFD      2               /* File descriptor of program */
-#define AT_PHDR                3               /* Program headers for program */
-#define AT_PHENT       4               /* Size of program header entry */
-#define AT_PHNUM       5               /* Number of program headers */
-#define AT_PAGESZ      6               /* System page size */
-#define AT_BASE                7               /* Base address of interpreter */
-#define AT_FLAGS       8               /* Flags */
-#define AT_ENTRY       9               /* Entry point of program */
-#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_CLKTCK      17              /* Frequency of times() */
-
-/* Some more special a_type values describing the hardware.  */
-#define AT_PLATFORM    15              /* String identifying platform.  */
-#define AT_HWCAP       16              /* Machine-dependent hints about
-                                          processor capabilities.  */
-
-/* This entry gives some information about the FPU initialization
-   performed by the kernel.  */
-#define AT_FPUCW       18              /* Used FPU control word.  */
-
-/* Cache block sizes.  */
-#define AT_DCACHEBSIZE 19              /* Data cache block size.  */
-#define AT_ICACHEBSIZE 20              /* Instruction cache block size.  */
-#define AT_UCACHEBSIZE 21              /* Unified cache block size.  */
-
-/* A special ignored value for PPC, used by the kernel to control the
-   interpretation of the AUXV. Must be > 16.  */
-#define AT_IGNOREPPC   22              /* Entry should be ignored.  */
-
-#define        AT_SECURE       23              /* Boolean, was exec setuid-like?  */
-
-#define AT_BASE_PLATFORM 24            /* String identifying real platforms.*/
-
-#define AT_RANDOM      25              /* Address of 16 random bytes.  */
-
-#define AT_HWCAP2      26              /* More machine-dependent hints about
-                                          processor capabilities.  */
-
-#define AT_EXECFN      31              /* Filename of executable.  */
-
-/* Pointer to the global system page used for system calls and other
-   nice things.  */
-#define AT_SYSINFO     32
-#define AT_SYSINFO_EHDR        33
-
-/* Shapes of the caches.  Bits 0-3 contains associativity; bits 4-7 contains
-   log2 of line size; mask those to get cache size.  */
-#define AT_L1I_CACHESHAPE      34
-#define AT_L1D_CACHESHAPE      35
-#define AT_L2_CACHESHAPE       36
-#define AT_L3_CACHESHAPE       37
-
+#include <bits/auxv.h>
 /* Note section contents.  Each entry in the note section begins with
    a header of a fixed form.  */
 
index ed988c3967243ed614fd3cd1f675fa2d7177e71a..ede330882511ed5018ad6cfbcd0d739818770269 100644 (file)
@@ -34,7 +34,7 @@ headers       := sys/uio.h bits/uio.h sys/ioctl.h bits/ioctls.h bits/ioctl-types.h \
           regexp.h bits/select.h bits/mman.h sys/xattr.h \
           syslog.h sys/syslog.h \
           bits/syslog.h bits/syslog-ldbl.h bits/syslog-path.h bits/error.h \
-          bits/select2.h bits/hwcap.h sys/auxv.h \
+          bits/select2.h bits/hwcap.h bits/auxv.h sys/auxv.h \
           sys/sysmacros.h bits/sysmacros.h
 
 routines := brk sbrk sstk ioctl \
index c83fbce054e319a61670b2100c597bd7aec25ab7..faf7f5b0b2b5e57a27788da9ad8f723d1fc396e1 100644 (file)
@@ -27,10 +27,15 @@ __getauxval (unsigned long int type)
   ElfW(auxv_t) *p;
 #endif
 
+#ifdef AT_HWCAP
   if (type == AT_HWCAP)
     return GLRO(dl_hwcap);
-  else if (type == AT_HWCAP2)
+#endif
+
+#ifdef AT_HWCAP2
+  if (type == AT_HWCAP2)
     return GLRO(dl_hwcap2);
+#endif
 
 #ifdef HAVE_AUX_VECTOR
   for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++)
index 9ec84e50a50e080c32e00378aad8f11a0a0e642d..d05b63c42f03e4e85ed6bdcd5613e46ed8083a50 100644 (file)
@@ -20,6 +20,7 @@
 #define _SYS_AUXV_H 1
 
 #include <elf.h>
+#include <bits/auxv.h>
 #include <sys/cdefs.h>
 #include <bits/hwcap.h>
 
index f26a8b20514e2c867c59bc684613ec912da547c7..2f4421442ed49ed9e21d7e30c1388e2478c6b491 100644 (file)
@@ -29,6 +29,7 @@
 #include <stdint.h>
 
 #include <elf.h>
+#include <bits/auxv.h>
 #include <dlfcn.h>
 #include <fpu_control.h>
 #include <sys/mman.h>