File: submitted-auxv.diff

package info (click to toggle)
glibc 2.36-9%2Bdeb12u10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports
  • size: 299,916 kB
  • sloc: ansic: 1,055,590; asm: 324,891; makefile: 15,194; python: 12,603; sh: 10,884; cpp: 5,685; awk: 1,883; perl: 518; yacc: 292; pascal: 182; sed: 39
file content (250 lines) | stat: -rw-r--r-- 8,702 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
https://sourceware.org/bugzilla/show_bug.cgi?id=15794

---
 bits/auxv.h                |   91 +++++++++++++++++++++++++++++++++++++++++++++
 elf/elf.h                  |   76 -------------------------------------
 misc/Makefile              |    2 
 misc/getauxval.c           |    7 ++-
 misc/sys/auxv.h            |    1 
 sysdeps/generic/ldsodefs.h |    1 
 6 files changed, 101 insertions(+), 77 deletions(-)

--- a/misc/getauxval.c
+++ b/misc/getauxval.c
@@ -27,16 +27,21 @@
   ElfW(auxv_t) *p;
 #endif
 
+#ifdef AT_HWCAP
   if (type == AT_HWCAP)
     {
       *result = GLRO(dl_hwcap);
       return true;
     }
-  else if (type == AT_HWCAP2)
+#endif
+
+#ifdef AT_HWCAP2
+  if (type == AT_HWCAP2)
     {
       *result = GLRO(dl_hwcap2);
       return true;
     }
+#endif
 
 #ifdef HAVE_AUX_VECTOR
   for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++)
--- /dev/null
+++ b/bits/auxv.h
@@ -0,0 +1,93 @@
+/* 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_RSEQ_FEATURE_SIZE	27	/* rseq supported feature size.  */
+#define AT_RSEQ_ALIGN	28		/* rseq allocation alignment.  */
+
+#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
+
+/* Shapes of the caches, with more room to describe them.
+   *GEOMETRY are comprised of cache line size in bytes in the bottom 16 bits
+   and the cache associativity in the next 16 bits.  */
+#define AT_L1I_CACHESIZE	40
+#define AT_L1I_CACHEGEOMETRY	41
+#define AT_L1D_CACHESIZE	42
+#define AT_L1D_CACHEGEOMETRY	43
+#define AT_L2_CACHESIZE		44
+#define AT_L2_CACHEGEOMETRY	45
+#define AT_L3_CACHESIZE		46
+#define AT_L3_CACHEGEOMETRY	47
+
+#define AT_MINSIGSTKSZ		51 /* Stack needed for signal delivery  */
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -1154,83 +1154,7 @@
     } 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_RSEQ_FEATURE_SIZE	27	/* rseq supported feature size.  */
-#define AT_RSEQ_ALIGN	28		/* rseq allocation alignment.  */
-
-#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
-
-/* Shapes of the caches, with more room to describe them.
-   *GEOMETRY are comprised of cache line size in bytes in the bottom 16 bits
-   and the cache associativity in the next 16 bits.  */
-#define AT_L1I_CACHESIZE	40
-#define AT_L1I_CACHEGEOMETRY	41
-#define AT_L1D_CACHESIZE	42
-#define AT_L1D_CACHEGEOMETRY	43
-#define AT_L2_CACHESIZE		44
-#define AT_L2_CACHEGEOMETRY	45
-#define AT_L3_CACHESIZE		46
-#define AT_L3_CACHEGEOMETRY	47
-
-#define AT_MINSIGSTKSZ		51 /* Stack needed for signal delivery  */
-
+#include <bits/auxv.h>
 /* Note section contents.  Each entry in the note section begins with
    a header of a fixed form.  */
 
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -35,7 +35,7 @@
 	   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 bits/types/struct_iovec.h \
 	   bits/err-ldbl.h bits/error-ldbl.h \
 	   sys/single_threaded.h
--- a/misc/sys/auxv.h
+++ b/misc/sys/auxv.h
@@ -20,6 +20,7 @@
 #define _SYS_AUXV_H 1
 
 #include <elf.h>
+#include <bits/auxv.h>
 #include <sys/cdefs.h>
 #include <bits/hwcap.h>
 
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -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>