]>
Commit | Line | Data |
---|---|---|
0cd3962f | 1 | diff --git a/ChangeLog b/ChangeLog |
0f2ff8b1 | 2 | index cb9124e..1c5ec45 100644 |
0cd3962f AM |
3 | --- a/ChangeLog |
4 | +++ b/ChangeLog | |
0f2ff8b1 AM |
5 | @@ -1,3 +1,88 @@ |
6 | +2015-09-11 Roland McGrath <roland@hack.frob.com> | |
7 | + | |
8 | + * sysdeps/nacl/Makefile [$(subdir) = misc] (sysdep_headers): | |
9 | + Use 'override' keyword to freeze the value here, preventing | |
10 | + the addition of sys/mtio.h by sysdeps/gnu/Makefile. | |
11 | + | |
12 | +2015-09-04 Roland McGrath <roland@hack.frob.com> | |
13 | + | |
14 | + [BZ #18921] | |
15 | + * sysdeps/posix/opendir.c (need_isdir_precheck) [O_DIRECTORY]: | |
16 | + Fix inverted sense of test of 'o_directory_works' value. | |
17 | + Reported by Pádraig Brady <P@draigBrady.com>, diagnosed by | |
18 | + Bernhard Voelker <mail@bernhard-voelker.de>. | |
19 | + | |
20 | +2015-08-31 Brett Neumeier <brett@neumeier.us> | |
21 | + | |
22 | + [BZ #18870] | |
23 | + * sysdeps/sparc/sparc32/sem_open.c: Add missing #include | |
24 | + | |
2914288c AM |
25 | +2015-08-28 Mike Frysinger <vapier@gentoo.org> |
26 | + | |
27 | + [BZ #18887] | |
28 | + * misc/Makefile (tests): Add tst-mntent-blank-corrupt and | |
29 | + tst-mntent-blank-passno. | |
30 | + * misc/mntent_r.c (__getmntent_r): Do not read past buffer[0]. | |
31 | + * misc/tst-mntent-blank-corrupt.c: New test. | |
32 | + * misc/tst-mntent-blank-passno.c: New test ripped from ... | |
33 | + * misc/tst-mntent.c (do_test): ... here. | |
34 | + | |
35 | +2015-08-25 Roland McGrath <roland@hack.frob.com> | |
36 | + | |
37 | + * sysdeps/nacl/start.c (_start): Call __nacl_main instead of main | |
38 | + if the weak reference is not null. | |
39 | + | |
40 | +2015-08-19 Andrew Senkevich <andrew.senkevich@intel.com> | |
41 | + | |
42 | + [BZ #18796] | |
43 | + * scripts/test-installation.pl: Don't add -lmvec to build options | |
44 | + if libmvec wasn't built. | |
45 | + * NEWS: Mention this fix. | |
46 | + | |
0cd3962f AM |
47 | +2015-08-10 Maxim Ostapenko <m.ostapenko@partner.samsung.com> |
48 | + | |
49 | + [BZ #18778] | |
50 | + * elf/Makefile (tests): Add Add tst-nodelete2. | |
51 | + (modules-names): Add tst-nodelete2mod. | |
52 | + (tst-nodelete2mod.so-no-z-defs): New. | |
53 | + ($(objpfx)tst-nodelete2): Likewise. | |
54 | + ($(objpfx)tst-nodelete2.out): Likewise. | |
55 | + (LDFLAGS-tst-nodelete2): Likewise. | |
56 | + * elf/dl-close.c (_dl_close_worker): Move DF_1_NODELETE clearing | |
57 | + out of loop through all loaded libraries. | |
58 | + * elf/tst-nodelete2.c: New file. | |
59 | + * elf/tst-nodelete2mod.c: Likewise. | |
60 | + | |
61 | +2015-08-10 Andreas Schwab <schwab@suse.de> | |
62 | + | |
63 | + [BZ #18781] | |
64 | + * sysdeps/unix/sysv/linux/openat.c (__OPENAT) [MORE_OFLAGS]: Add | |
65 | + MORE_OFLAGS to oflag. | |
66 | + * io/test-lfs.c (do_test): Test openat64. | |
67 | + | |
68 | +2015-08-08 John David Anglin <danglin@gcc.gnu.org> | |
69 | + | |
70 | + [BZ #18787] | |
71 | + * sysdeps/unix/sysv/linux/hppa/bits/atomic.h (_LWS_CLOBBER): Revise | |
72 | + clobber registers. | |
73 | + (atomic_compare_and_exchange_val_acq): Use register asms to assign | |
74 | + operand registers. Use register %r20 for EAGAIN and EDEADLOCK checks. | |
75 | + Cast return to __typeof (oldval). | |
76 | + | |
77 | +2015-08-08 Mike Frysinger <vapier@gentoo.org> | |
78 | + | |
79 | + * sysdeps/unix/sysv/linux/microblaze/sysdep.h: Wrap the whole file | |
80 | + in _LINUX_MICROBLAZE_SYSDEP_H defines. Include sysdeps/unix/sysdep.h | |
81 | + and delete sys/syscall.h include. | |
82 | + | |
83 | +2015-08-07 Mike Frysinger <vapier@gentoo.org> | |
84 | + | |
85 | + * sysdeps/hppa/dl-symaddr.c (_dl_symbol_address): Add rtld_hidden_def. | |
86 | + | |
87 | +2015-08-05 Zack Weinberg <zackw@panix.com> | |
88 | + | |
89 | + * misc/regexp.h: Update comments. | |
90 | + | |
91 | 2015-08-05 Carlos O'Donell <carlos@systemhalted.org> | |
92 | ||
93 | * version.h (RELEASE): Set to "stable". | |
94 | diff --git a/NEWS b/NEWS | |
0f2ff8b1 | 95 | index 4c31de7..d220c07 100644 |
0cd3962f AM |
96 | --- a/NEWS |
97 | +++ b/NEWS | |
98 | @@ -5,6 +5,12 @@ See the end for copying conditions. | |
99 | Please send GNU C library bug reports via <http://sourceware.org/bugzilla/> | |
100 | using `glibc' in the "product" field. | |
101 | \f | |
102 | +Version 2.22.1 | |
103 | + | |
104 | +* The following bugs are resolved with this release: | |
105 | + | |
0f2ff8b1 | 106 | + 18778, 18781, 18787, 18796, 18870, 18887, 18921. |
0cd3962f AM |
107 | +\f |
108 | Version 2.22 | |
109 | ||
110 | * The following bugs are resolved with this release: | |
111 | @@ -84,7 +90,7 @@ Version 2.22 | |
112 | release. Use of this header will trigger a deprecation warning. | |
113 | Application developers should update their code to use <regex.h> instead. | |
114 | ||
115 | - This header was formerly part of SUSv2, but was deprecated in 1997 and | |
116 | + This header was formerly part of SUS, but was deprecated in 1994 and | |
117 | removed from the standard in 2001. Also, the glibc implementation | |
118 | leaks memory. See BZ#18681 for more details. | |
119 | \f | |
120 | diff --git a/elf/Makefile b/elf/Makefile | |
121 | index 4ceeaf8..71a18a1 100644 | |
122 | --- a/elf/Makefile | |
123 | +++ b/elf/Makefile | |
124 | @@ -148,7 +148,8 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ | |
125 | tst-unique1 tst-unique2 $(if $(CXX),tst-unique3 tst-unique4 \ | |
126 | tst-nodelete) \ | |
127 | tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \ | |
128 | - tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened | |
129 | + tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \ | |
130 | + tst-nodelete2 | |
131 | # reldep9 | |
132 | ifeq ($(build-hardcoded-path-in-tests),yes) | |
133 | tests += tst-dlopen-aout | |
134 | @@ -218,7 +219,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ | |
135 | tst-initorder2d \ | |
136 | tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \ | |
137 | tst-array5dep tst-null-argv-lib \ | |
138 | - tst-tlsalign-lib tst-nodelete-opened-lib | |
139 | + tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod | |
140 | ifeq (yes,$(have-protected-data)) | |
141 | modules-names += tst-protected1moda tst-protected1modb | |
142 | tests += tst-protected1a tst-protected1b | |
143 | @@ -594,6 +595,7 @@ tst-auditmod9b.so-no-z-defs = yes | |
144 | tst-nodelete-uniquemod.so-no-z-defs = yes | |
145 | tst-nodelete-rtldmod.so-no-z-defs = yes | |
146 | tst-nodelete-zmod.so-no-z-defs = yes | |
147 | +tst-nodelete2mod.so-no-z-defs = yes | |
148 | ||
149 | ifeq ($(build-shared),yes) | |
150 | # Build all the modules even when not actually running test programs. | |
151 | @@ -1164,6 +1166,11 @@ $(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \ | |
152 | LDFLAGS-tst-nodelete = -rdynamic | |
153 | LDFLAGS-tst-nodelete-zmod.so = -Wl,--enable-new-dtags,-z,nodelete | |
154 | ||
155 | +$(objpfx)tst-nodelete2: $(libdl) | |
156 | +$(objpfx)tst-nodelete2.out: $(objpfx)tst-nodelete2mod.so | |
157 | + | |
158 | +LDFLAGS-tst-nodelete2 = -rdynamic | |
159 | + | |
160 | $(objpfx)tst-initorder-cmp.out: tst-initorder.exp $(objpfx)tst-initorder.out | |
161 | cmp $^ > $@; \ | |
162 | $(evaluate-test) | |
163 | diff --git a/elf/dl-close.c b/elf/dl-close.c | |
164 | index 9105277..c897247 100644 | |
165 | --- a/elf/dl-close.c | |
166 | +++ b/elf/dl-close.c | |
167 | @@ -144,6 +144,14 @@ _dl_close_worker (struct link_map *map, bool force) | |
168 | char done[nloaded]; | |
169 | struct link_map *maps[nloaded]; | |
170 | ||
171 | + /* Clear DF_1_NODELETE to force object deletion. We don't need to touch | |
172 | + l_tls_dtor_count because forced object deletion only happens when an | |
173 | + error occurs during object load. Destructor registration for TLS | |
174 | + non-POD objects should not have happened till then for this | |
175 | + object. */ | |
176 | + if (force) | |
177 | + map->l_flags_1 &= ~DF_1_NODELETE; | |
178 | + | |
179 | /* Run over the list and assign indexes to the link maps and enter | |
180 | them into the MAPS array. */ | |
181 | int idx = 0; | |
182 | @@ -153,13 +161,6 @@ _dl_close_worker (struct link_map *map, bool force) | |
183 | maps[idx] = l; | |
184 | ++idx; | |
185 | ||
186 | - /* Clear DF_1_NODELETE to force object deletion. We don't need to touch | |
187 | - l_tls_dtor_count because forced object deletion only happens when an | |
188 | - error occurs during object load. Destructor registration for TLS | |
189 | - non-POD objects should not have happened till then for this | |
190 | - object. */ | |
191 | - if (force) | |
192 | - l->l_flags_1 &= ~DF_1_NODELETE; | |
193 | } | |
194 | assert (idx == nloaded); | |
195 | ||
196 | diff --git a/elf/tst-nodelete2.c b/elf/tst-nodelete2.c | |
197 | new file mode 100644 | |
198 | index 0000000..388e8af | |
199 | --- /dev/null | |
200 | +++ b/elf/tst-nodelete2.c | |
201 | @@ -0,0 +1,37 @@ | |
202 | +#include "../dlfcn/dlfcn.h" | |
203 | +#include <stdio.h> | |
204 | +#include <stdlib.h> | |
205 | +#include <gnu/lib-names.h> | |
206 | + | |
207 | +static int | |
208 | +do_test (void) | |
209 | +{ | |
210 | + int result = 0; | |
211 | + | |
212 | + printf ("\nOpening pthread library.\n"); | |
213 | + void *pthread = dlopen (LIBPTHREAD_SO, RTLD_LAZY); | |
214 | + | |
215 | + /* This is a test for correct DF_1_NODELETE clearing when dlopen failure | |
216 | + happens. We should clear DF_1_NODELETE for failed library only, because | |
217 | + doing this for others (e.g. libpthread) might cause them to be unloaded, | |
218 | + that may lead to some global references (e.g. __rtld_lock_unlock) to be | |
219 | + broken. The dlopen should fail because of undefined symbols in shared | |
220 | + library, that cause DF_1_NODELETE to be cleared. For libpthread, this | |
221 | + flag should be set, because if not, SIGSEGV will happen in dlclose. */ | |
222 | + if (dlopen ("tst-nodelete2mod.so", RTLD_NOW) != NULL) | |
223 | + { | |
224 | + printf ("Unique symbols test failed\n"); | |
225 | + result = 1; | |
226 | + } | |
227 | + | |
228 | + if (pthread) | |
229 | + dlclose (pthread); | |
230 | + | |
231 | + if (result == 0) | |
232 | + printf ("SUCCESS\n"); | |
233 | + | |
234 | + return result; | |
235 | +} | |
236 | + | |
237 | +#define TEST_FUNCTION do_test () | |
238 | +#include "../test-skeleton.c" | |
239 | diff --git a/elf/tst-nodelete2mod.c b/elf/tst-nodelete2mod.c | |
240 | new file mode 100644 | |
241 | index 0000000..e88c756 | |
242 | --- /dev/null | |
243 | +++ b/elf/tst-nodelete2mod.c | |
244 | @@ -0,0 +1,7 @@ | |
245 | +/* Undefined symbol. */ | |
246 | +extern int not_exist (void); | |
247 | + | |
248 | +int foo (void) | |
249 | +{ | |
250 | + return not_exist (); | |
251 | +} | |
252 | diff --git a/elf/tst-znodelete-zlib.cc b/elf/tst-znodelete-zlib.cc | |
253 | deleted file mode 100644 | |
254 | index 1e8f368..0000000 | |
255 | --- a/elf/tst-znodelete-zlib.cc | |
256 | +++ /dev/null | |
257 | @@ -1,6 +0,0 @@ | |
258 | -extern int not_exist (void); | |
259 | - | |
260 | -int foo (void) | |
261 | -{ | |
262 | - return not_exist (); | |
263 | -} | |
264 | diff --git a/io/test-lfs.c b/io/test-lfs.c | |
265 | index 539c2a2..b6ebae4 100644 | |
266 | --- a/io/test-lfs.c | |
267 | +++ b/io/test-lfs.c | |
268 | @@ -144,7 +144,7 @@ test_ftello (void) | |
269 | int | |
270 | do_test (int argc, char *argv[]) | |
271 | { | |
272 | - int ret; | |
273 | + int ret, fd2; | |
274 | struct stat64 statbuf; | |
275 | ||
276 | ret = lseek64 (fd, TWO_GB+100, SEEK_SET); | |
277 | @@ -195,6 +195,25 @@ do_test (int argc, char *argv[]) | |
278 | error (EXIT_FAILURE, 0, "stat reported size %lld instead of %lld.", | |
279 | (long long int) statbuf.st_size, (TWO_GB + 100 + 5)); | |
280 | ||
281 | + fd2 = openat64 (AT_FDCWD, name, O_RDWR); | |
282 | + if (fd2 == -1) | |
283 | + { | |
284 | + if (errno == ENOSYS) | |
285 | + { | |
286 | + /* Silently ignore this test. */ | |
287 | + error (0, 0, "openat64 is not supported"); | |
288 | + } | |
289 | + else | |
290 | + error (EXIT_FAILURE, errno, "openat64 failed to open big file"); | |
291 | + } | |
292 | + else | |
293 | + { | |
294 | + ret = close (fd2); | |
295 | + | |
296 | + if (ret == -1) | |
297 | + error (EXIT_FAILURE, errno, "error closing file"); | |
298 | + } | |
299 | + | |
300 | test_ftello (); | |
301 | ||
302 | return 0; | |
2914288c AM |
303 | diff --git a/misc/Makefile b/misc/Makefile |
304 | index aecb0da..2f5edf6 100644 | |
305 | --- a/misc/Makefile | |
306 | +++ b/misc/Makefile | |
307 | @@ -76,7 +76,8 @@ install-lib := libg.a | |
308 | gpl2lgpl := error.c error.h | |
309 | ||
310 | tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \ | |
311 | - tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1 | |
312 | + tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1 \ | |
313 | + tst-mntent-blank-corrupt tst-mntent-blank-passno | |
314 | ifeq ($(run-built-tests),yes) | |
315 | tests-special += $(objpfx)tst-error1-mem.out | |
316 | endif | |
317 | diff --git a/misc/mntent_r.c b/misc/mntent_r.c | |
318 | index 6159873..4f26998 100644 | |
319 | --- a/misc/mntent_r.c | |
320 | +++ b/misc/mntent_r.c | |
321 | @@ -136,7 +136,9 @@ __getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz) | |
322 | end_ptr = strchr (buffer, '\n'); | |
323 | if (end_ptr != NULL) /* chop newline */ | |
324 | { | |
325 | - while (end_ptr[-1] == ' ' || end_ptr[-1] == '\t') | |
326 | + /* Do not walk past the start of buffer if it's all whitespace. */ | |
327 | + while (end_ptr != buffer | |
328 | + && (end_ptr[-1] == ' ' || end_ptr[-1] == '\t')) | |
329 | end_ptr--; | |
330 | *end_ptr = '\0'; | |
331 | } | |
0cd3962f AM |
332 | diff --git a/misc/regexp.h b/misc/regexp.h |
333 | index 3460989..42394f7 100644 | |
334 | --- a/misc/regexp.h | |
335 | +++ b/misc/regexp.h | |
336 | @@ -19,10 +19,11 @@ | |
337 | #ifndef _REGEXP_H | |
338 | #define _REGEXP_H 1 | |
339 | ||
340 | -/* The contents of this header file were standardized in the | |
341 | - Single Unix Specification, Version 2 (1997) but marked as | |
342 | - LEGACY; new applications were already being encouraged to | |
343 | - use <regex.h> instead. POSIX.1-2001 removed this header. | |
344 | +/* The contents of this header file were originally standardized in | |
345 | + the Single Unix Specification, Issue 3 (1992). In Issue 4 (1994) | |
346 | + the header was marked as TO BE WITHDRAWN, and new applications | |
347 | + were encouraged to use <regex.h> instead. It was officially | |
348 | + withdrawn from the standard in Issue 6 (aka POSIX.1-2001). | |
349 | ||
350 | This header is provided only for backward compatibility. | |
351 | It will be removed in the next release of the GNU C Library. | |
2914288c AM |
352 | diff --git a/misc/tst-mntent-blank-corrupt.c b/misc/tst-mntent-blank-corrupt.c |
353 | new file mode 100644 | |
354 | index 0000000..92266a3 | |
355 | --- /dev/null | |
356 | +++ b/misc/tst-mntent-blank-corrupt.c | |
357 | @@ -0,0 +1,45 @@ | |
358 | +/* Make sure blank lines does not cause memory corruption BZ #18887. | |
359 | + | |
360 | + Copyright (C) 2009-2015 Free Software Foundation, Inc. | |
361 | + This file is part of the GNU C Library. | |
362 | + | |
363 | + The GNU C Library is free software; you can redistribute it and/or | |
364 | + modify it under the terms of the GNU Lesser General Public | |
365 | + License as published by the Free Software Foundation; either | |
366 | + version 2.1 of the License, or (at your option) any later version. | |
367 | + | |
368 | + The GNU C Library is distributed in the hope that it will be useful, | |
369 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
370 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
371 | + Lesser General Public License for more details. | |
372 | + | |
373 | + You should have received a copy of the GNU Lesser General Public | |
374 | + License along with the GNU C Library; if not, see | |
375 | + <http://www.gnu.org/licenses/>. */ | |
376 | + | |
377 | +#include <mntent.h> | |
378 | +#include <stdio.h> | |
379 | +#include <string.h> | |
380 | + | |
381 | +/* Make sure blank lines don't trigger memory corruption. This doesn't happen | |
382 | + for all targets though, so it's a best effort test BZ #18887. */ | |
383 | +static int | |
384 | +do_test (void) | |
385 | +{ | |
386 | + FILE *fp; | |
387 | + | |
388 | + fp = tmpfile (); | |
389 | + fputs ("\n \n/foo\\040dir /bar\\040dir auto bind \t \n", fp); | |
390 | + rewind (fp); | |
391 | + | |
392 | + /* The corruption happens here ... */ | |
393 | + getmntent (fp); | |
394 | + /* ... but trigers here. */ | |
395 | + endmntent (fp); | |
396 | + | |
397 | + /* If the test failed, we would crash, and not hit this point. */ | |
398 | + return 0; | |
399 | +} | |
400 | + | |
401 | +#define TEST_FUNCTION do_test () | |
402 | +#include "../test-skeleton.c" | |
403 | diff --git a/misc/tst-mntent-blank-passno.c b/misc/tst-mntent-blank-passno.c | |
404 | new file mode 100644 | |
405 | index 0000000..fc04291 | |
406 | --- /dev/null | |
407 | +++ b/misc/tst-mntent-blank-passno.c | |
408 | @@ -0,0 +1,53 @@ | |
409 | +/* Make sure trailing whitespace is handled properly BZ #17273. | |
410 | + | |
411 | + Copyright (C) 2009-2015 Free Software Foundation, Inc. | |
412 | + This file is part of the GNU C Library. | |
413 | + | |
414 | + The GNU C Library is free software; you can redistribute it and/or | |
415 | + modify it under the terms of the GNU Lesser General Public | |
416 | + License as published by the Free Software Foundation; either | |
417 | + version 2.1 of the License, or (at your option) any later version. | |
418 | + | |
419 | + The GNU C Library is distributed in the hope that it will be useful, | |
420 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
421 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
422 | + Lesser General Public License for more details. | |
423 | + | |
424 | + You should have received a copy of the GNU Lesser General Public | |
425 | + License along with the GNU C Library; if not, see | |
426 | + <http://www.gnu.org/licenses/>. */ | |
427 | + | |
428 | +#include <mntent.h> | |
429 | +#include <stdio.h> | |
430 | +#include <string.h> | |
431 | + | |
432 | +/* Check entries to make sure trailing whitespace is ignored and we return the | |
433 | + correct passno value BZ #17273. */ | |
434 | +static int | |
435 | +do_test (void) | |
436 | +{ | |
437 | + int result = 0; | |
438 | + FILE *fp; | |
439 | + struct mntent *mnt; | |
440 | + | |
441 | + fp = tmpfile (); | |
442 | + fputs ("/foo\\040dir /bar\\040dir auto bind \t \n", fp); | |
443 | + rewind (fp); | |
444 | + | |
445 | + mnt = getmntent (fp); | |
446 | + if (strcmp (mnt->mnt_fsname, "/foo dir") != 0 | |
447 | + || strcmp (mnt->mnt_dir, "/bar dir") != 0 | |
448 | + || strcmp (mnt->mnt_type, "auto") != 0 | |
449 | + || strcmp (mnt->mnt_opts, "bind") != 0 | |
450 | + || mnt->mnt_freq != 0 | |
451 | + || mnt->mnt_passno != 0) | |
452 | + { | |
453 | + puts ("Error while reading entry with trailing whitespaces"); | |
454 | + result = 1; | |
455 | + } | |
456 | + | |
457 | + return result; | |
458 | +} | |
459 | + | |
460 | +#define TEST_FUNCTION do_test () | |
461 | +#include "../test-skeleton.c" | |
462 | diff --git a/misc/tst-mntent.c b/misc/tst-mntent.c | |
463 | index 876c89f..820b354 100644 | |
464 | --- a/misc/tst-mntent.c | |
465 | +++ b/misc/tst-mntent.c | |
466 | @@ -73,26 +73,6 @@ main (int argc, char *argv[]) | |
467 | puts ("Error while reading written entry back in"); | |
468 | result = 1; | |
469 | } | |
470 | - | |
471 | - /* Part III: Entry with whitespaces at the end of a line. */ | |
472 | - rewind (fp); | |
473 | - | |
474 | - fputs ("/foo\\040dir /bar\\040dir auto bind \t \n", fp); | |
475 | - | |
476 | - rewind (fp); | |
477 | - | |
478 | - mnt = getmntent (fp); | |
479 | - | |
480 | - if (strcmp (mnt->mnt_fsname, "/foo dir") != 0 | |
481 | - || strcmp (mnt->mnt_dir, "/bar dir") != 0 | |
482 | - || strcmp (mnt->mnt_type, "auto") != 0 | |
483 | - || strcmp (mnt->mnt_opts, "bind") != 0 | |
484 | - || mnt->mnt_freq != 0 | |
485 | - || mnt->mnt_passno != 0) | |
486 | - { | |
487 | - puts ("Error while reading entry with trailing whitespaces"); | |
488 | - result = 1; | |
489 | - } | |
490 | } | |
491 | ||
492 | return result; | |
493 | diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl | |
494 | index cac1562..79b2b3e 100755 | |
495 | --- a/scripts/test-installation.pl | |
496 | +++ b/scripts/test-installation.pl | |
497 | @@ -80,16 +80,25 @@ arglist: while (@ARGV) { | |
498 | # We expect none or one argument. | |
499 | if ($#ARGV == -1) { | |
500 | $soversions="soversions.mk"; | |
501 | + $config="config.make"; | |
502 | } elsif ($#ARGV == 0) { | |
503 | if (-d $ARGV[0]) { | |
504 | $soversions = "$ARGV[0]/soversions.mk"; | |
505 | + $config = "$ARGV[0]/config.make"; | |
506 | } else { | |
507 | - $soversions = $ARGV[0]; | |
508 | + $soversions = $dir = $ARGV[0]; | |
509 | + $dir =~ s!/?[^/]*/*$!!; | |
510 | + $config = $dir . "/config.make"; | |
511 | } | |
512 | } else { | |
513 | die "Wrong number of arguments."; | |
514 | } | |
515 | ||
516 | +if (system ("grep -q \"build-mathvec = yes\" $config") == 0) { | |
517 | + $build_mathvec = 1; | |
518 | +} else { | |
519 | + $build_mathvec = 0; | |
520 | +} | |
521 | ||
522 | # Read names and versions of all shared libraries that are part of | |
523 | # glibc | |
524 | @@ -111,6 +120,8 @@ while (<SOVERSIONS>) { | |
525 | # - libthread_db since it contains unresolved references | |
526 | # - it's just a test NSS module | |
527 | # - We don't provide the libgcc so we don't test it | |
528 | + # - libmvec if it wasn't built | |
529 | + next if ($build_mathvec == 0 && $name eq "mvec"); | |
530 | if ($name ne "nss_ldap" && $name ne "db1" | |
531 | && !($name =~/^nss1_/) && $name ne "thread_db" | |
532 | && $name ne "nss_test1" && $name ne "libgcc_s") { | |
0cd3962f AM |
533 | diff --git a/sysdeps/hppa/dl-symaddr.c b/sysdeps/hppa/dl-symaddr.c |
534 | index b707c19..89d8baf 100644 | |
535 | --- a/sysdeps/hppa/dl-symaddr.c | |
536 | +++ b/sysdeps/hppa/dl-symaddr.c | |
537 | @@ -33,3 +33,4 @@ _dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref) | |
538 | else | |
539 | return (void *) value; | |
540 | } | |
541 | +rtld_hidden_def (_dl_symbol_address) | |
0f2ff8b1 AM |
542 | diff --git a/sysdeps/nacl/Makefile b/sysdeps/nacl/Makefile |
543 | index 6749a44..1748886 100644 | |
544 | --- a/sysdeps/nacl/Makefile | |
545 | +++ b/sysdeps/nacl/Makefile | |
546 | @@ -132,4 +132,13 @@ ifeq ($(subdir),misc) | |
547 | # sysdeps/.../linux/ directories, but it's still a sysdeps decision to | |
548 | # install it. | |
549 | sysdep_headers += bits/mman-linux.h | |
550 | + | |
551 | +# This defeats sysdeps/gnu/Makefile's addition of sys/mtio.h, which | |
552 | +# we do not want. This is a total kludge, but it seems no worse for | |
553 | +# now than making the sysdeps/gnu/Makefile code conditional on a | |
554 | +# variable we set here. If some sysdeps/.../Makefile that is later | |
555 | +# in the list than sysdeps/gnu needed to add to sysdep_headers, this | |
556 | +# would break it. But sysdeps/gnu is close to last in the list and | |
557 | +# this coming up seems unlikely. | |
558 | +override sysdep_headers := $(sysdep_headers) | |
559 | endif | |
2914288c AM |
560 | diff --git a/sysdeps/nacl/start.c b/sysdeps/nacl/start.c |
561 | index a4b6dd3..8e8bc1a 100644 | |
562 | --- a/sysdeps/nacl/start.c | |
563 | +++ b/sysdeps/nacl/start.c | |
564 | @@ -44,6 +44,10 @@ | |
565 | /* The application defines this, of course. */ | |
566 | extern int main (int argc, char **argv, char **envp); | |
567 | ||
568 | +/* But maybe it defines this too, in which case it takes precedence. */ | |
569 | +extern int __nacl_main (int argc, char **argv, char **envp) | |
570 | + __attribute__ ((weak)); | |
571 | + | |
572 | /* These are defined in libc. */ | |
573 | extern int __libc_csu_init (int argc, char **argv, char **envp); | |
574 | extern void __libc_csu_fini (void); | |
575 | @@ -59,7 +63,7 @@ _start (uint32_t info[]) | |
576 | { | |
577 | /* The generic code actually assumes that envp follows argv. */ | |
578 | ||
579 | - __libc_start_main (&main, | |
580 | + __libc_start_main (&__nacl_main ?: &main, | |
581 | nacl_startup_argc (info), | |
582 | nacl_startup_argv (info), | |
583 | nacl_startup_auxv (info), | |
0f2ff8b1 AM |
584 | diff --git a/sysdeps/posix/opendir.c b/sysdeps/posix/opendir.c |
585 | index 6509f5c..9edf056 100644 | |
586 | --- a/sysdeps/posix/opendir.c | |
587 | +++ b/sysdeps/posix/opendir.c | |
588 | @@ -105,7 +105,7 @@ need_isdir_precheck (void) | |
589 | tryopen_o_directory (); | |
590 | ||
591 | /* We can skip the expensive `stat' call if O_DIRECTORY works. */ | |
592 | - return o_directory_works > 0; | |
593 | + return o_directory_works < 0; | |
594 | #endif | |
595 | return true; | |
596 | } | |
597 | diff --git a/sysdeps/sparc/sparc32/sem_open.c b/sysdeps/sparc/sparc32/sem_open.c | |
598 | index 16cb9ad..59df2d7 100644 | |
599 | --- a/sysdeps/sparc/sparc32/sem_open.c | |
600 | +++ b/sysdeps/sparc/sparc32/sem_open.c | |
601 | @@ -29,6 +29,7 @@ | |
602 | #include <sys/mman.h> | |
603 | #include <sys/stat.h> | |
604 | #include "semaphoreP.h" | |
605 | +#include <futex-internal.h> | |
606 | #include <shm-directory.h> | |
607 | ||
608 | ||
0cd3962f AM |
609 | diff --git a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h |
610 | index abde83e..6e73504 100644 | |
611 | --- a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h | |
612 | +++ b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h | |
613 | @@ -56,42 +56,41 @@ typedef uintmax_t uatomic_max_t; | |
614 | #define _LWS "0xb0" | |
615 | #define _LWS_CAS "0" | |
616 | /* Note r31 is the link register. */ | |
617 | -#define _LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" | |
618 | +#define _LWS_CLOBBER "r1", "r23", "r22", "r20", "r31", "memory" | |
619 | /* String constant for -EAGAIN. */ | |
620 | #define _ASM_EAGAIN "-11" | |
621 | /* String constant for -EDEADLOCK. */ | |
622 | #define _ASM_EDEADLOCK "-45" | |
623 | ||
624 | #if __ASSUME_LWS_CAS | |
625 | -/* The only basic operation needed is compare and exchange. */ | |
626 | +/* The only basic operation needed is compare and exchange. The mem | |
627 | + pointer must be word aligned. */ | |
628 | # define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ | |
629 | ({ \ | |
630 | - volatile int lws_errno; \ | |
631 | - __typeof__ (*mem) lws_ret; \ | |
632 | - asm volatile( \ | |
633 | + register long lws_errno asm("r21"); \ | |
634 | + register unsigned long lws_ret asm("r28"); \ | |
635 | + register unsigned long lws_mem asm("r26") = (unsigned long)(mem); \ | |
636 | + register unsigned long lws_old asm("r25") = (unsigned long)(oldval);\ | |
637 | + register unsigned long lws_new asm("r24") = (unsigned long)(newval);\ | |
638 | + __asm__ __volatile__( \ | |
639 | "0: \n\t" \ | |
640 | - "copy %2, %%r26 \n\t" \ | |
641 | - "copy %3, %%r25 \n\t" \ | |
642 | - "copy %4, %%r24 \n\t" \ | |
643 | "ble " _LWS "(%%sr2, %%r0) \n\t" \ | |
644 | "ldi " _LWS_CAS ", %%r20 \n\t" \ | |
645 | - "ldi " _ASM_EAGAIN ", %%r24 \n\t" \ | |
646 | - "cmpb,=,n %%r24, %%r21, 0b \n\t" \ | |
647 | + "ldi " _ASM_EAGAIN ", %%r20 \n\t" \ | |
648 | + "cmpb,=,n %%r20, %%r21, 0b \n\t" \ | |
649 | "nop \n\t" \ | |
650 | - "ldi " _ASM_EDEADLOCK ", %%r25 \n\t" \ | |
651 | - "cmpb,=,n %%r25, %%r21, 0b \n\t" \ | |
652 | + "ldi " _ASM_EDEADLOCK ", %%r20 \n\t" \ | |
653 | + "cmpb,=,n %%r20, %%r21, 0b \n\t" \ | |
654 | "nop \n\t" \ | |
655 | - "stw %%r28, %0 \n\t" \ | |
656 | - "stw %%r21, %1 \n\t" \ | |
657 | - : "=m" (lws_ret), "=m" (lws_errno) \ | |
658 | - : "r" (mem), "r" (oldval), "r" (newval) \ | |
659 | + : "=r" (lws_ret), "=r" (lws_errno) \ | |
660 | + : "r" (lws_mem), "r" (lws_old), "r" (lws_new) \ | |
661 | : _LWS_CLOBBER \ | |
662 | ); \ | |
663 | \ | |
664 | - if(lws_errno == -EFAULT || lws_errno == -ENOSYS) \ | |
665 | + if (lws_errno == -EFAULT || lws_errno == -ENOSYS) \ | |
666 | ABORT_INSTRUCTION; \ | |
667 | \ | |
668 | - lws_ret; \ | |
669 | + (__typeof (oldval)) lws_ret; \ | |
670 | }) | |
671 | ||
672 | # define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \ | |
673 | diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.h b/sysdeps/unix/sysv/linux/microblaze/sysdep.h | |
674 | index 83c0340..9d5c542 100644 | |
675 | --- a/sysdeps/unix/sysv/linux/microblaze/sysdep.h | |
676 | +++ b/sysdeps/unix/sysv/linux/microblaze/sysdep.h | |
677 | @@ -16,8 +16,11 @@ | |
678 | License along with the GNU C Library; if not, see | |
679 | <http://www.gnu.org/licenses/>. */ | |
680 | ||
681 | +#ifndef _LINUX_MICROBLAZE_SYSDEP_H | |
682 | +#define _LINUX_MICROBLAZE_SYSDEP_H 1 | |
683 | + | |
684 | +#include <sysdeps/unix/sysdep.h> | |
685 | #include <sysdeps/microblaze/sysdep.h> | |
686 | -#include <sys/syscall.h> | |
687 | ||
688 | /* Defines RTLD_PRIVATE_ERRNO. */ | |
689 | #include <dl-sysdep.h> | |
690 | @@ -305,3 +308,5 @@ SYSCALL_ERROR_LABEL_DCL: \ | |
691 | # define PTR_DEMANGLE(var) (void) (var) | |
692 | ||
693 | #endif /* not __ASSEMBLER__ */ | |
694 | + | |
695 | +#endif /* _LINUX_MICROBLAZE_SYSDEP_H */ | |
696 | diff --git a/sysdeps/unix/sysv/linux/openat.c b/sysdeps/unix/sysv/linux/openat.c | |
697 | index 6777123..ad8e31d 100644 | |
698 | --- a/sysdeps/unix/sysv/linux/openat.c | |
699 | +++ b/sysdeps/unix/sysv/linux/openat.c | |
700 | @@ -68,6 +68,11 @@ __OPENAT (int fd, const char *file, int oflag, ...) | |
701 | va_end (arg); | |
702 | } | |
703 | ||
704 | + /* We have to add the O_LARGEFILE flag for openat64. */ | |
705 | +#ifdef MORE_OFLAGS | |
706 | + oflag |= MORE_OFLAGS; | |
707 | +#endif | |
708 | + | |
709 | return SYSCALL_CANCEL (openat, fd, file, oflag, mode); | |
710 | } | |
711 | libc_hidden_def (__OPENAT) |