~vorlon/ubuntu/natty/eglibc/multiarch

« back to all changes in this revision

Viewing changes to debian/patches/svn-updates.diff

  • Committer: Steve Langasek
  • Date: 2011-02-18 21:18:44 UTC
  • mfrom: (103.1.7 eglibc)
  • Revision ID: steve.langasek@linaro.org-20110218211844-lodmi8b1qhyq3f3x
Tags: 2.13~pre1-0ubuntu1+multiarch.1
merge from natty

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
SVN update of svn://svn.eglibc.org/branches/eglibc-2_12 from revision 11211
 
1
SVN update of svn://svn.eglibc.org/branches/eglibc-2_13 from revision xxxxx
2
2
 
3
 
--- a/stdlib/msort.c    (revision 11211)
4
 
+++ b/stdlib/msort.c    (revision 12365)
5
 
@@ -25,6 +25,7 @@
6
 
 #include <unistd.h>
7
 
 #include <memcopy.h>
8
 
 #include <errno.h>
9
 
+#include <atomic.h>
10
 
 
11
 
 struct msort_param
12
 
 {
13
 
@@ -182,7 +183,7 @@
14
 
       static long int phys_pages;
15
 
       static int pagesize;
16
 
 
17
 
-      if (phys_pages == 0)
18
 
+      if (pagesize == 0)
19
 
        {
20
 
          phys_pages = __sysconf (_SC_PHYS_PAGES);
21
 
 
22
 
@@ -197,6 +198,9 @@
23
 
             a quarter of the physical memory.  */
24
 
          phys_pages /= 4;
25
 
 
26
 
+         /* Make sure phys_pages is written to memory.  */
27
 
+         atomic_write_barrier ();
28
 
+
29
 
          pagesize = __sysconf (_SC_PAGESIZE);
30
 
        }
31
 
 
32
 
--- a/stdlib/strtod_l.c (revision 11211)
33
 
+++ b/stdlib/strtod_l.c (revision 12365)
34
 
@@ -1504,7 +1504,9 @@
35
 
                          register int i;
36
 
                          (void) __mpn_lshift (&retval[used
37
 
                                                       / BITS_PER_MP_LIMB],
38
 
-                                              retval, RETURN_LIMB_SIZE,
39
 
+                                              retval,
40
 
+                                              (RETURN_LIMB_SIZE
41
 
+                                               - used / BITS_PER_MP_LIMB),
42
 
                                               used % BITS_PER_MP_LIMB);
43
 
                          for (i = used / BITS_PER_MP_LIMB - 1; i >= 0; --i)
44
 
                            retval[i] = 0;
45
 
--- a/scripts/data/localplt-s390x-linux-gnu.data        (revision 0)
46
 
+++ b/scripts/data/localplt-s390x-linux-gnu.data        (revision 12365)
47
 
@@ -0,0 +1,7 @@
48
 
+libc.so: _Unwind_Find_FDE
49
 
+libc.so: calloc
50
 
+libc.so: free
51
 
+libc.so: malloc
52
 
+libc.so: memalign
53
 
+libc.so: realloc
54
 
+libm.so: matherr
55
 
--- a/scripts/data/localplt-s390-linux-gnu.data (revision 0)
56
 
+++ b/scripts/data/localplt-s390-linux-gnu.data (revision 12365)
57
 
@@ -0,0 +1,7 @@
58
 
+libc.so: _Unwind_Find_FDE
59
 
+libc.so: calloc
60
 
+libc.so: free
61
 
+libc.so: malloc
62
 
+libc.so: memalign
63
 
+libc.so: realloc
64
 
+libm.so: matherr
65
 
--- a/wcsmbs/wcsmbsload.c       (revision 11211)
66
 
+++ b/wcsmbs/wcsmbsload.c       (revision 12365)
67
 
@@ -218,7 +218,7 @@
68
 
 #else
69
 
 void
70
 
 internal_function
71
 
-__wcsmbs_load_conv (struct locale_data *new_category)
72
 
+__wcsmbs_load_conv (struct __locale_data *new_category)
73
 
 {
74
 
   /* When OPTION_EGLIBC_LOCALE_CODE is disabled, we should never reach
75
 
      this point: there is no way to change locales, so every locale
76
 
--- a/wcsmbs/bits/wchar2.h      (revision 11211)
77
 
+++ b/wcsmbs/bits/wchar2.h      (revision 12365)
78
 
@@ -1,5 +1,5 @@
79
 
 /* Checking macros for wchar functions.
80
 
-   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
81
 
+   Copyright (C) 2005, 2006, 2007, 2010 Free Software Foundation, Inc.
82
 
    This file is part of the GNU C Library.
83
 
 
84
 
    The GNU C Library is free software; you can redistribute it and/or
85
 
@@ -60,15 +60,13 @@
86
 
                                                   __const wchar_t *__s2,
87
 
                                                   size_t __n), wmemmove);
88
 
 extern wchar_t *__REDIRECT_NTH (__wmemmove_chk_warn,
89
 
-                               (wchar_t *__restrict __s1,
90
 
-                                __const wchar_t *__restrict __s2, size_t __n,
91
 
-                                size_t __ns1), __wmemmove_chk)
92
 
+                               (wchar_t *__s1, __const wchar_t *__s2,
93
 
+                                size_t __n, size_t __ns1), __wmemmove_chk)
94
 
      __warnattr ("wmemmove called with length bigger than size of destination "
95
 
                 "buffer");
96
 
 
97
 
 __extern_always_inline wchar_t *
98
 
-__NTH (wmemmove (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
99
 
-                size_t __n))
100
 
+__NTH (wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n))
101
 
 {
102
 
   if (__bos0 (__s1) != (size_t) -1)
103
 
     {
104
 
@@ -129,7 +127,7 @@
105
 
                 "buffer");
106
 
 
107
 
 __extern_always_inline wchar_t *
108
 
-__NTH (wmemset (wchar_t *__restrict __s, wchar_t __c, size_t __n))
109
 
+__NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n))
110
 
 {
111
 
   if (__bos0 (__s) != (size_t) -1)
112
 
     {
113
 
@@ -152,7 +150,7 @@
114
 
                                 __const wchar_t *__restrict __src), wcscpy);
115
 
 
116
 
 __extern_always_inline wchar_t *
117
 
-__NTH (wcscpy (wchar_t *__dest, __const wchar_t *__src))
118
 
+__NTH (wcscpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src))
119
 
 {
120
 
   if (__bos (__dest) != (size_t) -1)
121
 
     return __wcscpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
122
 
@@ -160,14 +158,15 @@
123
 
 }
124
 
 
125
 
 
126
 
-extern wchar_t *__wcpcpy_chk (wchar_t *__dest, __const wchar_t *__src,
127
 
+extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
128
 
+                             __const wchar_t *__restrict __src,
129
 
                              size_t __destlen) __THROW;
130
 
-extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias, (wchar_t *__dest,
131
 
-                                                __const wchar_t *__src),
132
 
-                               wcpcpy);
133
 
+extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias,
134
 
+                               (wchar_t *__restrict __dest,
135
 
+                                __const wchar_t *__restrict __src), wcpcpy);
136
 
 
137
 
 __extern_always_inline wchar_t *
138
 
-__NTH (wcpcpy (wchar_t *__dest, __const wchar_t *__src))
139
 
+__NTH (wcpcpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src))
140
 
 {
141
 
   if (__bos (__dest) != (size_t) -1)
142
 
     return __wcpcpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
143
 
@@ -190,7 +189,8 @@
144
 
                 "buffer");
145
 
 
146
 
 __extern_always_inline wchar_t *
147
 
-__NTH (wcsncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
148
 
+__NTH (wcsncpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src,
149
 
+               size_t __n))
150
 
 {
151
 
   if (__bos (__dest) != (size_t) -1)
152
 
     {
153
 
@@ -220,7 +220,8 @@
154
 
                 "buffer");
155
 
 
156
 
 __extern_always_inline wchar_t *
157
 
-__NTH (wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
158
 
+__NTH (wcpncpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src,
159
 
+               size_t __n))
160
 
 {
161
 
   if (__bos (__dest) != (size_t) -1)
162
 
     {
163
 
@@ -243,7 +244,7 @@
164
 
                                 __const wchar_t *__restrict __src), wcscat);
165
 
 
166
 
 __extern_always_inline wchar_t *
167
 
-__NTH (wcscat (wchar_t *__dest, __const wchar_t *__src))
168
 
+__NTH (wcscat (wchar_t *__restrict __dest, __const wchar_t *__restrict __src))
169
 
 {
170
 
   if (__bos (__dest) != (size_t) -1)
171
 
     return __wcscat_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
172
 
@@ -260,7 +261,8 @@
173
 
                                 size_t __n), wcsncat);
174
 
 
175
 
 __extern_always_inline wchar_t *
176
 
-__NTH (wcsncat (wchar_t *__dest, __const wchar_t *__src, size_t __n))
177
 
+__NTH (wcsncat (wchar_t *__restrict __dest, __const wchar_t *__restrict __src,
178
 
+               size_t __n))
179
 
 {
180
 
   if (__bos (__dest) != (size_t) -1)
181
 
     return __wcsncat_chk (__dest, __src, __n,
182
 
@@ -428,14 +430,16 @@
183
 
 #endif
184
 
 
185
 
 
186
 
-extern size_t __wcrtomb_chk (char *__s, wchar_t __wchar, mbstate_t *__p,
187
 
-                         size_t __buflen) __THROW __wur;
188
 
+extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
189
 
+                            mbstate_t *__restrict __p,
190
 
+                            size_t __buflen) __THROW __wur;
191
 
 extern size_t __REDIRECT_NTH (__wcrtomb_alias,
192
 
                              (char *__restrict __s, wchar_t __wchar,
193
 
                               mbstate_t *__restrict __ps), wcrtomb) __wur;
194
 
 
195
 
 __extern_always_inline __wur size_t
196
 
-__NTH (wcrtomb (char *__s, wchar_t __wchar, mbstate_t *__ps))
197
 
+__NTH (wcrtomb (char *__restrict __s, wchar_t __wchar,
198
 
+               mbstate_t *__restrict __ps))
199
 
 {
200
 
   /* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
201
 
      But this would only disturb the namespace.  So we define our own
202
 
--- a/wcsmbs/wcsatcliff.c       (revision 11211)
203
 
+++ b/wcsmbs/wcsatcliff.c       (revision 12365)
204
 
@@ -16,6 +16,8 @@
205
 
 #define MEMCPY wmemcpy
206
 
 #define MEMPCPY wmempcpy
207
 
 #define MEMCHR wmemchr
208
 
+#define STRCMP wcscmp
209
 
+#define STRNCMP wcsncmp
210
 
 
211
 
 
212
 
 #include "../string/stratcliff.c"
213
 
--- a/wcsmbs/wchar.h    (revision 11211)
214
 
+++ b/wcsmbs/wchar.h    (revision 12365)
215
 
@@ -555,17 +555,17 @@
216
 
 extern long double wcstold_l (__const wchar_t *__restrict __nptr,
217
 
                              wchar_t **__restrict __endptr,
218
 
                              __locale_t __loc) __THROW;
219
 
-#endif /* GNU */
220
 
 
221
 
 
222
 
-#ifdef __USE_XOPEN2K8
223
 
 /* Copy SRC to DEST, returning the address of the terminating L'\0' in
224
 
    DEST.  */
225
 
-extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) __THROW;
226
 
+extern wchar_t *wcpcpy (wchar_t *__restrict __dest,
227
 
+                       __const wchar_t *__restrict __src) __THROW;
228
 
 
229
 
 /* Copy no more than N characters of SRC to DEST, returning the address of
230
 
    the last character written into DEST.  */
231
 
-extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n)
232
 
+extern wchar_t *wcpncpy (wchar_t *__restrict __dest,
233
 
+                        __const wchar_t *__restrict __src, size_t __n)
234
 
      __THROW;
235
 
 #endif /* use GNU */
236
 
 
237
 
--- a/include/dlfcn.h   (revision 11211)
238
 
+++ b/include/dlfcn.h   (revision 12365)
239
 
@@ -9,6 +9,7 @@
240
 
 #define __RTLD_OPENEXEC        0x20000000
241
 
 #define __RTLD_CALLMAP 0x10000000
242
 
 #define __RTLD_AUDIT   0x08000000
243
 
+#define __RTLD_SECURE  0x04000000 /* Apply additional security checks.  */
244
 
 
245
 
 #define __LM_ID_CALLER -2
246
 
 
247
 
--- a/config.make.in    (revision 11211)
248
 
+++ b/config.make.in    (revision 12365)
249
 
@@ -59,7 +59,7 @@
250
 
 enable-check-abi = @enable_check_abi@
251
 
 have-forced-unwind = @libc_cv_forced_unwind@
252
 
 have-fpie = @libc_cv_fpie@
253
 
-gnu89-inline-CFLAGS = @libc_cv_gnu89_inline@
254
 
+gnu89-inline-CFLAGS = @gnu89_inline@
255
 
 have-ssp = @libc_cv_ssp@
256
 
 have-selinux = @have_selinux@
257
 
 have-libaudit = @have_libaudit@
258
 
--- a/configure.in      (revision 11211)
259
 
+++ b/configure.in      (revision 12365)
260
 
@@ -278,9 +278,6 @@
261
 
                             [enable single DSO with optimizations for multiple architectures]),
262
 
              [multi_arch=$enableval],
263
 
              [multi_arch=default])
264
 
-if test x"$multi_arch" != xno; then
265
 
-  multi_arch_d=/multiarch
266
 
-fi
267
 
 
268
 
 AC_ARG_ENABLE([experimental-malloc],
269
 
              AC_HELP_STRING([--enable-experimental-malloc],
270
 
@@ -608,6 +605,90 @@
271
 
   AC_DEFINE(USE_REGPARMS)
272
 
 fi
273
 
 
274
 
+# For the multi-arch option we need support in the assembler.
275
 
+AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
276
 
+               libc_cv_asm_gnu_indirect_function, [dnl
277
 
+cat > conftest.s <<EOF
278
 
+.type foo,%gnu_indirect_function
279
 
+EOF
280
 
+if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
281
 
+then
282
 
+  libc_cv_asm_gnu_indirect_function=yes
283
 
+else
284
 
+  libc_cv_asm_gnu_indirect_function=no
285
 
+fi
286
 
+rm -f conftest*])
287
 
+
288
 
+AC_MSG_CHECKING(whether .text pseudo-op must be used)
289
 
+AC_CACHE_VAL(libc_cv_dot_text, [dnl
290
 
+cat > conftest.s <<EOF
291
 
+.text
292
 
+EOF
293
 
+libc_cv_dot_text=
294
 
+if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
295
 
+  libc_cv_dot_text=.text
296
 
+fi
297
 
+rm -f conftest*])
298
 
+if test -z "$libc_cv_dot_text"; then
299
 
+  AC_MSG_RESULT(no)
300
 
+else
301
 
+  AC_MSG_RESULT(yes)
302
 
+fi
303
 
+
304
 
+AC_CACHE_CHECK(for assembler global-symbol directive,
305
 
+              libc_cv_asm_global_directive, [dnl
306
 
+libc_cv_asm_global_directive=UNKNOWN
307
 
+for ac_globl in .globl .global .EXPORT; do
308
 
+  cat > conftest.s <<EOF
309
 
+       ${libc_cv_dot_text}
310
 
+       ${ac_globl} foo
311
 
+foo:
312
 
+EOF
313
 
+  if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
314
 
+    libc_cv_asm_global_directive=${ac_globl}
315
 
+  fi
316
 
+  rm -f conftest*
317
 
+  test $libc_cv_asm_global_directive != UNKNOWN && break
318
 
+done])
319
 
+if test $libc_cv_asm_global_directive = UNKNOWN; then
320
 
+  AC_MSG_ERROR(cannot determine asm global directive)
321
 
+else
322
 
+  AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive})
323
 
+fi
324
 
+
325
 
+AC_CACHE_CHECK(for assembler .type directive prefix,
326
 
+              libc_cv_asm_type_prefix, [dnl
327
 
+libc_cv_asm_type_prefix=no
328
 
+for ac_try_prefix in '@' '%' '#'; do
329
 
+  cat > conftest.s <<EOF
330
 
+       ${libc_cv_dot_text}
331
 
+       ${libc_cv_asm_global_directive} foo
332
 
+       .type foo, ${ac_try_prefix}object
333
 
+       .size foo, 1
334
 
+foo:
335
 
+       .byte 1
336
 
+EOF
337
 
+  if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
338
 
+    libc_cv_asm_type_prefix=${ac_try_prefix}
339
 
+  fi
340
 
+  rm -f conftest*
341
 
+  test "x$libc_cv_asm_type_prefix" != xno && break
342
 
+done])
343
 
+if test "x$libc_cv_asm_type_prefix" != xno; then
344
 
+  AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix})
345
 
+fi
346
 
+
347
 
+if test x"$libc_cv_asm_gnu_indirect_function" != xyes -a x"$libc_cv_asm_type_prefix" = xno; then
348
 
+  if test x"$multi_arch" = xyes; then
349
 
+    AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
350
 
+  else
351
 
+    multi_arch=no
352
 
+  fi
353
 
+fi
354
 
+if test x"$multi_arch" != xno; then
355
 
+  multi_arch_d=/multiarch
356
 
+fi
357
 
+
358
 
 # Compute the list of sysdep directories for this configuration.
359
 
 # This can take a while to compute.
360
 
 sysdep_dir=$srcdir/sysdeps
361
 
@@ -727,29 +808,14 @@
362
 
 
363
 
 # If the assembler supports gnu_indirect_function symbol type and the
364
 
 # architecture supports multi-arch, we enable multi-arch by default.
365
 
-if test "$multi_arch" = default; then
366
 
-AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
367
 
-               libc_cv_asm_gnu_indirect_function, [dnl
368
 
-cat > conftest.s <<EOF
369
 
-.type foo,%gnu_indirect_function
370
 
-EOF
371
 
-if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
372
 
-then
373
 
-  libc_cv_asm_gnu_indirect_function=yes
374
 
-else
375
 
-  libc_cv_asm_gnu_indirect_function=no
376
 
-fi
377
 
-rm -f conftest*])
378
 
+case $sysnames_add_ons$sysnames in
379
 
+*"$multi_arch_d"*)
380
 
+  ;;
381
 
+*)
382
 
   multi_arch=no
383
 
-  if test "$libc_cv_asm_gnu_indirect_function" = yes; then
384
 
-    case $sysnames_add_ons$sysnames in
385
 
-    *"$multi_arch_d"*)
386
 
-       multi_arch=yes
387
 
-      ;;
388
 
-    esac
389
 
-  fi
390
 
-fi
391
 
-if test x"$multi_arch" = xyes; then
392
 
+  ;;
393
 
+esac
394
 
+if test x"$multi_arch" != xno; then
395
 
   AC_DEFINE(USE_MULTIARCH)
396
 
 fi
397
 
 AC_SUBST(multi_arch)
398
 
@@ -1210,43 +1276,6 @@
399
 
 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
400
 
 fi
401
 
 
402
 
-AC_MSG_CHECKING(whether .text pseudo-op must be used)
403
 
-AC_CACHE_VAL(libc_cv_dot_text, [dnl
404
 
-cat > conftest.s <<EOF
405
 
-.text
406
 
-EOF
407
 
-libc_cv_dot_text=
408
 
-if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
409
 
-  libc_cv_dot_text=.text
410
 
-fi
411
 
-rm -f conftest*])
412
 
-if test -z "$libc_cv_dot_text"; then
413
 
-  AC_MSG_RESULT(no)
414
 
-else
415
 
-  AC_MSG_RESULT(yes)
416
 
-fi
417
 
-
418
 
-AC_CACHE_CHECK(for assembler global-symbol directive,
419
 
-              libc_cv_asm_global_directive, [dnl
420
 
-libc_cv_asm_global_directive=UNKNOWN
421
 
-for ac_globl in .globl .global .EXPORT; do
422
 
-  cat > conftest.s <<EOF
423
 
-       ${libc_cv_dot_text}
424
 
-       ${ac_globl} foo
425
 
-foo:
426
 
-EOF
427
 
-  if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
428
 
-    libc_cv_asm_global_directive=${ac_globl}
429
 
-  fi
430
 
-  rm -f conftest*
431
 
-  test $libc_cv_asm_global_directive != UNKNOWN && break
432
 
-done])
433
 
-if test $libc_cv_asm_global_directive = UNKNOWN; then
434
 
-  AC_MSG_ERROR(cannot determine asm global directive)
435
 
-else
436
 
-  AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive})
437
 
-fi
438
 
-
439
 
 AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
440
 
 cat > conftest.s <<EOF
441
 
 ${libc_cv_dot_text}
442
 
@@ -1272,28 +1301,6 @@
443
 
   AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
444
 
 fi
445
 
 
446
 
-AC_CACHE_CHECK(for assembler .type directive prefix,
447
 
-              libc_cv_asm_type_prefix, [dnl
448
 
-libc_cv_asm_type_prefix=no
449
 
-for ac_try_prefix in '@' '%' '#'; do
450
 
-  cat > conftest.s <<EOF
451
 
-       ${libc_cv_dot_text}
452
 
-       ${libc_cv_asm_global_directive} foo
453
 
-       .type foo, ${ac_try_prefix}object
454
 
-       .size foo, 1
455
 
-foo:
456
 
-       .byte 1
457
 
-EOF
458
 
-  if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
459
 
-    libc_cv_asm_type_prefix=${ac_try_prefix}
460
 
-  fi
461
 
-  rm -f conftest*
462
 
-  test "x$libc_cv_asm_type_prefix" != xno && break
463
 
-done])
464
 
-if test "x$libc_cv_asm_type_prefix" != xno; then
465
 
-  AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix})
466
 
-fi
467
 
-
468
 
 AC_CACHE_CHECK(for assembler gnu_unique_object symbol type,
469
 
               libc_cv_asm_unique_object, [dnl
470
 
 cat > conftest.s <<EOF
471
 
@@ -1311,29 +1318,6 @@
472
 
   AC_DEFINE(HAVE_ASM_UNIQUE_OBJECT)
473
 
 fi
474
 
 
475
 
-# For the multi-arch option we need support in the assembler.
476
 
-if test "$multi_arch" = yes; then
477
 
-  if test "x$libc_cv_asm_type_prefix" != xno; then
478
 
-AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
479
 
-               libc_cv_asm_gnu_indirect_function, [dnl
480
 
-cat > conftest.s <<EOF
481
 
-.type foo,%gnu_indirect_function
482
 
-EOF
483
 
-if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
484
 
-then
485
 
-  libc_cv_asm_gnu_indirect_function=yes
486
 
-else
487
 
-  libc_cv_asm_gnu_indirect_function=no
488
 
-fi
489
 
-rm -f conftest*])
490
 
-  else
491
 
-    libc_cv_asm_gnu_indirect_function=no
492
 
-  fi
493
 
-  if test x"$libc_cv_asm_gnu_indirect_function" != xyes; then
494
 
-    AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
495
 
-  fi
496
 
-fi
497
 
-
498
 
 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
499
 
 [cat > conftest.s <<EOF
500
 
 ${libc_cv_dot_text}
501
 
@@ -1827,11 +1811,11 @@
502
 
 fi
503
 
 rm -f conftest*])
504
 
 if test $libc_cv_gnu89_inline = yes; then
505
 
-  libc_cv_gnu89_inline=-fgnu89-inline
506
 
+  gnu89_inline=-fgnu89-inline
507
 
 else
508
 
-  libc_cv_gnu89_inline=
509
 
+  gnu89_inline=
510
 
 fi
511
 
-AC_SUBST(libc_cv_gnu89_inline)
512
 
+AC_SUBST(gnu89_inline)
513
 
 
514
 
 if test $elf != yes; then
515
 
   AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
516
 
--- a/ChangeLog (revision 11211)
517
 
+++ b/ChangeLog (revision 12365)
518
 
@@ -1,5 +1,378 @@
519
 
+2010-12-13  Andreas Schwab  <schwab@redhat.com>
520
 
+
521
 
+       * version.h (VERSION): Bump for 2.12.2 release.
522
 
+
523
 
+2010-12-10  Andreas Schwab  <schwab@redhat.com>
524
 
+
525
 
+       * wcsmbs/wchar.h (wcpcpy, wcpncpy): Only declare under
526
 
+       _GNU_SOURCE.
527
 
+
528
 
+2010-12-10  Andreas Schwab  <schwab@redhat.com>
529
 
+
530
 
+       * wcsmbs/wchar.h (wcpcpy, wcpncpy): Add __restrict.
531
 
+       * wcsmbs/bits/wchar2.h (__wmemmove_chk_warn, wmemmove, wmemset):
532
 
+       Remove __restrict.
533
 
+       (wcscpy, __wcpcpy_chk, __wcpcpy_alias, wcpcpy, wcsncpy, wcpncpy)
534
 
+       (wcscat, wcsncat, __wcrtomb_chk, wcrtomb): Add __restrict.
535
 
+
536
 
+2010-12-09  Ulrich Drepper  <drepper@gmail.com>
537
 
+
538
 
+       [BZ #11655]
539
 
+       * stdlib/msort.c (qsort_r): Make sure both phys_pages and pagesize
540
 
+       are initialized.
541
 
+
542
 
+2010-12-09  Jakub Jelinek  <jakub@redhat.com>
543
 
+
544
 
+       * string/bits/string3.h (memmove, bcopy): Remove __restrict.
545
 
+
546
 
+2010-08-11  Ulrich Drepper  <drepper@redhat.com>
547
 
+
548
 
+       [BZ #11903]
549
 
+       * sysdeps/generic/netinet/ip.h (IPTOS_CLASS): Fix definition.
550
 
+       Patch by Evgeni Bikov <bikovevg@iitp.ru>.
551
 
+
552
 
+2010-08-21  Mike Frysinger  <vapier@gentoo.org>
553
 
+
554
 
+       * configure.in: Move assembler checks to before sysdep dir checking.
555
 
+
556
 
+2010-11-24  Andreas Schwab  <schwab@redhat.com>
557
 
+
558
 
+       * resolv/nss_dns/dns-host.c (getanswer_r): Don't handle ttl == 0
559
 
+       specially.
560
 
+       (gaih_getanswer_slice): Likewise.
561
 
+
562
 
+2010-05-31  Petr Baudis  <pasky@suse.cz>
563
 
+
564
 
+       [BZ #11149]
565
 
+       * elf/ldconfig.c (main): Allow aux_cache_file open()ing to fail
566
 
+       silently even in the chroot mode.
567
 
+
568
 
+2010-05-31  Petr Baudis <pasky@suse.cz>
569
 
+
570
 
+       [BZ #10085]
571
 
+       * nis/nss_compat/compat-initgroups.c (internal_getgrent_r): Fix
572
 
+       initialization of skip_initgroups_dyn.
573
 
+
574
 
+2010-09-27  Andreas Schwab  <schwab@redhat.com>
575
 
+
576
 
+       [BZ #11611]
577
 
+       * sysdeps/unix/sysv/linux/internal_statvfs.c (INTERNAL_STATVFS):
578
 
+       Mask out sign-bit copies when constructing f_fsid.
579
 
+
580
 
+2010-11-19  Ulrich Drepper  <drepper@gmail.com>
581
 
+
582
 
+       * sysdeps/unix/sysv/linux/i386/bits/mman.h: Define MAP_HUGETLB.
583
 
+       * sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Likewise.
584
 
+
585
 
+2010-11-16  Ulrich Drepper  <drepper@gmail.com>
586
 
+
587
 
+       * sysdeps/unix/sysv/linux/sys/swap.h (SWAP_FLAG_DISCARD): Define.
588
 
+
589
 
+2010-11-11  Andreas Schwab  <schwab@redhat.com>
590
 
+
591
 
+       * posix/fnmatch_loop.c (NEW_PATTERN): Fix use of alloca.
592
 
+       * posix/Makefile (tests): Add $(objpfx)tst-fnmatch-mem.
593
 
+       (tst-fnmatch-ENV): Set MALLOC_TRACE.
594
 
+       ($(objpfx)tst-fnmatch-mem): New rule.
595
 
+       (generated): Add tst-fnmatch-mem and tst-fnmatch.mtrace.
596
 
+       * posix/tst-fnmatch.c (main): Call mtrace.
597
 
+
598
 
+2010-08-09  Ulrich Drepper  <drepper@redhat.com>
599
 
+
600
 
+       [BZ #11883]
601
 
+       * posix/fnmatch.c: Keep track of alloca use and fall back on malloc.
602
 
+       * posix/fnmatch_loop.c: Likewise.
603
 
+
604
 
+2010-11-10  Luis Machado  <luisgpm@br.ibm.com>
605
 
+
606
 
+       * sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c (__ieee754_sqrtl): Force
607
 
+         signed comparison.
608
 
+
609
 
+2010-11-08  Ulrich Drepper  <drepper@gmail.com>
610
 
+
611
 
+       [BZ #12194]
612
 
+       * sysdeps/i386/bits/byteswap.h: Avoid warning in __bswap_16.
613
 
+       * sysdeps/x86_64/bits/byteswap.h: Likewise.
614
 
+
615
 
+2010-08-31  Mike Frysinger  <vapier@gentoo.org>
616
 
+
617
 
+       * sysdeps/unix/sysv/linux/sparc/sys/epoll.h (epoll_create2): Delete.
618
 
+       (epoll_create1): Declare.
619
 
+
620
 
+2010-09-06  Andreas Schwab  <schwab@redhat.com>
621
 
+
622
 
+       * manual/Makefile: Don't mix pattern rules with normal rules.
623
 
+
624
 
+2010-08-12  Andreas Schwab  <schwab@redhat.com>
625
 
+
626
 
+       [BZ #11904]
627
 
+       * locale/programs/locale.c (print_assignment): New function.
628
 
+       (show_locale_vars): Use it.
629
 
+
630
 
+2010-10-26  Ulrich Drepper  <drepper@gmail.com>
631
 
+
632
 
+       * elf/rtld.c (dl_main): Move assertion after the point where rtld map
633
 
+       is added to the list.
634
 
+
635
 
+2010-10-24  Ulrich Drepper  <drepper@redhat.com>
636
 
+
637
 
+       [BZ #12140]
638
 
+       * malloc/malloc.c (_int_free): Fill correct number of bytes when
639
 
+       perturbing.
640
 
+
641
 
+2010-09-09  Andreas Schwab  <schwab@redhat.com>
642
 
+
643
 
+       * Makeconfig (sysd-rules-patterns): Add rtld-%:rtld-%.
644
 
+       (sysd-rules-targets): Remove duplicates.
645
 
+       * elf/rtld-Rules ($(objpfx)rtld-%.os): Add pattern rules with
646
 
+       rtld-%.$o dependency.
647
 
+
648
 
+2010-10-18  Andreas Schwab  <schwab@redhat.com>
649
 
+
650
 
+       * elf/dl-open.c (dl_open_worker): Don't expand DST here, let
651
 
+       _dl_map_object do it.
652
 
+
653
 
+2010-10-15  Andreas Schwab  <schwab@redhat.com>
654
 
+
655
 
+       * scripts/data/localplt-s390-linux-gnu.data: New file.
656
 
+       * scripts/data/localplt-s390x-linux-gnu.data: New file.
657
 
+
658
 
+2010-10-12  Ulrich Drepper  <drepper@redhat.com>
659
 
+
660
 
+       [BZ #12078]
661
 
+       * posix/regcomp.c (parse_branch): One more memory leak plugged.
662
 
+       * posix/bug-regex31.input: Add test case.
663
 
+
664
 
+2010-10-11  Ulrich Drepper  <drepper@gmail.com>
665
 
+
666
 
+       * posix/bug-regex31.c: Rewrite to run multiple tests from stdin.
667
 
+       * posix/bug-regex31.input: New file.
668
 
+
669
 
+       [BZ #12078]
670
 
+       * posix/regcomp.c (parse_branch): Free memory when allocation failed.
671
 
+       (parse_sub_exp): Fix last change, use postorder.
672
 
+
673
 
+2010-10-11  Ulrich Drepper  <drepper@gmail.com>
674
 
+
675
 
+       * posix/bug-regex31.c: New file.
676
 
+       * posix/Makefile: Add rules to build and run bug-regex31.
677
 
+
678
 
+2010-10-11  Ulrich Drepper  <drepper@gmail.com>
679
 
+
680
 
+       * posix/regcomp.c (parse_bracket_exp): Add missing re_free calls.
681
 
+
682
 
+       [BZ #12078]
683
 
+       * posix/regcomp.c (parse_sub_exp): Free tree data when it is not used.
684
 
+
685
 
+2010-10-11  Ulrich Drepper  <drepper@gmail.com>
686
 
+
687
 
+       [BZ #12093]
688
 
+       * sysdeps/unix/sysv/linux/check_pf.c (__check_pf): ->ifa_addr might
689
 
+       be NULL.
690
 
+
691
 
+2010-10-03  Ulrich Drepper  <drepper@gmail.com>
692
 
+
693
 
+       [BZ #12005]
694
 
+       * malloc/mcheck.c: Handle large requests.
695
 
+
696
 
+2010-09-15  Joseph Myers  <joseph@codesourcery.com>
697
 
+
698
 
+       * sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): When
699
 
+       implementing getdents64 using getdents syscall, set d_type if
700
 
+       __ASSUME_GETDENTS32_D_TYPE.
701
 
+
702
 
+2010-09-14  Andreas Schwab  <schwab@redhat.com>
703
 
+
704
 
+       * sysdeps/s390/s390-32/__longjmp.c (__longjmp): Define register
705
 
+       variables after CHECK_SP call.
706
 
+       * sysdeps/s390/s390-64/__longjmp.c (__longjmp): Likewise.
707
 
+
708
 
+2010-09-08  Chung-Lin Tang  <cltang@codesourcery.com>
709
 
+           Ulrich Drepper  <drepper@redhat.com>
710
 
+
711
 
+       [BZ #11968]
712
 
+       * sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
713
 
+       (____longjmp_chk): Use %ebx for saving value across system call.
714
 
+       Add unwind info.
715
 
+
716
 
+2010-08-31  Mike Frysinger  <vapier@gentoo.org>
717
 
+
718
 
+       * sysdeps/unix/sysv/linux/x86_64/sys/epoll.h: Fix typo.
719
 
+
720
 
+2010-08-31  Andreas Schwab  <schwab@redhat.com>
721
 
+
722
 
+       [BZ #7066]
723
 
+       * stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix array overflow when
724
 
+       shifting retval into place.
725
 
+
726
 
+2010-09-14  Ulrich Drepper  <drepper@redhat.com>
727
 
+
728
 
+       * resolv/res_init.c (__res_vinit): Count the default server we added.
729
 
+
730
 
+2010-08-25  Ulrich Drepper  <drepper@redhat.com>
731
 
+
732
 
+       [BZ #10851]
733
 
+       * resolv/res_init.c (__res_vinit): When no server address at all
734
 
+       is given default to loopback.
735
 
+
736
 
+2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
737
 
+
738
 
+       * sysdeps/i386/elf/Makefile: New file.
739
 
+
740
 
+2010-07-31  Samuel Thibault  <samuel.thibault@ens-lyon.org>
741
 
+
742
 
+       * hurd/hurdselect.c (_hurd_select): Round timeout up instead of down
743
 
+       when converting to ms.
744
 
+
745
 
+2010-07-29  Roland McGrath  <roland@redhat.com>
746
 
+
747
 
+       [BZ 11856]
748
 
+       * manual/locale.texi (Yes-or-No Questions): Fix example code.
749
 
+
750
 
 2010-07-27  Andreas Schwab  <schwab@redhat.com>
751
 
 
752
 
+       * manual/memory.texi (Malloc Tunable Parameters): Document
753
 
+       M_PERTURB.
754
 
+
755
 
+2010-07-26  Roland McGrath  <roland@redhat.com>
756
 
+
757
 
+       [BZ #11840]
758
 
+       * configure.in (-fgnu89-inline check): Set and substitute
759
 
+       gnu89_inline, not libc_cv_gnu89_inline.
760
 
+       * configure: Regenerated.
761
 
+       * config.make.in (gnu89-inline-CFLAGS): Use @gnu89_inline@.
762
 
+
763
 
+2010-07-20  Roland McGrath  <roland@redhat.com>
764
 
+
765
 
+       * elf/dl-sysdep.c (_dl_important_hwcaps): Add dsocaps mask to
766
 
+       dl_hwcap_mask as well as dl_hwcap.  Without this, dsocaps matching in
767
 
+       ld.so.cache was broken.  With it, there is no way to disable dsocaps
768
 
+       like LD_HWCAP_MASK can disable hwcaps.
769
 
+
770
 
+2010-07-05  Roland McGrath  <roland@redhat.com>
771
 
+
772
 
+       * manual/arith.texi (Rounding Functions): Fix rint description
773
 
+       implicit in round description.
774
 
+
775
 
+2010-07-02  Ulrich Drepper  <drepper@redhat.com>
776
 
+
777
 
+       * elf/Makefile: Fix linking for a few tests to make recent linker
778
 
+       happy.
779
 
+
780
 
+2010-06-02  Emilio Pozuelo Monfort  <pochu27@gmail.com>
781
 
+
782
 
+       * hurd/lookup-at.c (__file_name_lookup_at): Accept
783
 
+       AT_SYMLINK_FOLLOW in AT_FLAGS.  Fail with EINVAL if both
784
 
+       AT_SYMLINK_FOLLOW and AT_SYMLINK_NOFOLLOW are present
785
 
+       in AT_FLAGS.
786
 
+       * hurd/hurd/fd.h (__file_name_lookup_at): Update comment.
787
 
+       * sysdeps/mach/hurd/linkat.c (linkat): Pass O_NOLINK in FLAGS.
788
 
+
789
 
+2010-11-03  H.J. Lu  <hongjiu.lu@intel.com>
790
 
+
791
 
+       [BZ #12191]
792
 
+       * sysdeps/i386/i686/cacheinfo.c (__x86_64_raw_data_cache_size): New.
793
 
+       (__x86_64_raw_data_cache_size_half): Likewise.
794
 
+       (__x86_64_raw_shared_cache_size): Likewise.
795
 
+       (__x86_64_raw_shared_cache_size_half): Likewise.
796
 
+
797
 
+       * sysdeps/x86_64/cacheinfo.c (__x86_64_raw_data_cache_size): New.
798
 
+       (__x86_64_raw_data_cache_size_half): Likewise.
799
 
+       (__x86_64_raw_shared_cache_size): Likewise.
800
 
+       (__x86_64_raw_shared_cache_size_half): Likewise.
801
 
+       (init_cacheinfo): Set __x86_64_raw_data_cache_size,
802
 
+       __x86_64_raw_data_cache_size_half, __x86_64_raw_shared_cache_size
803
 
+       and __x86_64_raw_shared_cache_size_half.  Round
804
 
+       __x86_64_data_cache_size_half, __x86_64_data_cache_size
805
 
+       __x86_64_shared_cache_size_half and __x86_64_shared_cache_size,
806
 
+       to multiple of 256 bytes.
807
 
+
808
 
+2010-11-03  Ulrich Drepper  <drepper@gmail.com>
809
 
+
810
 
+       [BZ #12167]
811
 
+       * sysdeps/unix/sysv/linux/ttyname.c (ttyname): Recognize new mangling
812
 
+       of inacessible symlinks.  Verify result of symlink before returning it.
813
 
+       * sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Likewise.
814
 
+       Patch mostly by Miklos Szeredi <miklos@szeredi.hu>.
815
 
+
816
 
+2010-10-20  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
817
 
+           Ulrich Drepper  <drepper@gmail.com>
818
 
+
819
 
+       * elf/dl-object.c (_dl_new_object): Don't append the new object to
820
 
+       the global list here.  Move code to...
821
 
+       (_dl_add_to_namespace_list): ...here.  New function.
822
 
+       * elf/rtld.c (dl_main): Invoke _dl_add_to_namespace_list.
823
 
+       * sysdeps/generic/ldsodefs.h (_dl_add_to_namespace_list): Declare.
824
 
+       * elf/dl-load.c (lose): Don't remove the element from the list.
825
 
+       (_dl_map_object_from_fd): Invoke _dl_add_to_namespace_list.
826
 
+       (_dl_map_object): Likewise.
827
 
+
828
 
+2010-10-25  Ulrich Drepper  <drepper@redhat.com>
829
 
+
830
 
+       [BZ #12159]
831
 
+       * sysdeps/x86_64/multiarch/strchr.S: Fix propagation of search byte
832
 
+       into all bytes of SSE register.
833
 
+       Patch by Richard Li <richardpku@gmail.com>.
834
 
+
835
 
+2010-10-22  Andreas Schwab  <schwab@redhat.com>
836
 
+
837
 
+       * include/dlfcn.h (__RTLD_SECURE): Define.
838
 
+       * elf/dl-load.c (_dl_map_object): Remove preloaded parameter.  Use
839
 
+       mode & __RTLD_SECURE instead.
840
 
+       (open_path): Rename preloaded parameter to secure.
841
 
+       * sysdeps/generic/ldsodefs.h (_dl_map_object): Adjust declaration.
842
 
+       * elf/dl-open.c (dl_open_worker): Adjust call to _dl_map_object.
843
 
+       * elf/dl-deps.c (openaux): Likewise.
844
 
+       * elf/rtld.c (struct map_args): Remove is_preloaded.
845
 
+       (map_doit): Don't use it.
846
 
+       (dl_main): Likewise.
847
 
+       (do_preload): Use __RTLD_SECURE instead of is_preloaded.
848
 
+       (dlmopen_doit): Add __RTLD_SECURE to mode bits.
849
 
+
850
 
+2010-10-06  Ulrich Drepper  <drepper@gmail.com>
851
 
+
852
 
+       * string/bug-strstr1.c: New file.
853
 
+       * string/Makefile: Add rules to build and run bug-strstr1.
854
 
+
855
 
+2010-10-05  Eric Blake  <eblake@redhat.com>
856
 
+
857
 
+       [BZ #12092]
858
 
+       * string/str-two-way.h (two_way_long_needle): Always clear memory
859
 
+       when skipping input due to the shift table.
860
 
+
861
 
+2010-10-03  Ulrich Drepper  <drepper@gmail.com>
862
 
+
863
 
+       [BZ #12077]
864
 
+       * sysdeps/x86_64/strcmp.S: Fix handling of remaining bytes in buffer
865
 
+       for strncmp.
866
 
+       * string/stratcliff.c: Add tests for strcmp and strncmp.
867
 
+       * wcsmbs/wcsatcliff.c: Adjust for stratcliff change.
868
 
+
869
 
+2010-08-19  Andreas Schwab  <schwab@redhat.com>
870
 
+
871
 
+       * sysdeps/i386/i686/multiarch/strspn.S [!SHARED]: Fix SSE4.2 check.
872
 
+
873
 
+2010-08-06  Ulrich Drepper  <drepper@redhat.com>
874
 
+
875
 
+       * sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid):
876
 
+       Also fail if tpwd after pwuid call is NULL.
877
 
+
878
 
+2010-06-21  Andreas Schwab <schwab@redhat.com>
879
 
+
880
 
+       * sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid):
881
 
+       Restore proper fallback handling.
882
 
+
883
 
+2010-06-19  Ulrich Drepper  <drepper@redhat.com>
884
 
+
885
 
+       * sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): Handle
886
 
+       OOM in getpwuid_r correctly.  Return error number when the caller
887
 
+       should return, otherwise -1.
888
 
+       (getlogin_r): Adjust to return also for result of __getlogin_r_loginuid
889
 
+       call returning > 0 value.
890
 
+       * sysdeps/unix/sysv/linux/getlogin.c (getlogin): Likewise.
891
 
+
892
 
+2010-07-27  Andreas Schwab  <schwab@redhat.com>
893
 
+
894
 
        * version.h (VERSION): Bump for 2.12.1 release.
895
 
 
896
 
 2010-06-02  Kirill A. Shutemov  <kirill@shutemov.name>
897
 
--- a/sysdeps/unix/sysv/linux/sparc/sys/epoll.h (revision 11211)
898
 
+++ b/sysdeps/unix/sysv/linux/sparc/sys/epoll.h (revision 12365)
899
 
@@ -1,4 +1,4 @@
900
 
-/* Copyright (C) 2002-2006, 2007, 2008 Free Software Foundation, Inc.
901
 
+/* Copyright (C) 2002-2006, 2007, 2008, 2010 Free Software Foundation, Inc.
902
 
    This file is part of the GNU C Library.
903
 
 
904
 
    The GNU C Library is free software; you can redistribute it and/or
905
 
@@ -31,7 +31,7 @@
906
 
 #endif
907
 
 
908
 
 
909
 
-/* Flags to be passed to epoll_create2.  */
910
 
+/* Flags to be passed to epoll_create1.  */
911
 
 enum
912
 
   {
913
 
     EPOLL_CLOEXEC = 0x400000,
914
 
@@ -101,8 +101,9 @@
915
 
    returned by epoll_create() should be closed with close().  */
916
 
 extern int epoll_create (int __size) __THROW;
917
 
 
918
 
-/* Same as epoll_create but with an additional FLAGS parameter.  */
919
 
-extern int epoll_create2 (int __size, int __flags) __THROW;
920
 
+/* Same as epoll_create but with an FLAGS parameter.  The unused SIZE
921
 
+   parameter has been dropped.  */
922
 
+extern int epoll_create1 (int __flags) __THROW;
923
 
 
924
 
 
925
 
 /* Manipulate an epoll instance "epfd". Returns 0 in case of success,
926
 
--- a/sysdeps/unix/sysv/linux/i386/bits/mman.h  (revision 11211)
927
 
+++ b/sysdeps/unix/sysv/linux/i386/bits/mman.h  (revision 12365)
928
 
@@ -1,5 +1,6 @@
929
 
 /* Definitions for POSIX memory map interface.  Linux/i386 version.
930
 
-   Copyright (C) 1997,2000,2003,2005,2006,2009 Free Software Foundation, Inc.
931
 
+   Copyright (C) 1997,2000,2003,2005,2006,2009,2010
932
 
+   Free Software Foundation, Inc.
933
 
    This file is part of the GNU C Library.
934
 
 
935
 
    The GNU C Library is free software; you can redistribute it and/or
936
 
@@ -64,6 +65,7 @@
937
 
 # define MAP_POPULATE  0x08000         /* Populate (prefault) pagetables.  */
938
 
 # define MAP_NONBLOCK  0x10000         /* Do not block on IO.  */
939
 
 # define MAP_STACK     0x20000         /* Allocation is for a stack.  */
940
 
+# define MAP_HUGETLB   0x40000         /* Create huge page mapping.  */
941
 
 #endif
942
 
 
943
 
 /* Flags to `msync'.  */
944
 
--- a/sysdeps/unix/sysv/linux/ttyname_r.c       (revision 11211)
945
 
+++ b/sysdeps/unix/sysv/linux/ttyname_r.c       (revision 12365)
946
 
@@ -1,4 +1,5 @@
947
 
-/* Copyright (C) 1991,92,93,1995-2001,2003,2006 Free Software Foundation, Inc.
948
 
+/* Copyright (C) 1991-1993,1995-2001,2003,2006,2010
949
 
+   Free Software Foundation, Inc.
950
 
    This file is part of the GNU C Library.
951
 
 
952
 
    The GNU C Library is free software; you can redistribute it and/or
953
 
@@ -122,6 +123,9 @@
954
 
   if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
955
 
     return errno;
956
 
 
957
 
+  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
958
 
+    return errno;
959
 
+
960
 
   /* We try using the /proc filesystem.  */
961
 
   *_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';
962
 
 
963
 
@@ -145,13 +149,31 @@
964
 
 #endif
965
 
                        , 1))
966
 
     {
967
 
+#define UNREACHABLE_LEN strlen ("(unreachable)")
968
 
+      if (ret > UNREACHABLE_LEN
969
 
+         && memcmp (buf, "(unreachable)", UNREACHABLE_LEN) == 0)
970
 
+       {
971
 
+         memmove (buf, buf + UNREACHABLE_LEN, ret - UNREACHABLE_LEN);
972
 
+         ret -= UNREACHABLE_LEN;
973
 
+       }
974
 
+
975
 
+      /* readlink need not terminate the string.  */
976
 
       buf[ret] = '\0';
977
 
-      return 0;
978
 
+
979
 
+      /* Verify readlink result, fall back on iterating through devices.  */
980
 
+      if (buf[0] == '/'
981
 
+         && __xstat64 (_STAT_VER, buf, &st1) == 0
982
 
+#ifdef _STATBUF_ST_RDEV
983
 
+         && S_ISCHR (st1.st_mode)
984
 
+         && st1.st_rdev == st.st_rdev
985
 
+#else
986
 
+         && st1.st_ino == st.st_ino
987
 
+         && st1.st_dev == st.st_dev
988
 
+#endif
989
 
+         )
990
 
+       return 0;
991
 
     }
992
 
 
993
 
-  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
994
 
-    return errno;
995
 
-
996
 
   /* Prepare the result buffer.  */
997
 
   memcpy (buf, "/dev/pts/", sizeof ("/dev/pts/"));
998
 
   buflen -= sizeof ("/dev/pts/") - 1;
999
 
--- a/sysdeps/unix/sysv/linux/getlogin.c        (revision 11211)
1000
 
+++ b/sysdeps/unix/sysv/linux/getlogin.c        (revision 12365)
1001
 
@@ -32,8 +32,9 @@
1002
 
 char *
1003
 
 getlogin (void)
1004
 
 {
1005
 
-  if (__getlogin_r_loginuid (name, sizeof (name)) == 0)
1006
 
-    return name;
1007
 
+  int res = __getlogin_r_loginuid (name, sizeof (name));
1008
 
+  if (res >= 0)
1009
 
+    return res == 0 ? name : NULL;
1010
 
 
1011
 
   return getlogin_fd0 ();
1012
 
 }
1013
 
--- a/sysdeps/unix/sysv/linux/ttyname.c (revision 11211)
1014
 
+++ b/sysdeps/unix/sysv/linux/ttyname.c (revision 12365)
1015
 
@@ -1,4 +1,5 @@
1016
 
-/* Copyright (C) 1991,92,93,1996-2002,2006,2009 Free Software Foundation, Inc.
1017
 
+/* Copyright (C) 1991-1993,1996-2002,2006,2009,2010
1018
 
+   Free Software Foundation, Inc.
1019
 
    This file is part of the GNU C Library.
1020
 
 
1021
 
    The GNU C Library is free software; you can redistribute it and/or
1022
 
@@ -131,6 +132,9 @@
1023
 
   if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
1024
 
     return NULL;
1025
 
 
1026
 
+  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
1027
 
+    return NULL;
1028
 
+
1029
 
   /* We try using the /proc filesystem.  */
1030
 
   *_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';
1031
 
 
1032
 
@@ -161,14 +165,33 @@
1033
 
     {
1034
 
       if ((size_t) len >= buflen)
1035
 
        return NULL;
1036
 
+
1037
 
+#define UNREACHABLE_LEN strlen ("(unreachable)")
1038
 
+      if (len > UNREACHABLE_LEN
1039
 
+         && memcmp (ttyname_buf, "(unreachable)", UNREACHABLE_LEN) == 0)
1040
 
+       {
1041
 
+         memmove (ttyname_buf, ttyname_buf + UNREACHABLE_LEN,
1042
 
+                  len - UNREACHABLE_LEN);
1043
 
+         len -= UNREACHABLE_LEN;
1044
 
+       }
1045
 
+
1046
 
       /* readlink need not terminate the string.  */
1047
 
       ttyname_buf[len] = '\0';
1048
 
-      return ttyname_buf;
1049
 
+
1050
 
+      /* Verify readlink result, fall back on iterating through devices.  */
1051
 
+      if (ttyname_buf[0] == '/'
1052
 
+         && __xstat64 (_STAT_VER, ttyname_buf, &st1) == 0
1053
 
+#ifdef _STATBUF_ST_RDEV
1054
 
+         && S_ISCHR (st1.st_mode)
1055
 
+         && st1.st_rdev == st.st_rdev
1056
 
+#else
1057
 
+         && st1.st_ino == st.st_ino
1058
 
+         && st1.st_dev == st.st_dev
1059
 
+#endif
1060
 
+         )
1061
 
+       return ttyname_buf;
1062
 
     }
1063
 
 
1064
 
-  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
1065
 
-    return NULL;
1066
 
-
1067
 
   if (__xstat64 (_STAT_VER, "/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode))
1068
 
     {
1069
 
 #ifdef _STATBUF_ST_RDEV
1070
 
--- a/sysdeps/unix/sysv/linux/sys/swap.h        (revision 11211)
1071
 
+++ b/sysdeps/unix/sysv/linux/sys/swap.h        (revision 12365)
1072
 
@@ -1,5 +1,5 @@
1073
 
 /* Calls to enable and disable swapping on specified locations.  Linux version.
1074
 
-   Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
1075
 
+   Copyright (C) 1996, 1998, 1999, 2010 Free Software Foundation, Inc.
1076
 
    This file is part of the GNU C Library.
1077
 
 
1078
 
    The GNU C Library is free software; you can redistribute it and/or
1079
 
@@ -28,6 +28,7 @@
1080
 
 #define        SWAP_FLAG_PREFER        0x8000  /* Set if swap priority is specified. */
1081
 
 #define        SWAP_FLAG_PRIO_MASK     0x7fff
1082
 
 #define        SWAP_FLAG_PRIO_SHIFT    0
1083
 
+#define SWAP_FLAG_DISCARD      0x10000 /* Discard swap cluster after use.  */
1084
 
 
1085
 
 __BEGIN_DECLS
1086
 
 
1087
 
--- a/sysdeps/unix/sysv/linux/check_pf.c        (revision 11211)
1088
 
+++ b/sysdeps/unix/sysv/linux/check_pf.c        (revision 12365)
1089
 
@@ -1,5 +1,5 @@
1090
 
 /* Determine protocol families for which interfaces exist.  Linux version.
1091
 
-   Copyright (C) 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
1092
 
+   Copyright (C) 2003, 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
1093
 
    This file is part of the GNU C Library.
1094
 
 
1095
 
    The GNU C Library is free software; you can redistribute it and/or
1096
 
@@ -304,10 +304,13 @@
1097
 
 
1098
 
   struct ifaddrs *runp;
1099
 
   for (runp = ifa; runp != NULL; runp = runp->ifa_next)
1100
 
-    if (runp->ifa_addr->sa_family == PF_INET)
1101
 
-      *seen_ipv4 = true;
1102
 
-    else if (runp->ifa_addr->sa_family == PF_INET6)
1103
 
-      *seen_ipv6 = true;
1104
 
+    if (runp->ifa_addr != NULL)
1105
 
+      {
1106
 
+       if (runp->ifa_addr->sa_family == PF_INET)
1107
 
+         *seen_ipv4 = true;
1108
 
+       else if (runp->ifa_addr->sa_family == PF_INET6)
1109
 
+         *seen_ipv6 = true;
1110
 
+      }
1111
 
 
1112
 
   (void) freeifaddrs (ifa);
1113
 
 #endif
1114
 
--- a/sysdeps/unix/sysv/linux/getdents.c        (revision 11211)
1115
 
+++ b/sysdeps/unix/sysv/linux/getdents.c        (revision 12365)
1116
 
@@ -1,4 +1,4 @@
1117
 
-/* Copyright (C) 1993, 1995-2003, 2004, 2006, 2007
1118
 
+/* Copyright (C) 1993, 1995-2004, 2006, 2007, 2010
1119
 
    Free Software Foundation, Inc.
1120
 
    This file is part of the GNU C Library.
1121
 
 
1122
 
@@ -285,7 +285,11 @@
1123
 
        DIRENT_SET_DP_INO(dp, kdp->d_ino);
1124
 
        dp->d_off = kdp->d_off;
1125
 
        dp->d_reclen = new_reclen;
1126
 
+#ifdef __ASSUME_GETDENTS32_D_TYPE
1127
 
+       dp->d_type = *((char *) kdp + kdp->d_reclen - 1);
1128
 
+#else
1129
 
        dp->d_type = DT_UNKNOWN;
1130
 
+#endif
1131
 
        memcpy (dp->d_name, kdp->d_name,
1132
 
                kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
1133
 
 
1134
 
--- a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S  (revision 11211)
1135
 
+++ b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S  (revision 12365)
1136
 
@@ -1,4 +1,4 @@
1137
 
-/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
1138
 
+/* Copyright (C) 2001,2004,2005,2006,2009,2010 Free Software Foundation, Inc.
1139
 
    This file is part of the GNU C Library.
1140
 
 
1141
 
    The GNU C Library is free software; you can redistribute it and/or
1142
 
@@ -49,9 +49,9 @@
1143
 
        .text
1144
 
 ENTRY(____longjmp_chk)
1145
 
        /* Restore registers.  */
1146
 
-       movq    (JB_RSP*8)(%rdi),%r8
1147
 
-       movq    (JB_RBP*8)(%rdi),%r9
1148
 
-       movq    (JB_PC*8)(%rdi),%rdx
1149
 
+       movq    (JB_RSP*8)(%rdi), %r8
1150
 
+       movq    (JB_RBP*8)(%rdi), %r9
1151
 
+       movq    (JB_PC*8)(%rdi), %rdx
1152
 
 #ifdef PTR_DEMANGLE
1153
 
        PTR_DEMANGLE (%r8)
1154
 
        PTR_DEMANGLE (%r9)
1155
 
@@ -63,7 +63,9 @@
1156
 
 
1157
 
        /* Save function parameters.  */
1158
 
        movq    %rdi, %r10
1159
 
-       movl    %esi, %ecx
1160
 
+       cfi_register (%rdi, %r10)
1161
 
+       movl    %esi, %ebx
1162
 
+       cfi_register (%rsi, %rbx)
1163
 
 
1164
 
        xorl    %edi, %edi
1165
 
        leaq    -24(%rsp), %rsi
1166
 
@@ -84,7 +86,9 @@
1167
 
 .Lfail:        CALL_FAIL
1168
 
 
1169
 
 .Lok2: movq    %r10, %rdi
1170
 
-       movl    %ecx, %esi
1171
 
+       cfi_restore (%rdi)
1172
 
+       movl    %ebx, %esi
1173
 
+       cfi_restore (%rsi)
1174
 
 
1175
 
 .Lok:  /* We add unwind information for the target here.  */
1176
 
        cfi_def_cfa(%rdi, 0)
1177
 
@@ -96,11 +100,11 @@
1178
 
        cfi_offset(%r13,JB_R13*8)
1179
 
        cfi_offset(%r14,JB_R14*8)
1180
 
        cfi_offset(%r15,JB_R15*8)
1181
 
-       movq    (JB_RBX*8)(%rdi),%rbx
1182
 
-       movq    (JB_R12*8)(%rdi),%r12
1183
 
-       movq    (JB_R13*8)(%rdi),%r13
1184
 
-       movq    (JB_R14*8)(%rdi),%r14
1185
 
-       movq    (JB_R15*8)(%rdi),%r15
1186
 
+       movq    (JB_RBX*8)(%rdi), %rbx
1187
 
+       movq    (JB_R12*8)(%rdi), %r12
1188
 
+       movq    (JB_R13*8)(%rdi), %r13
1189
 
+       movq    (JB_R14*8)(%rdi), %r14
1190
 
+       movq    (JB_R15*8)(%rdi), %r15
1191
 
        /* Set return value for setjmp.  */
1192
 
        movl    %esi, %eax
1193
 
        movq    %r8,%rsp
1194
 
--- a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h        (revision 11211)
1195
 
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h        (revision 12365)
1196
 
@@ -1,5 +1,5 @@
1197
 
 /* Definitions for POSIX memory map interface.  Linux/x86_64 version.
1198
 
-   Copyright (C) 2001, 2003, 2005, 2006, 2009 Free Software Foundation, Inc.
1199
 
+   Copyright (C) 2001,2003,2005,2006,2009,2010 Free Software Foundation, Inc.
1200
 
    This file is part of the GNU C Library.
1201
 
 
1202
 
    The GNU C Library is free software; you can redistribute it and/or
1203
 
@@ -65,6 +65,7 @@
1204
 
 # define MAP_POPULATE  0x08000         /* Populate (prefault) pagetables.  */
1205
 
 # define MAP_NONBLOCK  0x10000         /* Do not block on IO.  */
1206
 
 # define MAP_STACK     0x20000         /* Allocation is for a stack.  */
1207
 
+# define MAP_HUGETLB   0x40000         /* Create huge page mapping.  */
1208
 
 #endif
1209
 
 
1210
 
 /* Flags to `msync'.  */
1211
 
--- a/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h        (revision 11211)
1212
 
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h        (revision 12365)
1213
 
@@ -1,4 +1,4 @@
1214
 
-/* Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
1215
 
+/* Copyright (C) 2002-2008, 2010 Free Software Foundation, Inc.
1216
 
    This file is part of the GNU C Library.
1217
 
 
1218
 
    The GNU C Library is free software; you can redistribute it and/or
1219
 
@@ -31,7 +31,7 @@
1220
 
 #endif
1221
 
 
1222
 
 
1223
 
-/* Flags to be passed to epoll_create2.  */
1224
 
+/* Flags to be passed to epoll_create1.  */
1225
 
 enum
1226
 
   {
1227
 
     EPOLL_CLOEXEC = 02000000,
1228
 
--- a/sysdeps/unix/sysv/linux/internal_statvfs.c        (revision 11211)
1229
 
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.c        (revision 12365)
1230
 
@@ -221,7 +221,8 @@
1231
 
   buf->f_files = fsbuf->f_files;
1232
 
   buf->f_ffree = fsbuf->f_ffree;
1233
 
   if (sizeof (buf->f_fsid) == sizeof (fsbuf->f_fsid))
1234
 
-    buf->f_fsid = (fsbuf->f_fsid.__val[0]
1235
 
+    buf->f_fsid = ((fsbuf->f_fsid.__val[0]
1236
 
+                   & ((1UL << (8 * sizeof (fsbuf->f_fsid.__val[0]))) - 1))
1237
 
                   | ((unsigned long int) fsbuf->f_fsid.__val[1]
1238
 
                      << (8 * (sizeof (buf->f_fsid)
1239
 
                               - sizeof (fsbuf->f_fsid.__val[0])))));
1240
 
--- a/sysdeps/unix/sysv/linux/getlogin_r.c      (revision 11211)
1241
 
+++ b/sysdeps/unix/sysv/linux/getlogin_r.c      (revision 12365)
1242
 
@@ -27,6 +27,10 @@
1243
 
 #undef getlogin_r
1244
 
 
1245
 
 
1246
 
+/* Try to determine login name from /proc/self/loginuid and return 0
1247
 
+   if successful.  If /proc/self/loginuid cannot be read return -1.
1248
 
+   Otherwise return the error number.  */
1249
 
+
1250
 
 int
1251
 
 attribute_hidden
1252
 
 __getlogin_r_loginuid (name, namesize)
1253
 
@@ -35,7 +39,7 @@
1254
 
 {
1255
 
   int fd = open_not_cancel_2 ("/proc/self/loginuid", O_RDONLY);
1256
 
   if (fd == -1)
1257
 
-    return 1;
1258
 
+    return -1;
1259
 
 
1260
 
   /* We are reading a 32-bit number.  12 bytes are enough for the text
1261
 
      representation.  If not, something is wrong.  */
1262
 
@@ -51,37 +55,38 @@
1263
 
       || (uidbuf[n] = '\0',
1264
 
          uid = strtoul (uidbuf, &endp, 10),
1265
 
          endp == uidbuf || *endp != '\0'))
1266
 
-    return 1;
1267
 
+    return -1;
1268
 
 
1269
 
   size_t buflen = 1024;
1270
 
   char *buf = alloca (buflen);
1271
 
   bool use_malloc = false;
1272
 
   struct passwd pwd;
1273
 
   struct passwd *tpwd;
1274
 
+  int result = 0;
1275
 
   int res;
1276
 
 
1277
 
-  while ((res = __getpwuid_r (uid, &pwd, buf, buflen, &tpwd)) != 0)
1278
 
+  while ((res = __getpwuid_r (uid, &pwd, buf, buflen, &tpwd)) == ERANGE)
1279
 
     if (__libc_use_alloca (2 * buflen))
1280
 
-      extend_alloca (buf, buflen, 2 * buflen);
1281
 
+      buf = extend_alloca (buf, buflen, 2 * buflen);
1282
 
     else
1283
 
       {
1284
 
        buflen *= 2;
1285
 
        char *newp = realloc (use_malloc ? buf : NULL, buflen);
1286
 
        if (newp == NULL)
1287
 
          {
1288
 
-         fail:
1289
 
-           if (use_malloc)
1290
 
-             free (buf);
1291
 
-           return 1;
1292
 
+           result = ENOMEM;
1293
 
+           goto out;
1294
 
          }
1295
 
        buf = newp;
1296
 
        use_malloc = true;
1297
 
       }
1298
 
 
1299
 
-  if (tpwd == NULL)
1300
 
-    goto fail;
1301
 
+  if (res != 0 || tpwd == NULL)
1302
 
+    {
1303
 
+      result = -1;
1304
 
+      goto out;
1305
 
+    }
1306
 
 
1307
 
-  int result = 0;
1308
 
   size_t needed = strlen (pwd.pw_name) + 1;
1309
 
   if (needed > namesize)
1310
 
     {
1311
 
@@ -109,8 +114,9 @@
1312
 
      char *name;
1313
 
      size_t namesize;
1314
 
 {
1315
 
-  if (__getlogin_r_loginuid (name, namesize) == 0)
1316
 
-    return 0;
1317
 
+  int res = __getlogin_r_loginuid (name, namesize);
1318
 
+  if (res >= 0)
1319
 
+    return res;
1320
 
 
1321
 
   return getlogin_r_fd0 (name, namesize);
1322
 
 }
1323
 
--- a/sysdeps/i386/bits/byteswap.h      (revision 11211)
1324
 
+++ b/sysdeps/i386/bits/byteswap.h      (revision 12365)
1325
 
@@ -1,5 +1,5 @@
1326
 
 /* Macros to swap the order of bytes in integer values.
1327
 
-   Copyright (C) 1997, 1998, 2000, 2002, 2003, 2006, 2007, 2008
1328
 
+   Copyright (C) 1997, 1998, 2000, 2002, 2003, 2006, 2007, 2008, 2010
1329
 
    Free Software Foundation, Inc.
1330
 
    This file is part of the GNU C Library.
1331
 
 
1332
 
@@ -27,26 +27,27 @@
1333
 
 
1334
 
 /* Swap bytes in 16 bit value.  */
1335
 
 #define __bswap_constant_16(x) \
1336
 
-     ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
1337
 
+     ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
1338
 
 
1339
 
 #ifdef __GNUC__
1340
 
 # if __GNUC__ >= 2
1341
 
 #  define __bswap_16(x) \
1342
 
      (__extension__                                                          \
1343
 
-      ({ register unsigned short int __v, __x = (x);                         \
1344
 
+      ({ register unsigned short int __v, __x = (unsigned short int) (x);     \
1345
 
         if (__builtin_constant_p (__x))                                      \
1346
 
           __v = __bswap_constant_16 (__x);                                   \
1347
 
         else                                                                 \
1348
 
           __asm__ ("rorw $8, %w0"                                            \
1349
 
                    : "=r" (__v)                                              \
1350
 
-                   : "0" (__x)                                               \
1351
 
-                   : "cc");                                                  \
1352
 
+                   : "0" (__x)                                               \
1353
 
+                   : "cc");                                                  \
1354
 
         __v; }))
1355
 
 # else
1356
 
 /* This is better than nothing.  */
1357
 
 #  define __bswap_16(x) \
1358
 
      (__extension__                                                          \
1359
 
-      ({ register unsigned short int __x = (x); __bswap_constant_16 (__x); }))
1360
 
+      ({ register unsigned short int __x = (unsigned short int) (x);         \
1361
 
+        __bswap_constant_16 (__x); }))
1362
 
 # endif
1363
 
 #else
1364
 
 static __inline unsigned short int
1365
 
@@ -122,7 +123,7 @@
1366
 
      (__extension__                                                          \
1367
 
       ({ union { __extension__ unsigned long long int __ll;                  \
1368
 
                 unsigned long int __l[2]; } __w, __r;                        \
1369
 
-         if (__builtin_constant_p (x))                                       \
1370
 
+        if (__builtin_constant_p (x))                                        \
1371
 
           __r.__ll = __bswap_constant_64 (x);                                \
1372
 
         else                                                                 \
1373
 
           {                                                                  \
1374
 
--- a/sysdeps/i386/i686/multiarch/strspn.S      (revision 11211)
1375
 
+++ b/sysdeps/i386/i686/multiarch/strspn.S      (revision 12365)
1376
 
@@ -1,5 +1,5 @@
1377
 
 /* Multiple versions of strspn
1378
 
-   Copyright (C) 2009 Free Software Foundation, Inc.
1379
 
+   Copyright (C) 2009,2010 Free Software Foundation, Inc.
1380
 
    Contributed by Intel Corporation.
1381
 
    This file is part of the GNU C Library.
1382
 
 
1383
 
@@ -65,7 +65,7 @@
1384
 
        jne     1f
1385
 
        call    __init_cpu_features
1386
 
 1:     leal    __strspn_ia32, %eax
1387
 
-       testl   $index_SSE2, CPUID_OFFSET+index_SSE4_2+__cpu_features
1388
 
+       testl   $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features
1389
 
        jz      2f
1390
 
        leal    __strspn_sse42, %eax
1391
 
 2:     ret
1392
 
--- a/sysdeps/i386/i686/cacheinfo.c     (revision 11211)
1393
 
+++ b/sysdeps/i386/i686/cacheinfo.c     (revision 12365)
1394
 
@@ -1,7 +1,11 @@
1395
 
 #define __x86_64_data_cache_size __x86_data_cache_size
1396
 
+#define __x86_64_raw_data_cache_size __x86_raw_data_cache_size
1397
 
 #define __x86_64_data_cache_size_half __x86_data_cache_size_half
1398
 
+#define __x86_64_raw_data_cache_size_half __x86_raw_data_cache_size_half
1399
 
 #define __x86_64_shared_cache_size __x86_shared_cache_size
1400
 
+#define __x86_64_raw_shared_cache_size __x86_raw_shared_cache_size
1401
 
 #define __x86_64_shared_cache_size_half __x86_shared_cache_size_half
1402
 
+#define __x86_64_raw_shared_cache_size_half __x86_raw_shared_cache_size_half
1403
 
 
1404
 
 #define DISABLE_PREFETCHW
1405
 
 #define DISABLE_PREFERRED_MEMORY_INSTRUCTION
1406
 
--- a/sysdeps/x86_64/strcmp.S   (revision 11211)
1407
 
+++ b/sysdeps/x86_64/strcmp.S   (revision 12365)
1408
 
@@ -320,7 +320,7 @@
1409
 
        jnz     LABEL(ashr_1_exittail)  /* find null char*/
1410
 
 
1411
 
 # ifdef USE_AS_STRNCMP
1412
 
-       cmp     $14, %r11
1413
 
+       cmp     $15, %r11
1414
 
        jbe     LABEL(ashr_1_exittail)
1415
 
 # endif
1416
 
 
1417
 
@@ -445,7 +445,7 @@
1418
 
        jnz     LABEL(ashr_2_exittail)
1419
 
 
1420
 
 # ifdef USE_AS_STRNCMP
1421
 
-       cmp     $13, %r11
1422
 
+       cmp     $14, %r11
1423
 
        jbe     LABEL(ashr_2_exittail)
1424
 
 # endif
1425
 
 
1426
 
@@ -567,7 +567,7 @@
1427
 
        jnz     LABEL(ashr_3_exittail)
1428
 
 
1429
 
 # ifdef USE_AS_STRNCMP
1430
 
-       cmp     $12, %r11
1431
 
+       cmp     $13, %r11
1432
 
        jbe     LABEL(ashr_3_exittail)
1433
 
 # endif
1434
 
 
1435
 
@@ -689,7 +689,7 @@
1436
 
        jnz     LABEL(ashr_4_exittail)
1437
 
 
1438
 
 # ifdef USE_AS_STRNCMP
1439
 
-       cmp     $11, %r11
1440
 
+       cmp     $12, %r11
1441
 
        jbe     LABEL(ashr_4_exittail)
1442
 
 # endif
1443
 
 
1444
 
@@ -811,7 +811,7 @@
1445
 
        jnz     LABEL(ashr_5_exittail)
1446
 
 
1447
 
 # ifdef USE_AS_STRNCMP
1448
 
-       cmp     $10, %r11
1449
 
+       cmp     $11, %r11
1450
 
        jbe     LABEL(ashr_5_exittail)
1451
 
 # endif
1452
 
 
1453
 
@@ -933,7 +933,7 @@
1454
 
        jnz     LABEL(ashr_6_exittail)
1455
 
 
1456
 
 # ifdef USE_AS_STRNCMP
1457
 
-       cmp     $9, %r11
1458
 
+       cmp     $10, %r11
1459
 
        jbe     LABEL(ashr_6_exittail)
1460
 
 # endif
1461
 
 
1462
 
@@ -1055,7 +1055,7 @@
1463
 
        jnz     LABEL(ashr_7_exittail)
1464
 
 
1465
 
 # ifdef USE_AS_STRNCMP
1466
 
-       cmp     $8, %r11
1467
 
+       cmp     $9, %r11
1468
 
        jbe     LABEL(ashr_7_exittail)
1469
 
 # endif
1470
 
 
1471
 
@@ -1177,7 +1177,7 @@
1472
 
        jnz     LABEL(ashr_8_exittail)
1473
 
 
1474
 
 # ifdef USE_AS_STRNCMP
1475
 
-       cmp     $7, %r11
1476
 
+       cmp     $8, %r11
1477
 
        jbe     LABEL(ashr_8_exittail)
1478
 
 # endif
1479
 
 
1480
 
@@ -1299,7 +1299,7 @@
1481
 
        jnz     LABEL(ashr_9_exittail)
1482
 
 
1483
 
 # ifdef USE_AS_STRNCMP
1484
 
-       cmp     $6, %r11
1485
 
+       cmp     $7, %r11
1486
 
        jbe     LABEL(ashr_9_exittail)
1487
 
 # endif
1488
 
 
1489
 
@@ -1421,7 +1421,7 @@
1490
 
        jnz     LABEL(ashr_10_exittail)
1491
 
 
1492
 
 # ifdef USE_AS_STRNCMP
1493
 
-       cmp     $5, %r11
1494
 
+       cmp     $6, %r11
1495
 
        jbe     LABEL(ashr_10_exittail)
1496
 
 # endif
1497
 
 
1498
 
@@ -1543,7 +1543,7 @@
1499
 
        jnz     LABEL(ashr_11_exittail)
1500
 
 
1501
 
 # ifdef USE_AS_STRNCMP
1502
 
-       cmp     $4, %r11
1503
 
+       cmp     $5, %r11
1504
 
        jbe     LABEL(ashr_11_exittail)
1505
 
 # endif
1506
 
 
1507
 
@@ -1665,7 +1665,7 @@
1508
 
        jnz     LABEL(ashr_12_exittail)
1509
 
 
1510
 
 # ifdef USE_AS_STRNCMP
1511
 
-       cmp     $3, %r11
1512
 
+       cmp     $4, %r11
1513
 
        jbe     LABEL(ashr_12_exittail)
1514
 
 # endif
1515
 
 
1516
 
@@ -1787,7 +1787,7 @@
1517
 
        jnz     LABEL(ashr_13_exittail)
1518
 
 
1519
 
 # ifdef USE_AS_STRNCMP
1520
 
-       cmp     $2, %r11
1521
 
+       cmp     $3, %r11
1522
 
        jbe     LABEL(ashr_13_exittail)
1523
 
 # endif
1524
 
 
1525
 
@@ -1909,7 +1909,7 @@
1526
 
        jnz     LABEL(ashr_14_exittail)
1527
 
 
1528
 
 # ifdef USE_AS_STRNCMP
1529
 
-       cmp     $1, %r11
1530
 
+       cmp     $2, %r11
1531
 
        jbe     LABEL(ashr_14_exittail)
1532
 
 # endif
1533
 
 
1534
 
@@ -2033,8 +2033,8 @@
1535
 
        jnz     LABEL(ashr_15_exittail)
1536
 
 
1537
 
 # ifdef USE_AS_STRNCMP
1538
 
-       test    %r11, %r11
1539
 
-       je      LABEL(ashr_15_exittail)
1540
 
+       cmpq    $1, %r11
1541
 
+       jbe     LABEL(ashr_15_exittail)
1542
 
 # endif
1543
 
 
1544
 
        pxor    %xmm0, %xmm0
1545
 
--- a/sysdeps/x86_64/cacheinfo.c        (revision 11211)
1546
 
+++ b/sysdeps/x86_64/cacheinfo.c        (revision 12365)
1547
 
@@ -455,13 +455,21 @@
1548
 
 
1549
 
 
1550
 
 /* Data cache size for use in memory and string routines, typically
1551
 
-   L1 size.  */
1552
 
+   L1 size, rounded to multiple of 256 bytes.  */
1553
 
 long int __x86_64_data_cache_size_half attribute_hidden = 32 * 1024 / 2;
1554
 
 long int __x86_64_data_cache_size attribute_hidden = 32 * 1024;
1555
 
+/* Similar to __x86_64_data_cache_size_half, but not rounded.  */
1556
 
+long int __x86_64_raw_data_cache_size_half attribute_hidden = 32 * 1024 / 2;
1557
 
+/* Similar to __x86_64_data_cache_size, but not rounded.  */
1558
 
+long int __x86_64_raw_data_cache_size attribute_hidden = 32 * 1024;
1559
 
 /* Shared cache size for use in memory and string routines, typically
1560
 
-   L2 or L3 size.  */
1561
 
+   L2 or L3 size, rounded to multiple of 256 bytes.  */
1562
 
 long int __x86_64_shared_cache_size_half attribute_hidden = 1024 * 1024 / 2;
1563
 
 long int __x86_64_shared_cache_size attribute_hidden = 1024 * 1024;
1564
 
+/* Similar to __x86_64_shared_cache_size_half, but not rounded.  */
1565
 
+long int __x86_64_raw_shared_cache_size_half attribute_hidden = 1024 * 1024 / 2;
1566
 
+/* Similar to __x86_64_shared_cache_size, but not rounded.  */
1567
 
+long int __x86_64_raw_shared_cache_size attribute_hidden = 1024 * 1024;
1568
 
 
1569
 
 #ifndef DISABLE_PREFETCHW
1570
 
 /* PREFETCHW support flag for use in memory and string routines.  */
1571
 
@@ -661,12 +669,20 @@
1572
 
 
1573
 
   if (data > 0)
1574
 
     {
1575
 
+      __x86_64_raw_data_cache_size_half = data / 2;
1576
 
+      __x86_64_raw_data_cache_size = data;
1577
 
+      /* Round data cache size to multiple of 256 bytes.  */
1578
 
+      data = data & ~255L;
1579
 
       __x86_64_data_cache_size_half = data / 2;
1580
 
       __x86_64_data_cache_size = data;
1581
 
     }
1582
 
 
1583
 
   if (shared > 0)
1584
 
     {
1585
 
+      __x86_64_raw_shared_cache_size_half = shared / 2;
1586
 
+      __x86_64_raw_shared_cache_size = shared;
1587
 
+      /* Round shared cache size to multiple of 256 bytes.  */
1588
 
+      shared = shared & ~255L;
1589
 
       __x86_64_shared_cache_size_half = shared / 2;
1590
 
       __x86_64_shared_cache_size = shared;
1591
 
     }
1592
 
--- a/sysdeps/x86_64/bits/byteswap.h    (revision 11211)
1593
 
+++ b/sysdeps/x86_64/bits/byteswap.h    (revision 12365)
1594
 
@@ -1,5 +1,5 @@
1595
 
 /* Macros to swap the order of bytes in integer values.
1596
 
-   Copyright (C) 1997, 1998, 2000, 2002, 2003, 2007, 2008
1597
 
+   Copyright (C) 1997, 1998, 2000, 2002, 2003, 2007, 2008, 2010
1598
 
    Free Software Foundation, Inc.
1599
 
    This file is part of the GNU C Library.
1600
 
 
1601
 
@@ -29,12 +29,12 @@
1602
 
 
1603
 
 /* Swap bytes in 16 bit value.  */
1604
 
 #define __bswap_constant_16(x) \
1605
 
-     ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
1606
 
+     ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
1607
 
 
1608
 
 #if defined __GNUC__ && __GNUC__ >= 2
1609
 
 # define __bswap_16(x) \
1610
 
      (__extension__                                                          \
1611
 
-      ({ register unsigned short int __v, __x = (x);                         \
1612
 
+      ({ register unsigned short int __v, __x = (unsigned short int) (x);     \
1613
 
         if (__builtin_constant_p (__x))                                      \
1614
 
           __v = __bswap_constant_16 (__x);                                   \
1615
 
         else                                                                 \
1616
 
@@ -47,7 +47,8 @@
1617
 
 /* This is better than nothing.  */
1618
 
 # define __bswap_16(x) \
1619
 
      (__extension__                                                          \
1620
 
-      ({ register unsigned short int __x = (x); __bswap_constant_16 (__x); }))
1621
 
+      ({ register unsigned short int __x = (unsigned short int) (x);          \
1622
 
+        __bswap_constant_16 (__x); }))
1623
 
 #endif
1624
 
 
1625
 
 
1626
 
@@ -120,16 +121,16 @@
1627
 
 #  define __bswap_64(x) \
1628
 
      (__extension__                                                           \
1629
 
       ({ union { __extension__ unsigned long long int __ll;                   \
1630
 
-                 unsigned int __l[2]; } __w, __r;                             \
1631
 
-         if (__builtin_constant_p (x))                                        \
1632
 
-           __r.__ll = __bswap_constant_64 (x);                                \
1633
 
-         else                                                                 \
1634
 
-           {                                                                  \
1635
 
-             __w.__ll = (x);                                                  \
1636
 
-             __r.__l[0] = __bswap_32 (__w.__l[1]);                            \
1637
 
-             __r.__l[1] = __bswap_32 (__w.__l[0]);                            \
1638
 
-           }                                                                  \
1639
 
-         __r.__ll; }))
1640
 
+                unsigned int __l[2]; } __w, __r;                             \
1641
 
+        if (__builtin_constant_p (x))                                        \
1642
 
+          __r.__ll = __bswap_constant_64 (x);                                \
1643
 
+        else                                                                 \
1644
 
+          {                                                                  \
1645
 
+            __w.__ll = (x);                                                  \
1646
 
+            __r.__l[0] = __bswap_32 (__w.__l[1]);                            \
1647
 
+            __r.__l[1] = __bswap_32 (__w.__l[0]);                            \
1648
 
+          }                                                                  \
1649
 
+        __r.__ll; }))
1650
 
 # endif
1651
 
 #endif
1652
 
 
1653
 
--- a/sysdeps/x86_64/multiarch/strchr.S (revision 11211)
1654
 
+++ b/sysdeps/x86_64/multiarch/strchr.S (revision 12365)
1655
 
@@ -1,5 +1,5 @@
1656
 
 /* strchr with SSE4.2
1657
 
-   Copyright (C) 2009 Free Software Foundation, Inc.
1658
 
+   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
1659
 
    This file is part of the GNU C Library.
1660
 
 
1661
 
    The GNU C Library is free software; you can redistribute it and/or
1662
 
@@ -87,13 +87,13 @@
1663
 
        pxor    %xmm2, %xmm2
1664
 
        movd    %esi, %xmm1
1665
 
        movl    %edi, %ecx
1666
 
+       pshufb  %xmm2, %xmm1
1667
 
        andl    $15, %ecx
1668
 
        movq    %rdi, %r8
1669
 
        je      L(aligned_start)
1670
 
 
1671
 
 /* Handle unaligned string.  */
1672
 
        andq    $-16, %r8
1673
 
-       pshufb  %xmm2, %xmm1
1674
 
        movdqa  (%r8), %xmm0
1675
 
        pcmpeqb  %xmm0, %xmm2
1676
 
        pcmpeqb  %xmm1, %xmm0
1677
 
--- a/sysdeps/s390/s390-32/__longjmp.c  (revision 11211)
1678
 
+++ b/sysdeps/s390/s390-32/__longjmp.c  (revision 12365)
1679
 
@@ -1,4 +1,4 @@
1680
 
-/* Copyright (C) 2000, 2001, 2005, 2009 Free Software Foundation, Inc.
1681
 
+/* Copyright (C) 2000, 2001, 2005, 2009, 2010 Free Software Foundation, Inc.
1682
 
    This file is part of the GNU C Library.
1683
 
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
1684
 
 
1685
 
@@ -29,16 +29,19 @@
1686
 
 void
1687
 
 __longjmp (__jmp_buf env, int val)
1688
 
 {
1689
 
-  register int r2 __asm ("%r2") = val == 0 ? 1 : val;
1690
 
 #ifdef PTR_DEMANGLE
1691
 
-  register uintptr_t r3 __asm ("%r3") = THREAD_GET_POINTER_GUARD ();
1692
 
-  register void *r1 __asm ("%r1") = (void *) env;
1693
 
+  uintptr_t guard = THREAD_GET_POINTER_GUARD ();
1694
 
 # ifdef CHECK_SP
1695
 
-  CHECK_SP (env, r3);
1696
 
+  CHECK_SP (env, guard);
1697
 
 # endif
1698
 
 #elif defined CHECK_SP
1699
 
   CHECK_SP (env, 0);
1700
 
 #endif
1701
 
+  register int r2 __asm ("%r2") = val == 0 ? 1 : val;
1702
 
+#ifdef PTR_DEMANGLE
1703
 
+  register uintptr_t r3 __asm ("%r3") = guard;
1704
 
+  register void *r1 __asm ("%r1") = (void *) env;
1705
 
+#endif
1706
 
   /* Restore registers and jump back.  */
1707
 
   asm volatile ("ld   %%f6,48(%1)\n\t"
1708
 
                "ld   %%f4,40(%1)\n\t"
1709
 
--- a/sysdeps/s390/s390-64/__longjmp.c  (revision 11211)
1710
 
+++ b/sysdeps/s390/s390-64/__longjmp.c  (revision 12365)
1711
 
@@ -1,4 +1,4 @@
1712
 
-/* Copyright (C) 2001, 2005, 2009 Free Software Foundation, Inc.
1713
 
+/* Copyright (C) 2001, 2005, 2009, 2010 Free Software Foundation, Inc.
1714
 
    This file is part of the GNU C Library.
1715
 
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
1716
 
 
1717
 
@@ -29,16 +29,19 @@
1718
 
 void
1719
 
 __longjmp (__jmp_buf env, int val)
1720
 
 {
1721
 
-  register long int r2 __asm ("%r2") = val == 0 ? 1 : val;
1722
 
 #ifdef PTR_DEMANGLE
1723
 
-  register uintptr_t r3 __asm ("%r3") = THREAD_GET_POINTER_GUARD ();
1724
 
-  register void *r1 __asm ("%r1") = (void *) env;
1725
 
+  uintptr_t guard = THREAD_GET_POINTER_GUARD ();
1726
 
 # ifdef CHECK_SP
1727
 
-  CHECK_SP (env, r3);
1728
 
+  CHECK_SP (env, guard);
1729
 
 # endif
1730
 
 #elif defined CHECK_SP
1731
 
   CHECK_SP (env, 0);
1732
 
 #endif
1733
 
+  register long int r2 __asm ("%r2") = val == 0 ? 1 : val;
1734
 
+#ifdef PTR_DEMANGLE
1735
 
+  register uintptr_t r3 __asm ("%r3") = guard;
1736
 
+  register void *r1 __asm ("%r1") = (void *) env;
1737
 
+#endif
1738
 
   /* Restore registers and jump back.  */
1739
 
   asm volatile ("ld   %%f7,104(%1)\n\t"
1740
 
                "ld   %%f5,96(%1)\n\t"
1741
 
--- a/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c     (revision 11211)
1742
 
+++ b/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c     (revision 12365)
1743
 
@@ -73,9 +73,9 @@
1744
 
        m = ((a.i[2] >> 20) & 0x7ff) - 54;
1745
 
       }
1746
 
       m += n;
1747
 
-      if (m > 0)
1748
 
+      if ((int) m > 0)
1749
 
        a.i[2] = (a.i[2] & 0x800fffff) | (m << 20);
1750
 
-      else if (m <= -54) {
1751
 
+      else if ((int) m <= -54) {
1752
 
        a.i[2] &= 0x80000000;
1753
 
        a.i[3] = 0;
1754
 
       } else {
1755
 
--- a/sysdeps/mach/hurd/linkat.c        (revision 11211)
1756
 
+++ b/sysdeps/mach/hurd/linkat.c        (revision 12365)
1757
 
@@ -1,5 +1,5 @@
1758
 
 /* Make a link between file names relative to open directories.  Hurd version.
1759
 
-   Copyright (C) 2006 Free Software Foundation, Inc.
1760
 
+   Copyright (C) 2006,2010 Free Software Foundation, Inc.
1761
 
    This file is part of the GNU C Library.
1762
 
 
1763
 
    The GNU C Library is free software; you can redistribute it and/or
1764
 
@@ -38,7 +38,9 @@
1765
 
   file_t oldfile, linknode, todir;
1766
 
   char *toname;
1767
 
 
1768
 
-  oldfile = __file_name_lookup_at (fromfd, flags, from, 0, 0);
1769
 
+  /* POSIX says linkat doesn't follow symlinks by default, so pass
1770
 
+     O_NOLINK.  That can be overridden by AT_SYMLINK_FOLLOW in FLAGS.  */
1771
 
+  oldfile = __file_name_lookup_at (fromfd, flags, from, O_NOLINK, 0);
1772
 
   if (oldfile == MACH_PORT_NULL)
1773
 
     return -1;
1774
 
 
1775
 
--- a/sysdeps/generic/ldsodefs.h        (revision 11211)
1776
 
+++ b/sysdeps/generic/ldsodefs.h        (revision 12365)
1777
 
@@ -832,11 +832,9 @@
1778
 
 
1779
 
 /* Open the shared object NAME and map in its segments.
1780
 
    LOADER's DT_RPATH is used in searching for NAME.
1781
 
-   If the object is already opened, returns its existing map.
1782
 
-   For preloaded shared objects PRELOADED is set to a non-zero
1783
 
-   value to allow additional security checks.  */
1784
 
+   If the object is already opened, returns its existing map.  */
1785
 
 extern struct link_map *_dl_map_object (struct link_map *loader,
1786
 
-                                       const char *name, int preloaded,
1787
 
+                                       const char *name,
1788
 
                                        int type, int trace_mode, int mode,
1789
 
                                        Lmid_t nsid)
1790
 
      internal_function attribute_hidden;
1791
 
@@ -901,8 +899,11 @@
1792
 
 extern ElfW(Addr) _dl_symbol_value (struct link_map *map, const char *name)
1793
 
      internal_function;
1794
 
 
1795
 
-/* Allocate a `struct link_map' for a new object being loaded,
1796
 
-   and enter it into the _dl_main_map list.  */
1797
 
+/* Add the new link_map NEW to the end of the namespace list.  */
1798
 
+extern void _dl_add_to_namespace_list (struct link_map *new, Lmid_t nsid)
1799
 
+     internal_function attribute_hidden;
1800
 
+
1801
 
+/* Allocate a `struct link_map' for a new object being loaded.  */
1802
 
 extern struct link_map *_dl_new_object (char *realname, const char *libname,
1803
 
                                        int type, struct link_map *loader,
1804
 
                                        int mode, Lmid_t nsid)
1805
 
--- a/sysdeps/generic/netinet/ip.h      (revision 11211)
1806
 
+++ b/sysdeps/generic/netinet/ip.h      (revision 12365)
1807
 
@@ -1,5 +1,4 @@
1808
 
-/* Copyright (C) 1991,92,93,95,96,97,98,99,2000,2009 Free Software
1809
 
-   Foundation, Inc.
1810
 
+/* Copyright (C) 1991-1993,1995-2000,2009,2010 Free Software Foundation, Inc.
1811
 
    This file is part of the GNU C Library.
1812
 
 
1813
 
    The GNU C Library is free software; you can redistribute it and/or
1814
 
@@ -194,7 +193,7 @@
1815
 
  */
1816
 
 
1817
 
 #define        IPTOS_CLASS_MASK                0xe0
1818
 
-#define        IPTOS_CLASS(class)              ((tos) & IPTOS_CLASS_MASK)
1819
 
+#define        IPTOS_CLASS(class)              ((class) & IPTOS_CLASS_MASK)
1820
 
 #define        IPTOS_CLASS_CS0                 0x00
1821
 
 #define        IPTOS_CLASS_CS1                 0x20
1822
 
 #define        IPTOS_CLASS_CS2                 0x40
1823
 
--- a/hurd/hurdselect.c (revision 11211)
1824
 
+++ b/hurd/hurdselect.c (revision 12365)
1825
 
@@ -52,7 +52,7 @@
1826
 
   int firstfd, lastfd;
1827
 
   mach_msg_timeout_t to = (timeout != NULL ?
1828
 
                           (timeout->tv_sec * 1000 +
1829
 
-                           timeout->tv_nsec / 1000000) :
1830
 
+                           (timeout->tv_nsec + 999999) / 1000000) :
1831
 
                           0);
1832
 
   struct
1833
 
     {
1834
 
--- a/hurd/lookup-at.c  (revision 11211)
1835
 
+++ b/hurd/lookup-at.c  (revision 12365)
1836
 
@@ -30,8 +30,14 @@
1837
 
   error_t err;
1838
 
   file_t result;
1839
 
 
1840
 
+  if ((at_flags & AT_SYMLINK_FOLLOW) && (at_flags & AT_SYMLINK_NOFOLLOW))
1841
 
+    return (__hurd_fail (EINVAL), MACH_PORT_NULL);
1842
 
+
1843
 
   flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
1844
 
   at_flags &= ~AT_SYMLINK_NOFOLLOW;
1845
 
+  if (at_flags & AT_SYMLINK_FOLLOW)
1846
 
+    flags &= ~O_NOLINK;
1847
 
+  at_flags &= ~AT_SYMLINK_FOLLOW;
1848
 
   if (at_flags != 0)
1849
 
     return (__hurd_fail (EINVAL), MACH_PORT_NULL);
1850
 
 
1851
 
--- a/hurd/hurd/fd.h    (revision 11211)
1852
 
+++ b/hurd/hurd/fd.h    (revision 12365)
1853
 
@@ -254,8 +254,9 @@
1854
 
                         const sigset_t *sigmask);
1855
 
 
1856
 
 /* Variant of file_name_lookup used in *at function implementations.
1857
 
-   AT_FLAGS should contain only AT_SYMLINK_NOFOLLOW; other bits
1858
 
-   cause EINVAL.  */
1859
 
+   AT_FLAGS may only contain AT_SYMLINK_FOLLOW or AT_SYMLINK_NOFOLLOW,
1860
 
+   which will remove and add O_NOLINK from FLAGS respectively.
1861
 
+   Other bits cause EINVAL.  */
1862
 
 extern file_t __file_name_lookup_at (int fd, int at_flags,
1863
 
                                     const char *file_name,
1864
 
                                     int flags, mode_t mode);
1865
 
--- a/Makeconfig        (revision 11211)
1866
 
+++ b/Makeconfig        (revision 12365)
1867
 
@@ -703,7 +703,7 @@
1868
 
           -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
1869
 
           $(CPPFLAGS-$(suffix $@)) \
1870
 
           $(foreach lib,$(libof-$(basename $(@F))) \
1871
 
-                        $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
1872
 
+                        $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
1873
 
           $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
1874
 
 override CFLAGS        = -std=gnu99 $(gnu89-inline-CFLAGS) \
1875
 
                  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
1876
 
@@ -992,7 +992,7 @@
1877
 
 # emitted into sysd-rules.  A sysdeps Makeconfig fragment can
1878
 
 # add its own special object file prefix to this list with e.g. foo-%:%
1879
 
 # to have foo-*.? compiled from *.? using $(foo-CPPFLAGS).
1880
 
-sysd-rules-patterns := %:% rtld-%:% m_%:s_%
1881
 
+sysd-rules-patterns := %:% rtld-%:rtld-% rtld-%:% m_%:s_%
1882
 
 
1883
 
 # Let sysdeps/ subdirs contain a Makeconfig fragment for us to include here.
1884
 
 sysdep-makeconfigs := $(wildcard $(+sysdep_dirs:=/Makeconfig))
1885
 
@@ -1001,8 +1001,8 @@
1886
 
 endif
1887
 
 
1888
 
 # Compute just the target patterns.  Makeconfig has set sysd-rules-patterns.
1889
 
-sysd-rules-targets := $(foreach p,$(sysd-rules-patterns),\
1890
 
-                               $(firstword $(subst :, ,$p)))
1891
 
+sysd-rules-targets := $(sort $(foreach p,$(sysd-rules-patterns),\
1892
 
+                                        $(firstword $(subst :, ,$p))))
1893
 
 
1894
 
 endif # Makeconfig not yet included
1895
 
 
1896
 
--- a/string/bits/string3.h     (revision 11211)
1897
 
+++ b/string/bits/string3.h     (revision 12365)
1898
 
@@ -1,4 +1,4 @@
1899
 
-/* Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
1900
 
+/* Copyright (C) 2004, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
1901
 
    This file is part of the GNU C Library.
1902
 
 
1903
 
    The GNU C Library is free software; you can redistribute it and/or
1904
 
@@ -53,8 +53,7 @@
1905
 
 }
1906
 
 
1907
 
 __extern_always_inline void *
1908
 
-__NTH (memmove (void *__restrict __dest, __const void *__restrict __src,
1909
 
-               size_t __len))
1910
 
+__NTH (memmove (void *__dest, __const void *__src, size_t __len))
1911
 
 {
1912
 
   return __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
1913
 
 }
1914
 
@@ -88,8 +87,7 @@
1915
 
 
1916
 
 #ifdef __USE_BSD
1917
 
 __extern_always_inline void
1918
 
-__NTH (bcopy (__const void *__restrict __src, void *__restrict __dest,
1919
 
-             size_t __len))
1920
 
+__NTH (bcopy (__const void *__src, void *__dest, size_t __len))
1921
 
 {
1922
 
   (void) __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
1923
 
 }
1924
 
--- a/string/stratcliff.c       (revision 11211)
1925
 
+++ b/string/stratcliff.c       (revision 12365)
1926
 
@@ -1,5 +1,6 @@
1927
 
 /* Test for string function add boundaries of usable memory.
1928
 
-   Copyright (C) 1996,1997,1999-2003,2007, 2009 Free Software Foundation, Inc.
1929
 
+   Copyright (C) 1996,1997,1999-2003,2007,2009,2010
1930
 
+   Free Software Foundation, Inc.
1931
 
    This file is part of the GNU C Library.
1932
 
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
1933
 
 
1934
 
@@ -47,6 +48,8 @@
1935
 
 # define MEMCPY memcpy
1936
 
 # define MEMPCPY mempcpy
1937
 
 # define MEMCHR memchr
1938
 
+# define STRCMP strcmp
1939
 
+# define STRNCMP strncmp
1940
 
 #endif
1941
 
 
1942
 
 
1943
 
@@ -70,12 +73,12 @@
1944
 
   if (adr == MAP_FAILED || dest == MAP_FAILED)
1945
 
     {
1946
 
       if (errno == ENOSYS)
1947
 
-        puts ("No test, mmap not available.");
1948
 
+       puts ("No test, mmap not available.");
1949
 
       else
1950
 
-        {
1951
 
-          printf ("mmap failed: %m");
1952
 
-          result = 1;
1953
 
-        }
1954
 
+       {
1955
 
+         printf ("mmap failed: %m");
1956
 
+         result = 1;
1957
 
+       }
1958
 
     }
1959
 
   else
1960
 
     {
1961
 
@@ -93,8 +96,8 @@
1962
 
 
1963
 
       /* strlen/wcslen test */
1964
 
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
1965
 
-        {
1966
 
-          for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
1967
 
+       {
1968
 
+         for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
1969
 
            {
1970
 
              adr[inner] = L('\0');
1971
 
 
1972
 
@@ -107,12 +110,12 @@
1973
 
 
1974
 
              adr[inner] = L('T');
1975
 
            }
1976
 
-        }
1977
 
+       }
1978
 
 
1979
 
       /* strnlen/wcsnlen test */
1980
 
       for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
1981
 
-        {
1982
 
-          for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
1983
 
+       {
1984
 
+         for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
1985
 
            {
1986
 
              adr[inner] = L('\0');
1987
 
 
1988
 
@@ -126,9 +129,9 @@
1989
 
 
1990
 
              adr[inner] = L('T');
1991
 
            }
1992
 
-        }
1993
 
+       }
1994
 
       for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
1995
 
-        {
1996
 
+       {
1997
 
          for (inner = MAX (outer, nchars - 64); inner <= nchars; ++inner)
1998
 
            {
1999
 
              if (STRNLEN (&adr[outer], inner - outer)
2000
 
@@ -139,11 +142,11 @@
2001
 
                  result = 1;
2002
 
                }
2003
 
            }
2004
 
-        }
2005
 
+       }
2006
 
 
2007
 
       /* strchr/wcschr test */
2008
 
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
2009
 
-        {
2010
 
+       {
2011
 
          for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
2012
 
            {
2013
 
              for (inner = middle; inner < nchars; ++inner)
2014
 
@@ -167,7 +170,7 @@
2015
 
                  adr[middle] = L('T');
2016
 
                }
2017
 
            }
2018
 
-        }
2019
 
+       }
2020
 
 
2021
 
       /* Special test.  */
2022
 
       adr[nchars - 1] = L('\0');
2023
 
@@ -180,7 +183,7 @@
2024
 
 
2025
 
       /* strrchr/wcsrchr test */
2026
 
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
2027
 
-        {
2028
 
+       {
2029
 
          for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
2030
 
            {
2031
 
              for (inner = middle; inner < nchars; ++inner)
2032
 
@@ -204,11 +207,11 @@
2033
 
                  adr[middle] = L('T');
2034
 
                }
2035
 
            }
2036
 
-        }
2037
 
+       }
2038
 
 
2039
 
       /* memchr test */
2040
 
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
2041
 
-        {
2042
 
+       {
2043
 
          for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
2044
 
            {
2045
 
              adr[middle] = L('V');
2046
 
@@ -224,9 +227,9 @@
2047
 
 
2048
 
              adr[middle] = L('T');
2049
 
            }
2050
 
-        }
2051
 
+       }
2052
 
       for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
2053
 
-        {
2054
 
+       {
2055
 
          CHAR *cp = MEMCHR (&adr[outer], L('V'), nchars - outer);
2056
 
 
2057
 
          if (cp != NULL)
2058
 
@@ -235,13 +238,13 @@
2059
 
                      STRINGIFY (MEMCHR), outer);
2060
 
              result = 1;
2061
 
            }
2062
 
-        }
2063
 
+       }
2064
 
 
2065
 
       /* This function only exists for single-byte characters.  */
2066
 
 #ifndef WCSTEST
2067
 
       /* rawmemchr test */
2068
 
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
2069
 
-        {
2070
 
+       {
2071
 
          for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
2072
 
            {
2073
 
              adr[middle] = L('V');
2074
 
@@ -257,13 +260,13 @@
2075
 
 
2076
 
              adr[middle] = L('T');
2077
 
            }
2078
 
-        }
2079
 
+       }
2080
 
 #endif
2081
 
 
2082
 
       /* strcpy/wcscpy test */
2083
 
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
2084
 
-        {
2085
 
-          for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
2086
 
+       {
2087
 
+         for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
2088
 
            {
2089
 
              adr[inner] = L('\0');
2090
 
 
2091
 
@@ -277,8 +280,75 @@
2092
 
 
2093
 
              adr[inner] = L('T');
2094
 
            }
2095
 
-        }
2096
 
+       }
2097
 
 
2098
 
+      /* strcmp/wcscmp tests */
2099
 
+      for (outer = 1; outer < 32; ++outer)
2100
 
+       for (middle = 0; middle < 16; ++middle)
2101
 
+         {
2102
 
+           MEMSET (adr + middle, L('T'), 256);
2103
 
+           adr[256] = L('\0');
2104
 
+           MEMSET (dest + nchars - outer, L('T'), outer - 1);
2105
 
+           dest[nchars - 1] = L('\0');
2106
 
+
2107
 
+           if (STRCMP (adr + middle, dest + nchars - outer) <= 0)
2108
 
+             {
2109
 
+               printf ("%s 1 flunked for outer = %d, middle = %d\n",
2110
 
+                       STRINGIFY (STRCMP), outer, middle);
2111
 
+               result = 1;
2112
 
+             }
2113
 
+
2114
 
+           if (STRCMP (dest + nchars - outer, adr + middle) >= 0)
2115
 
+             {
2116
 
+               printf ("%s 2 flunked for outer = %d, middle = %d\n",
2117
 
+                       STRINGIFY (STRCMP), outer, middle);
2118
 
+               result = 1;
2119
 
+             }
2120
 
+         }
2121
 
+
2122
 
+      /* strncmp/wcsncmp tests */
2123
 
+      for (outer = 1; outer < 32; ++outer)
2124
 
+       for (middle = 0; middle < 16; ++middle)
2125
 
+         {
2126
 
+           MEMSET (adr + middle, L('T'), 256);
2127
 
+           adr[256] = L('\0');
2128
 
+           MEMSET (dest + nchars - outer, L('T'), outer - 1);
2129
 
+           dest[nchars - 1] = L('U');
2130
 
+
2131
 
+           for (inner = 0; inner < outer; ++inner)
2132
 
+             {
2133
 
+               if (STRNCMP (adr + middle, dest + nchars - outer, inner) != 0)
2134
 
+                 {
2135
 
+                   printf ("%s 1 flunked for outer = %d, middle = %d, "
2136
 
+                           "inner = %d\n",
2137
 
+                           STRINGIFY (STRNCMP), outer, middle, inner);
2138
 
+                   result = 1;
2139
 
+                 }
2140
 
+
2141
 
+               if (STRNCMP (dest + nchars - outer, adr + middle, inner) != 0)
2142
 
+                 {
2143
 
+                   printf ("%s 2 flunked for outer = %d, middle = %d, "
2144
 
+                           "inner = %d\n",
2145
 
+                           STRINGIFY (STRNCMP), outer, middle, inner);
2146
 
+                   result = 1;
2147
 
+                 }
2148
 
+             }
2149
 
+
2150
 
+           if (STRNCMP (adr + middle, dest + nchars - outer, outer) >= 0)
2151
 
+             {
2152
 
+               printf ("%s 1 flunked for outer = %d, middle = %d, full\n",
2153
 
+                       STRINGIFY (STRNCMP), outer, middle);
2154
 
+               result = 1;
2155
 
+             }
2156
 
+
2157
 
+           if (STRNCMP (dest + nchars - outer, adr + middle, outer) <= 0)
2158
 
+             {
2159
 
+               printf ("%s 2 flunked for outer = %d, middle = %d, full\n",
2160
 
+                       STRINGIFY (STRNCMP), outer, middle);
2161
 
+               result = 1;
2162
 
+             }
2163
 
+         }
2164
 
+
2165
 
       /* strncpy/wcsncpy tests */
2166
 
       adr[nchars - 1] = L('T');
2167
 
       for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
2168
 
@@ -295,12 +365,12 @@
2169
 
                  result = 1;
2170
 
                }
2171
 
            }
2172
 
-        }
2173
 
+       }
2174
 
       adr[nchars - 1] = L('\0');
2175
 
 
2176
 
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
2177
 
-        {
2178
 
-          for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
2179
 
+       {
2180
 
+         for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
2181
 
            {
2182
 
              size_t len;
2183
 
 
2184
 
@@ -334,12 +404,12 @@
2185
 
 
2186
 
              adr[inner] = L('T');
2187
 
            }
2188
 
-        }
2189
 
+       }
2190
 
 
2191
 
       /* stpcpy/wcpcpy test */
2192
 
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
2193
 
-        {
2194
 
-          for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
2195
 
+       {
2196
 
+         for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
2197
 
            {
2198
 
              adr[inner] = L('\0');
2199
 
 
2200
 
@@ -352,7 +422,7 @@
2201
 
 
2202
 
              adr[inner] = L('T');
2203
 
            }
2204
 
-        }
2205
 
+       }
2206
 
 
2207
 
       /* stpncpy/wcpncpy test */
2208
 
       adr[nchars - 1] = L('T');
2209
 
@@ -374,8 +444,8 @@
2210
 
       adr[nchars - 1] = L('\0');
2211
 
 
2212
 
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
2213
 
-        {
2214
 
-          for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
2215
 
+       {
2216
 
+         for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
2217
 
            {
2218
 
              adr[middle] = L('\0');
2219
 
 
2220
 
@@ -393,7 +463,7 @@
2221
 
 
2222
 
              adr[middle] = L('T');
2223
 
            }
2224
 
-        }
2225
 
+       }
2226
 
 
2227
 
       /* memcpy/wmemcpy test */
2228
 
       for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
2229
 
--- a/string/str-two-way.h      (revision 11211)
2230
 
+++ b/string/str-two-way.h      (revision 12365)
2231
 
@@ -350,8 +350,8 @@
2232
 
                     a byte out of place, there can be no match until
2233
 
                     after the mismatch.  */
2234
 
                  shift = needle_len - period;
2235
 
-                 memory = 0;
2236
 
                }
2237
 
+             memory = 0;
2238
 
              j += shift;
2239
 
              continue;
2240
 
            }
2241
 
--- a/string/Makefile   (revision 11211)
2242
 
+++ b/string/Makefile   (revision 12365)
2243
 
@@ -58,7 +58,7 @@
2244
 
                   bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap      \
2245
 
                   tst-strtok tst-strfry        \
2246
 
                   bug-strtok1 $(addprefix test-,$(strop-tests))        \
2247
 
-                  tst-strxfrm2 tst-endian tst-svc2
2248
 
+                  tst-strxfrm2 tst-endian tst-svc2 bug-strstr1 bug-strchr1
2249
 
 tests-$(OPTION_EGLIBC_ENVZ) += bug-envz1 
2250
 
 tests-$(OPTION_EGLIBC_LOCALE_CODE) \
2251
 
                += tst-strxfrm bug-strcoll1
2252
 
@@ -81,6 +81,7 @@
2253
 
 CFLAGS-stratcliff.c = -fno-builtin
2254
 
 CFLAGS-test-ffs.c = -fno-builtin
2255
 
 CFLAGS-tst-inlcall.c = -fno-builtin
2256
 
+CFLAGS-bug-strstr1.c = -fno-builtin
2257
 
 
2258
 
 # eglibc: ifeq ($(cross-compiling),no)
2259
 
 tests: $(objpfx)tst-svc.out
2260
 
--- a/string/bug-strchr1.c      (revision 0)
2261
 
+++ b/string/bug-strchr1.c      (revision 12365)
2262
 
@@ -0,0 +1,14 @@
2263
 
+#include <stdio.h>
2264
 
+#include <string.h>
2265
 
+
2266
 
+static int
2267
 
+do_test (void)
2268
 
+{
2269
 
+  char s[] __attribute__((aligned(16))) = "\xff";
2270
 
+  char *p = strchr (s, '\xfe');
2271
 
+  printf ("%p\n", p);
2272
 
+  return p != NULL;
2273
 
+}
2274
 
+
2275
 
+#define TEST_FUNCTION do_test ()
2276
 
+#include "../test-skeleton.c"
2277
 
--- a/string/bug-strstr1.c      (revision 0)
2278
 
+++ b/string/bug-strstr1.c      (revision 12365)
2279
 
@@ -0,0 +1,26 @@
2280
 
+#include <stdio.h>
2281
 
+#include <string.h>
2282
 
+
2283
 
+int main (int argc, char** argv)
2284
 
+{
2285
 
+  const char haystack[] =
2286
 
+    "F_BD_CE_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_88_20_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_A7_20_EF_BF_BD";
2287
 
+
2288
 
+  const char needle[] =
2289
 
+    "_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD";
2290
 
+
2291
 
+  const char* sub = strstr (haystack, needle);
2292
 
+
2293
 
+  if (sub != NULL)
2294
 
+    {
2295
 
+      int j;
2296
 
+
2297
 
+      fprintf (stderr, "BUG: expected NULL, got:\n%s\n%s\n", sub, needle);
2298
 
+      for (j = 0; needle[j] != '\0'; ++j)
2299
 
+        putchar (needle[j] == sub[j] ? ' ' : '^');
2300
 
+      puts ("");
2301
 
+      return 1;
2302
 
+    }
2303
 
+
2304
 
+  return 0;
2305
 
+}
2306
 
--- a/locale/xlocale.c  (revision 11211)
2307
 
+++ b/locale/xlocale.c  (revision 12365)
2308
 
@@ -84,7 +84,7 @@
2309
 
    pointers here.  */
2310
 
 #if defined (NL_CURRENT_INDIRECT)
2311
 
 #define DEFINE_CATEGORY(category, category_name, items, a)      \
2312
 
-  __thread struct locale_data * const *_nl_current_##category   \
2313
 
+  __thread struct __locale_data * const *_nl_current_##category   \
2314
 
   attribute_hidden = &_nl_C_locobj.__locales[category];
2315
 
 #include "categories.def"
2316
 
 #undef DEFINE_CATEGORY
2317
 
--- a/locale/programs/locale.c  (revision 11211)
2318
 
+++ b/locale/programs/locale.c  (revision 12365)
2319
 
@@ -765,6 +765,29 @@
2320
 
   twalk (all_data, print_names);
2321
 
 }
2322
 
 
2323
 
+/* Print a properly quoted assignment of NAME with VAL, using double
2324
 
+   quotes iff DQUOTE is true.  */
2325
 
+static void
2326
 
+print_assignment (const char *name, const char *val, bool dquote)
2327
 
+{
2328
 
+  printf ("%s=", name);
2329
 
+  if (dquote)
2330
 
+    putchar ('"');
2331
 
+  while (*val != '\0')
2332
 
+    {
2333
 
+      size_t segment
2334
 
+       = strcspn (val, dquote ? "$`\"\\" : "~|&;<>()$`\\\"' \t\n");
2335
 
+      printf ("%.*s", (int) segment, val);
2336
 
+      val += segment;
2337
 
+      if (*val == '\0')
2338
 
+       break;
2339
 
+      putchar ('\\');
2340
 
+      putchar (*val++);
2341
 
+    }
2342
 
+  if (dquote)
2343
 
+    putchar ('"');
2344
 
+  putchar ('\n');
2345
 
+}
2346
 
 
2347
 
 /* We have to show the contents of the environments determining the
2348
 
    locale.  */
2349
 
@@ -772,7 +795,7 @@
2350
 
 show_locale_vars (void)
2351
 
 {
2352
 
   size_t cat_no;
2353
 
-  const char *lcall = getenv ("LC_ALL");
2354
 
+  const char *lcall = getenv ("LC_ALL") ? : "";
2355
 
   const char *lang = getenv ("LANG") ? : "";
2356
 
 
2357
 
   auto void get_source (const char *name);
2358
 
@@ -781,15 +804,15 @@
2359
 
     {
2360
 
       char *val = getenv (name);
2361
 
 
2362
 
-      if ((lcall ?: "")[0] != '\0' || val == NULL)
2363
 
-       printf ("%s=\"%s\"\n", name,
2364
 
-               (lcall ?: "")[0] ? lcall : (lang ?: "")[0] ? lang : "POSIX");
2365
 
+      if (lcall[0] != '\0' || val == NULL)
2366
 
+       print_assignment (name, lcall[0] ? lcall : lang[0] ? lang : "POSIX",
2367
 
+                         true);
2368
 
       else
2369
 
-       printf ("%s=%s\n", name, val);
2370
 
+       print_assignment (name, val, false);
2371
 
     }
2372
 
 
2373
 
   /* LANG has to be the first value.  */
2374
 
-  printf ("LANG=%s\n", lang);
2375
 
+  print_assignment ("LANG", lang, false);
2376
 
 
2377
 
   /* Now all categories in an unspecified order.  */
2378
 
   for (cat_no = 0; cat_no < NCATEGORIES; ++cat_no)
2379
 
@@ -797,7 +820,7 @@
2380
 
       get_source (category[cat_no].name);
2381
 
 
2382
 
   /* The last is the LC_ALL value.  */
2383
 
-  printf ("LC_ALL=%s\n", lcall ? : "");
2384
 
+  print_assignment ("LC_ALL", lcall, false);
2385
 
 }
2386
 
 
2387
 
 
2388
 
--- a/INSTALL   (revision 11211)
2389
 
+++ b/INSTALL   (revision 12365)
2390
 
@@ -329,11 +329,12 @@
2391
 
      Check the FAQ for any special compiler issues on particular
2392
 
      platforms.
2393
 
 
2394
 
-   * GNU `binutils' 2.15 or later
2395
 
+   * GNU `binutils'
2396
 
 
2397
 
      You must use GNU `binutils' (as and ld) to build the GNU C library.
2398
 
      No other assembler or linker has the necessary functionality at the
2399
 
-     moment.
2400
 
+     moment.  The configure scripts checks for the appropriate version
2401
 
+     for the platform.  Too-old versions will prevent building glibc.
2402
 
 
2403
 
    * GNU `texinfo' 3.12f
2404
 
 
2405
 
@@ -472,4 +473,3 @@
2406
 
 errors or omissions in this manual, please report them to the bug
2407
 
 database.  If you refer to specific sections of the manual, please
2408
 
 include the section names for easier identification.
2409
 
-
2410
 
--- a/malloc/malloc.c   (revision 11211)
2411
 
+++ b/malloc/malloc.c   (revision 12365)
2412
 
@@ -4850,7 +4850,7 @@
2413
 
       }
2414
 
 
2415
 
     if (__builtin_expect (perturb_byte, 0))
2416
 
-      free_perturb (chunk2mem(p), size - SIZE_SZ);
2417
 
+      free_perturb (chunk2mem(p), size - 2 * SIZE_SZ);
2418
 
 
2419
 
     set_fastchunks(av);
2420
 
     unsigned int idx = fastbin_index(size);
2421
 
@@ -4954,7 +4954,7 @@
2422
 
       }
2423
 
 
2424
 
     if (__builtin_expect (perturb_byte, 0))
2425
 
-      free_perturb (chunk2mem(p), size - SIZE_SZ);
2426
 
+      free_perturb (chunk2mem(p), size - 2 * SIZE_SZ);
2427
 
 
2428
 
     /* consolidate backward */
2429
 
     if (!prev_inuse(p)) {
2430
 
--- a/malloc/mcheck.c   (revision 11211)
2431
 
+++ b/malloc/mcheck.c   (revision 12365)
2432
 
@@ -1,5 +1,6 @@
2433
 
 /* Standard debugging hooks for `malloc'.
2434
 
-   Copyright (C) 1990-1997,1999,2000-2002,2007 Free Software Foundation, Inc.
2435
 
+   Copyright (C) 1990-1997,1999,2000-2002,2007,2010
2436
 
+   Free Software Foundation, Inc.
2437
 
    This file is part of the GNU C Library.
2438
 
    Written May 1989 by Mike Haertel.
2439
 
 
2440
 
@@ -25,6 +26,7 @@
2441
 
 # include <stdint.h>
2442
 
 # include <stdio.h>
2443
 
 # include <libintl.h>
2444
 
+# include <errno.h>
2445
 
 #endif
2446
 
 
2447
 
 /* Old hook values.  */
2448
 
@@ -209,6 +211,12 @@
2449
 
   if (pedantic)
2450
 
     mcheck_check_all ();
2451
 
 
2452
 
+  if (size > ~((size_t) 0) - (sizeof (struct hdr) + 1))
2453
 
+    {
2454
 
+      __set_errno (ENOMEM);
2455
 
+      return NULL;
2456
 
+    }
2457
 
+
2458
 
   __malloc_hook = old_malloc_hook;
2459
 
   if (old_malloc_hook != NULL)
2460
 
     hdr = (struct hdr *) (*old_malloc_hook) (sizeof (struct hdr) + size + 1,
2461
 
@@ -241,6 +249,12 @@
2462
 
 
2463
 
   slop = (sizeof *hdr + alignment - 1) & -alignment;
2464
 
 
2465
 
+  if (size > ~((size_t) 0) - (slop + 1))
2466
 
+    {
2467
 
+      __set_errno (ENOMEM);
2468
 
+      return NULL;
2469
 
+    }
2470
 
+
2471
 
   __memalign_hook = old_memalign_hook;
2472
 
   if (old_memalign_hook != NULL)
2473
 
     block = (*old_memalign_hook) (alignment, slop + size + 1, caller);
2474
 
@@ -276,6 +290,12 @@
2475
 
   if (pedantic)
2476
 
     mcheck_check_all ();
2477
 
 
2478
 
+  if (size > ~((size_t) 0) - (sizeof (struct hdr) + 1))
2479
 
+    {
2480
 
+      __set_errno (ENOMEM);
2481
 
+      return NULL;
2482
 
+    }
2483
 
+
2484
 
   if (ptr)
2485
 
     {
2486
 
       hdr = ((struct hdr *) ptr) - 1;
2487
 
--- a/nptl/tst-abstime.c        (revision 0)
2488
 
+++ b/nptl/tst-abstime.c        (revision 12365)
2489
 
@@ -0,0 +1,98 @@
2490
 
+/* Copyright (C) 2010 Free Software Foundation, Inc.
2491
 
+   This file is part of the GNU C Library.
2492
 
+   Contributed by Andreas Schwab <schwab@redhat.com>, 2010.
2493
 
+
2494
 
+   The GNU C Library is free software; you can redistribute it and/or
2495
 
+   modify it under the terms of the GNU Lesser General Public
2496
 
+   License as published by the Free Software Foundation; either
2497
 
+   version 2.1 of the License, or (at your option) any later version.
2498
 
+
2499
 
+   The GNU C Library is distributed in the hope that it will be useful,
2500
 
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
2501
 
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2502
 
+   Lesser General Public License for more details.
2503
 
+
2504
 
+   You should have received a copy of the GNU Lesser General Public
2505
 
+   License along with the GNU C Library; if not, write to the Free
2506
 
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2507
 
+   02111-1307 USA.  */
2508
 
+
2509
 
+#include <errno.h>
2510
 
+#include <pthread.h>
2511
 
+#include <semaphore.h>
2512
 
+#include <stdio.h>
2513
 
+
2514
 
+static pthread_cond_t c = PTHREAD_COND_INITIALIZER;
2515
 
+static pthread_mutex_t m1 = PTHREAD_MUTEX_INITIALIZER;
2516
 
+static pthread_mutex_t m2 = PTHREAD_MUTEX_INITIALIZER;
2517
 
+static pthread_rwlock_t rw1 = PTHREAD_RWLOCK_INITIALIZER;
2518
 
+static pthread_rwlock_t rw2 = PTHREAD_RWLOCK_INITIALIZER;
2519
 
+static sem_t sem;
2520
 
+
2521
 
+static void *
2522
 
+th (void *arg)
2523
 
+{
2524
 
+  long int res = 0;
2525
 
+  int r;
2526
 
+  struct timespec t = { -2, 0 };
2527
 
+
2528
 
+  r = pthread_mutex_timedlock (&m1, &t);
2529
 
+  if (r != ETIMEDOUT)
2530
 
+    {
2531
 
+      puts ("pthread_mutex_timedlock did not return ETIMEDOUT");
2532
 
+      res = 1;
2533
 
+    }
2534
 
+  r = pthread_rwlock_timedrdlock (&rw1, &t);
2535
 
+  if (r != ETIMEDOUT)
2536
 
+    {
2537
 
+      puts ("pthread_rwlock_timedrdlock did not return ETIMEDOUT");
2538
 
+      res = 1;
2539
 
+    }
2540
 
+  r = pthread_rwlock_timedwrlock (&rw2, &t);
2541
 
+  if (r != ETIMEDOUT)
2542
 
+    {
2543
 
+      puts ("pthread_rwlock_timedwrlock did not return ETIMEDOUT");
2544
 
+      res = 1;
2545
 
+    }
2546
 
+  return (void *) res;
2547
 
+}
2548
 
+
2549
 
+static int
2550
 
+do_test (void)
2551
 
+{
2552
 
+  int res = 0;
2553
 
+  int r;
2554
 
+  struct timespec t = { -2, 0 };
2555
 
+  pthread_t pth;
2556
 
+
2557
 
+  sem_init (&sem, 0, 0);
2558
 
+  r = sem_timedwait (&sem, &t);
2559
 
+  if (r != -1 || errno != ETIMEDOUT)
2560
 
+    {
2561
 
+      puts ("sem_timedwait did not fail with ETIMEDOUT");
2562
 
+      res = 1;
2563
 
+    }
2564
 
+
2565
 
+  pthread_mutex_lock (&m1);
2566
 
+  pthread_rwlock_wrlock (&rw1);
2567
 
+  pthread_rwlock_rdlock (&rw2);
2568
 
+  pthread_mutex_lock (&m2);
2569
 
+  if (pthread_create (&pth, 0, th, 0) != 0)
2570
 
+    {
2571
 
+      puts ("cannot create thread");
2572
 
+      return 1;
2573
 
+    }
2574
 
+  r = pthread_cond_timedwait (&c, &m2, &t);
2575
 
+  if (r != ETIMEDOUT)
2576
 
+    {
2577
 
+      puts ("pthread_cond_timedwait did not return ETIMEDOUT");
2578
 
+      res = 1;
2579
 
+    }
2580
 
+  void *thres;
2581
 
+  pthread_join (pth, &thres);
2582
 
+  return res | (thres != NULL);
2583
 
+}
2584
 
+
2585
 
+
2586
 
+#define TEST_FUNCTION do_test ()
2587
 
+#include "../test-skeleton.c"
2588
 
--- a/nptl/Makefile     (revision 11211)
2589
 
+++ b/nptl/Makefile     (revision 12365)
2590
 
@@ -259,6 +259,7 @@
2591
 
        tst-context1 \
2592
 
        tst-sched1 \
2593
 
        tst-oddstacklimit \
2594
 
+       tst-abstime \
2595
 
        tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \
2596
 
        tst-getpid1 tst-getpid2 tst-getpid3 \
2597
 
        tst-initializers1 $(patsubst %,tst-initializers1-%,c89 gnu89 c99 gnu99)
2598
 
@@ -511,7 +512,8 @@
2599
 
 $(objpfx)tst-_res1mod2.so: $(objpfx)tst-_res1mod1.so
2600
 
 LDFLAGS-tst-_res1mod1.so = -Wl,-soname,tst-_res1mod1.so
2601
 
 LDFLAGS-tst-_res1mod2.so = -Wl,-soname,tst-_res1mod2.so
2602
 
-$(objpfx)tst-_res1: $(objpfx)tst-_res1mod2.so $(shared-thread-library)
2603
 
+$(objpfx)tst-_res1: $(objpfx)tst-_res1mod1.so $(objpfx)tst-_res1mod2.so \
2604
 
+                   $(shared-thread-library)
2605
 
 else
2606
 
 $(objpfx)tst-cond11: $(common-objpfx)rt/librt.a
2607
 
 $(objpfx)tst-cond19: $(common-objpfx)rt/librt.a
2608
 
--- a/nptl/ChangeLog    (revision 11211)
2609
 
+++ b/nptl/ChangeLog    (revision 12365)
2610
 
@@ -1,3 +1,52 @@
2611
 
+2010-08-10  Dinakar Guniguntala  <dino@in.ibm.com>
2612
 
+           Stefan Hajnoczi  <stefanha@linux.vnet.ibm.com>
2613
 
+
2614
 
+       * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: If
2615
 
+       FUTEX_WAKE_OP fails make sure to call FUTEX_WAKE instead.
2616
 
+
2617
 
+2010-07-03  Ulrich Drepper  <drepper@redhat.com>
2618
 
+
2619
 
+       * tst-abstime.c (do_test): Some more cleanups
2620
 
+
2621
 
+2010-07-02  Ulrich Drepper  <drepper@redhat.com>
2622
 
+
2623
 
+       * tst-abstime.c: Correct testing and add test for sem_timedwait.
2624
 
+
2625
 
+2010-07-01  Andreas Schwab  <schwab@redhat.com>
2626
 
+           Ulrich Drepper  <drepper@redhat.com>
2627
 
+
2628
 
+       * Makefile (tests): Add tst-abstime.
2629
 
+       * tst-abstime.c: New file.
2630
 
+       * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2631
 
+       (__lll_timedlock_wait): Check for timestamp before the Epoch.
2632
 
+       * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2633
 
+       (__lll_timedlock_wait): Likewise.
2634
 
+       * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2635
 
+       (__lll_robust_timedlock_wait): Likewise.
2636
 
+       * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2637
 
+       (__pthread_cond_timedwait): Likewise.
2638
 
+       * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
2639
 
+       (pthread_rwlock_timedrdlock): Likewise.
2640
 
+       * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
2641
 
+       (pthread_rwlock_timedwrlock): Likewise.
2642
 
+       * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2643
 
+       Likewise.
2644
 
+
2645
 
+2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
2646
 
+
2647
 
+       * nptl/sysdeps/unix/sysv/linux/i386/Makefile: New file.
2648
 
+
2649
 
+2010-07-01  Ulrich Drepper  <drepper@redhat.com>
2650
 
+
2651
 
+       * Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
2652
 
+
2653
 
+2010-10-13  H.J. Lu  <hongjiu.lu@intel.com>
2654
 
+
2655
 
+       [BZ #12113]
2656
 
+       * sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
2657
 
+       * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
2658
 
+       of "struct pthread".
2659
 
+
2660
 
 2010-06-01  Takashi Yoshii  <takashi.yoshii.zj@renesas.com>
2661
 
 
2662
 
        * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
2663
 
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S      (revision 11211)
2664
 
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S      (revision 12365)
2665
 
@@ -1,4 +1,4 @@
2666
 
-/* Copyright (C) 2002,2003,2004,2005,2007,2009 Free Software Foundation, Inc.
2667
 
+/* Copyright (C) 2002-2005,2007,2009,2010 Free Software Foundation, Inc.
2668
 
    This file is part of the GNU C Library.
2669
 
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
2670
 
 
2671
 
@@ -163,7 +163,6 @@
2672
 
 #endif
2673
 
        orl     $FUTEX_WAKE, %ecx
2674
 
 
2675
 
-       xorl    $(FUTEX_WAKE ^ FUTEX_WAKE_OP), %ecx
2676
 
        movl    $SYS_futex, %eax
2677
 
        /* %edx should be 1 already from $FUTEX_WAKE_OP syscall.
2678
 
        movl    $1, %edx  */
2679
 
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S     (revision 11211)
2680
 
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S     (revision 12365)
2681
 
@@ -1,4 +1,4 @@
2682
 
-/* Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc.
2683
 
+/* Copyright (C) 2002-2004,2006,2007,2009,2010 Free Software Foundation, Inc.
2684
 
    This file is part of the GNU C Library.
2685
 
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
2686
 
 
2687
 
@@ -188,6 +188,9 @@
2688
 
        je      .Lreltmo
2689
 
 # endif
2690
 
 
2691
 
+       cmpl    $0, (%edx)
2692
 
+       js      8f
2693
 
+
2694
 
        movl    %ecx, %ebx
2695
 
        movl    %esi, %ecx
2696
 
        movl    %edx, %esi
2697
 
@@ -223,6 +226,9 @@
2698
 
        cfi_restore(%ebp)
2699
 
        ret
2700
 
 
2701
 
+8:     movl    $ETIMEDOUT, %eax
2702
 
+       jmp     7b
2703
 
+
2704
 
 # ifndef __ASSUME_FUTEX_CLOCK_REALTIME
2705
 
 .Lreltmo:
2706
 
        /* Check for a valid timeout value.  */
2707
 
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S  (revision 11211)
2708
 
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S  (revision 12365)
2709
 
@@ -1,4 +1,4 @@
2710
 
-/* Copyright (C) 2002-2005, 2007, 2009 Free Software Foundation, Inc.
2711
 
+/* Copyright (C) 2002-2005, 2007, 2009, 2010 Free Software Foundation, Inc.
2712
 
    This file is part of the GNU C Library.
2713
 
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
2714
 
 
2715
 
@@ -102,6 +102,9 @@
2716
 
        je      .Lreltmo
2717
 
 #endif
2718
 
 
2719
 
+       cmpq    $0, (%r13)
2720
 
+       js      16f             /* Time is already up.  */
2721
 
+
2722
 
        movl    $FUTEX_PRIVATE_FLAG|FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %esi
2723
 
        xorl    PSHARED(%r12), %esi
2724
 
        movq    %r13, %r10
2725
 
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S  (revision 11211)
2726
 
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S  (revision 12365)
2727
 
@@ -1,5 +1,4 @@
2728
 
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009
2729
 
-   Free Software Foundation, Inc.
2730
 
+/* Copyright (C) 2002=2007, 2009, 2010 Free Software Foundation, Inc.
2731
 
    This file is part of the GNU C Library.
2732
 
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
2733
 
 
2734
 
@@ -125,6 +124,9 @@
2735
 
        je      .Lreltmo
2736
 
 # endif
2737
 
 
2738
 
+       cmpq    $0, (%rdx)
2739
 
+       js      7f
2740
 
+
2741
 
        pushq   %r9
2742
 
        cfi_adjust_cfa_offset(8)
2743
 
        cfi_rel_offset(%r9, 0)
2744
 
@@ -180,7 +182,10 @@
2745
 
        cfi_adjust_cfa_offset(-8)
2746
 
        cfi_restore(%r9)
2747
 
 
2748
 
+7:     movl    $ETIMEDOUT, %eax
2749
 
+       retq
2750
 
 
2751
 
+
2752
 
 # ifndef __ASSUME_FUTEX_CLOCK_REALTIME
2753
 
 .Lreltmo:
2754
 
        /* Check for a valid timeout value.  */
2755
 
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S        (revision 11211)
2756
 
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S        (revision 12365)
2757
 
@@ -1,4 +1,4 @@
2758
 
-/* Copyright (C) 2002-2006, 2007, 2009 Free Software Foundation, Inc.
2759
 
+/* Copyright (C) 2002-2006, 2007, 2009, 2010 Free Software Foundation, Inc.
2760
 
    This file is part of the GNU C Library.
2761
 
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
2762
 
 
2763
 
@@ -169,9 +169,13 @@
2764
 
        je      .Lreltmo
2765
 
 # endif
2766
 
 
2767
 
+       cmpq    $0, (%rdx)
2768
 
+       js      5f
2769
 
+
2770
 
        pushq   %r9
2771
 
        cfi_adjust_cfa_offset(8)
2772
 
        cfi_rel_offset(%r9, 0)
2773
 
+
2774
 
        movq    %rdx, %r10
2775
 
        movl    $0xffffffff, %r9d
2776
 
        LOAD_FUTEX_WAIT_ABS (%esi)
2777
 
@@ -202,6 +206,9 @@
2778
 
        cfi_restore(%r9)
2779
 
        retq
2780
 
 
2781
 
+5:     movl    $ETIMEDOUT, %eax
2782
 
+       retq
2783
 
+
2784
 
 # ifndef __ASSUME_FUTEX_CLOCK_REALTIME
2785
 
 .Lreltmo:
2786
 
        /* Check for a valid timeout value.  */
2787
 
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S       (revision 11211)
2788
 
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S       (revision 12365)
2789
 
@@ -1,4 +1,4 @@
2790
 
-/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
2791
 
+/* Copyright (C) 2002,2003,2005,2007,2009,2010 Free Software Foundation, Inc.
2792
 
    This file is part of the GNU C Library.
2793
 
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
2794
 
 
2795
 
@@ -77,6 +77,9 @@
2796
 
        je      .Lreltmo
2797
 
 #endif
2798
 
 
2799
 
+       cmpq    $0, (%rsi)
2800
 
+       js      16f
2801
 
+
2802
 
        /* This push is only needed to store the sem_t pointer for the
2803
 
           exception handler.  */
2804
 
        pushq   %rdi
2805
 
@@ -169,6 +172,19 @@
2806
 
 
2807
 
        retq
2808
 
 
2809
 
+16:
2810
 
+#if USE___THREAD
2811
 
+       movq    errno@gottpoff(%rip), %rdx
2812
 
+       movl    $ETIMEDOUT, %fs:(%rdx)
2813
 
+#else
2814
 
+       callq   __errno_location@plt
2815
 
+       movl    $ETIMEDOUT, (%rax)
2816
 
+#endif
2817
 
+
2818
 
+       orl     $-1, %eax
2819
 
+
2820
 
+       retq
2821
 
+
2822
 
 #ifndef __ASSUME_FUTEX_CLOCK_REALTIME
2823
 
 .Lreltmo:
2824
 
        pushq   %r12
2825
 
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S      (revision 11211)
2826
 
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S      (revision 12365)
2827
 
@@ -1,4 +1,4 @@
2828
 
-/* Copyright (C) 2002-2005, 2007, 2009 Free Software Foundation, Inc.
2829
 
+/* Copyright (C) 2002-2005, 2007, 2009, 2010 Free Software Foundation, Inc.
2830
 
    This file is part of the GNU C Library.
2831
 
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
2832
 
 
2833
 
@@ -144,6 +144,10 @@
2834
 
        movq    %r9, 24(%rsp)
2835
 
        movl    %edx, 4(%rsp)
2836
 
 
2837
 
+       cmpq    $0, (%r13)
2838
 
+       movq    $-ETIMEDOUT, %r14
2839
 
+       js      36f
2840
 
+
2841
 
 38:    movl    cond_futex(%rdi), %r12d
2842
 
 
2843
 
        /* Unlock.  */
2844
 
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S  (revision 11211)
2845
 
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S  (revision 12365)
2846
 
@@ -1,4 +1,4 @@
2847
 
-/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
2848
 
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
2849
 
    This file is part of the GNU C Library.
2850
 
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
2851
 
 
2852
 
@@ -99,6 +99,9 @@
2853
 
        je      .Lreltmo
2854
 
 #endif
2855
 
 
2856
 
+       cmpq    $0, (%r13)
2857
 
+       js      16f             /* Time is already up. */
2858
 
+
2859
 
        movl    $FUTEX_PRIVATE_FLAG|FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %esi
2860
 
        xorl    PSHARED(%r12), %esi
2861
 
        movq    %r13, %r10
2862
 
--- a/nptl/sysdeps/x86_64/tls.h (revision 11211)
2863
 
+++ b/nptl/sysdeps/x86_64/tls.h (revision 12365)
2864
 
@@ -117,12 +117,7 @@
2865
 
 # define TLS_TCB_SIZE sizeof (struct pthread)
2866
 
 
2867
 
 /* Alignment requirements for the TCB.  */
2868
 
-//# define TLS_TCB_ALIGN __alignof__ (struct pthread)
2869
 
-// Normally the above would be correct  But we have to store post-AVX
2870
 
-// vector registers in the TCB and we want the storage to be aligned.
2871
 
-// unfortunately there isn't yet a type for these values and hence no
2872
 
-// 32-byte alignment requirement.  Make this explicit, for now.
2873
 
-# define TLS_TCB_ALIGN 32
2874
 
+# define TLS_TCB_ALIGN __alignof__ (struct pthread)
2875
 
 
2876
 
 /* The TCB can have any size and the memory following the address the
2877
 
    thread pointer points to is unspecified.  Allocate the TCB there.  */
2878
 
--- a/nptl/sysdeps/x86_64/pthreaddef.h  (revision 11211)
2879
 
+++ b/nptl/sysdeps/x86_64/pthreaddef.h  (revision 12365)
2880
 
@@ -27,8 +27,9 @@
2881
 
 /* Minimal stack size after allocating thread descriptor and guard size.  */
2882
 
 #define MINIMAL_REST_STACK     2048
2883
 
 
2884
 
-/* Alignment requirement for TCB.  */
2885
 
-#define TCB_ALIGNMENT          16
2886
 
+/* Alignment requirement for TCB.  Need to store post-AVX vector registers
2887
 
+   in the TCB and we want the storage to be aligned at 32-byte.  */
2888
 
+#define TCB_ALIGNMENT          32
2889
 
 
2890
 
 
2891
 
 /* Location of current stack frame.  The frame pointer is not usable.  */
2892
 
--- a/NEWS      (revision 11211)
2893
 
+++ b/NEWS      (revision 12365)
2894
 
@@ -1,10 +1,24 @@
2895
 
-GNU C Library NEWS -- history of user-visible changes.  2010-5-4
2896
 
+GNU C Library NEWS -- history of user-visible changes.  2010-12-13
2897
 
 Copyright (C) 1992-2009, 2010 Free Software Foundation, Inc.
2898
 
 See the end for copying conditions.
2899
 
 
2900
 
 Please send GNU C library bug reports via <http://sources.redhat.com/bugzilla/>
2901
 
 using `glibc' in the "product" field.
2902
 
 
2903
 
+Version 2.12.2
2904
 
+
2905
 
+* The following bugs are resolved with this release:
2906
 
+
2907
 
+  12077, 12092, 12113, 12159, 12167, 12191, 11840, 11856, 10851, 7066,
2908
 
+  11968, 12005, 12093, 12078, 12140, 11904, 12194, 11883, 11611,
2909
 
+  10085, 11149, 11903, 11655
2910
 
+
2911
 
+Version 2.12.1
2912
 
+
2913
 
+* The following bugs are resolved with this release:
2914
 
+
2915
 
+  11571, 11640
2916
 
+
2917
 
 Version 2.12
2918
 
 
2919
 
 * The following bugs are resolved with this release:
2920
 
--- a/posix/regcomp.c   (revision 11211)
2921
 
+++ b/posix/regcomp.c   (revision 12365)
2922
 
@@ -2170,16 +2170,21 @@
2923
 
       exp = parse_expression (regexp, preg, token, syntax, nest, err);
2924
 
       if (BE (*err != REG_NOERROR && exp == NULL, 0))
2925
 
        {
2926
 
+         if (tree != NULL)
2927
 
+           postorder (tree, free_tree, NULL);
2928
 
          return NULL;
2929
 
        }
2930
 
       if (tree != NULL && exp != NULL)
2931
 
        {
2932
 
-         tree = create_tree (dfa, tree, exp, CONCAT);
2933
 
-         if (tree == NULL)
2934
 
+         bin_tree_t *newtree = create_tree (dfa, tree, exp, CONCAT);
2935
 
+         if (newtree == NULL)
2936
 
            {
2937
 
+             postorder (exp, free_tree, NULL);
2938
 
+             postorder (tree, free_tree, NULL);
2939
 
              *err = REG_ESPACE;
2940
 
              return NULL;
2941
 
            }
2942
 
+         tree = newtree;
2943
 
        }
2944
 
       else if (tree == NULL)
2945
 
        tree = exp;
2946
 
@@ -2428,7 +2433,11 @@
2947
 
     {
2948
 
       tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
2949
 
       if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0))
2950
 
-       *err = REG_EPAREN;
2951
 
+       {
2952
 
+         if (tree != NULL)
2953
 
+           postorder (tree, free_tree, NULL);
2954
 
+         *err = REG_EPAREN;
2955
 
+       }
2956
 
       if (BE (*err != REG_NOERROR, 0))
2957
 
        return NULL;
2958
 
     }
2959
 
@@ -3055,6 +3064,10 @@
2960
 
   if (BE (sbcset == NULL, 0))
2961
 
 #endif /* RE_ENABLE_I18N */
2962
 
     {
2963
 
+      re_free (sbcset);
2964
 
+#ifdef RE_ENABLE_I18N
2965
 
+      re_free (mbcset);
2966
 
+#endif
2967
 
       *err = REG_ESPACE;
2968
 
       return NULL;
2969
 
     }
2970
 
--- a/posix/tst-fnmatch.c       (revision 11211)
2971
 
+++ b/posix/tst-fnmatch.c       (revision 12365)
2972
 
@@ -1,5 +1,5 @@
2973
 
 /* Tests for fnmatch function.
2974
 
-   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
2975
 
+   Copyright (C) 2000, 2001, 2010 Free Software Foundation, Inc.
2976
 
    This file is part of the GNU C Library.
2977
 
 
2978
 
    The GNU C Library is free software; you can redistribute it and/or
2979
 
@@ -25,6 +25,7 @@
2980
 
 #include <stdlib.h>
2981
 
 #include <string.h>
2982
 
 #include <sys/types.h>
2983
 
+#include <mcheck.h>
2984
 
 
2985
 
 
2986
 
 static char *next_input (char **line, int first, int last);
2987
 
@@ -46,6 +47,8 @@
2988
 
   size_t escpatternlen = 0;
2989
 
   int nr = 0;
2990
 
 
2991
 
+  mtrace ();
2992
 
+
2993
 
   /* Read lines from stdin with the following format:
2994
 
 
2995
 
        locale  input-string  match-string  flags  result
2996
 
--- a/posix/fnmatch_loop.c      (revision 11211)
2997
 
+++ b/posix/fnmatch_loop.c      (revision 12365)
2998
 
@@ -1,4 +1,4 @@
2999
 
-/* Copyright (C) 1991-1993,1996-2001,2003-2005,2007
3000
 
+/* Copyright (C) 1991-1993,1996-2001,2003-2005,2007,2010
3001
 
    Free Software Foundation, Inc.
3002
 
    This file is part of the GNU C Library.
3003
 
 
3004
 
@@ -30,22 +30,24 @@
3005
 
    it matches, nonzero if not.  */
3006
 
 static int FCT (const CHAR *pattern, const CHAR *string,
3007
 
                const CHAR *string_end, int no_leading_period, int flags,
3008
 
-               struct STRUCT *ends)
3009
 
+               struct STRUCT *ends, size_t alloca_used)
3010
 
      internal_function;
3011
 
 static int EXT (INT opt, const CHAR *pattern, const CHAR *string,
3012
 
-               const CHAR *string_end, int no_leading_period, int flags)
3013
 
+               const CHAR *string_end, int no_leading_period, int flags,
3014
 
+               size_t alloca_used)
3015
 
      internal_function;
3016
 
 static const CHAR *END (const CHAR *patternp) internal_function;
3017
 
 
3018
 
 static int
3019
 
 internal_function
3020
 
-FCT (pattern, string, string_end, no_leading_period, flags, ends)
3021
 
+FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
3022
 
      const CHAR *pattern;
3023
 
      const CHAR *string;
3024
 
      const CHAR *string_end;
3025
 
      int no_leading_period;
3026
 
      int flags;
3027
 
      struct STRUCT *ends;
3028
 
+     size_t alloca_used;
3029
 
 {
3030
 
   register const CHAR *p = pattern, *n = string;
3031
 
   register UCHAR c;
3032
 
@@ -74,10 +76,8 @@
3033
 
        case L('?'):
3034
 
          if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
3035
 
            {
3036
 
-             int res;
3037
 
-
3038
 
-             res = EXT (c, p, n, string_end, no_leading_period,
3039
 
-                        flags);
3040
 
+             int res = EXT (c, p, n, string_end, no_leading_period,
3041
 
+                            flags, alloca_used);
3042
 
              if (res != -1)
3043
 
                return res;
3044
 
            }
3045
 
@@ -106,10 +106,8 @@
3046
 
        case L('*'):
3047
 
          if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
3048
 
            {
3049
 
-             int res;
3050
 
-
3051
 
-             res = EXT (c, p, n, string_end, no_leading_period,
3052
 
-                        flags);
3053
 
+             int res = EXT (c, p, n, string_end, no_leading_period,
3054
 
+                            flags, alloca_used);
3055
 
              if (res != -1)
3056
 
                return res;
3057
 
            }
3058
 
@@ -198,7 +196,7 @@
3059
 
 
3060
 
                  for (--p; n < endp; ++n, no_leading_period = 0)
3061
 
                    if (FCT (p, n, string_end, no_leading_period, flags2,
3062
 
-                            &end) == 0)
3063
 
+                            &end, alloca_used) == 0)
3064
 
                      goto found;
3065
 
                }
3066
 
              else if (c == L('/') && (flags & FNM_FILE_NAME))
3067
 
@@ -207,7 +205,7 @@
3068
 
                    ++n;
3069
 
                  if (n < string_end && *n == L('/')
3070
 
                      && (FCT (p, n + 1, string_end, flags & FNM_PERIOD, flags,
3071
 
-                              NULL) == 0))
3072
 
+                              NULL, alloca_used) == 0))
3073
 
                    return 0;
3074
 
                }
3075
 
              else
3076
 
@@ -221,7 +219,7 @@
3077
 
                  for (--p; n < endp; ++n, no_leading_period = 0)
3078
 
                    if (FOLD ((UCHAR) *n) == c
3079
 
                        && (FCT (p, n, string_end, no_leading_period, flags2,
3080
 
-                                &end) == 0))
3081
 
+                                &end, alloca_used) == 0))
3082
 
                      {
3083
 
                      found:
3084
 
                        if (end.pattern == NULL)
3085
 
@@ -758,7 +756,7 @@
3086
 
                                               _NL_COLLATE_SYMB_EXTRAMB);
3087
 
 
3088
 
                                /* Locate the character in the hashing
3089
 
-                                   table.  */
3090
 
+                                  table.  */
3091
 
                                hash = elem_hash (str, c1);
3092
 
 
3093
 
                                idx = 0;
3094
 
@@ -980,9 +978,8 @@
3095
 
        case L('!'):
3096
 
          if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
3097
 
            {
3098
 
-             int res;
3099
 
-
3100
 
-             res = EXT (c, p, n, string_end, no_leading_period, flags);
3101
 
+             int res = EXT (c, p, n, string_end, no_leading_period, flags,
3102
 
+                            alloca_used);
3103
 
              if (res != -1)
3104
 
                return res;
3105
 
            }
3106
 
@@ -1061,26 +1058,32 @@
3107
 
 static int
3108
 
 internal_function
3109
 
 EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
3110
 
-     int no_leading_period, int flags)
3111
 
+     int no_leading_period, int flags, size_t alloca_used)
3112
 
 {
3113
 
   const CHAR *startp;
3114
 
   int level;
3115
 
   struct patternlist
3116
 
   {
3117
 
     struct patternlist *next;
3118
 
+    CHAR malloced;
3119
 
     CHAR str[0];
3120
 
   } *list = NULL;
3121
 
   struct patternlist **lastp = &list;
3122
 
   size_t pattern_len = STRLEN (pattern);
3123
 
+  int any_malloced = 0;
3124
 
   const CHAR *p;
3125
 
   const CHAR *rs;
3126
 
+  int retval = 0;
3127
 
 
3128
 
   /* Parse the pattern.  Store the individual parts in the list.  */
3129
 
   level = 0;
3130
 
   for (startp = p = pattern + 1; level >= 0; ++p)
3131
 
     if (*p == L('\0'))
3132
 
-      /* This is an invalid pattern.  */
3133
 
-      return -1;
3134
 
+      {
3135
 
+       /* This is an invalid pattern.  */
3136
 
+       retval = -1;
3137
 
+       goto out;
3138
 
+      }
3139
 
     else if (*p == L('['))
3140
 
       {
3141
 
        /* Handle brackets special.  */
3142
 
@@ -1097,8 +1100,11 @@
3143
 
        /* Skip over all characters of the list.  */
3144
 
        while (*p != L(']'))
3145
 
          if (*p++ == L('\0'))
3146
 
-           /* This is no valid pattern.  */
3147
 
-           return -1;
3148
 
+           {
3149
 
+             /* This is no valid pattern.  */
3150
 
+             retval = -1;
3151
 
+             goto out;
3152
 
+           }
3153
 
       }
3154
 
     else if ((*p == L('?') || *p == L('*') || *p == L('+') || *p == L('@')
3155
 
              || *p == L('!')) && p[1] == L('('))
3156
 
@@ -1111,15 +1117,25 @@
3157
 
            /* This means we found the end of the pattern.  */
3158
 
 #define NEW_PATTERN \
3159
 
            struct patternlist *newp;                                         \
3160
 
-                                                                             \
3161
 
-           if (opt == L('?') || opt == L('@'))                               \
3162
 
-             newp = alloca (sizeof (struct patternlist)                      \
3163
 
-                            + (pattern_len * sizeof (CHAR)));                \
3164
 
+           size_t slen = (opt == L('?') || opt == L('@')                     \
3165
 
+                          ? pattern_len : (p - startp + 1));                 \
3166
 
+           slen = sizeof (struct patternlist) + (slen * sizeof (CHAR));      \
3167
 
+           int malloced = ! __libc_use_alloca (alloca_used + slen);          \
3168
 
+           if (__builtin_expect (malloced, 0))                               \
3169
 
+             {                                                               \
3170
 
+               newp = malloc (slen);                                         \
3171
 
+               if (newp == NULL)                                             \
3172
 
+                 {                                                           \
3173
 
+                   retval = -2;                                              \
3174
 
+                   goto out;                                                 \
3175
 
+                 }                                                           \
3176
 
+               any_malloced = 1;                                             \
3177
 
+             }                                                               \
3178
 
            else                                                              \
3179
 
-             newp = alloca (sizeof (struct patternlist)                      \
3180
 
-                            + ((p - startp + 1) * sizeof (CHAR)));           \
3181
 
+             newp = alloca_account (slen, alloca_used);                      \
3182
 
+           newp->next = NULL;                                                \
3183
 
+           newp->malloced = malloced;                                        \
3184
 
            *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L('\0');    \
3185
 
-           newp->next = NULL;                                                \
3186
 
            *lastp = newp;                                                    \
3187
 
            lastp = &newp->next
3188
 
            NEW_PATTERN;
3189
 
@@ -1140,8 +1156,9 @@
3190
 
   switch (opt)
3191
 
     {
3192
 
     case L('*'):
3193
 
-      if (FCT (p, string, string_end, no_leading_period, flags, NULL) == 0)
3194
 
-       return 0;
3195
 
+      if (FCT (p, string, string_end, no_leading_period, flags, NULL,
3196
 
+              alloca_used) == 0)
3197
 
+       goto success;
3198
 
       /* FALLTHROUGH */
3199
 
 
3200
 
     case L('+'):
3201
 
@@ -1152,7 +1169,7 @@
3202
 
               current pattern.  */
3203
 
            if (FCT (list->str, string, rs, no_leading_period,
3204
 
                     flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
3205
 
-                    NULL) == 0
3206
 
+                    NULL, alloca_used) == 0
3207
 
                /* This was successful.  Now match the rest with the rest
3208
 
                   of the pattern.  */
3209
 
                && (FCT (p, rs, string_end,
3210
 
@@ -1160,7 +1177,7 @@
3211
 
                         ? no_leading_period
3212
 
                         : rs[-1] == '/' && NO_LEADING_PERIOD (flags) ? 1 : 0,
3213
 
                         flags & FNM_FILE_NAME
3214
 
-                        ? flags : flags & ~FNM_PERIOD, NULL) == 0
3215
 
+                        ? flags : flags & ~FNM_PERIOD, NULL, alloca_used) == 0
3216
 
                    /* This didn't work.  Try the whole pattern.  */
3217
 
                    || (rs != string
3218
 
                        && FCT (pattern - 1, rs, string_end,
3219
 
@@ -1169,18 +1186,21 @@
3220
 
                                : (rs[-1] == '/' && NO_LEADING_PERIOD (flags)
3221
 
                                   ? 1 : 0),
3222
 
                                flags & FNM_FILE_NAME
3223
 
-                               ? flags : flags & ~FNM_PERIOD, NULL) == 0)))
3224
 
+                               ? flags : flags & ~FNM_PERIOD, NULL,
3225
 
+                               alloca_used) == 0)))
3226
 
              /* It worked.  Signal success.  */
3227
 
-             return 0;
3228
 
+             goto success;
3229
 
        }
3230
 
       while ((list = list->next) != NULL);
3231
 
 
3232
 
       /* None of the patterns lead to a match.  */
3233
 
-      return FNM_NOMATCH;
3234
 
+      retval = FNM_NOMATCH;
3235
 
+      break;
3236
 
 
3237
 
     case L('?'):
3238
 
-      if (FCT (p, string, string_end, no_leading_period, flags, NULL) == 0)
3239
 
-       return 0;
3240
 
+      if (FCT (p, string, string_end, no_leading_period, flags, NULL,
3241
 
+              alloca_used) == 0)
3242
 
+       goto success;
3243
 
       /* FALLTHROUGH */
3244
 
 
3245
 
     case L('@'):
3246
 
@@ -1192,13 +1212,14 @@
3247
 
        if (FCT (STRCAT (list->str, p), string, string_end,
3248
 
                 no_leading_period,
3249
 
                 flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
3250
 
-                NULL) == 0)
3251
 
+                NULL, alloca_used) == 0)
3252
 
          /* It worked.  Signal success.  */
3253
 
-         return 0;
3254
 
+         goto success;
3255
 
       while ((list = list->next) != NULL);
3256
 
 
3257
 
       /* None of the patterns lead to a match.  */
3258
 
-      return FNM_NOMATCH;
3259
 
+      retval = FNM_NOMATCH;
3260
 
+      break;
3261
 
 
3262
 
     case L('!'):
3263
 
       for (rs = string; rs <= string_end; ++rs)
3264
 
@@ -1208,7 +1229,7 @@
3265
 
          for (runp = list; runp != NULL; runp = runp->next)
3266
 
            if (FCT (runp->str, string, rs,  no_leading_period,
3267
 
                     flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
3268
 
-                    NULL) == 0)
3269
 
+                    NULL, alloca_used) == 0)
3270
 
              break;
3271
 
 
3272
 
          /* If none of the patterns matched see whether the rest does.  */
3273
 
@@ -1218,21 +1239,34 @@
3274
 
                       ? no_leading_period
3275
 
                       : rs[-1] == '/' && NO_LEADING_PERIOD (flags) ? 1 : 0,
3276
 
                       flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
3277
 
-                      NULL) == 0))
3278
 
+                      NULL, alloca_used) == 0))
3279
 
            /* This is successful.  */
3280
 
-           return 0;
3281
 
+           goto success;
3282
 
        }
3283
 
 
3284
 
       /* None of the patterns together with the rest of the pattern
3285
 
         lead to a match.  */
3286
 
-      return FNM_NOMATCH;
3287
 
+      retval = FNM_NOMATCH;
3288
 
+      break;
3289
 
 
3290
 
     default:
3291
 
       assert (! "Invalid extended matching operator");
3292
 
+      retval = -1;
3293
 
       break;
3294
 
     }
3295
 
 
3296
 
-  return -1;
3297
 
+ success:
3298
 
+ out:
3299
 
+  if (any_malloced)
3300
 
+    while (list != NULL)
3301
 
+      {
3302
 
+       struct patternlist *old = list;
3303
 
+       list = list->next;
3304
 
+       if (old->malloced)
3305
 
+         free (old);
3306
 
+      }
3307
 
+
3308
 
+  return retval;
3309
 
 }
3310
 
 
3311
 
 
3312
 
--- a/posix/bug-regex31.c       (revision 0)
3313
 
+++ b/posix/bug-regex31.c       (revision 12365)
3314
 
@@ -0,0 +1,36 @@
3315
 
+#include <mcheck.h>
3316
 
+#include <regex.h>
3317
 
+#include <stdio.h>
3318
 
+#include <sys/types.h>
3319
 
+
3320
 
+int
3321
 
+main (void)
3322
 
+{
3323
 
+  mtrace ();
3324
 
+
3325
 
+  int res = 0;
3326
 
+  char *buf = NULL;
3327
 
+  size_t len = 0;
3328
 
+  while (! feof (stdin))
3329
 
+    {
3330
 
+      ssize_t n = getline (&buf, &len, stdin);
3331
 
+      if (n <= 0)
3332
 
+       break;
3333
 
+      if (buf[n - 1] == '\n')
3334
 
+       buf[n - 1] = '\0';
3335
 
+
3336
 
+      regex_t regex;
3337
 
+      int rc = regcomp (&regex, buf, REG_EXTENDED);
3338
 
+      if (rc != 0)
3339
 
+       printf ("%s: Error %d (expected)\n", buf, rc);
3340
 
+      else
3341
 
+       {
3342
 
+         printf ("%s: succeeded !\n", buf);
3343
 
+         res = 1;
3344
 
+       }
3345
 
+    }
3346
 
+
3347
 
+  free (buf);
3348
 
+
3349
 
+  return 0;
3350
 
+}
3351
 
--- a/posix/Makefile    (revision 11211)
3352
 
+++ b/posix/Makefile    (revision 12365)
3353
 
@@ -94,6 +94,7 @@
3354
 
                   bug-regex14 bug-regex15 \
3355
 
                   bug-regex21 bug-regex24 \
3356
 
                   bug-regex27 bug-regex28 bug-regex29 bug-regex30 \
3357
 
+                  bug-regex31 \
3358
 
                   tst-nice tst-nanosleep \
3359
 
                   transbug \
3360
 
                   tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
3361
 
@@ -136,10 +137,12 @@
3362
 
             annexc annexc.out wordexp-tst.out bug-regex2-mem \
3363
 
             bug-regex2.mtrace bug-regex14-mem bug-regex14.mtrace \
3364
 
             bug-regex21-mem bug-regex21.mtrace \
3365
 
+            bug-regex31-mem bug-regex31.mtrace \
3366
 
             tst-rxspencer-mem tst-rxspencer.mtrace tst-getconf.out \
3367
 
             tst-pcre-mem tst-pcre.mtrace tst-boost-mem tst-boost.mtrace \
3368
 
             bug-ga2.mtrace bug-ga2-mem bug-glob2.mtrace bug-glob2-mem \
3369
 
-            tst-vfork3-mem tst-vfork3.mtrace getconf.speclist
3370
 
+            tst-vfork3-mem tst-vfork3.mtrace getconf.speclist \
3371
 
+            tst-fnmatch-mem tst-fnmatch.mtrace
3372
 
 
3373
 
 include ../Rules
3374
 
 
3375
 
@@ -259,8 +262,9 @@
3376
 
 # eglibc: ifeq (no,$(cross-compiling))
3377
 
 tests: $(objpfx)bug-regex2-mem \
3378
 
   $(objpfx)bug-regex21-mem \
3379
 
+  $(objpfx)bug-regex31-mem \
3380
 
   $(objpfx)tst-getconf.out \
3381
 
-  $(objpfx)bug-glob2-mem $(objpfx)tst-vfork3-mem
3382
 
+  $(objpfx)bug-glob2-mem $(objpfx)tst-vfork3-mem $(objpfx)tst-fnmatch-mem
3383
 
 ifeq (y,($OPTION_POSIX_REGEXP_GLIBC))
3384
 
 tests: $(objpfx)bug-regex14-mem $(objpfx)tst-rxspencer-mem \
3385
 
   $(objpfx)tst-pcre-mem $(objpfx)tst-boost-mem 
3386
 
@@ -276,6 +280,11 @@
3387
 
 $(objpfx)annexc: annexc.c
3388
 
        $(native-compile)
3389
 
 
3390
 
+tst-fnmatch-ENV += MALLOC_TRACE=$(objpfx)tst-fnmatch.mtrace
3391
 
+
3392
 
+$(objpfx)tst-fnmatch-mem: $(objpfx)tst-fnmatch.out
3393
 
+       $(common-objpfx)malloc/mtrace $(objpfx)tst-fnmatch.mtrace > $@
3394
 
+
3395
 
 bug-regex2-ENV = MALLOC_TRACE=$(objpfx)bug-regex2.mtrace
3396
 
 
3397
 
 $(objpfx)bug-regex2-mem: $(objpfx)bug-regex2.out
3398
 
@@ -291,6 +300,11 @@
3399
 
 $(objpfx)bug-regex21-mem: $(objpfx)bug-regex21.out
3400
 
        $(common-objpfx)malloc/mtrace $(objpfx)bug-regex21.mtrace > $@
3401
 
 
3402
 
+bug-regex31-ENV = MALLOC_TRACE=$(objpfx)bug-regex31.mtrace
3403
 
+
3404
 
+$(objpfx)bug-regex31-mem: $(objpfx)bug-regex31.out
3405
 
+       $(common-objpfx)malloc/mtrace $(objpfx)bug-regex31.mtrace > $@
3406
 
+
3407
 
 tst-vfork3-ENV = MALLOC_TRACE=$(objpfx)tst-vfork3.mtrace
3408
 
 
3409
 
 $(objpfx)tst-vfork3-mem: $(objpfx)tst-vfork3.out
3410
 
--- a/posix/bug-regex31.input   (revision 0)
3411
 
+++ b/posix/bug-regex31.input   (revision 12365)
3412
 
@@ -0,0 +1,4 @@
3413
 
+[[][
3414
 
+([0]
3415
 
+([0]a
3416
 
+([0]([0])
3417
 
--- a/posix/fnmatch.c   (revision 11211)
3418
 
+++ b/posix/fnmatch.c   (revision 12365)
3419
 
@@ -1,4 +1,4 @@
3420
 
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007
3421
 
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007,2010
3422
 
        Free Software Foundation, Inc.
3423
 
    This file is part of the GNU C Library.
3424
 
 
3425
 
@@ -45,6 +45,12 @@
3426
 
 # include <stdlib.h>
3427
 
 #endif
3428
 
 
3429
 
+#ifdef _LIBC
3430
 
+# include <alloca.h>
3431
 
+#else
3432
 
+# define alloca_account(size., var) alloca (size)
3433
 
+#endif
3434
 
+
3435
 
 /* For platform which support the ISO C amendement 1 functionality we
3436
 
    support user defined character classes.  */
3437
 
 #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
3438
 
@@ -334,8 +340,11 @@
3439
 
       mbstate_t ps;
3440
 
       size_t n;
3441
 
       const char *p;
3442
 
+      wchar_t *wpattern_malloc = NULL;
3443
 
       wchar_t *wpattern;
3444
 
+      wchar_t *wstring_malloc = NULL;
3445
 
       wchar_t *wstring;
3446
 
+      size_t alloca_used = 0;
3447
 
 
3448
 
       /* Convert the strings into wide characters.  */
3449
 
       memset (&ps, '\0', sizeof (ps));
3450
 
@@ -347,7 +356,8 @@
3451
 
 #endif
3452
 
       if (__builtin_expect (n < 1024, 1))
3453
 
        {
3454
 
-         wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
3455
 
+         wpattern = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
3456
 
+                                                alloca_used);
3457
 
          n = mbsrtowcs (wpattern, &p, n + 1, &ps);
3458
 
          if (__builtin_expect (n == (size_t) -1, 0))
3459
 
            /* Something wrong.
3460
 
@@ -369,8 +379,11 @@
3461
 
               XXX Do we have to set `errno' to something which mbsrtows hasn't
3462
 
               already done?  */
3463
 
            return -1;
3464
 
-         wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
3465
 
+         wpattern_malloc = wpattern
3466
 
+           = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
3467
 
          assert (mbsinit (&ps));
3468
 
+         if (wpattern == NULL)
3469
 
+           return -2;
3470
 
          (void) mbsrtowcs (wpattern, &pattern, n + 1, &ps);
3471
 
        }
3472
 
 
3473
 
@@ -383,13 +396,18 @@
3474
 
       p = string;
3475
 
       if (__builtin_expect (n < 1024, 1))
3476
 
        {
3477
 
-         wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
3478
 
+         wstring = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
3479
 
+                                               alloca_used);
3480
 
          n = mbsrtowcs (wstring, &p, n + 1, &ps);
3481
 
          if (__builtin_expect (n == (size_t) -1, 0))
3482
 
-           /* Something wrong.
3483
 
-              XXX Do we have to set `errno' to something which mbsrtows hasn't
3484
 
-              already done?  */
3485
 
-           return -1;
3486
 
+           {
3487
 
+             /* Something wrong.
3488
 
+                XXX Do we have to set `errno' to something which
3489
 
+                mbsrtows hasn't already done?  */
3490
 
+           free_return:
3491
 
+             free (wpattern_malloc);
3492
 
+             return -1;
3493
 
+           }
3494
 
          if (p)
3495
 
            {
3496
 
              memset (&ps, '\0', sizeof (ps));
3497
 
@@ -404,19 +422,32 @@
3498
 
            /* Something wrong.
3499
 
               XXX Do we have to set `errno' to something which mbsrtows hasn't
3500
 
               already done?  */
3501
 
-           return -1;
3502
 
-         wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
3503
 
+           goto free_return;
3504
 
+
3505
 
+         wstring_malloc = wstring
3506
 
+           = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
3507
 
+         if (wstring == NULL)
3508
 
+           {
3509
 
+             free (wpattern_malloc);
3510
 
+             return -2;
3511
 
+           }
3512
 
          assert (mbsinit (&ps));
3513
 
          (void) mbsrtowcs (wstring, &string, n + 1, &ps);
3514
 
        }
3515
 
 
3516
 
-      return internal_fnwmatch (wpattern, wstring, wstring + n,
3517
 
-                               flags & FNM_PERIOD, flags, NULL);
3518
 
+      int res = internal_fnwmatch (wpattern, wstring, wstring + n,
3519
 
+                                  flags & FNM_PERIOD, flags, NULL,
3520
 
+                                  alloca_used);
3521
 
+
3522
 
+      free (wstring_malloc);
3523
 
+      free (wpattern_malloc);
3524
 
+
3525
 
+      return res;
3526
 
     }
3527
 
 # endif  /* mbstate_t and mbsrtowcs or _LIBC.  */
3528
 
 
3529
 
   return internal_fnmatch (pattern, string, string + strlen (string),
3530
 
-                          flags & FNM_PERIOD, flags, NULL);
3531
 
+                          flags & FNM_PERIOD, flags, NULL, 0);
3532
 
 }
3533
 
 
3534
 
 # ifdef _LIBC
3535
 
--- a/resolv/res_init.c (revision 11211)
3536
 
+++ b/resolv/res_init.c (revision 12365)
3537
 
@@ -176,13 +176,6 @@
3538
 
                statp->id = res_randomid();
3539
 
        }
3540
 
 
3541
 
-#ifdef USELOOPBACK
3542
 
-       statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
3543
 
-#else
3544
 
-       statp->nsaddr.sin_addr.s_addr = INADDR_ANY;
3545
 
-#endif
3546
 
-       statp->nsaddr.sin_family = AF_INET;
3547
 
-       statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
3548
 
        statp->nscount = 0;
3549
 
        statp->ndots = 1;
3550
 
        statp->pfcode = 0;
3551
 
@@ -321,24 +314,24 @@
3552
 
                        nserv++;
3553
 
 #ifdef _LIBC
3554
 
                        nservall++;
3555
 
-                    } else {
3556
 
-                        struct in6_addr a6;
3557
 
-                        char *el;
3558
 
+                   } else {
3559
 
+                       struct in6_addr a6;
3560
 
+                       char *el;
3561
 
 
3562
 
-                        if ((el = strchr(cp, '\n')) != NULL)
3563
 
-                            *el = '\0';
3564
 
+                       if ((el = strchr(cp, '\n')) != NULL)
3565
 
+                           *el = '\0';
3566
 
                        if ((el = strchr(cp, SCOPE_DELIMITER)) != NULL)
3567
 
                            *el = '\0';
3568
 
-                        if ((*cp != '\0') &&
3569
 
-                            (inet_pton(AF_INET6, cp, &a6) > 0)) {
3570
 
-                            struct sockaddr_in6 *sa6;
3571
 
+                       if ((*cp != '\0') &&
3572
 
+                           (inet_pton(AF_INET6, cp, &a6) > 0)) {
3573
 
+                           struct sockaddr_in6 *sa6;
3574
 
 
3575
 
-                            sa6 = malloc(sizeof(*sa6));
3576
 
-                            if (sa6 != NULL) {
3577
 
-                                sa6->sin6_family = AF_INET6;
3578
 
-                                sa6->sin6_port = htons(NAMESERVER_PORT);
3579
 
+                           sa6 = malloc(sizeof(*sa6));
3580
 
+                           if (sa6 != NULL) {
3581
 
+                               sa6->sin6_family = AF_INET6;
3582
 
+                               sa6->sin6_port = htons(NAMESERVER_PORT);
3583
 
                                sa6->sin6_flowinfo = 0;
3584
 
-                                sa6->sin6_addr = a6;
3585
 
+                               sa6->sin6_addr = a6;
3586
 
 
3587
 
                                if (__builtin_expect (el == NULL, 1))
3588
 
                                    sa6->sin6_scope_id = 0;
3589
 
@@ -365,9 +358,9 @@
3590
 
                                statp->_u._ext.nsaddrs[nservall] = sa6;
3591
 
                                statp->_u._ext.nssocks[nservall] = -1;
3592
 
                                statp->_u._ext.nsmap[nservall] = MAXNS + 1;
3593
 
-                                nservall++;
3594
 
-                            }
3595
 
-                        }
3596
 
+                               nservall++;
3597
 
+                           }
3598
 
+                       }
3599
 
 #endif
3600
 
                    }
3601
 
                    continue;
3602
 
@@ -433,6 +426,12 @@
3603
 
 #endif
3604
 
            (void) fclose(fp);
3605
 
        }
3606
 
+       if (__builtin_expect(statp->nscount == 0, 0)) {
3607
 
+           statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
3608
 
+           statp->nsaddr.sin_family = AF_INET;
3609
 
+           statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
3610
 
+           statp->nscount = 1;
3611
 
+       }
3612
 
        if (statp->defdname[0] == 0 &&
3613
 
            __gethostname(buf, sizeof(statp->defdname) - 1) == 0 &&
3614
 
            (cp = strchr(buf, '.')) != NULL)
3615
 
@@ -538,12 +537,12 @@
3616
 
                } else if (!strncmp(cp, "no-check-names",
3617
 
                                    sizeof("no-check-names") - 1)) {
3618
 
                        statp->options |= RES_NOCHECKNAME;
3619
 
-                } else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) {
3620
 
+               } else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) {
3621
 
                        statp->options |= RES_USE_EDNS0;
3622
 
-                } else if (!strncmp(cp, "single-request-reopen",
3623
 
+               } else if (!strncmp(cp, "single-request-reopen",
3624
 
                                    sizeof("single-request-reopen") - 1)) {
3625
 
                        statp->options |= RES_SNGLKUPREOP;
3626
 
-                } else if (!strncmp(cp, "single-request",
3627
 
+               } else if (!strncmp(cp, "single-request",
3628
 
                                    sizeof("single-request") - 1)) {
3629
 
                        statp->options |= RES_SNGLKUP;
3630
 
                } else {
3631
 
--- a/resolv/nss_dns/dns-host.c (revision 11211)
3632
 
+++ b/resolv/nss_dns/dns-host.c (revision 12365)
3633
 
@@ -599,7 +599,6 @@
3634
 
   int (*name_ok) (const char *);
3635
 
   u_char packtmp[NS_MAXCDNAME];
3636
 
   int have_to_map = 0;
3637
 
-  int32_t ttl = 0;
3638
 
   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
3639
 
   buffer += pad;
3640
 
   if (__builtin_expect (buflen < sizeof (struct host_data) + pad, 0))
3641
 
@@ -733,7 +732,7 @@
3642
 
       cp += INT16SZ;                   /* type */
3643
 
       class = __ns_get16 (cp);
3644
 
       cp += INT16SZ;                   /* class */
3645
 
-      ttl = __ns_get32 (cp);
3646
 
+      int32_t ttl = __ns_get32 (cp);
3647
 
       cp += INT32SZ;                   /* TTL */
3648
 
       n = __ns_get16 (cp);
3649
 
       cp += INT16SZ;                   /* len */
3650
 
@@ -907,7 +906,7 @@
3651
 
            {
3652
 
              register int nn;
3653
 
 
3654
 
-             if (ttlp != NULL && ttl != 0)
3655
 
+             if (ttlp != NULL)
3656
 
                *ttlp = ttl;
3657
 
              if (canonp != NULL)
3658
 
                *canonp = bp;
3659
 
@@ -1163,7 +1162,7 @@
3660
 
 
3661
 
       if (*firstp)
3662
 
        {
3663
 
-         if (ttl != 0 && ttlp != NULL)
3664
 
+         if (ttlp != NULL)
3665
 
            *ttlp = ttl;
3666
 
 
3667
 
          (*pat)->name = canon ?: h_name;
3668
 
--- a/version.h (revision 11211)
3669
 
+++ b/version.h (revision 12365)
3670
 
@@ -1,4 +1,4 @@
3671
 
 /* This file just defines the current version number of libc.  */
3672
 
 
3673
 
 #define RELEASE "stable"
3674
 
-#define VERSION "2.12.1"
3675
 
+#define VERSION "2.12.2"
3676
 
--- a/manual/arith.texi (revision 11211)
3677
 
+++ b/manual/arith.texi (revision 12365)
3678
 
@@ -1407,7 +1407,8 @@
3679
 
 @comment ISO
3680
 
 @deftypefunx {long double} roundl (long double @var{x})
3681
 
 These functions are similar to @code{rint}, but they round halfway
3682
 
-cases away from zero instead of to the nearest even integer.
3683
 
+cases away from zero instead of to the nearest integer (or other
3684
 
+current rounding mode).
3685
 
 @end deftypefun
3686
 
 
3687
 
 @comment math.h
3688
 
--- a/manual/Makefile   (revision 11211)
3689
 
+++ b/manual/Makefile   (revision 12365)
3690
 
@@ -243,9 +243,12 @@
3691
 
 .PHONY: stubs
3692
 
 stubs: $(objpfx)stubs
3693
 
 endif
3694
 
-$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
3695
 
+$(objpfx)stubs ../po/manual.pot:
3696
 
        $(make-target-directory)
3697
 
        touch $@
3698
 
+$(objpfx)stamp%:
3699
 
+       $(make-target-directory)
3700
 
+       touch $@
3701
 
 
3702
 
 # Make the target directory if it doesn't exist, using the `mkinstalldirs'
3703
 
 # script that does `mkdir -p' even if `mkdir' doesn't support that flag.
3704
 
--- a/manual/memory.texi        (revision 11211)
3705
 
+++ b/manual/memory.texi        (revision 12365)
3706
 
@@ -702,6 +702,11 @@
3707
 
 @item M_MMAP_MAX
3708
 
 The maximum number of chunks to allocate with @code{mmap}.  Setting this
3709
 
 to zero disables all use of @code{mmap}.
3710
 
+@item M_PERTURB
3711
 
+If non-zero, memory blocks are filled with values depending on some
3712
 
+low order bits of this parameter when they are allocated (except when
3713
 
+allocated by @code{calloc}) and freed.  This can be used to debug the
3714
 
+use of uninitialized or freed heap memory.
3715
 
 @end table
3716
 
 
3717
 
 @end deftypefun
3718
 
--- a/manual/locale.texi        (revision 11211)
3719
 
+++ b/manual/locale.texi        (revision 12365)
3720
 
@@ -1210,7 +1210,7 @@
3721
 
   /* @r{Prepare the @code{getline} call.}  */
3722
 
   line = NULL;
3723
 
   len = 0;
3724
 
-  while (getline (&line, &len, stdout) >= 0)
3725
 
+  while (getline (&line, &len, stdin) >= 0)
3726
 
     @{
3727
 
       /* @r{Check the response.}  */
3728
 
       int res = rpmatch (line);
3729
 
--- a/configure (revision 11211)
3730
 
+++ b/configure (revision 12365)
3731
 
@@ -682,7 +682,7 @@
3732
 
 exceptions
3733
 
 no_whole_archive
3734
 
 libc_cv_have_initfini
3735
 
-libc_cv_gnu89_inline
3736
 
+gnu89_inline
3737
 
 libc_cv_ssp
3738
 
 fno_unit_at_a_time
3739
 
 libc_cv_hashstyle
3740
 
@@ -3873,9 +3873,6 @@
3741
 
   multi_arch=default
3742
 
 fi
3743
 
 
3744
 
-if test x"$multi_arch" != xno; then
3745
 
-  multi_arch_d=/multiarch
3746
 
-fi
3747
 
 
3748
 
 # Check whether --enable-experimental-malloc was given.
3749
 
 if test "${enable_experimental_malloc+set}" = set; then
3750
 
@@ -4309,6 +4306,140 @@
3751
 
 
3752
 
 fi
3753
 
 
3754
 
+# For the multi-arch option we need support in the assembler.
3755
 
+{ $as_echo "$as_me:$LINENO: checking for assembler gnu_indirect_function symbol type support" >&5
3756
 
+$as_echo_n "checking for assembler gnu_indirect_function symbol type support... " >&6; }
3757
 
+if test "${libc_cv_asm_gnu_indirect_function+set}" = set; then
3758
 
+  $as_echo_n "(cached) " >&6
3759
 
+else
3760
 
+  cat > conftest.s <<EOF
3761
 
+.type foo,%gnu_indirect_function
3762
 
+EOF
3763
 
+if ${CC-cc} -c $ASFLAGS conftest.s 1>&5 2>&5;
3764
 
+then
3765
 
+  libc_cv_asm_gnu_indirect_function=yes
3766
 
+else
3767
 
+  libc_cv_asm_gnu_indirect_function=no
3768
 
+fi
3769
 
+rm -f conftest*
3770
 
+fi
3771
 
+{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_gnu_indirect_function" >&5
3772
 
+$as_echo "$libc_cv_asm_gnu_indirect_function" >&6; }
3773
 
+
3774
 
+{ $as_echo "$as_me:$LINENO: checking whether .text pseudo-op must be used" >&5
3775
 
+$as_echo_n "checking whether .text pseudo-op must be used... " >&6; }
3776
 
+if test "${libc_cv_dot_text+set}" = set; then
3777
 
+  $as_echo_n "(cached) " >&6
3778
 
+else
3779
 
+  cat > conftest.s <<EOF
3780
 
+.text
3781
 
+EOF
3782
 
+libc_cv_dot_text=
3783
 
+if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5'
3784
 
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3785
 
+  (eval $ac_try) 2>&5
3786
 
+  ac_status=$?
3787
 
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3788
 
+  (exit $ac_status); }; }; then
3789
 
+  libc_cv_dot_text=.text
3790
 
+fi
3791
 
+rm -f conftest*
3792
 
+fi
3793
 
+
3794
 
+if test -z "$libc_cv_dot_text"; then
3795
 
+  { $as_echo "$as_me:$LINENO: result: no" >&5
3796
 
+$as_echo "no" >&6; }
3797
 
+else
3798
 
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
3799
 
+$as_echo "yes" >&6; }
3800
 
+fi
3801
 
+
3802
 
+{ $as_echo "$as_me:$LINENO: checking for assembler global-symbol directive" >&5
3803
 
+$as_echo_n "checking for assembler global-symbol directive... " >&6; }
3804
 
+if test "${libc_cv_asm_global_directive+set}" = set; then
3805
 
+  $as_echo_n "(cached) " >&6
3806
 
+else
3807
 
+  libc_cv_asm_global_directive=UNKNOWN
3808
 
+for ac_globl in .globl .global .EXPORT; do
3809
 
+  cat > conftest.s <<EOF
3810
 
+       ${libc_cv_dot_text}
3811
 
+       ${ac_globl} foo
3812
 
+foo:
3813
 
+EOF
3814
 
+  if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5'
3815
 
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3816
 
+  (eval $ac_try) 2>&5
3817
 
+  ac_status=$?
3818
 
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3819
 
+  (exit $ac_status); }; }; then
3820
 
+    libc_cv_asm_global_directive=${ac_globl}
3821
 
+  fi
3822
 
+  rm -f conftest*
3823
 
+  test $libc_cv_asm_global_directive != UNKNOWN && break
3824
 
+done
3825
 
+fi
3826
 
+{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_global_directive" >&5
3827
 
+$as_echo "$libc_cv_asm_global_directive" >&6; }
3828
 
+if test $libc_cv_asm_global_directive = UNKNOWN; then
3829
 
+  { { $as_echo "$as_me:$LINENO: error: cannot determine asm global directive" >&5
3830
 
+$as_echo "$as_me: error: cannot determine asm global directive" >&2;}
3831
 
+   { (exit 1); exit 1; }; }
3832
 
+else
3833
 
+  cat >>confdefs.h <<_ACEOF
3834
 
+#define ASM_GLOBAL_DIRECTIVE ${libc_cv_asm_global_directive}
3835
 
+_ACEOF
3836
 
+
3837
 
+fi
3838
 
+
3839
 
+{ $as_echo "$as_me:$LINENO: checking for assembler .type directive prefix" >&5
3840
 
+$as_echo_n "checking for assembler .type directive prefix... " >&6; }
3841
 
+if test "${libc_cv_asm_type_prefix+set}" = set; then
3842
 
+  $as_echo_n "(cached) " >&6
3843
 
+else
3844
 
+  libc_cv_asm_type_prefix=no
3845
 
+for ac_try_prefix in '@' '%' '#'; do
3846
 
+  cat > conftest.s <<EOF
3847
 
+       ${libc_cv_dot_text}
3848
 
+       ${libc_cv_asm_global_directive} foo
3849
 
+       .type foo, ${ac_try_prefix}object
3850
 
+       .size foo, 1
3851
 
+foo:
3852
 
+       .byte 1
3853
 
+EOF
3854
 
+  if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5'
3855
 
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3856
 
+  (eval $ac_try) 2>&5
3857
 
+  ac_status=$?
3858
 
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3859
 
+  (exit $ac_status); }; }; then
3860
 
+    libc_cv_asm_type_prefix=${ac_try_prefix}
3861
 
+  fi
3862
 
+  rm -f conftest*
3863
 
+  test "x$libc_cv_asm_type_prefix" != xno && break
3864
 
+done
3865
 
+fi
3866
 
+{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_type_prefix" >&5
3867
 
+$as_echo "$libc_cv_asm_type_prefix" >&6; }
3868
 
+if test "x$libc_cv_asm_type_prefix" != xno; then
3869
 
+  cat >>confdefs.h <<_ACEOF
3870
 
+#define ASM_TYPE_DIRECTIVE_PREFIX ${libc_cv_asm_type_prefix}
3871
 
+_ACEOF
3872
 
+
3873
 
+fi
3874
 
+
3875
 
+if test x"$libc_cv_asm_gnu_indirect_function" != xyes -a x"$libc_cv_asm_type_prefix" = xno; then
3876
 
+  if test x"$multi_arch" = xyes; then
3877
 
+    { { $as_echo "$as_me:$LINENO: error: --enable-multi-arch support requires assembler and linker support" >&5
3878
 
+$as_echo "$as_me: error: --enable-multi-arch support requires assembler and linker support" >&2;}
3879
 
+   { (exit 1); exit 1; }; }
3880
 
+  else
3881
 
+    multi_arch=no
3882
 
+  fi
3883
 
+fi
3884
 
+if test x"$multi_arch" != xno; then
3885
 
+  multi_arch_d=/multiarch
3886
 
+fi
3887
 
+
3888
 
 # Compute the list of sysdep directories for this configuration.
3889
 
 # This can take a while to compute.
3890
 
 sysdep_dir=$srcdir/sysdeps
3891
 
@@ -4425,35 +4556,14 @@
3892
 
 
3893
 
 # If the assembler supports gnu_indirect_function symbol type and the
3894
 
 # architecture supports multi-arch, we enable multi-arch by default.
3895
 
-if test "$multi_arch" = default; then
3896
 
-{ $as_echo "$as_me:$LINENO: checking for assembler gnu_indirect_function symbol type support" >&5
3897
 
-$as_echo_n "checking for assembler gnu_indirect_function symbol type support... " >&6; }
3898
 
-if test "${libc_cv_asm_gnu_indirect_function+set}" = set; then
3899
 
-  $as_echo_n "(cached) " >&6
3900
 
-else
3901
 
-  cat > conftest.s <<EOF
3902
 
-.type foo,%gnu_indirect_function
3903
 
-EOF
3904
 
-if ${CC-cc} -c $ASFLAGS conftest.s 1>&5 2>&5;
3905
 
-then
3906
 
-  libc_cv_asm_gnu_indirect_function=yes
3907
 
-else
3908
 
-  libc_cv_asm_gnu_indirect_function=no
3909
 
-fi
3910
 
-rm -f conftest*
3911
 
-fi
3912
 
-{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_gnu_indirect_function" >&5
3913
 
-$as_echo "$libc_cv_asm_gnu_indirect_function" >&6; }
3914
 
+case $sysnames_add_ons$sysnames in
3915
 
+*"$multi_arch_d"*)
3916
 
+  ;;
3917
 
+*)
3918
 
   multi_arch=no
3919
 
-  if test "$libc_cv_asm_gnu_indirect_function" = yes; then
3920
 
-    case $sysnames_add_ons$sysnames in
3921
 
-    *"$multi_arch_d"*)
3922
 
-       multi_arch=yes
3923
 
-      ;;
3924
 
-    esac
3925
 
-  fi
3926
 
-fi
3927
 
-if test x"$multi_arch" = xyes; then
3928
 
+  ;;
3929
 
+esac
3930
 
+if test x"$multi_arch" != xno; then
3931
 
   cat >>confdefs.h <<\_ACEOF
3932
 
 #define USE_MULTIARCH 1
3933
 
 _ACEOF
3934
 
@@ -6020,71 +6130,6 @@
3935
 
 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
3936
 
 fi
3937
 
 
3938
 
-{ $as_echo "$as_me:$LINENO: checking whether .text pseudo-op must be used" >&5
3939
 
-$as_echo_n "checking whether .text pseudo-op must be used... " >&6; }
3940
 
-if test "${libc_cv_dot_text+set}" = set; then
3941
 
-  $as_echo_n "(cached) " >&6
3942
 
-else
3943
 
-  cat > conftest.s <<EOF
3944
 
-.text
3945
 
-EOF
3946
 
-libc_cv_dot_text=
3947
 
-if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5'
3948
 
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3949
 
-  (eval $ac_try) 2>&5
3950
 
-  ac_status=$?
3951
 
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3952
 
-  (exit $ac_status); }; }; then
3953
 
-  libc_cv_dot_text=.text
3954
 
-fi
3955
 
-rm -f conftest*
3956
 
-fi
3957
 
-
3958
 
-if test -z "$libc_cv_dot_text"; then
3959
 
-  { $as_echo "$as_me:$LINENO: result: no" >&5
3960
 
-$as_echo "no" >&6; }
3961
 
-else
3962
 
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
3963
 
-$as_echo "yes" >&6; }
3964
 
-fi
3965
 
-
3966
 
-{ $as_echo "$as_me:$LINENO: checking for assembler global-symbol directive" >&5
3967
 
-$as_echo_n "checking for assembler global-symbol directive... " >&6; }
3968
 
-if test "${libc_cv_asm_global_directive+set}" = set; then
3969
 
-  $as_echo_n "(cached) " >&6
3970
 
-else
3971
 
-  libc_cv_asm_global_directive=UNKNOWN
3972
 
-for ac_globl in .globl .global .EXPORT; do
3973
 
-  cat > conftest.s <<EOF
3974
 
-       ${libc_cv_dot_text}
3975
 
-       ${ac_globl} foo
3976
 
-foo:
3977
 
-EOF
3978
 
-  if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5'
3979
 
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3980
 
-  (eval $ac_try) 2>&5
3981
 
-  ac_status=$?
3982
 
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3983
 
-  (exit $ac_status); }; }; then
3984
 
-    libc_cv_asm_global_directive=${ac_globl}
3985
 
-  fi
3986
 
-  rm -f conftest*
3987
 
-  test $libc_cv_asm_global_directive != UNKNOWN && break
3988
 
-done
3989
 
-fi
3990
 
-{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_global_directive" >&5
3991
 
-$as_echo "$libc_cv_asm_global_directive" >&6; }
3992
 
-if test $libc_cv_asm_global_directive = UNKNOWN; then
3993
 
-  { { $as_echo "$as_me:$LINENO: error: cannot determine asm global directive" >&5
3994
 
-$as_echo "$as_me: error: cannot determine asm global directive" >&2;}
3995
 
-   { (exit 1); exit 1; }; }
3996
 
-else
3997
 
-  cat >>confdefs.h <<_ACEOF
3998
 
-#define ASM_GLOBAL_DIRECTIVE ${libc_cv_asm_global_directive}
3999
 
-_ACEOF
4000
 
-
4001
 
-fi
4002
 
-
4003
 
 { $as_echo "$as_me:$LINENO: checking for .set assembler directive" >&5
4004
 
 $as_echo_n "checking for .set assembler directive... " >&6; }
4005
 
 if test "${libc_cv_asm_set_directive+set}" = set; then
4006
 
@@ -6120,42 +6165,6 @@
4007
 
 
4008
 
 fi
4009
 
 
4010
 
-{ $as_echo "$as_me:$LINENO: checking for assembler .type directive prefix" >&5
4011
 
-$as_echo_n "checking for assembler .type directive prefix... " >&6; }
4012
 
-if test "${libc_cv_asm_type_prefix+set}" = set; then
4013
 
-  $as_echo_n "(cached) " >&6
4014
 
-else
4015
 
-  libc_cv_asm_type_prefix=no
4016
 
-for ac_try_prefix in '@' '%' '#'; do
4017
 
-  cat > conftest.s <<EOF
4018
 
-       ${libc_cv_dot_text}
4019
 
-       ${libc_cv_asm_global_directive} foo
4020
 
-       .type foo, ${ac_try_prefix}object
4021
 
-       .size foo, 1
4022
 
-foo:
4023
 
-       .byte 1
4024
 
-EOF
4025
 
-  if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5'
4026
 
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4027
 
-  (eval $ac_try) 2>&5
4028
 
-  ac_status=$?
4029
 
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4030
 
-  (exit $ac_status); }; }; then
4031
 
-    libc_cv_asm_type_prefix=${ac_try_prefix}
4032
 
-  fi
4033
 
-  rm -f conftest*
4034
 
-  test "x$libc_cv_asm_type_prefix" != xno && break
4035
 
-done
4036
 
-fi
4037
 
-{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_type_prefix" >&5
4038
 
-$as_echo "$libc_cv_asm_type_prefix" >&6; }
4039
 
-if test "x$libc_cv_asm_type_prefix" != xno; then
4040
 
-  cat >>confdefs.h <<_ACEOF
4041
 
-#define ASM_TYPE_DIRECTIVE_PREFIX ${libc_cv_asm_type_prefix}
4042
 
-_ACEOF
4043
 
-
4044
 
-fi
4045
 
-
4046
 
 { $as_echo "$as_me:$LINENO: checking for assembler gnu_unique_object symbol type" >&5
4047
 
 $as_echo_n "checking for assembler gnu_unique_object symbol type... " >&6; }
4048
 
 if test "${libc_cv_asm_unique_object+set}" = set; then
4049
 
@@ -6182,37 +6191,6 @@
4050
 
 
4051
 
 fi
4052
 
 
4053
 
-# For the multi-arch option we need support in the assembler.
4054
 
-if test "$multi_arch" = yes; then
4055
 
-  if test "x$libc_cv_asm_type_prefix" != xno; then
4056
 
-{ $as_echo "$as_me:$LINENO: checking for assembler gnu_indirect_function symbol type support" >&5
4057
 
-$as_echo_n "checking for assembler gnu_indirect_function symbol type support... " >&6; }
4058
 
-if test "${libc_cv_asm_gnu_indirect_function+set}" = set; then
4059
 
-  $as_echo_n "(cached) " >&6
4060
 
-else
4061
 
-  cat > conftest.s <<EOF
4062
 
-.type foo,%gnu_indirect_function
4063
 
-EOF
4064
 
-if ${CC-cc} -c $ASFLAGS conftest.s 1>&5 2>&5;
4065
 
-then
4066
 
-  libc_cv_asm_gnu_indirect_function=yes
4067
 
-else
4068
 
-  libc_cv_asm_gnu_indirect_function=no
4069
 
-fi
4070
 
-rm -f conftest*
4071
 
-fi
4072
 
-{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_gnu_indirect_function" >&5
4073
 
-$as_echo "$libc_cv_asm_gnu_indirect_function" >&6; }
4074
 
-  else
4075
 
-    libc_cv_asm_gnu_indirect_function=no
4076
 
-  fi
4077
 
-  if test x"$libc_cv_asm_gnu_indirect_function" != xyes; then
4078
 
-    { { $as_echo "$as_me:$LINENO: error: --enable-multi-arch support requires assembler and linker support" >&5
4079
 
-$as_echo "$as_me: error: --enable-multi-arch support requires assembler and linker support" >&2;}
4080
 
-   { (exit 1); exit 1; }; }
4081
 
-  fi
4082
 
-fi
4083
 
-
4084
 
 { $as_echo "$as_me:$LINENO: checking for .symver assembler directive" >&5
4085
 
 $as_echo_n "checking for .symver assembler directive... " >&6; }
4086
 
 if test "${libc_cv_asm_symver_directive+set}" = set; then
4087
 
@@ -6998,9 +6976,9 @@
4088
 
 { $as_echo "$as_me:$LINENO: result: $libc_cv_gnu89_inline" >&5
4089
 
 $as_echo "$libc_cv_gnu89_inline" >&6; }
4090
 
 if test $libc_cv_gnu89_inline = yes; then
4091
 
-  libc_cv_gnu89_inline=-fgnu89-inline
4092
 
+  gnu89_inline=-fgnu89-inline
4093
 
 else
4094
 
-  libc_cv_gnu89_inline=
4095
 
+  gnu89_inline=
4096
 
 fi
4097
 
 
4098
 
 
4099
 
--- a/ChangeLog.eglibc  (revision 11211)
4100
 
+++ b/ChangeLog.eglibc  (revision 12365)
4101
 
@@ -1,3 +1,10 @@
4102
 
+2010-12-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
4103
 
+
4104
 
+       Backport from trunk:
4105
 
+       2010-12-19  Gordon Schumacher  <whiplash@pobox.com>
4106
 
+       * locale/xlocale.x (DEFINE_CATEGORY): Fix merge issue.
4107
 
+       * wcsmbs/wcsmbsload.c (wcsmbs_load_conv): Same.
4108
 
+
4109
 
 2010-03-31  Joseph Myers  <joseph@codesourcery.com>
4110
 
 
4111
 
        * manual/Makefile (stamp-pkgvers): Substitute @@ for @ in
4112
 
--- a/nis/nss_compat/compat-initgroups.c        (revision 11211)
4113
 
+++ b/nis/nss_compat/compat-initgroups.c        (revision 12365)
4114
 
@@ -474,18 +474,21 @@
4115
 
          /* If the selected module does not support getgrent_r or
4116
 
             initgroups_dyn, abort. We cannot find the needed group
4117
 
             entries.  */
4118
 
-         if (nss_getgrent_r == NULL && nss_initgroups_dyn == NULL)
4119
 
+         if (nss_initgroups_dyn == NULL || nss_getgrgid_r == NULL)
4120
 
+           {
4121
 
+             if (nss_setgrent != NULL)
4122
 
+               {
4123
 
+                 nss_setgrent (1);
4124
 
+                 ent->need_endgrent = true;
4125
 
+               }
4126
 
+             ent->skip_initgroups_dyn = true;
4127
 
+           }
4128
 
+
4129
 
+         if (ent->skip_initgroups_dyn && nss_getgrent_r == NULL)
4130
 
            return NSS_STATUS_UNAVAIL;
4131
 
 
4132
 
          ent->files = false;
4133
 
 
4134
 
-         if (nss_initgroups_dyn == NULL && nss_setgrent != NULL)
4135
 
-           {
4136
 
-             nss_setgrent (1);
4137
 
-             ent->need_endgrent = true;
4138
 
-           }
4139
 
-         ent->skip_initgroups_dyn = true;
4140
 
-
4141
 
          return getgrent_next_nss (ent, buffer, buflen, user, group,
4142
 
                                    start, size, groupsp, limit, errnop);
4143
 
        }
4144
 
--- a/elf/dl-open.c     (revision 11211)
4145
 
+++ b/elf/dl-open.c     (revision 12365)
4146
 
@@ -221,38 +221,9 @@
4147
 
 
4148
 
   assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT);
4149
 
 
4150
 
-  /* Maybe we have to expand a DST.  */
4151
 
-  if (__builtin_expect (dst != NULL, 0))
4152
 
-    {
4153
 
-      size_t len = strlen (file);
4154
 
-
4155
 
-      /* Determine how much space we need.  We have to allocate the
4156
 
-        memory locally.  */
4157
 
-      size_t required = DL_DST_REQUIRED (call_map, file, len,
4158
 
-                                        _dl_dst_count (dst, 0));
4159
 
-
4160
 
-      /* Get space for the new file name.  */
4161
 
-      char *new_file = (char *) alloca (required + 1);
4162
 
-
4163
 
-      /* Generate the new file name.  */
4164
 
-      _dl_dst_substitute (call_map, file, new_file, 0);
4165
 
-
4166
 
-      /* If the substitution failed don't try to load.  */
4167
 
-      if (*new_file == '\0')
4168
 
-       _dl_signal_error (0, "dlopen", NULL,
4169
 
-                         N_("empty dynamic string token substitution"));
4170
 
-
4171
 
-      /* Now we have a new file name.  */
4172
 
-      file = new_file;
4173
 
-
4174
 
-      /* It does not matter whether call_map is set even if we
4175
 
-        computed it only because of the DST.  Since the path contains
4176
 
-        a slash the value is not used.  See dl-load.c.  */
4177
 
-    }
4178
 
-
4179
 
   /* Load the named object.  */
4180
 
   struct link_map *new;
4181
 
-  args->map = new = _dl_map_object (call_map, file, 0, lt_loaded, 0,
4182
 
+  args->map = new = _dl_map_object (call_map, file, lt_loaded, 0,
4183
 
                                    mode | __RTLD_CALLMAP, args->nsid);
4184
 
 
4185
 
   /* If the pointer returned is NULL this means the RTLD_NOLOAD flag is
4186
 
--- a/elf/rtld-Rules    (revision 11211)
4187
 
+++ b/elf/rtld-Rules    (revision 12365)
4188
 
@@ -1,6 +1,6 @@
4189
 
 # Subroutine makefile for compiling libc modules linked into dynamic linker.
4190
 
 
4191
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2008 Free Software Foundation, Inc.
4192
 
+# Copyright (C) 2002,2003,2005,2006,2008,2010 Free Software Foundation, Inc.
4193
 
 # This file is part of the GNU C Library.
4194
 
 
4195
 
 # The GNU C Library is free software; you can redistribute it and/or
4196
 
@@ -56,7 +56,7 @@
4197
 
 # Use the verbose option of ar and tar when not running silently.
4198
 
 ifeq   "$(findstring s,$(MAKEFLAGS))" ""       # if not -s
4199
 
 verbose := v
4200
 
-else                                           # -s
4201
 
+else                                           # -s
4202
 
 verbose        :=
4203
 
 endif                                          # not -s
4204
 
 
4205
 
@@ -93,6 +93,12 @@
4206
 
 # These are the basic compilation rules corresponding to the Makerules ones.
4207
 
 # The sysd-rules generated makefile already defines pattern rules for rtld-%
4208
 
 # targets built from sysdeps source files.
4209
 
+$(objpfx)rtld-%.os: rtld-%.S $(before-compile)
4210
 
+       $(compile-command.S) $(rtld-CPPFLAGS)
4211
 
+$(objpfx)rtld-%.os: rtld-%.s $(before-compile)
4212
 
+       $(compile-command.s) $(rtld-CPPFLAGS)
4213
 
+$(objpfx)rtld-%.os: rtld-%.c $(before-compile)
4214
 
+       $(compile-command.c) $(rtld-CPPFLAGS)
4215
 
 $(objpfx)rtld-%.os: %.S $(before-compile)
4216
 
        $(compile-command.S) $(rtld-CPPFLAGS)
4217
 
 $(objpfx)rtld-%.os: %.s $(before-compile)
4218
 
@@ -101,6 +107,9 @@
4219
 
        $(compile-command.c) $(rtld-CPPFLAGS)
4220
 
 
4221
 
 # The rules for generated source files.
4222
 
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.S $(before-compile); $(compile-command.S)
4223
 
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.s $(before-compile); $(compile-command.s)
4224
 
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.c $(before-compile); $(compile-command.c)
4225
 
 $(objpfx)rtld-%.os: $(objpfx)%.S $(before-compile); $(compile-command.S)
4226
 
 $(objpfx)rtld-%.os: $(objpfx)%.s $(before-compile); $(compile-command.s)
4227
 
 $(objpfx)rtld-%.os: $(objpfx)%.c $(before-compile); $(compile-command.c)
4228
 
--- a/elf/dl-sysdep.c   (revision 11211)
4229
 
+++ b/elf/dl-sysdep.c   (revision 12365)
4230
 
@@ -425,6 +425,11 @@
4231
 
     {
4232
 
       const ElfW(Word) mask = ((const ElfW(Word) *) dsocaps)[-1];
4233
 
       GLRO(dl_hwcap) |= (uint64_t) mask << _DL_FIRST_EXTRA;
4234
 
+      /* Note that we add the dsocaps to the set already chosen by the
4235
 
+        LD_HWCAP_MASK environment variable (or default HWCAP_IMPORTANT).
4236
 
+        So there is no way to request ignoring an OS-supplied dsocap
4237
 
+        string and bit like you can ignore an OS-supplied HWCAP bit.  */
4238
 
+      GLRO(dl_hwcap_mask) |= (uint64_t) mask << _DL_FIRST_EXTRA;
4239
 
       size_t len;
4240
 
       for (const char *p = dsocaps; p < dsocaps + dsocapslen; p += len + 1)
4241
 
        {
4242
 
--- a/elf/Makefile      (revision 11211)
4243
 
+++ b/elf/Makefile      (revision 12365)
4244
 
@@ -766,11 +766,11 @@
4245
 
 $(objpfx)tst-tls9: $(libdl)
4246
 
 $(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
4247
 
 
4248
 
-$(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so
4249
 
+$(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so $(objpfx)tst-tlsmod7.so
4250
 
 
4251
 
-$(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so
4252
 
+$(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so $(objpfx)tst-tlsmod9.so
4253
 
 
4254
 
-$(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so
4255
 
+$(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so $(objpfx)tst-tlsmod11.so
4256
 
 
4257
 
 $(objpfx)tst-tls13: $(libdl)
4258
 
 $(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so
4259
 
--- a/elf/dl-object.c   (revision 11211)
4260
 
+++ b/elf/dl-object.c   (revision 12365)
4261
 
@@ -1,5 +1,5 @@
4262
 
 /* Storage management for the chain of loaded shared objects.
4263
 
-   Copyright (C) 1995-2002,2004,2006-2008,2009 Free Software Foundation, Inc.
4264
 
+   Copyright (C) 1995-2002,2004,2006-2009,2010 Free Software Foundation, Inc.
4265
 
    This file is part of the GNU C Library.
4266
 
 
4267
 
    The GNU C Library is free software; you can redistribute it and/or
4268
 
@@ -26,16 +26,41 @@
4269
 
 #include <assert.h>
4270
 
 
4271
 
 
4272
 
+/* Add the new link_map NEW to the end of the namespace list.  */
4273
 
+void
4274
 
+internal_function
4275
 
+_dl_add_to_namespace_list (struct link_map *new, Lmid_t nsid)
4276
 
+{
4277
 
+  /* We modify the list of loaded objects.  */
4278
 
+  __rtld_lock_lock_recursive (GL(dl_load_write_lock));
4279
 
+
4280
 
+  if (GL(dl_ns)[nsid]._ns_loaded != NULL)
4281
 
+    {
4282
 
+      struct link_map *l = GL(dl_ns)[nsid]._ns_loaded;
4283
 
+      while (l->l_next != NULL)
4284
 
+       l = l->l_next;
4285
 
+      new->l_prev = l;
4286
 
+      /* new->l_next = NULL;   Would be necessary but we use calloc.  */
4287
 
+      l->l_next = new;
4288
 
+    }
4289
 
+  else
4290
 
+    GL(dl_ns)[nsid]._ns_loaded = new;
4291
 
+  ++GL(dl_ns)[nsid]._ns_nloaded;
4292
 
+  new->l_serial = GL(dl_load_adds);
4293
 
+  ++GL(dl_load_adds);
4294
 
+
4295
 
+  __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
4296
 
+}
4297
 
+
4298
 
+
4299
 
 /* Allocate a `struct link_map' for a new object being loaded,
4300
 
    and enter it into the _dl_loaded list.  */
4301
 
-
4302
 
 struct link_map *
4303
 
 internal_function
4304
 
 _dl_new_object (char *realname, const char *libname, int type,
4305
 
                struct link_map *loader, int mode, Lmid_t nsid)
4306
 
 {
4307
 
   struct link_map *l;
4308
 
-  int idx;
4309
 
   size_t libname_len = strlen (libname) + 1;
4310
 
   struct link_map *new;
4311
 
   struct libname_list *newname;
4312
 
@@ -93,32 +118,13 @@
4313
 
   new->l_scope = new->l_scope_mem;
4314
 
   new->l_scope_max = sizeof (new->l_scope_mem) / sizeof (new->l_scope_mem[0]);
4315
 
 
4316
 
-  /* We modify the list of loaded objects.  */
4317
 
-  __rtld_lock_lock_recursive (GL(dl_load_write_lock));
4318
 
-
4319
 
   /* Counter for the scopes we have to handle.  */
4320
 
-  idx = 0;
4321
 
+  int idx = 0;
4322
 
 
4323
 
   if (GL(dl_ns)[nsid]._ns_loaded != NULL)
4324
 
-    {
4325
 
-      l = GL(dl_ns)[nsid]._ns_loaded;
4326
 
-      while (l->l_next != NULL)
4327
 
-       l = l->l_next;
4328
 
-      new->l_prev = l;
4329
 
-      /* new->l_next = NULL;   Would be necessary but we use calloc.  */
4330
 
-      l->l_next = new;
4331
 
+    /* Add the global scope.  */
4332
 
+    new->l_scope[idx++] = &GL(dl_ns)[nsid]._ns_loaded->l_searchlist;
4333
 
 
4334
 
-      /* Add the global scope.  */
4335
 
-      new->l_scope[idx++] = &GL(dl_ns)[nsid]._ns_loaded->l_searchlist;
4336
 
-    }
4337
 
-  else
4338
 
-    GL(dl_ns)[nsid]._ns_loaded = new;
4339
 
-  ++GL(dl_ns)[nsid]._ns_nloaded;
4340
 
-  new->l_serial = GL(dl_load_adds);
4341
 
-  ++GL(dl_load_adds);
4342
 
-
4343
 
-  __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
4344
 
-
4345
 
   /* If we have no loader the new object acts as it.  */
4346
 
   if (loader == NULL)
4347
 
     loader = new;
4348
 
--- a/elf/rtld.c        (revision 11211)
4349
 
+++ b/elf/rtld.c        (revision 12365)
4350
 
@@ -589,7 +589,6 @@
4351
 
   /* Argument to map_doit.  */
4352
 
   char *str;
4353
 
   struct link_map *loader;
4354
 
-  int is_preloaded;
4355
 
   int mode;
4356
 
   /* Return value of map_doit.  */
4357
 
   struct link_map *map;
4358
 
@@ -627,16 +626,17 @@
4359
 
 map_doit (void *a)
4360
 
 {
4361
 
   struct map_args *args = (struct map_args *) a;
4362
 
-  args->map = _dl_map_object (args->loader, args->str,
4363
 
-                             args->is_preloaded, lt_library, 0, args->mode,
4364
 
-                             LM_ID_BASE);
4365
 
+  args->map = _dl_map_object (args->loader, args->str, lt_library, 0,
4366
 
+                             args->mode, LM_ID_BASE);
4367
 
 }
4368
 
 
4369
 
 static void
4370
 
 dlmopen_doit (void *a)
4371
 
 {
4372
 
   struct dlmopen_args *args = (struct dlmopen_args *) a;
4373
 
-  args->map = _dl_open (args->fname, RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT,
4374
 
+  args->map = _dl_open (args->fname,
4375
 
+                       (RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT
4376
 
+                        | __RTLD_SECURE),
4377
 
                        dl_main, LM_ID_NEWLM, _dl_argc, INTUSE(_dl_argv),
4378
 
                        __environ);
4379
 
 }
4380
 
@@ -806,8 +806,7 @@
4381
 
 
4382
 
   args.str = fname;
4383
 
   args.loader = main_map;
4384
 
-  args.is_preloaded = 1;
4385
 
-  args.mode = 0;
4386
 
+  args.mode = __RTLD_SECURE;
4387
 
 
4388
 
   unsigned int old_nloaded = GL(dl_ns)[LM_ID_BASE]._ns_nloaded;
4389
 
 
4390
 
@@ -1054,7 +1053,6 @@
4391
 
 
4392
 
          args.str = rtld_progname;
4393
 
          args.loader = NULL;
4394
 
-         args.is_preloaded = 0;
4395
 
          args.mode = __RTLD_OPENEXEC;
4396
 
          (void) _dl_catch_error (&objname, &err_str, &malloced, map_doit,
4397
 
                                  &args);
4398
 
@@ -1066,7 +1064,7 @@
4399
 
       else
4400
 
        {
4401
 
          HP_TIMING_NOW (start);
4402
 
-         _dl_map_object (NULL, rtld_progname, 0, lt_library, 0,
4403
 
+         _dl_map_object (NULL, rtld_progname, lt_library, 0,
4404
 
                          __RTLD_OPENEXEC, LM_ID_BASE);
4405
 
          HP_TIMING_NOW (stop);
4406
 
 
4407
 
@@ -1110,11 +1108,15 @@
4408
 
       main_map = _dl_new_object ((char *) "", "", lt_executable, NULL,
4409
 
                                 __RTLD_OPENEXEC, LM_ID_BASE);
4410
 
       assert (main_map != NULL);
4411
 
-      assert (main_map == GL(dl_ns)[LM_ID_BASE]._ns_loaded);
4412
 
       main_map->l_phdr = phdr;
4413
 
       main_map->l_phnum = phnum;
4414
 
       main_map->l_entry = *user_entry;
4415
 
 
4416
 
+      /* Even though the link map is not yet fully initialized we can add
4417
 
+        it to the map list since there are no possible users running yet.  */
4418
 
+      _dl_add_to_namespace_list (main_map, LM_ID_BASE);
4419
 
+      assert (main_map == GL(dl_ns)[LM_ID_BASE]._ns_loaded);
4420
 
+
4421
 
       /* At this point we are in a bit of trouble.  We would have to
4422
 
         fill in the values for l_dev and l_ino.  But in general we
4423
 
         do not know where the file is.  We also do not handle AT_EXECFD
4424
 
@@ -1257,7 +1259,7 @@
4425
 
       /* We were invoked directly, so the program might not have a
4426
 
         PT_INTERP.  */
4427
 
       _dl_rtld_libname.name = GL(dl_rtld_map).l_name;
4428
 
-      /* _dl_rtld_libname.next = NULL;         Already zero.  */
4429
 
+      /* _dl_rtld_libname.next = NULL; Already zero.  */
4430
 
       GL(dl_rtld_map).l_libname =  &_dl_rtld_libname;
4431
 
     }
4432
 
   else
4433
 
@@ -1382,6 +1384,9 @@
4434
 
              l->l_libname->name = memcpy (copy, dsoname, len);
4435
 
            }
4436
 
 
4437
 
+         /* Add the vDSO to the object list.  */
4438
 
+         _dl_add_to_namespace_list (l, LM_ID_BASE);
4439
 
+
4440
 
          /* Rearrange the list so this DSO appears after rtld_map.  */
4441
 
          assert (l->l_next == NULL);
4442
 
          assert (l->l_prev == main_map);
4443
 
--- a/elf/dl-deps.c     (revision 11211)
4444
 
+++ b/elf/dl-deps.c     (revision 12365)
4445
 
@@ -62,7 +62,7 @@
4446
 
 {
4447
 
   struct openaux_args *args = (struct openaux_args *) a;
4448
 
 
4449
 
-  args->aux = _dl_map_object (args->map, args->name, 0,
4450
 
+  args->aux = _dl_map_object (args->map, args->name,
4451
 
                              (args->map->l_type == lt_executable
4452
 
                               ? lt_library : args->map->l_type),
4453
 
                              args->trace_mode, args->open_mode,
4454
 
--- a/elf/dl-load.c     (revision 11211)
4455
 
+++ b/elf/dl-load.c     (revision 12365)
4456
 
@@ -801,22 +801,7 @@
4457
 
   /* The file might already be closed.  */
4458
 
   if (fd != -1)
4459
 
     (void) __close (fd);
4460
 
-  if (l != NULL)
4461
 
-    {
4462
 
-      /* We modify the list of loaded objects.  */
4463
 
-      __rtld_lock_lock_recursive (GL(dl_load_write_lock));
4464
 
-      /* Remove the stillborn object from the list and free it.  */
4465
 
-      assert (l->l_next == NULL);
4466
 
-      if (l->l_prev == NULL)
4467
 
-       /* No other module loaded. This happens only in the static library,
4468
 
-          or in rtld under --verify.  */
4469
 
-       GL(dl_ns)[l->l_ns]._ns_loaded = NULL;
4470
 
-      else
4471
 
-       l->l_prev->l_next = NULL;
4472
 
-      --GL(dl_ns)[l->l_ns]._ns_nloaded;
4473
 
-      free (l);
4474
 
-      __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
4475
 
-    }
4476
 
+  free (l);
4477
 
   free (realname);
4478
 
 
4479
 
   if (r != NULL)
4480
 
@@ -901,6 +886,9 @@
4481
 
         never be unloaded.  */
4482
 
       __close (fd);
4483
 
 
4484
 
+      /* Add the map for the mirrored object to the object list.  */
4485
 
+      _dl_add_to_namespace_list (l, nsid);
4486
 
+
4487
 
       return l;
4488
 
     }
4489
 
 #endif
4490
 
@@ -1495,6 +1483,9 @@
4491
 
     add_name_to_object (l, ((const char *) D_PTR (l, l_info[DT_STRTAB])
4492
 
                            + l->l_info[DT_SONAME]->d_un.d_val));
4493
 
 
4494
 
+  /* Now that the object is fully initialized add it to the object list.  */
4495
 
+  _dl_add_to_namespace_list (l, nsid);
4496
 
+
4497
 
 #ifdef SHARED
4498
 
   /* Auditing checkpoint: we have a new object.  */
4499
 
   if (__builtin_expect (GLRO(dl_naudit) > 0, 0)
4500
 
@@ -1815,7 +1806,7 @@
4501
 
    if MAY_FREE_DIRS is true.  */
4502
 
 
4503
 
 static int
4504
 
-open_path (const char *name, size_t namelen, int preloaded,
4505
 
+open_path (const char *name, size_t namelen, int secure,
4506
 
           struct r_search_path_struct *sps, char **realname,
4507
 
           struct filebuf *fbp, struct link_map *loader, int whatcode,
4508
 
           bool *found_other_class)
4509
 
@@ -1897,7 +1888,7 @@
4510
 
          /* Remember whether we found any existing directory.  */
4511
 
          here_any |= this_dir->status[cnt] != nonexisting;
4512
 
 
4513
 
-         if (fd != -1 && __builtin_expect (preloaded, 0)
4514
 
+         if (fd != -1 && __builtin_expect (secure, 0)
4515
 
              && INTUSE(__libc_enable_secure))
4516
 
            {
4517
 
              /* This is an extra security effort to make sure nobody can
4518
 
@@ -1966,7 +1957,7 @@
4519
 
 
4520
 
 struct link_map *
4521
 
 internal_function
4522
 
-_dl_map_object (struct link_map *loader, const char *name, int preloaded,
4523
 
+_dl_map_object (struct link_map *loader, const char *name,
4524
 
                int type, int trace_mode, int mode, Lmid_t nsid)
4525
 
 {
4526
 
   int fd;
4527
 
@@ -2070,7 +2061,8 @@
4528
 
          for (l = loader; l; l = l->l_loader)
4529
 
            if (cache_rpath (l, &l->l_rpath_dirs, DT_RPATH, "RPATH"))
4530
 
              {
4531
 
-               fd = open_path (name, namelen, preloaded, &l->l_rpath_dirs,
4532
 
+               fd = open_path (name, namelen, mode & __RTLD_SECURE,
4533
 
+                               &l->l_rpath_dirs,
4534
 
                                &realname, &fb, loader, LA_SER_RUNPATH,
4535
 
                                &found_other_class);
4536
 
                if (fd != -1)
4537
 
@@ -2085,14 +2077,15 @@
4538
 
              && main_map != NULL && main_map->l_type != lt_loaded
4539
 
              && cache_rpath (main_map, &main_map->l_rpath_dirs, DT_RPATH,
4540
 
                              "RPATH"))
4541
 
-           fd = open_path (name, namelen, preloaded, &main_map->l_rpath_dirs,
4542
 
+           fd = open_path (name, namelen, mode & __RTLD_SECURE,
4543
 
+                           &main_map->l_rpath_dirs,
4544
 
                            &realname, &fb, loader ?: main_map, LA_SER_RUNPATH,
4545
 
                            &found_other_class);
4546
 
        }
4547
 
 
4548
 
       /* Try the LD_LIBRARY_PATH environment variable.  */
4549
 
       if (fd == -1 && env_path_list.dirs != (void *) -1)
4550
 
-       fd = open_path (name, namelen, preloaded, &env_path_list,
4551
 
+       fd = open_path (name, namelen, mode & __RTLD_SECURE, &env_path_list,
4552
 
                        &realname, &fb,
4553
 
                        loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
4554
 
                        LA_SER_LIBPATH, &found_other_class);
4555
 
@@ -2101,12 +2094,12 @@
4556
 
       if (fd == -1 && loader != NULL
4557
 
          && cache_rpath (loader, &loader->l_runpath_dirs,
4558
 
                          DT_RUNPATH, "RUNPATH"))
4559
 
-       fd = open_path (name, namelen, preloaded,
4560
 
+       fd = open_path (name, namelen, mode & __RTLD_SECURE,
4561
 
                        &loader->l_runpath_dirs, &realname, &fb, loader,
4562
 
                        LA_SER_RUNPATH, &found_other_class);
4563
 
 
4564
 
       if (fd == -1
4565
 
-         && (__builtin_expect (! preloaded, 1)
4566
 
+         && (__builtin_expect (! (mode & __RTLD_SECURE), 1)
4567
 
              || ! INTUSE(__libc_enable_secure)))
4568
 
        {
4569
 
          /* Check the list of libraries in the file /etc/ld.so.cache,
4570
 
@@ -2172,7 +2165,7 @@
4571
 
          && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
4572
 
              || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
4573
 
          && rtld_search_dirs.dirs != (void *) -1)
4574
 
-       fd = open_path (name, namelen, preloaded, &rtld_search_dirs,
4575
 
+       fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
4576
 
                        &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
4577
 
 
4578
 
       /* Add another newline when we are tracing the library loading.  */
4579
 
@@ -2217,7 +2210,7 @@
4580
 
             have.  */
4581
 
          static const Elf_Symndx dummy_bucket = STN_UNDEF;
4582
 
 
4583
 
-         /* Enter the new object in the list of loaded objects.  */
4584
 
+         /* Allocate a new object map.  */
4585
 
          if ((name_copy = local_strdup (name)) == NULL
4586
 
              || (l = _dl_new_object (name_copy, name, type, loader,
4587
 
                                      mode, nsid)) == NULL)
4588
 
@@ -2235,6 +2228,9 @@
4589
 
          l->l_nbuckets = 1;
4590
 
          l->l_relocated = 1;
4591
 
 
4592
 
+         /* Enter the object in the object list.  */
4593
 
+         _dl_add_to_namespace_list (l, nsid);
4594
 
+
4595
 
          return l;
4596
 
        }
4597
 
       else if (found_other_class)
4598
 
--- a/elf/ldconfig.c    (revision 11211)
4599
 
+++ b/elf/ldconfig.c    (revision 12365)
4600
 
@@ -1362,14 +1362,9 @@
4601
 
 
4602
 
   const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
4603
 
   if (opt_chroot)
4604
 
-    {
4605
 
-      aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
4606
 
-      if (aux_cache_file == NULL)
4607
 
-       error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
4608
 
-              _PATH_LDCONFIG_AUX_CACHE);
4609
 
-    }
4610
 
+    aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
4611
 
 
4612
 
-  if (! opt_ignore_aux_cache)
4613
 
+  if (! opt_ignore_aux_cache && aux_cache_file)
4614
 
     load_aux_cache (aux_cache_file);
4615
 
   else
4616
 
     init_aux_cache ();
4617
 
@@ -1379,7 +1374,8 @@
4618
 
   if (opt_build_cache)
4619
 
     {
4620
 
       save_cache (cache_file);
4621
 
-      save_aux_cache (aux_cache_file);
4622
 
+      if (aux_cache_file)
4623
 
+        save_aux_cache (aux_cache_file);
4624
 
     }
4625
 
 
4626
 
   return 0;
4627
 
--- a/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h       (revision 11211)
4628
 
+++ b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h       (revision 12365)
4629
 
@@ -19,11 +19,6 @@
4630
 
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4631
 
    02111-1307 USA.  */
4632
 
 
4633
 
-#ifndef _LINUX_M68K_SYSDEP_H
4634
 
-#define _LINUX_M68K_SYSDEP_H 1
4635
 
-
4636
 
-#include <sysdeps/unix/sysdep.h>
4637
 
-#include <sysdeps/m68k/sysdep.h>
4638
 
 #include <tls.h>
4639
 
 
4640
 
 /* Defines RTLD_PRIVATE_ERRNO.  */
4641
 
@@ -122,7 +117,7 @@
4642
 
     neg.l %d0;                                                               \
4643
 
     move.l %d0, -(%sp);                                                              \
4644
 
     jbsr __m68k_read_tp@PLTPC;                                               \
4645
 
-    lea (_GLOBAL_OFFSET_TABLE_@GOTPC, %pc), %a1;                             \
4646
 
+    SYSCALL_ERROR_LOAD_GOT (%a1);                                            \
4647
 
     add.l (SYSCALL_ERROR_ERRNO@TLSIE, %a1), %a0;                             \
4648
 
     move.l (%sp)+, (%a0);                                                    \
4649
 
     move.l &-1, %d0;                                                         \
4650
 
@@ -333,5 +328,3 @@
4651
 
    even when statically linked.  */
4652
 
 # define NEED_STATIC_SYSINFO_DSO 1
4653
 
 #endif
4654
 
-
4655
 
-#endif
4656
 
--- a/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h     (revision 11211)
4657
 
+++ b/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h     (revision 12365)
4658
 
@@ -1,4 +1,4 @@
4659
 
-/* Copyright (C) 2008 Free Software Foundation, Inc.
4660
 
+/* Copyright (C) 2008, 2010 Free Software Foundation, Inc.
4661
 
    This file is part of the GNU C Library.
4662
 
 
4663
 
    The GNU C Library is free software; you can redistribute it and/or
4664
 
@@ -58,4 +58,9 @@
4665
 
        char u_comm[32];
4666
 
 };
4667
 
 
4668
 
+#define NBPG 4096
4669
 
+#define UPAGES 1
4670
 
+#define HOST_TEXT_START_ADDR u.start_code
4671
 
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
4672
 
+
4673
 
 #endif
4674
 
--- a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h        (revision 0)
4675
 
+++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h        (revision 12365)
4676
 
@@ -0,0 +1,29 @@
4677
 
+/* Copyright (C) 2010 Free Software Foundation, Inc.
4678
 
+   This file is part of the GNU C Library.
4679
 
+
4680
 
+   The GNU C Library is free software; you can redistribute it and/or
4681
 
+   modify it under the terms of the GNU Lesser General Public
4682
 
+   License as published by the Free Software Foundation; either
4683
 
+   version 2.1 of the License, or (at your option) any later version.
4684
 
+
4685
 
+   The GNU C Library is distributed in the hope that it will be useful,
4686
 
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
4687
 
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4688
 
+   Lesser General Public License for more details.
4689
 
+
4690
 
+   You should have received a copy of the GNU Lesser General Public
4691
 
+   License along with the GNU C Library; if not, write to the Free
4692
 
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4693
 
+   02111-1307 USA.  */
4694
 
+
4695
 
+#ifndef _LINUX_M68K_M680X0_SYSDEP_H
4696
 
+#define _LINUX_M68K_M680X0_SYSDEP_H 1
4697
 
+
4698
 
+#include <sysdeps/unix/sysdep.h>
4699
 
+#include <sysdeps/m68k/m680x0/sysdep.h>
4700
 
+#include <sysdeps/unix/sysv/linux/m68k/sysdep.h>
4701
 
+
4702
 
+#define SYSCALL_ERROR_LOAD_GOT(reg)                                          \
4703
 
+    lea (_GLOBAL_OFFSET_TABLE_@GOTPC, %pc), reg
4704
 
+
4705
 
+#endif
4706
 
--- a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h      (revision 0)
4707
 
+++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h      (revision 12365)
4708
 
@@ -0,0 +1,30 @@
4709
 
+/* Copyright (C) 2010 Free Software Foundation, Inc.
4710
 
+   This file is part of the GNU C Library.
4711
 
+
4712
 
+   The GNU C Library is free software; you can redistribute it and/or
4713
 
+   modify it under the terms of the GNU Lesser General Public
4714
 
+   License as published by the Free Software Foundation; either
4715
 
+   version 2.1 of the License, or (at your option) any later version.
4716
 
+
4717
 
+   The GNU C Library is distributed in the hope that it will be useful,
4718
 
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
4719
 
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4720
 
+   Lesser General Public License for more details.
4721
 
+
4722
 
+   You should have received a copy of the GNU Lesser General Public
4723
 
+   License along with the GNU C Library; if not, write to the Free
4724
 
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4725
 
+   02111-1307 USA.  */
4726
 
+
4727
 
+#ifndef _LINUX_M68K_COLDFIRE_SYSDEP_H
4728
 
+#define _LINUX_M68K_COLDFIRE_SYSDEP_H 1
4729
 
+
4730
 
+#include <sysdeps/unix/sysdep.h>
4731
 
+#include <sysdeps/m68k/coldfire/sysdep.h>
4732
 
+#include <sysdeps/unix/sysv/linux/m68k/sysdep.h>
4733
 
+
4734
 
+#define SYSCALL_ERROR_LOAD_GOT(reg)                                          \
4735
 
+    move.l &_GLOBAL_OFFSET_TABLE_@GOTPC, reg;                                \
4736
 
+    lea (-6, %pc, reg), reg
4737
 
+
4738
 
+#endif
4739
 
--- a/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h      (revision 11211)
4740
 
+++ b/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h      (revision 12365)
4741
 
@@ -38,3 +38,9 @@
4742
 
 #endif
4743
 
 
4744
 
 #include_next <kernel-features.h>
4745
 
+
4746
 
+/* The n32 syscall ABI did not have a getdents64 syscall until
4747
 
+   2.6.35.  */
4748
 
+#if _MIPS_SIM == _ABIN32 && __LINUX_KERNEL_VERSION < 0x020623
4749
 
+# undef __ASSUME_GETDENTS64_SYSCALL
4750
 
+#endif
4751
 
--- a/ports/sysdeps/unix/mips/mips64/n32/sysdep.h       (revision 11211)
4752
 
+++ b/ports/sysdeps/unix/mips/mips64/n32/sysdep.h       (revision 12365)
4753
 
@@ -45,6 +45,7 @@
4754
 
   .set noreorder;                                                            \
4755
 
   .align 2;                                                                  \
4756
 
   99: j __syscall_error;                                                     \
4757
 
+  nop;                                                                        \
4758
 
   ENTRY(name)                                                                \
4759
 
   .set noreorder;                                                            \
4760
 
   li v0, SYS_ify(syscall_name);                                                      \
4761
 
--- a/ports/sysdeps/unix/mips/mips64/n64/sysdep.h       (revision 11211)
4762
 
+++ b/ports/sysdeps/unix/mips/mips64/n64/sysdep.h       (revision 12365)
4763
 
@@ -45,6 +45,7 @@
4764
 
   .set noreorder;                                                            \
4765
 
   .align 2;                                                                  \
4766
 
   99: j __syscall_error;                                                     \
4767
 
+  nop;                                                                        \
4768
 
   ENTRY(name)                                                                \
4769
 
   .set noreorder;                                                            \
4770
 
   li v0, SYS_ify(syscall_name);                                                      \
4771
 
--- a/ports/sysdeps/m68k/sysdep.h       (revision 11211)
4772
 
+++ b/ports/sysdeps/m68k/sysdep.h       (revision 12365)
4773
 
@@ -1,5 +1,5 @@
4774
 
 /* Assembler macros for m68k.
4775
 
-   Copyright (C) 1998, 2003 Free Software Foundation, Inc.
4776
 
+   Copyright (C) 1998, 2003, 2010 Free Software Foundation, Inc.
4777
 
    This file is part of the GNU C Library.
4778
 
 
4779
 
    The GNU C Library is free software; you can redistribute it and/or
4780
 
@@ -97,26 +97,4 @@
4781
 
 #  define JUMPTARGET(name)     name
4782
 
 # endif
4783
 
 
4784
 
-/* Perform operation OP with PC-relative SRC as the first operand and
4785
 
-   DST as the second.  TMP is available as a temporary if needed.  */
4786
 
-#ifdef __mcoldfire__
4787
 
-#define PCREL_OP(OP, SRC, DST, TMP) \
4788
 
-  move.l &SRC - ., TMP; OP (-8, %pc, TMP), DST
4789
 
-#else
4790
 
-#define PCREL_OP(OP, SRC, DST, TMP) \
4791
 
-  OP SRC(%pc), DST
4792
 
-#endif
4793
 
-
4794
 
-#else
4795
 
-
4796
 
-/* As above, but PC is the spelling of the PC register.  We need this
4797
 
-   so that the macro can be used in both normal and extended asms.  */
4798
 
-#ifdef __mcoldfire__
4799
 
-#define PCREL_OP(OP, SRC, DST, TMP, PC) \
4800
 
-  "move.l #" SRC " - ., " TMP "\n\t" OP " (-8, " PC ", " TMP "), " DST
4801
 
-#else
4802
 
-#define PCREL_OP(OP, SRC, DST, TMP, PC) \
4803
 
-  OP " " SRC "(" PC "), " DST
4804
 
-#endif
4805
 
-
4806
 
 #endif /* __ASSEMBLER__ */
4807
 
--- a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h   (revision 11211)
4808
 
+++ b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h   (revision 12365)
4809
 
@@ -126,7 +126,7 @@
4810
 
 /* Define a const math function.  */
4811
 
 #define __m81_defun(rettype, func, args)                                     \
4812
 
   __m81_inline rettype __attribute__((__const__))                            \
4813
 
-  __m81_u(func) args
4814
 
+  __NTH (__m81_u(func) args)
4815
 
 
4816
 
 /* Define the three variants of a math function that has a direct
4817
 
    implementation in the m68k fpu.  FUNC is the name for C (which will be
4818
 
@@ -329,8 +329,8 @@
4819
 
 }                                                                        \
4820
 
                                                                          \
4821
 
 __m81_inline float_type                                                          \
4822
 
-__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y,               \
4823
 
-                          float_type __z)                                \
4824
 
+__NTH (__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y,        \
4825
 
+                                 float_type __z))                        \
4826
 
 {                                                                        \
4827
 
   return (__x * __y) + __z;                                              \
4828
 
 }
4829
 
@@ -346,8 +346,8 @@
4830
 
 
4831
 
 # define __inline_functions(float_type, s)                             \
4832
 
 __m81_inline void                                                      \
4833
 
-__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx,      \
4834
 
-                             float_type *__cosx)                       \
4835
 
+__NTH (__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \
4836
 
+                                    float_type *__cosx))               \
4837
 
 {                                                                      \
4838
 
   __asm ("fsincos%.x %2,%1:%0"                                         \
4839
 
         : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x));                 \
4840
 
@@ -368,13 +368,13 @@
4841
 
    NAME, to make token pasting work correctly with -traditional.  */
4842
 
 # define __inline_forward_c(rettype, name, args1, args2)       \
4843
 
 __MATH_INLINE rettype __attribute__((__const__))               \
4844
 
-  name args1                                                   \
4845
 
+__NTH (name args1)                                             \
4846
 
 {                                                              \
4847
 
   return __CONCAT(__,name) args2;                              \
4848
 
 }
4849
 
 
4850
 
 # define __inline_forward(rettype, name, args1, args2) \
4851
 
-__MATH_INLINE rettype name args1                       \
4852
 
+__MATH_INLINE rettype __NTH (name args1)               \
4853
 
 {                                                      \
4854
 
   return __CONCAT(__,name) args2;                      \
4855
 
 }
4856
 
--- a/ports/sysdeps/m68k/m680x0/sysdep.h        (revision 0)
4857
 
+++ b/ports/sysdeps/m68k/m680x0/sysdep.h        (revision 12365)
4858
 
@@ -0,0 +1,36 @@
4859
 
+/* Assembler macros for m680x0.
4860
 
+   Copyright (C) 2010 Free Software Foundation, Inc.
4861
 
+   This file is part of the GNU C Library.
4862
 
+
4863
 
+   The GNU C Library is free software; you can redistribute it and/or
4864
 
+   modify it under the terms of the GNU Lesser General Public
4865
 
+   License as published by the Free Software Foundation; either
4866
 
+   version 2.1 of the License, or (at your option) any later version.
4867
 
+
4868
 
+   The GNU C Library is distributed in the hope that it will be useful,
4869
 
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
4870
 
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4871
 
+   Lesser General Public License for more details.
4872
 
+
4873
 
+   You should have received a copy of the GNU Lesser General Public
4874
 
+   License along with the GNU C Library; if not, write to the Free
4875
 
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4876
 
+   02111-1307 USA.  */
4877
 
+
4878
 
+#include <sysdeps/m68k/sysdep.h>
4879
 
+
4880
 
+#ifdef __ASSEMBLER__
4881
 
+
4882
 
+/* Perform operation OP with PC-relative SRC as the first operand and
4883
 
+   DST as the second.  TMP is available as a temporary if needed.  */
4884
 
+#define PCREL_OP(OP, SRC, DST, TMP) \
4885
 
+  OP SRC(%pc), DST
4886
 
+
4887
 
+#else
4888
 
+
4889
 
+/* As above, but PC is the spelling of the PC register.  We need this
4890
 
+   so that the macro can be used in both normal and extended asms.  */
4891
 
+#define PCREL_OP(OP, SRC, DST, TMP, PC) \
4892
 
+  OP " " SRC "(" PC "), " DST
4893
 
+
4894
 
+#endif /* __ASSEMBLER__ */
4895
 
--- a/ports/sysdeps/m68k/coldfire/sysdep.h      (revision 0)
4896
 
+++ b/ports/sysdeps/m68k/coldfire/sysdep.h      (revision 12365)
4897
 
@@ -0,0 +1,36 @@
4898
 
+/* Assembler macros for Coldfire.
4899
 
+   Copyright (C) 1998, 2003, 2010 Free Software Foundation, Inc.
4900
 
+   This file is part of the GNU C Library.
4901
 
+
4902
 
+   The GNU C Library is free software; you can redistribute it and/or
4903
 
+   modify it under the terms of the GNU Lesser General Public
4904
 
+   License as published by the Free Software Foundation; either
4905
 
+   version 2.1 of the License, or (at your option) any later version.
4906
 
+
4907
 
+   The GNU C Library is distributed in the hope that it will be useful,
4908
 
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
4909
 
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4910
 
+   Lesser General Public License for more details.
4911
 
+
4912
 
+   You should have received a copy of the GNU Lesser General Public
4913
 
+   License along with the GNU C Library; if not, write to the Free
4914
 
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4915
 
+   02111-1307 USA.  */
4916
 
+
4917
 
+#include <sysdeps/m68k/sysdep.h>
4918
 
+
4919
 
+#ifdef __ASSEMBLER__
4920
 
+
4921
 
+/* Perform operation OP with PC-relative SRC as the first operand and
4922
 
+   DST as the second.  TMP is available as a temporary if needed.  */
4923
 
+# define PCREL_OP(OP, SRC, DST, TMP) \
4924
 
+  move.l &SRC - ., TMP; OP (-8, %pc, TMP), DST
4925
 
+
4926
 
+#else
4927
 
+
4928
 
+/* As above, but PC is the spelling of the PC register.  We need this
4929
 
+   so that the macro can be used in both normal and extended asms.  */
4930
 
+# define PCREL_OP(OP, SRC, DST, TMP, PC) \
4931
 
+  "move.l #" SRC " - ., " TMP "\n\t" OP " (-8, " PC ", " TMP "), " DST
4932
 
+
4933
 
+#endif /* __ASSEMBLER__ */
4934
 
--- a/ports/ChangeLog.mips      (revision 11211)
4935
 
+++ b/ports/ChangeLog.mips      (revision 12365)
4936
 
@@ -1,3 +1,14 @@
4937
 
+2010-08-13  Joseph Myers  <joseph@codesourcery.com>
4938
 
+
4939
 
+       * sysdeps/unix/sysv/linux/mips/kernel-features.h
4940
 
+       (__ASSUME_GETDENTS64_SYSCALL): Undefine for n32 ABI before 2.6.35.
4941
 
+
4942
 
+2010-08-13  Chandrakala Chavva  <cchavva@caviumnetworks.com>
4943
 
+
4944
 
+       * sysdeps/unix/mips/mips64/n64/sysdep.h (PSEUDO): Add 'nop' in
4945
 
+       jump delay slot.
4946
 
+       * sysdeps/unix/mips/mips64/n32/sysdep.h (PSEUDO): Ditto.
4947
 
+
4948
 
 2010-05-21  Joseph Myers  <joseph@codesourcery.com>
4949
 
 
4950
 
        * sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c,
4951
 
--- a/ports/ChangeLog.m68k      (revision 11211)
4952
 
+++ b/ports/ChangeLog.m68k      (revision 12365)
4953
 
@@ -1,3 +1,37 @@
4954
 
+2010-08-25  Andreas Schwab  <schwab@linux-m68k.org>
4955
 
+
4956
 
+       * sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h
4957
 
+       (SYSCALL_ERROR_LOAD_GOT): Use & instead of #.
4958
 
+
4959
 
+2010-08-02  Andreas Schwab  <schwab@linux-m68k.org>
4960
 
+
4961
 
+       * sysdeps/m68k/coldfire/sysdep.h: New file.
4962
 
+       (PCREL_OP): Define.
4963
 
+       * sysdeps/m68k/m680x0/sysdep.h: New file.
4964
 
+       (PCREL_OP): Define.
4965
 
+       * sysdeps/m68k/sysdep.h (PCREL_OP): Don't define here.
4966
 
+       * sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h: New file.
4967
 
+       (SYSCALL_ERROR_LOAD_GOT): Define.
4968
 
+       * sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h: New file.
4969
 
+       (SYSCALL_ERROR_LOAD_GOT): Define.
4970
 
+       * sysdeps/unix/sysv/linux/m68k/sysdep.h: Don't include subordinate
4971
 
+       sysdep files.
4972
 
+       (SYSCALL_ERROR_HANDLER) [PIC && USE___THREAD]: Use
4973
 
+       SYSCALL_ERROR_LOAD_GOT.
4974
 
+
4975
 
+2010-06-13  Andreas Schwab  <schwab@linux-m68k.org>
4976
 
+
4977
 
+       * sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Mark all functions as
4978
 
+       non-throwing.
4979
 
+
4980
 
+       * sysdeps/unix/sysv/linux/m68k/sys/user.h (NBPG, UPAGES)
4981
 
+       (HOST_TEXT_START_ADDR, HOST_STACK_END_ADDR): Define.
4982
 
+
4983
 
+2010-06-11  Andreas Schwab  <schwab@linux-m68k.org>
4984
 
+
4985
 
+       * sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h: Force
4986
 
+       alignment of futex variables.
4987
 
+
4988
 
 2010-03-13  Andreas Schwab  <schwab@linux-m68k.org>
4989
 
 
4990
 
        * sysdeps/m68k/m680x0/fpu/s_ccosh.c: Use signbit macro.