[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r10443 - in /fsf/glibc-2_11-branch/libc: ./ argp/ bits/ crypt/ csu/ elf/ hurd/ iconv/ io/ libio/ locale/ localedata/ localed...



Author: eglibc
Date: Wed May 12 00:06:29 2010
New Revision: 10443

Log:
Import glibc-2.11 for 2010-05-12

Added:
    fsf/glibc-2_11-branch/libc/argp/bug-argp2.c
Modified:
    fsf/glibc-2_11-branch/libc/ChangeLog
    fsf/glibc-2_11-branch/libc/argp/Makefile
    fsf/glibc-2_11-branch/libc/argp/argp-parse.c
    fsf/glibc-2_11-branch/libc/bits/confname.h
    fsf/glibc-2_11-branch/libc/crypt/crypt_util.c
    fsf/glibc-2_11-branch/libc/csu/Makefile
    fsf/glibc-2_11-branch/libc/elf/chroot_canon.c
    fsf/glibc-2_11-branch/libc/elf/dl-version.c
    fsf/glibc-2_11-branch/libc/elf/dynamic-link.h
    fsf/glibc-2_11-branch/libc/elf/ldconfig.c
    fsf/glibc-2_11-branch/libc/hurd/lookup-at.c
    fsf/glibc-2_11-branch/libc/iconv/iconv_prog.c
    fsf/glibc-2_11-branch/libc/io/ftw.c
    fsf/glibc-2_11-branch/libc/libio/iovdprintf.c
    fsf/glibc-2_11-branch/libc/locale/loadlocale.c
    fsf/glibc-2_11-branch/libc/localedata/ChangeLog
    fsf/glibc-2_11-branch/libc/localedata/Makefile
    fsf/glibc-2_11-branch/libc/localedata/locales/i18n
    fsf/glibc-2_11-branch/libc/malloc/malloc.c
    fsf/glibc-2_11-branch/libc/manual/charset.texi
    fsf/glibc-2_11-branch/libc/manual/errno.texi
    fsf/glibc-2_11-branch/libc/manual/getopt.texi
    fsf/glibc-2_11-branch/libc/manual/math.texi
    fsf/glibc-2_11-branch/libc/manual/memory.texi
    fsf/glibc-2_11-branch/libc/manual/message.texi
    fsf/glibc-2_11-branch/libc/manual/resource.texi
    fsf/glibc-2_11-branch/libc/manual/stdio.texi
    fsf/glibc-2_11-branch/libc/manual/time.texi
    fsf/glibc-2_11-branch/libc/misc/bits/syslog.h
    fsf/glibc-2_11-branch/libc/misc/getusershell.c
    fsf/glibc-2_11-branch/libc/misc/mntent_r.c
    fsf/glibc-2_11-branch/libc/nscd/aicache.c
    fsf/glibc-2_11-branch/libc/posix/gai.conf
    fsf/glibc-2_11-branch/libc/posix/getopt.c
    fsf/glibc-2_11-branch/libc/posix/regex_internal.c
    fsf/glibc-2_11-branch/libc/posix/regexec.c
    fsf/glibc-2_11-branch/libc/resolv/netdb.h
    fsf/glibc-2_11-branch/libc/resolv/nss_dns/dns-host.c
    fsf/glibc-2_11-branch/libc/sysdeps/i386/lshift.S
    fsf/glibc-2_11-branch/libc/sysdeps/mach/hurd/ttyname_r.c
    fsf/glibc-2_11-branch/libc/sysdeps/posix/cuserid.c
    fsf/glibc-2_11-branch/libc/sysdeps/posix/getaddrinfo.c
    fsf/glibc-2_11-branch/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c
    fsf/glibc-2_11-branch/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c
    fsf/glibc-2_11-branch/libc/sysdeps/unix/bsd/ptsname.c
    fsf/glibc-2_11-branch/libc/sysdeps/unix/getlogin.c
    fsf/glibc-2_11-branch/libc/sysdeps/unix/readdir_r.c
    fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/fallocate.c
    fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c
    fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/readdir64_r.c
    fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/ifaddrs.c
    fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
    fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
    fsf/glibc-2_11-branch/libc/sysdeps/x86_64/dl-machine.h
    fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/init-arch.c
    fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/init-arch.h

Modified: fsf/glibc-2_11-branch/libc/ChangeLog
==============================================================================
--- fsf/glibc-2_11-branch/libc/ChangeLog (original)
+++ fsf/glibc-2_11-branch/libc/ChangeLog Wed May 12 00:06:29 2010
@@ -1,3 +1,265 @@
+2010-05-07  Roland McGrath  <roland@xxxxxxxxxx>
+
+	* elf/ldconfig.c (main): Add a const.
+
+2010-05-04  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* posix/regexec.c (find_collation_sequence_value): Fix skipping
+	the wide char sequence of the collating element.
+
+2010-05-03  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11149]
+	* elf/ldconfig.c (search_dir): Fix handling of symlinks in chroot.
+
+	* elf/chroot_canon.c (chroot_canon): Use xmalloc and xrealloc.
+
+	* elf/ldconfig.c (parse_conf_include): Don't fall back to
+	directories named in config file outside the chroot.
+
+2010-05-02  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* misc/mntent_r.c (encode_name): The slow loop handles newlines so we
+	should recognize them as an abort condition.
+	Patch by Jan Lieskovsky <jlieskov@xxxxxxxxxx>.
+
+2010-04-25  Bruno Haible  <bruno@xxxxxxxxx>
+
+	[BZ #11538]
+	* sysdeps/unix/bsd/ptsname.c (__ptsname_r): Use __ttyname_r's return
+	value instead of errno.
+	* sysdeps/unix/getlogin.c (getlogin): Likewise.
+
+	[BZ #11537]
+	* sysdeps/mach/hurd/ttyname_r.c (__ttyname_r): Upon failure, return
+	errno, not -1.
+
+2010-04-24  Emilio Pozuelo Monfort  <pochu27@xxxxxxxxx>
+
+	* hurd/lookup-at.c (__file_name_lookup_at): Fix error return value.
+
+2010-04-14  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* elf/dl-version.c (_dl_check_map_versions): Avoid index overflow
+	when dependencies are missing.
+
+2010-04-09  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* nscd/aicache.c (addhstaiX): Correct passing memory to address
+	list to gethostbyname4_r functions.
+
+	* resolv/nss_dns/dns-host.c (gaih_getanswer_slice): Optimize
+	copying of h_name.
+
+2010-04-07  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/i386/fallocate.c: Set errno on error.
+	* sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise.
+
+2009-12-01  Eric Blake  <ebb9@xxxxxxx>
+
+	[BZ #11039]
+	* posix/getopt.c (_getopt_internal_r): Skip optional - or + before
+	checking lead byte of optstring for :.
+
+	[BZ #11040]
+	* posix/getopt.c (_getopt_internal_r): Reject '-;' as short
+	option, since it conflicts with "W;" optstring extension.
+
+2009-12-02  Eric Blake  <ebb9@xxxxxxx>
+
+	[BZ #11041]
+	* posix/getopt.c (_getopt_internal_r): Handle '-Wfoo' identically
+	to '--foo', with optional argument or non-ambiguous prefix.
+
+2010-04-05  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11010]
+	* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Handle
+	timeouts from servers.
+
+	[BZ #11149]
+	* elf/ldconfig.c (main): Respect chroot setting when looking for
+	the aux cache.
+
+2010-04-04  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11043]
+	* posix/getopt.c (_getopt_internal_r): Fix arguments printed in error
+	messages.
+
+	[BZ #11070]
+	* resolv/netdb.h: Declare iruserok and iruserok_af.
+
+	* argp/Makefile: Add rules to build and run bug-argp2.
+	* argp/bug-argp2.c: New file.
+
+2010-02-05  Sergey Poznyakoff  <gray@xxxxxxxxxx>
+
+	[BZ #11254]
+	* argp/argp-parse.c (convert_options): Fix improper use of `|'
+	between character values.
+
+2010-04-04  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11287]
+	* csu/Makefile ($(objpfx)version-info.h): Handle newer kernel headers
+	which don't define UTS_RELEASE.
+
+2010-04-04  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+	    Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11292]
+	* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features): Allow
+	concurrent initialization and use of __cpu_features.
+
+2010-04-04  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/x86_64/multiarch/init-arch.h (cpu_features): Add tag to
+	the enum.
+
+2010-04-03  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11333]
+	* sysdeps/unix/readdir_r.c (__READDIR_R): Add support for platforms
+	which include unnecessary padding in d_reclen.
+	* sysdeps/unix/sysv/linux/i386/readdir64_r.c: Select work-around for
+	unnecessary padding.
+
+	[BZ #11387]
+	* sysdeps/unix/sysv/linux/ifaddrs.c (map_newlin): Don't abort on
+	unknown interface, return -1.
+	(getifaddrs_internal): Rename from getifaddrs.  Handle errors in
+	map_newlink be returning -EAGAIN.
+	(getifaddrs): If -EAGAIN is returned from getifaddrs_internal try
+	again.
+
+2010-04-03  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11438]
+	* posix/gai.conf: Document problems with IPv4 site-local addresses and
+	NATs.
+
+	[BZ #11449]
+	* crypt/crypt_util.c (__init_des_r): Add memory barrier before setting
+	small_tables_initialized.
+
+	* malloc/malloc.c (set_max_fast): Fix computation of the value.
+
+2010-03-25  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Reset no_data before
+	each action.
+
+2010-03-25  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/posix/cuserid.c: Fix typo.
+
+2010-03-24  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11397]
+	* sysdeps/posix/cuserid.c (cuserid): Make sure the returned string
+	is NUL terminated.
+	Patch by Jonathan Geisler <jgeisler@xxxxxxxxxxxxxx>.
+
+2010-03-02  Richard Guenther  <rguenther@xxxxxxx>
+
+	* sysdeps/x86_64/dl-machine.h (elf_machine_rela): R_X86_64_PC32
+	is sign-extending.
+
+2010-02-24  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11319]
+	* libio/iovdprintf.c (_IO_vdprintf): Explicitly flush stream before
+	undoing the stream because _IO_FINISH doesn't report failures.
+
+	[BZ #5553]
+	* malloc/malloc.c (public_vALLOc): Set ar_ptr when trying main_arena.
+	(public_pVALLOc): Likewise.
+	Patch by Petr Baudis.
+
+2010-02-22  Jim Meyering  <meyering@xxxxxxxxxx>
+
+	* manual/math.texi (BSD Random): Fix a typo: s/are/is/
+
+	* manual/charset.texi: Adjust grammar.
+
+	* manual/errno.texi (Error Messages): Fix doubled-words and typos.
+	* manual/charset.texi (Selecting the Conversion): Likewise.
+	* manual/getopt.texi (Getopt Long Options): Likewise.
+	* manual/memory.texi (Resizing the Data Segment): Likewise.
+	* manual/message.texi (GUI program problems): Likewise.
+	* manual/resource.texi (CPU Affinity): Likewise.
+	* manual/stdio.texi (Streams and Threads): Likewise.
+	* manual/time.texi (High Accuracy Clock): Likewise.
+
+2010-02-11  Andreas Krebbel  <Andreas.Krebbel@xxxxxxxxxx>
+
+	* sysdeps/s390/s390-64/utf8-utf16-z9.c: Disable hardware
+	instructions cu21 and cu24.  Add well-formedness checking
+	parameter and adjust the software implementation.
+	* sysdeps/s390/s390-64/utf16-utf32-z9.c: Likewise.
+
+2010-02-10  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11271]
+	* io/ftw.c (ftw_startup): Close	descriptor for initial directory
+	after changing back to it.
+
+2010-02-09  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/i386/lshift.S: Fix unwind information.
+
+2010-02-03  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11242]
+	* misc/getusershell.c (initshells): Allocate one more byte in input
+	buffer so that fgets doesn't loop undefinitely.
+
+2010-01-25  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* iconv/iconv_prog.c (write_output): Fix check for open failure.
+
+2010-01-22  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11200]
+	* locale/loadlocale.c (_nl_load_locale): Fix recognition of genuine
+	mmap resource problem.  Patch by Joe Landers <jlanders@xxxxxxxxxx>.
+
+2010-01-22  Jim Meyering  <jim@xxxxxxxxxxxx>
+
+	[BZ #11184]
+	* posix/regex_internal.c (re_dfa_add_node): Extend the overflow
+	detection test.  Patch by Paul Eggert.
+
+	[BZ #11183]
+	* posix/regex_internal.c (re_string_realloc_buffers):
+	Detect and handle internal overflow.  Patch by Paul Eggert
+
+2010-01-20  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
+	(CHECK_SP): Fix check for alternate stack.
+	* sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
+	(CHECK_SP): Likewise.
+
+2010-01-19  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11194]
+	* misc/bits/syslog.h (syslog, vsyslog): Remove unnecessary return.
+
+2010-01-18  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* elf/dynamic-link.h (elf_get_dynamic_info): Use correct type when
+	casting d_tag.
+
+	* elf/dynamic-link.h (elf_get_dynamic_info): Ignore negative
+	dynamic entry types.
+
+2010-01-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* bits/confname.h: Make pre-C99-safe.
+
 2010-02-05  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
 	[BZ #11230]

Modified: fsf/glibc-2_11-branch/libc/argp/Makefile
==============================================================================
--- fsf/glibc-2_11-branch/libc/argp/Makefile (original)
+++ fsf/glibc-2_11-branch/libc/argp/Makefile Wed May 12 00:06:29 2010
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1997,2002,2003,2006,2007,2010 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -26,12 +26,13 @@
 routines	= $(addprefix argp-, ba fmtstream fs-xinl help parse pv \
 				     pvh xinl eexst)
 
-tests		= argp-test tst-argp1 bug-argp1 tst-argp2
+tests		= argp-test tst-argp1 bug-argp1 tst-argp2 bug-argp2
 
 CFLAGS-argp-help.c = $(uses-callbacks) -fexceptions
 CFLAGS-argp-parse.c = $(uses-callbacks)
 CFLAGS-argp-fmtstream.c = -fexceptions
 
 bug-argp1-ARGS = -- --help
+bug-argp2-ARGS = -- -d 111 --dstaddr 222 -p 333 --peer 444
 
 include ../Rules

Modified: fsf/glibc-2_11-branch/libc/argp/argp-parse.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/argp/argp-parse.c (original)
+++ fsf/glibc-2_11-branch/libc/argp/argp-parse.c Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* Hierarchial argument parsing, layered over getopt
-   Copyright (C) 1995-2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1995-2000, 2002, 2003, 2004, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Miles Bader <miles@xxxxxxxxxxxxxx>.
 
@@ -99,7 +99,7 @@
 
 static const struct argp_option argp_default_options[] =
 {
-  {"help",	  '?',    	0, 0,  N_("Give this help list"), -1},
+  {"help",	  '?',	  	0, 0,  N_("Give this help list"), -1},
   {"usage",	  OPT_USAGE,	0, 0,  N_("Give a short usage message")},
   {"program-name",OPT_PROGNAME,"NAME", OPTION_HIDDEN, N_("Set the program name")},
   {"HANG",	  OPT_HANG,    "SECS", OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
@@ -164,7 +164,7 @@
 
 static const struct argp_option argp_version_options[] =
 {
-  {"version",	  'V',    	0, 0,  N_("Print program version"), -1},
+  {"version",	  'V',	  	0, 0,  N_("Print program version"), -1},
   {0, 0}
 };
 
@@ -364,7 +364,7 @@
 		       values (the sign of the lower bits is preserved
 		       however)...  */
 		    cvt->long_end->val =
-		      ((opt->key | real->key) & USER_MASK)
+		      ((opt->key ? opt->key : real->key) & USER_MASK)
 		      + (((group - cvt->parser->groups) + 1) << USER_BITS);
 
 		    /* Keep the LONG_OPTS list terminated.  */
@@ -385,7 +385,7 @@
 
       if (children)
 	/* Assign GROUP's CHILD_INPUTS field some space from
-           CVT->child_inputs_end.*/
+	   CVT->child_inputs_end.*/
 	{
 	  unsigned num_children = 0;
 	  while (children[num_children].argp)
@@ -823,7 +823,7 @@
 	  parser->try_getopt = 0;
 	  if (parser->state.next > 1
 	      && strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
-	           == 0)
+		   == 0)
 	    /* Not only is this the end of the options, but it's a
 	       `quoted' region, which may have args that *look* like
 	       options, so we definitely shouldn't try to use getopt past

Added: fsf/glibc-2_11-branch/libc/argp/bug-argp2.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/argp/bug-argp2.c (added)
+++ fsf/glibc-2_11-branch/libc/argp/bug-argp2.c Wed May 12 00:06:29 2010
@@ -1,0 +1,55 @@
+#include <argp.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static struct argp_option argp_options[] = {
+  { "dstaddr", 'd', "ADDR", 0,
+    "set destination (peer) address to ADDR" },
+  { "peer", 'p', "ADDR", OPTION_ALIAS },
+  { NULL }
+};
+
+static error_t parse_opt (int key, char *arg, struct argp_state *state);
+
+static struct argp argp =
+{
+  argp_options, parse_opt
+};
+
+static int cnt;
+
+static int
+do_test (int argc, char *argv[])
+{
+  int remaining;
+  argp_parse (&argp, argc, argv, 0, &remaining, NULL);
+  return cnt != 4;
+}
+
+static error_t
+parse_opt (int key, char *arg, struct argp_state *state)
+{
+  switch (key)
+  {
+  case 'd':
+  case 'p':
+    printf ("got '%c' with argument '%s'\n", key, arg);
+    ++cnt;
+    break;
+  case 0:
+  case ARGP_KEY_END:
+  case ARGP_KEY_NO_ARGS:
+  case ARGP_KEY_INIT:
+  case ARGP_KEY_SUCCESS:
+  case ARGP_KEY_FINI:
+    // Ignore.
+    return ARGP_ERR_UNKNOWN;
+  default:
+    printf ("invalid key '%x'\n", key);
+    exit (1);
+  }
+  return 0;
+}
+
+#define TEST_FUNCTION do_test (argc, argv)
+#include "../test-skeleton.c"

Modified: fsf/glibc-2_11-branch/libc/bits/confname.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/bits/confname.h (original)
+++ fsf/glibc-2_11-branch/libc/bits/confname.h Wed May 12 00:06:29 2010
@@ -527,7 +527,7 @@
 
     _SC_THREAD_ROBUST_PRIO_INHERIT,
 #define _SC_THREAD_ROBUST_PRIO_INHERIT	_SC_THREAD_ROBUST_PRIO_INHERIT
-    _SC_THREAD_ROBUST_PRIO_PROTECT,
+    _SC_THREAD_ROBUST_PRIO_PROTECT
 #define _SC_THREAD_ROBUST_PRIO_PROTECT	_SC_THREAD_ROBUST_PRIO_PROTECT
   };
 

Modified: fsf/glibc-2_11-branch/libc/crypt/crypt_util.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/crypt/crypt_util.c (original)
+++ fsf/glibc-2_11-branch/libc/crypt/crypt_util.c Wed May 12 00:06:29 2010
@@ -1,7 +1,7 @@
 /*
  * UFC-crypt: ultra fast crypt(3) implementation
  *
- * Copyright (C) 1991, 92, 93, 96, 97, 98, 2000 Free Software Foundation, Inc.
+ * Copyright (C) 1991-1993,1996-1998,2000,2010 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -27,6 +27,7 @@
 #ifdef DEBUG
 #include <stdio.h>
 #endif
+#include <atomic.h>
 #include <string.h>
 
 #ifndef STATIC
@@ -114,53 +115,53 @@
  * The sboxes
  */
 static const int sbox[8][4][16]= {
-        { { 14,  4, 13,  1,  2, 15, 11,  8,  3, 10,  6, 12,  5,  9,  0,  7 },
-          {  0, 15,  7,  4, 14,  2, 13,  1, 10,  6, 12, 11,  9,  5,  3,  8 },
-          {  4,  1, 14,  8, 13,  6,  2, 11, 15, 12,  9,  7,  3, 10,  5,  0 },
-          { 15, 12,  8,  2,  4,  9,  1,  7,  5, 11,  3, 14, 10,  0,  6, 13 }
-        },
-
-        { { 15,  1,  8, 14,  6, 11,  3,  4,  9,  7,  2, 13, 12,  0,  5, 10 },
-          {  3, 13,  4,  7, 15,  2,  8, 14, 12,  0,  1, 10,  6,  9, 11,  5 },
-          {  0, 14,  7, 11, 10,  4, 13,  1,  5,  8, 12,  6,  9,  3,  2, 15 },
-          { 13,  8, 10,  1,  3, 15,  4,  2, 11,  6,  7, 12,  0,  5, 14,  9 }
-        },
-
-        { { 10,  0,  9, 14,  6,  3, 15,  5,  1, 13, 12,  7, 11,  4,  2,  8 },
-          { 13,  7,  0,  9,  3,  4,  6, 10,  2,  8,  5, 14, 12, 11, 15,  1 },
-          { 13,  6,  4,  9,  8, 15,  3,  0, 11,  1,  2, 12,  5, 10, 14,  7 },
-          {  1, 10, 13,  0,  6,  9,  8,  7,  4, 15, 14,  3, 11,  5,  2, 12 }
-        },
-
-        { {  7, 13, 14,  3,  0,  6,  9, 10,  1,  2,  8,  5, 11, 12,  4, 15 },
-          { 13,  8, 11,  5,  6, 15,  0,  3,  4,  7,  2, 12,  1, 10, 14,  9 },
-          { 10,  6,  9,  0, 12, 11,  7, 13, 15,  1,  3, 14,  5,  2,  8,  4 },
-          {  3, 15,  0,  6, 10,  1, 13,  8,  9,  4,  5, 11, 12,  7,  2, 14 }
-        },
-
-        { {  2, 12,  4,  1,  7, 10, 11,  6,  8,  5,  3, 15, 13,  0, 14,  9 },
-          { 14, 11,  2, 12,  4,  7, 13,  1,  5,  0, 15, 10,  3,  9,  8,  6 },
-          {  4,  2,  1, 11, 10, 13,  7,  8, 15,  9, 12,  5,  6,  3,  0, 14 },
-          { 11,  8, 12,  7,  1, 14,  2, 13,  6, 15,  0,  9, 10,  4,  5,  3 }
-        },
-
-        { { 12,  1, 10, 15,  9,  2,  6,  8,  0, 13,  3,  4, 14,  7,  5, 11 },
-          { 10, 15,  4,  2,  7, 12,  9,  5,  6,  1, 13, 14,  0, 11,  3,  8 },
-          {  9, 14, 15,  5,  2,  8, 12,  3,  7,  0,  4, 10,  1, 13, 11,  6 },
-          {  4,  3,  2, 12,  9,  5, 15, 10, 11, 14,  1,  7,  6,  0,  8, 13 }
-        },
-
-        { {  4, 11,  2, 14, 15,  0,  8, 13,  3, 12,  9,  7,  5, 10,  6,  1 },
-          { 13,  0, 11,  7,  4,  9,  1, 10, 14,  3,  5, 12,  2, 15,  8,  6 },
-          {  1,  4, 11, 13, 12,  3,  7, 14, 10, 15,  6,  8,  0,  5,  9,  2 },
-          {  6, 11, 13,  8,  1,  4, 10,  7,  9,  5,  0, 15, 14,  2,  3, 12 }
-        },
-
-        { { 13,  2,  8,  4,  6, 15, 11,  1, 10,  9,  3, 14,  5,  0, 12,  7 },
-          {  1, 15, 13,  8, 10,  3,  7,  4, 12,  5,  6, 11,  0, 14,  9,  2 },
-          {  7, 11,  4,  1,  9, 12, 14,  2,  0,  6, 10, 13, 15,  3,  5,  8 },
-          {  2,  1, 14,  7,  4, 10,  8, 13, 15, 12,  9,  0,  3,  5,  6, 11 }
-        }
+	{ { 14,  4, 13,  1,  2, 15, 11,  8,  3, 10,  6, 12,  5,  9,  0,  7 },
+	  {  0, 15,  7,  4, 14,  2, 13,  1, 10,  6, 12, 11,  9,  5,  3,  8 },
+	  {  4,  1, 14,  8, 13,  6,  2, 11, 15, 12,  9,  7,  3, 10,  5,  0 },
+	  { 15, 12,  8,  2,  4,  9,  1,  7,  5, 11,  3, 14, 10,  0,  6, 13 }
+	},
+
+	{ { 15,  1,  8, 14,  6, 11,  3,  4,  9,  7,  2, 13, 12,  0,  5, 10 },
+	  {  3, 13,  4,  7, 15,  2,  8, 14, 12,  0,  1, 10,  6,  9, 11,  5 },
+	  {  0, 14,  7, 11, 10,  4, 13,  1,  5,  8, 12,  6,  9,  3,  2, 15 },
+	  { 13,  8, 10,  1,  3, 15,  4,  2, 11,  6,  7, 12,  0,  5, 14,  9 }
+	},
+
+	{ { 10,  0,  9, 14,  6,  3, 15,  5,  1, 13, 12,  7, 11,  4,  2,  8 },
+	  { 13,  7,  0,  9,  3,  4,  6, 10,  2,  8,  5, 14, 12, 11, 15,  1 },
+	  { 13,  6,  4,  9,  8, 15,  3,  0, 11,  1,  2, 12,  5, 10, 14,  7 },
+	  {  1, 10, 13,  0,  6,  9,  8,  7,  4, 15, 14,  3, 11,  5,  2, 12 }
+	},
+
+	{ {  7, 13, 14,  3,  0,  6,  9, 10,  1,  2,  8,  5, 11, 12,  4, 15 },
+	  { 13,  8, 11,  5,  6, 15,  0,  3,  4,  7,  2, 12,  1, 10, 14,  9 },
+	  { 10,  6,  9,  0, 12, 11,  7, 13, 15,  1,  3, 14,  5,  2,  8,  4 },
+	  {  3, 15,  0,  6, 10,  1, 13,  8,  9,  4,  5, 11, 12,  7,  2, 14 }
+	},
+
+	{ {  2, 12,  4,  1,  7, 10, 11,  6,  8,  5,  3, 15, 13,  0, 14,  9 },
+	  { 14, 11,  2, 12,  4,  7, 13,  1,  5,  0, 15, 10,  3,  9,  8,  6 },
+	  {  4,  2,  1, 11, 10, 13,  7,  8, 15,  9, 12,  5,  6,  3,  0, 14 },
+	  { 11,  8, 12,  7,  1, 14,  2, 13,  6, 15,  0,  9, 10,  4,  5,  3 }
+	},
+
+	{ { 12,  1, 10, 15,  9,  2,  6,  8,  0, 13,  3,  4, 14,  7,  5, 11 },
+	  { 10, 15,  4,  2,  7, 12,  9,  5,  6,  1, 13, 14,  0, 11,  3,  8 },
+	  {  9, 14, 15,  5,  2,  8, 12,  3,  7,  0,  4, 10,  1, 13, 11,  6 },
+	  {  4,  3,  2, 12,  9,  5, 15, 10, 11, 14,  1,  7,  6,  0,  8, 13 }
+	},
+
+	{ {  4, 11,  2, 14, 15,  0,  8, 13,  3, 12,  9,  7,  5, 10,  6,  1 },
+	  { 13,  0, 11,  7,  4,  9,  1, 10, 14,  3,  5, 12,  2, 15,  8,  6 },
+	  {  1,  4, 11, 13, 12,  3,  7, 14, 10, 15,  6,  8,  0,  5,  9,  2 },
+	  {  6, 11, 13,  8,  1,  4, 10,  7,  9,  5,  0, 15, 14,  2,  3, 12 }
+	},
+
+	{ { 13,  2,  8,  4,  6, 15, 11,  1, 10,  9,  3, 14,  5,  0, 12,  7 },
+	  {  1, 15, 13,  8, 10,  3,  7,  4, 12,  5,  6, 11,  0, 14,  9,  2 },
+	  {  7, 11,  4,  1,  9, 12, 14,  2,  0,  6, 10, 13, 15,  3,  5,  8 },
+	  {  2,  1, 14,  7,  4, 10,  8, 13, 15, 12,  9,  0,  3,  5,  6, 11 }
+	}
 };
 
 /*
@@ -468,6 +469,7 @@
 	  efp[comes_from_word][word_value][o_long] |= mask2;
       }
     }
+    atomic_write_barrier ();
     small_tables_initialized = 1;
 #ifdef __GNU_LIBRARY__
 small_tables_done:

Modified: fsf/glibc-2_11-branch/libc/csu/Makefile
==============================================================================
--- fsf/glibc-2_11-branch/libc/csu/Makefile (original)
+++ fsf/glibc-2_11-branch/libc/csu/Makefile Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 # Makefile for csu code for GNU C library.
-# Copyright (C) 1995-2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1995-2004, 2005, 2006, 2010 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -209,8 +209,19 @@
 	   linux*) version=`(printf '%s\n%s\n' \
 				    '#include <linux/version.h>' \
 				    UTS_RELEASE \
-			     | $(CC) $(CPPFLAGS) -E -P - -DNOT_IN_libc=1 | \
+			     | $(CC) $(CPPFLAGS) -O -E -P - -DNOT_IN_libc=1 | \
 			     sed -e 's/"\([^"]*\)".*/\1/p' -e d) 2>/dev/null`;\
+		   if [ -z "$$version" ]; then \
+		     version=`(printf '%s\n%s\n' \
+				      '#include <linux/version.h>' \
+				       LINUX_VERSION_CODE \
+			       | $(CC) $(CPPFLAGS) -O -E -P - -DNOT_IN_libc=1 \
+			       | sed -n -e '/^[123456789].*/p' \
+			       | awk '{v=$$1; \
+				       printf("%d.%d.%d\n", \
+					      v/65535, v/256%256, v%256)}') \
+				2>/dev/null`; \
+		   fi; \
 		   if [ -z "$$version" ]; then \
 		     if [ -r /proc/version ]; then \
 		       version=`sed 's/.*Linux version \([^ ]*\) .*/>>\1<</' \

Modified: fsf/glibc-2_11-branch/libc/elf/chroot_canon.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/elf/chroot_canon.c (original)
+++ fsf/glibc-2_11-branch/libc/elf/chroot_canon.c Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* Return the canonical absolute name of a given file inside chroot.
-   Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005
+   Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005,2010
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -58,9 +58,7 @@
       return NULL;
     }
 
-  rpath = malloc (chroot_len + PATH_MAX);
-  if (rpath == NULL)
-    return NULL;
+  rpath = xmalloc (chroot_len + PATH_MAX);
 
   rpath_limit = rpath + chroot_len + PATH_MAX;
 
@@ -109,9 +107,7 @@
 		new_size += end - start + 1;
 	      else
 		new_size += PATH_MAX;
-	      new_rpath = (char *) realloc (rpath, new_size);
-	      if (new_rpath == NULL)
-		goto error;
+	      new_rpath = (char *) xrealloc (rpath, new_size);
 	      rpath = new_rpath;
 	      rpath_limit = rpath + new_size;
 

Modified: fsf/glibc-2_11-branch/libc/elf/dl-version.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/elf/dl-version.c (original)
+++ fsf/glibc-2_11-branch/libc/elf/dl-version.c Wed May 12 00:06:29 2010
@@ -322,10 +322,14 @@
 	      while (1)
 		{
 		  ElfW(Half) ndx = aux->vna_other & 0x7fff;
-		  map->l_versions[ndx].hash = aux->vna_hash;
-		  map->l_versions[ndx].hidden = aux->vna_other & 0x8000;
-		  map->l_versions[ndx].name = &strtab[aux->vna_name];
-		  map->l_versions[ndx].filename = &strtab[ent->vn_file];
+		  /* In trace mode, dependencies may be missing.  */
+		  if (__builtin_expect (ndx < map->l_nversions, 1))
+		    {
+		      map->l_versions[ndx].hash = aux->vna_hash;
+		      map->l_versions[ndx].hidden = aux->vna_other & 0x8000;
+		      map->l_versions[ndx].name = &strtab[aux->vna_name];
+		      map->l_versions[ndx].filename = &strtab[ent->vn_file];
+		    }
 
 		  if (aux->vna_next == 0)
 		    /* No more symbols.  */

Modified: fsf/glibc-2_11-branch/libc/elf/dynamic-link.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/elf/dynamic-link.h (original)
+++ fsf/glibc-2_11-branch/libc/elf/dynamic-link.h Wed May 12 00:06:29 2010
@@ -103,6 +103,11 @@
 {
   ElfW(Dyn) *dyn = l->l_ld;
   ElfW(Dyn) **info;
+#if __ELF_NATIVE_CLASS == 32
+  typedef Elf32_Word d_tag_utype;
+#elif __ELF_NATIVE_CLASS == 64
+  typedef Elf64_Xword d_tag_utype;
+#endif
 
 #ifndef RTLD_BOOTSTRAP
   if (dyn == NULL)
@@ -113,20 +118,20 @@
 
   while (dyn->d_tag != DT_NULL)
     {
-      if (dyn->d_tag < DT_NUM)
+      if ((d_tag_utype) dyn->d_tag < DT_NUM)
 	info[dyn->d_tag] = dyn;
       else if (dyn->d_tag >= DT_LOPROC &&
 	       dyn->d_tag < DT_LOPROC + DT_THISPROCNUM)
 	info[dyn->d_tag - DT_LOPROC + DT_NUM] = dyn;
-      else if ((Elf32_Word) DT_VERSIONTAGIDX (dyn->d_tag) < DT_VERSIONTAGNUM)
+      else if ((d_tag_utype) DT_VERSIONTAGIDX (dyn->d_tag) < DT_VERSIONTAGNUM)
 	info[VERSYMIDX (dyn->d_tag)] = dyn;
-      else if ((Elf32_Word) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM)
+      else if ((d_tag_utype) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM)
 	info[DT_EXTRATAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
 	     + DT_VERSIONTAGNUM] = dyn;
-      else if ((Elf32_Word) DT_VALTAGIDX (dyn->d_tag) < DT_VALNUM)
+      else if ((d_tag_utype) DT_VALTAGIDX (dyn->d_tag) < DT_VALNUM)
 	info[DT_VALTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
 	     + DT_VERSIONTAGNUM + DT_EXTRANUM] = dyn;
-      else if ((Elf32_Word) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM)
+      else if ((d_tag_utype) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM)
 	info[DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
 	     + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] = dyn;
       ++dyn;

Modified: fsf/glibc-2_11-branch/libc/elf/ldconfig.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/elf/ldconfig.c (original)
+++ fsf/glibc-2_11-branch/libc/elf/ldconfig.c Wed May 12 00:06:29 2010
@@ -773,7 +773,18 @@
 	{
 	  /* In case of symlink, we check if the symlink refers to
 	     a directory. */
-	  if (__builtin_expect (stat64 (real_file_name, &stat_buf), 0))
+	  char *target_name = real_file_name;
+	  if (opt_chroot)
+	    {
+	      target_name = chroot_canon (opt_chroot, file_name);
+	      if (target_name == NULL)
+		{
+		  if (strstr (file_name, ".so") == NULL)
+		    error (0, 0, _("Input file %s not found.\n"), file_name);
+		  continue;
+		}
+	    }
+	  if (__builtin_expect (stat64 (target_name, &stat_buf), 0))
 	    {
 	      if (opt_verbose)
 		error (0, errno, _("Cannot stat %s"), file_name);
@@ -1174,7 +1185,9 @@
   if (do_chroot && opt_chroot)
     {
       char *canon = chroot_canon (opt_chroot, pattern);
-      result = glob64 (canon ?: pattern, 0, NULL, &gl);
+      if (canon == NULL)
+	return;
+      result = glob64 (canon, 0, NULL, &gl);
       free (canon);
     }
   else
@@ -1305,11 +1318,9 @@
 				  p ? (*p = '\0', cache_file) : "/");
 
       if (canon == NULL)
-	{
-	  error (EXIT_FAILURE, errno,
-		 _("Can't open cache file directory %s\n"),
-		 p ? cache_file : "/");
-	}
+	error (EXIT_FAILURE, errno,
+	       _("Can't open cache file directory %s\n"),
+	       p ? cache_file : "/");
 
       if (p)
 	++p;
@@ -1346,8 +1357,17 @@
 	add_system_dir (LIBDIR);
     }
 
+  const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
+  if (opt_chroot)
+    {
+      aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
+      if (aux_cache_file == NULL)
+	error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
+	       _PATH_LDCONFIG_AUX_CACHE);
+    }
+
   if (! opt_ignore_aux_cache)
-    load_aux_cache (_PATH_LDCONFIG_AUX_CACHE);
+    load_aux_cache (aux_cache_file);
   else
     init_aux_cache ();
 
@@ -1356,7 +1376,7 @@
   if (opt_build_cache)
     {
       save_cache (cache_file);
-      save_aux_cache (_PATH_LDCONFIG_AUX_CACHE);
+      save_aux_cache (aux_cache_file);
     }
 
   return 0;

Modified: fsf/glibc-2_11-branch/libc/hurd/lookup-at.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/hurd/lookup-at.c (original)
+++ fsf/glibc-2_11-branch/libc/hurd/lookup-at.c Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* Lookup helper function for Hurd implementation of *at functions.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006,2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@
   flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
   at_flags &= ~AT_SYMLINK_NOFOLLOW;
   if (at_flags != 0)
-    return __hurd_fail (EINVAL);
+    return (__hurd_fail (EINVAL), MACH_PORT_NULL);
 
   if (fd == AT_FDCWD || file_name[0] == '/')
     return __file_name_lookup (file_name, flags, mode);

Modified: fsf/glibc-2_11-branch/libc/iconv/iconv_prog.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/iconv/iconv_prog.c (original)
+++ fsf/glibc-2_11-branch/libc/iconv/iconv_prog.c Wed May 12 00:06:29 2010
@@ -442,7 +442,7 @@
       if (output_file != NULL && strcmp (output_file, "-") != 0)
 	{
 	  *output = fopen (output_file, "w");
-	  if (output == NULL)
+	  if (*output == NULL)
 	    error (EXIT_FAILURE, errno, _("cannot open output file"));
 	}
       else

Modified: fsf/glibc-2_11-branch/libc/io/ftw.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/io/ftw.c (original)
+++ fsf/glibc-2_11-branch/libc/io/ftw.c Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* File tree walker functions.
-   Copyright (C) 1996-2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1996-2004, 2006-2008, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
 
@@ -790,6 +790,7 @@
     {
       int save_err = errno;
       __fchdir (cwdfd);
+      close_not_cancel_no_status (cwdfd);
       __set_errno (save_err);
     }
   else if (cwd != NULL)

Modified: fsf/glibc-2_11-branch/libc/libio/iovdprintf.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/libio/iovdprintf.c (original)
+++ fsf/glibc-2_11-branch/libc/libio/iovdprintf.c Wed May 12 00:06:29 2010
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006
+/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -60,6 +60,9 @@
 
   done = INTUSE(_IO_vfprintf) (&tmpfil.file, format, arg);
 
+  if (done != EOF && _IO_do_flush (&tmpfil.file) == EOF)
+    done = EOF;
+
   _IO_FINISH (&tmpfil.file);
 
   return done;

Modified: fsf/glibc-2_11-branch/libc/locale/loadlocale.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/locale/loadlocale.c (original)
+++ fsf/glibc-2_11-branch/libc/locale/loadlocale.c Wed May 12 00:06:29 2010
@@ -224,6 +224,7 @@
 		     PROT_READ, MAP_FILE|MAP_COPY, fd, 0);
   if (__builtin_expect (filedata == MAP_FAILED, 0))
     {
+      filedata = NULL;
       if (__builtin_expect (errno, ENOSYS) == ENOSYS)
 	{
 #endif	/* _POSIX_MAPPED_FILES */

Modified: fsf/glibc-2_11-branch/libc/localedata/ChangeLog
==============================================================================
--- fsf/glibc-2_11-branch/libc/localedata/ChangeLog (original)
+++ fsf/glibc-2_11-branch/libc/localedata/ChangeLog Wed May 12 00:06:29 2010
@@ -1,3 +1,11 @@
+2010-02-16  Paul Pluzhnikov  <ppluzhnikov@xxxxxxxxxx>
+
+	* Makefile: Add missing gconv-modules dependency.
+
+2010-01-25  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* locales/i18n: Don't map U00DF to U1E9E in toupper table.
+
 2009-11-24  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* locales/hsb_DE: Define week, first_weekday, and first_workday.

Modified: fsf/glibc-2_11-branch/libc/localedata/Makefile
==============================================================================
--- fsf/glibc-2_11-branch/libc/localedata/Makefile (original)
+++ fsf/glibc-2_11-branch/libc/localedata/Makefile Wed May 12 00:06:29 2010
@@ -106,6 +106,8 @@
 install-others := $(addprefix $(inst_i18ndir)/, \
 			      $(addsuffix .gz, $(charmaps)) \
 			      $(locales))
+
+tests: $(objdir)/iconvdata/gconv-modules
 
 include ../Rules
 
@@ -298,3 +300,6 @@
 		LOCPATH=$(common-objpfx)localedata
 $(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@
+
+$(objdir)/iconvdata/gconv-modules:
+	$(MAKE) -C ../iconvdata subdir=iconvdata $@

Modified: fsf/glibc-2_11-branch/libc/localedata/locales/i18n
==============================================================================
--- fsf/glibc-2_11-branch/libc/localedata/locales/i18n (original)
+++ fsf/glibc-2_11-branch/libc/localedata/locales/i18n Wed May 12 00:06:29 2010
@@ -928,8 +928,7 @@
    (<U006D>,<U004D>);(<U006E>,<U004E>);(<U006F>,<U004F>);(<U0070>,<U0050>);/
    (<U0071>,<U0051>);(<U0072>,<U0052>);(<U0073>,<U0053>);(<U0074>,<U0054>);/
    (<U0075>,<U0055>);(<U0076>,<U0056>);(<U0077>,<U0057>);(<U0078>,<U0058>);/
-   (<U0079>,<U0059>);(<U007A>,<U005A>);(<U00B5>,<U039C>);(<U00DF>,<U1E9E>);/
-   (<U00E0>,<U00C0>);/
+   (<U0079>,<U0059>);(<U007A>,<U005A>);(<U00B5>,<U039C>);(<U00E0>,<U00C0>);/
    (<U00E1>,<U00C1>);(<U00E2>,<U00C2>);(<U00E3>,<U00C3>);(<U00E4>,<U00C4>);/
    (<U00E5>,<U00C5>);(<U00E6>,<U00C6>);(<U00E7>,<U00C7>);(<U00E8>,<U00C8>);/
    (<U00E9>,<U00C9>);(<U00EA>,<U00CA>);(<U00EB>,<U00CB>);(<U00EC>,<U00CC>);/

Modified: fsf/glibc-2_11-branch/libc/malloc/malloc.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/malloc/malloc.c (original)
+++ fsf/glibc-2_11-branch/libc/malloc/malloc.c Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 1996-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1996-2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@xxxxxxxxx>
    and Doug Lea <dl@xxxxxxxxxxxxx>, 2001.
@@ -2351,7 +2351,8 @@
 */
 
 #define set_max_fast(s) \
-  global_max_fast = ((s) == 0)? SMALLBIN_WIDTH: request2size(s)
+  global_max_fast = (((s) == 0)						      \
+		     ? SMALLBIN_WIDTH: ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK))
 #define get_max_fast() global_max_fast
 
 
@@ -3933,9 +3934,10 @@
   if(!p) {
     /* Maybe the failure is due to running out of mmapped areas. */
     if(ar_ptr != &main_arena) {
-      (void)mutex_lock(&main_arena.mutex);
-      p = _int_memalign(&main_arena, pagesz, bytes);
-      (void)mutex_unlock(&main_arena.mutex);
+      ar_ptr = &main_arena;
+      (void)mutex_lock(&ar_ptr->mutex);
+      p = _int_memalign(ar_ptr, pagesz, bytes);
+      (void)mutex_unlock(&ar_ptr->mutex);
     } else {
 #if USE_ARENAS
       /* ... or sbrk() has failed and there is still a chance to mmap() */
@@ -3978,9 +3980,10 @@
   if(!p) {
     /* Maybe the failure is due to running out of mmapped areas. */
     if(ar_ptr != &main_arena) {
-      (void)mutex_lock(&main_arena.mutex);
-      p = _int_memalign(&main_arena, pagesz, rounded_bytes);
-      (void)mutex_unlock(&main_arena.mutex);
+      ar_ptr = &main_arena;
+      (void)mutex_lock(&ar_ptr->mutex);
+      p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
+      (void)mutex_unlock(&ar_ptr->mutex);
     } else {
 #if USE_ARENAS
       /* ... or sbrk() has failed and there is still a chance to mmap() */

Modified: fsf/glibc-2_11-branch/libc/manual/charset.texi
==============================================================================
--- fsf/glibc-2_11-branch/libc/manual/charset.texi (original)
+++ fsf/glibc-2_11-branch/libc/manual/charset.texi Wed May 12 00:06:29 2010
@@ -393,7 +393,7 @@
 by the functions we are about to describe.  Each locale uses its own
 character set (given as an argument to @code{localedef}) and this is the
 one assumed as the external multibyte encoding.  The wide character
-character set always is UCS-4, at least on GNU systems.
+set is always UCS-4, at least on GNU systems.
 
 A characteristic of each multibyte character set is the maximum number
 of bytes that can be necessary to represent one character.  This
@@ -577,8 +577,8 @@
 and is declared in @file{wchar.h}.
 @end deftypefun
 
-Despite the limitation that the single byte value always is interpreted
-in the initial state this function is actually useful most of the time.
+Despite the limitation that the single byte value is always interpreted
+in the initial state, this function is actually useful most of the time.
 Most characters are either entirely single-byte character sets or they
 are extension to ASCII.  But then it is possible to write code like this
 (not that this specific example is very useful):
@@ -607,10 +607,10 @@
 on the character of the character set used for @code{wchar_t}
 representation.  In other situations the bytes are not constant at
 compile time and so the compiler cannot do the work.  In situations like
-this it is necessary @code{btowc}.
+this, using @code{btowc} is required.
 
 @noindent
-There also is a function for the conversion in the other direction.
+There is also a function for the conversion in the other direction.
 
 @comment wchar.h
 @comment ISO

Modified: fsf/glibc-2_11-branch/libc/manual/errno.texi
==============================================================================
--- fsf/glibc-2_11-branch/libc/manual/errno.texi (original)
+++ fsf/glibc-2_11-branch/libc/manual/errno.texi Wed May 12 00:06:29 2010
@@ -1419,7 +1419,7 @@
 @code{perror} generates is not what is wanted and there is no way to
 extend or change what @code{perror} does.  The GNU coding standard, for
 instance, requires error messages to be preceded by the program name and
-programs which read some input files should should provide information
+programs which read some input files should provide information
 about the input file name and the line number in case an error is
 encountered while reading the file.  For these occasions there are two
 functions available which are widely used throughout the GNU project.

Modified: fsf/glibc-2_11-branch/libc/manual/getopt.texi
==============================================================================
--- fsf/glibc-2_11-branch/libc/manual/getopt.texi (original)
+++ fsf/glibc-2_11-branch/libc/manual/getopt.texi Wed May 12 00:06:29 2010
@@ -269,7 +269,7 @@
 @var{argv} of the next remaining argument.
 @end deftypefun
 
-Since long option names were used before before the @code{getopt_long}
+Since long option names were used before the @code{getopt_long}
 options was invented there are program interfaces which require programs
 to recognize options like @w{@samp{-option value}} instead of
 @w{@samp{--option value}}.  To enable these programs to use the GNU

Modified: fsf/glibc-2_11-branch/libc/manual/math.texi
==============================================================================
--- fsf/glibc-2_11-branch/libc/manual/math.texi (original)
+++ fsf/glibc-2_11-branch/libc/manual/math.texi Wed May 12 00:06:29 2010
@@ -1421,7 +1421,7 @@
 
 The GNU C library contains four additional functions which contain the
 state as an explicit parameter and therefore make it possible to handle
-thread-local PRNGs.  Beside this there are no difference.  In fact, the
+thread-local PRNGs.  Beside this there is no difference.  In fact, the
 four functions already discussed are implemented internally using the
 following interfaces.
 

Modified: fsf/glibc-2_11-branch/libc/manual/memory.texi
==============================================================================
--- fsf/glibc-2_11-branch/libc/manual/memory.texi (original)
+++ fsf/glibc-2_11-branch/libc/manual/memory.texi Wed May 12 00:06:29 2010
@@ -2379,7 +2379,7 @@
 @c The Brk system call in Linux (as opposed to the GNU C Library function)
 @c is considerably different.  It always returns the new end of the data
 @c segment, whether it succeeds or fails.  The GNU C library Brk determines
-@c it's a failure if and only if if the system call returns an address less
+@c it's a failure if and only if the system call returns an address less
 @c than the address requested.
 
 @end deftypefun

Modified: fsf/glibc-2_11-branch/libc/manual/message.texi
==============================================================================
--- fsf/glibc-2_11-branch/libc/manual/message.texi (original)
+++ fsf/glibc-2_11-branch/libc/manual/message.texi Wed May 12 00:06:29 2010
@@ -1466,7 +1466,7 @@
 handle these kind of problems with the @code{gettext} functions.
 
 @noindent
-As as example consider the following fictional situation.  A GUI program
+As an example consider the following fictional situation.  A GUI program
 has a menu bar with the following entries:
 
 @smallexample

Modified: fsf/glibc-2_11-branch/libc/manual/resource.texi
==============================================================================
--- fsf/glibc-2_11-branch/libc/manual/resource.texi (original)
+++ fsf/glibc-2_11-branch/libc/manual/resource.texi Wed May 12 00:06:29 2010
@@ -1288,7 +1288,7 @@
 The POSIX standard up to this date is of not much help to solve this
 problem.  The Linux kernel provides a set of interfaces to allow
 specifying @emph{affinity sets} for a process.  The scheduler will
-schedule the thread or process on on CPUs specified by the affinity
+schedule the thread or process on CPUs specified by the affinity
 masks.  The interfaces which the GNU C library define follow to some
 extend the Linux kernel interface.
 

Modified: fsf/glibc-2_11-branch/libc/manual/stdio.texi
==============================================================================
--- fsf/glibc-2_11-branch/libc/manual/stdio.texi (original)
+++ fsf/glibc-2_11-branch/libc/manual/stdio.texi Wed May 12 00:06:29 2010
@@ -574,7 +574,7 @@
 introduction of threads) were implemented as macros which are very fast
 if the buffer is not empty.  With the addition of locking requirements
 these functions are no longer implemented as macros since they would
-would expand to too much code.
+expand to too much code.
 But these macros are still available with the same functionality under the new
 names @code{putc_unlocked} and @code{getc_unlocked}.  This possibly huge
 difference of speed also suggests the use of the @code{_unlocked}

Modified: fsf/glibc-2_11-branch/libc/manual/time.texi
==============================================================================
--- fsf/glibc-2_11-branch/libc/manual/time.texi (original)
+++ fsf/glibc-2_11-branch/libc/manual/time.texi Wed May 12 00:06:29 2010
@@ -972,7 +972,7 @@
 large offsets or jitter).
 
 @item long int stbcnt
-This counter denotes the number of of calibrations where the stability
+This counter denotes the number of calibrations where the stability
 exceeded the threshold.
 @end table
 @end deftp

Modified: fsf/glibc-2_11-branch/libc/misc/bits/syslog.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/misc/bits/syslog.h (original)
+++ fsf/glibc-2_11-branch/libc/misc/bits/syslog.h Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* Checking macros for syslog functions.
-   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -29,7 +29,7 @@
 __extern_always_inline void
 syslog (int __pri, __const char *__fmt, ...)
 {
-  return __syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
+  __syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
 }
 #elif !defined __cplusplus
 # define syslog(pri, ...) \
@@ -45,6 +45,6 @@
 __extern_always_inline void
 vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
 {
-  return __vsyslog_chk (__pri,  __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+  __vsyslog_chk (__pri,  __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
 }
 #endif

Modified: fsf/glibc-2_11-branch/libc/misc/getusershell.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/misc/getusershell.c (original)
+++ fsf/glibc-2_11-branch/libc/misc/getusershell.c Wed May 12 00:06:29 2010
@@ -116,7 +116,8 @@
 	}
 	if (statb.st_size > ~(size_t)0 / sizeof (char *) * 3)
 		goto init_okshells;
-	if ((strings = malloc(statb.st_size + 2)) == NULL)
+	flen = statb.st_size + 3;
+	if ((strings = malloc(flen)) == NULL)
 		goto init_okshells;
 	shells = malloc(statb.st_size / 3 * sizeof (char *));
 	if (shells == NULL) {
@@ -126,7 +127,6 @@
 	}
 	sp = shells;
 	cp = strings;
-	flen = statb.st_size + 2;
 	while (fgets_unlocked(cp, flen - (cp - strings), fp) != NULL) {
 		while (*cp != '#' && *cp != '/' && *cp != '\0')
 			cp++;

Modified: fsf/glibc-2_11-branch/libc/misc/mntent_r.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/misc/mntent_r.c (original)
+++ fsf/glibc-2_11-branch/libc/misc/mntent_r.c Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* Utilities for reading/writing fstab, mtab, etc.
-   Copyright (C) 1995-2000, 2001, 2002, 2003, 2006
+   Copyright (C) 1995-2000, 2001, 2002, 2003, 2006, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -194,7 +194,7 @@
     const char *rp = name;						      \
 									      \
     while (*rp != '\0')							      \
-      if (*rp == ' ' || *rp == '\t' || *rp == '\\')			      \
+      if (*rp == ' ' || *rp == '\t' || *rp == '\n' || *rp == '\\')	      \
 	break;								      \
       else								      \
 	++rp;								      \
@@ -202,7 +202,7 @@
     if (*rp != '\0')							      \
       {									      \
 	/* In the worst case the length of the string can increase to	      \
-	   founr times the current length.  */				      \
+	   four times the current length.  */				      \
 	char *wp;							      \
 									      \
 	rp = name;							      \

Modified: fsf/glibc-2_11-branch/libc/nscd/aicache.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/nscd/aicache.c (original)
+++ fsf/glibc-2_11-branch/libc/nscd/aicache.c Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* Cache handling for host lookup.
-   Copyright (C) 2004-2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2004-2008, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2004.
 
@@ -111,7 +111,7 @@
   int old_res_options = _res.options;
   _res.options &= ~RES_USE_INET6;
 
-  size_t tmpbuf6len = 512;
+  size_t tmpbuf6len = 1024;
   char *tmpbuf6 = alloca (tmpbuf6len);
   size_t tmpbuf4len = 0;
   char *tmpbuf4 = NULL;
@@ -133,9 +133,11 @@
 							 "gethostbyname4_r");
       if (fct4 != NULL)
 	{
-	  struct gaih_addrtuple *at = NULL;
+	  struct gaih_addrtuple atmem;
+	  struct gaih_addrtuple *at;
 	  while (1)
 	    {
+	      at = &atmem;
 	      rc6 = 0;
 	      herrno = 0;
 	      status[1] = DL_CALL_FCT (fct4, (key, &at, tmpbuf6, tmpbuf6len,
@@ -153,7 +155,7 @@
 	    goto next_nip;
 
 	  /* We found the data.  Count the addresses and the size.  */
-	  for (const struct gaih_addrtuple *at2 = at; at2 != NULL;
+	  for (const struct gaih_addrtuple *at2 = at = &atmem; at2 != NULL;
 	       at2 = at2->next)
 	    {
 	      ++naddrs;

Modified: fsf/glibc-2_11-branch/libc/posix/gai.conf
==============================================================================
--- fsf/glibc-2_11-branch/libc/posix/gai.conf (original)
+++ fsf/glibc-2_11-branch/libc/posix/gai.conf Wed May 12 00:06:29 2010
@@ -66,3 +66,12 @@
 #scopev4 ::ffff:172.16.0.0/108   5
 #scopev4 ::ffff:192.168.0.0/112  5
 #scopev4 ::ffff:0.0.0.0/96       14
+#
+#    For sites which use site-local IPv4 addresses behind NAT there is
+#    the problem that even if IPv4 addresses are preferred they do not
+#    have the same scope and are therefore not sorted first.  To change
+#    this use only these rules:
+#
+#scopev4 ::ffff:169.254.0.0/112  2
+#scopev4 ::ffff:127.0.0.0/104    2
+#scopev4 ::ffff:0.0.0.0/96       14

Modified: fsf/glibc-2_11-branch/libc/posix/getopt.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/posix/getopt.c (original)
+++ fsf/glibc-2_11-branch/libc/posix/getopt.c Wed May 12 00:06:29 2010
@@ -2,7 +2,8 @@
    NOTE: getopt is part of the C library, so if you don't know what
    "Keep this file name-space clean" means, talk to drepper@xxxxxxx
    before changing it!
-   Copyright (C) 1987-1996,1998-2004,2008,2009 Free Software Foundation, Inc.
+   Copyright (C) 1987-1996,1998-2004,2008,2009,2010
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -394,8 +395,6 @@
 		    int long_only, struct _getopt_data *d, int posixly_correct)
 {
   int print_errors = d->opterr;
-  if (optstring[0] == ':')
-    print_errors = 0;
 
   if (argc < 1)
     return -1;
@@ -410,6 +409,10 @@
 				      posixly_correct);
       d->__initialized = 1;
     }
+  else if (optstring[0] == '-' || optstring[0] == '+')
+    optstring++;
+  if (optstring[0] == ':')
+    print_errors = 0;
 
   /* Test whether ARGV[optind] points to a non-option argument.
      Either it does not have option syntax, or there is an environment flag
@@ -679,8 +682,8 @@
 		      char *buf;
 
 		      if (__asprintf (&buf, _("\
-%s: option '%s' requires an argument\n"),
-				      argv[0], argv[d->optind - 1]) >= 0)
+%s: option '--%s' requires an argument\n"),
+				      argv[0], pfound->name) >= 0)
 			{
 			  _IO_flockfile (stderr);
 
@@ -697,8 +700,8 @@
 			}
 #else
 		      fprintf (stderr,
-			       _("%s: option '%s' requires an argument\n"),
-			       argv[0], argv[d->optind - 1]);
+			       _("%s: option '--%s' requires an argument\n"),
+			       argv[0], pfound->name);
 #endif
 		    }
 		  d->__nextchar += strlen (d->__nextchar);
@@ -788,7 +791,7 @@
     if (*d->__nextchar == '\0')
       ++d->optind;
 
-    if (temp == NULL || c == ':')
+    if (temp == NULL || c == ':' || c == ';')
       {
 	if (print_errors)
 	  {
@@ -910,7 +913,10 @@
 		  pfound = p;
 		  indfound = option_index;
 		}
-	      else
+	      else if (long_only
+		       || pfound->has_arg != p->has_arg
+		       || pfound->flag != p->flag
+		       || pfound->val != p->val)
 		/* Second or later nonexact match found.  */
 		ambig = 1;
 	    }
@@ -922,7 +928,7 @@
 		char *buf;
 
 		if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"),
-				argv[0], argv[d->optind]) >= 0)
+				argv[0], d->optarg) >= 0)
 		  {
 		    _IO_flockfile (stderr);
 
@@ -938,7 +944,7 @@
 		  }
 #else
 		fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"),
-			 argv[0], argv[d->optind]);
+			 argv[0], d->optarg);
 #endif
 	      }
 	    d->__nextchar += strlen (d->__nextchar);
@@ -1001,8 +1007,8 @@
 			char *buf;
 
 			if (__asprintf (&buf, _("\
-%s: option '%s' requires an argument\n"),
-					argv[0], argv[d->optind - 1]) >= 0)
+%s: option '-W %s' requires an argument\n"),
+					argv[0], pfound->name) >= 0)
 			  {
 			    _IO_flockfile (stderr);
 
@@ -1018,15 +1024,17 @@
 			    free (buf);
 			  }
 #else
-			fprintf (stderr,
-				 _("%s: option '%s' requires an argument\n"),
-				 argv[0], argv[d->optind - 1]);
+			fprintf (stderr, _("\
+%s: option '-W %s' requires an argument\n"),
+				 argv[0], pfound->name);
 #endif
 		      }
 		    d->__nextchar += strlen (d->__nextchar);
 		    return optstring[0] == ':' ? ':' : '?';
 		  }
 	      }
+	    else
+	      d->optarg = NULL;
 	    d->__nextchar += strlen (d->__nextchar);
 	    if (longind != NULL)
 	      *longind = option_index;

Modified: fsf/glibc-2_11-branch/libc/posix/regex_internal.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/posix/regex_internal.c (original)
+++ fsf/glibc-2_11-branch/libc/posix/regex_internal.c Wed May 12 00:06:29 2010
@@ -133,7 +133,14 @@
 #ifdef RE_ENABLE_I18N
   if (pstr->mb_cur_max > 1)
     {
-      wint_t *new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len);
+      wint_t *new_wcs;
+
+      /* Avoid overflow in realloc.  */
+      const size_t max_object_size = MAX (sizeof (wint_t), sizeof (int));
+      if (BE (SIZE_MAX / max_object_size < new_buf_len, 0))
+	return REG_ESPACE;
+
+      new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len);
       if (BE (new_wcs == NULL, 0))
 	return REG_ESPACE;
       pstr->wcs = new_wcs;
@@ -1404,8 +1411,11 @@
       re_node_set *new_edests, *new_eclosures;
       re_token_t *new_nodes;
 
-      /* Avoid overflows.  */
-      if (BE (new_nodes_alloc < dfa->nodes_alloc, 0))
+      /* Avoid overflows in realloc.  */
+      const size_t max_object_size = MAX (sizeof (re_token_t),
+					  MAX (sizeof (re_node_set),
+					       sizeof (int)));
+      if (BE (SIZE_MAX / max_object_size < new_nodes_alloc, 0))
 	return -1;
 
       new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc);

Modified: fsf/glibc-2_11-branch/libc/posix/regexec.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/posix/regexec.c (original)
+++ fsf/glibc-2_11-branch/libc/posix/regexec.c Wed May 12 00:06:29 2010
@@ -3998,7 +3998,7 @@
 	  /* Skip the collation sequence value.  */
 	  idx += sizeof (uint32_t);
 	  /* Skip the wide char sequence of the collating element.  */
-	  idx = idx + sizeof (uint32_t) * (extra[idx] + 1);
+	  idx = idx + sizeof (uint32_t) * (*(int32_t *) (extra + idx) + 1);
 	  /* If we found the entry, return the sequence value.  */
 	  if (found)
 	    return *(uint32_t *) (extra + idx);

Modified: fsf/glibc-2_11-branch/libc/resolv/netdb.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/resolv/netdb.h (original)
+++ fsf/glibc-2_11-branch/libc/resolv/netdb.h Wed May 12 00:06:29 2010
@@ -515,6 +515,30 @@
 extern int ruserok_af (__const char *__rhost, int __suser,
 		       __const char *__remuser, __const char *__locuser,
 		       sa_family_t __af);
+
+/* Check whether user REMUSER on system indicated by IPv4 address
+   RADDR is allowed to login as LOCUSER.  Non-IPv4 (e.g., IPv6) are
+   not supported.  If SUSER is not zero the user tries to become
+   superuser.  Return 0 if it is possible.
+
+   This function is not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation it is a cancellation point and
+   therefore not marked with __THROW.  */
+extern int iruserok (uint32_t __raddr, int __suser,
+		     __const char *__remuser, __const char *__locuser);
+
+/* This is the equivalent function where the pfamiliy if the address
+   pointed to by RADDR is determined by the value of AF.  It therefore
+   can be used for IPv6
+
+   This function is not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation it is a cancellation point and
+   therefore not marked with __THROW.  */
+extern int iruserok_af (__const void *__raddr, int __suser,
+			__const char *__remuser, __const char *__locuser,
+			sa_family_t __af);
 
 /* Try to allocate reserved port, returning a descriptor for a socket opened
    at this port or -1 if unsuccessful.  The search for an available port

Modified: fsf/glibc-2_11-branch/libc/resolv/nss_dns/dns-host.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/resolv/nss_dns/dns-host.c (original)
+++ fsf/glibc-2_11-branch/libc/resolv/nss_dns/dns-host.c Wed May 12 00:06:29 2010
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2004, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2004, 2007-2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Extended from original form by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
 
@@ -198,21 +198,27 @@
 			  1024, &host_buffer.ptr, NULL, NULL, NULL);
   if (n < 0)
     {
-      if (errno == ESRCH)
-	{
+      switch (errno)
+	{
+	case ESRCH:
 	  status = NSS_STATUS_TRYAGAIN;
 	  h_errno = TRY_AGAIN;
-	}
-      else
-	status = (errno == ECONNREFUSED
-		  ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
+	  break;
+	case ECONNREFUSED:
+	case ETIMEDOUT:
+	  status = NSS_STATUS_UNAVAIL;
+	  break;
+	default:
+	  status = NSS_STATUS_NOTFOUND;
+	  break;
+	}
       *h_errnop = h_errno;
       if (h_errno == TRY_AGAIN)
 	*errnop = EAGAIN;
       else
 	__set_errno (olderr);
 
-      /* If we are looking for a IPv6 address and mapping is enabled
+      /* If we are looking for an IPv6 address and mapping is enabled
 	 by having the RES_USE_INET6 bit in _res.options set, we try
 	 another lookup.  */
       if (af == AF_INET6 && (_res.options & RES_USE_INET6))
@@ -1044,7 +1050,7 @@
 	  ++had_error;
 	  continue;
 	}
-      if (*firstp)
+      if (*firstp && canon == NULL)
 	{
 	  h_name = buffer;
 	  buffer += h_namelen;
@@ -1160,19 +1166,7 @@
 	  if (ttl != 0 && ttlp != NULL)
 	    *ttlp = ttl;
 
-	  if (canon != NULL)
-	    {
-	      (*pat)->name = canon;
-
-	      /* Reclaim buffer space.  */
-	      if (h_name + h_namelen == buffer)
-		{
-		  buffer = h_name;
-		  buflen += h_namelen;
-		}
-	    }
-	  else
-	    (*pat)->name = h_name;
+	  (*pat)->name = canon ?: h_name;
 
 	  *firstp = 0;
 	}

Modified: fsf/glibc-2_11-branch/libc/sysdeps/i386/lshift.S
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/i386/lshift.S (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/i386/lshift.S Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* i80386 __mpn_lshift --
-   Copyright (C) 1992, 1994, 1997-2000, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1992,1994,1997-2000,2005,2010 Free Software Foundation, Inc.
    This file is part of the GNU MP Library.
 
    The GNU MP Library is free software; you can redistribute it and/or modify
@@ -55,6 +55,7 @@
 
 	movl	(%esi,%edx,4),%ebx	/* read most significant limb */
 	cfi_rel_offset (ebx, 0)
+	cfi_remember_state
 	xorl	%eax,%eax
 	shldl	%cl,%ebx,%eax		/* compute carry limb */
 	decl	%edx
@@ -95,6 +96,7 @@
 	LEAVE
 	ret
 
+	cfi_restore_state
 L(end):	shll	%cl,%ebx		/* compute least significant limb */
 	movl	%ebx,(%edi)		/* store it */
 

Modified: fsf/glibc-2_11-branch/libc/sysdeps/mach/hurd/ttyname_r.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/mach/hurd/ttyname_r.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/mach/hurd/ttyname_r.c Wed May 12 00:06:29 2010
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 95, 96, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1995,1996,1998,2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -34,13 +34,13 @@
 
   nodename[0] = '\0';
   if (err = HURD_DPORT_USE (fd, __term_get_nodename (port, nodename)))
-    return __hurd_dfail (fd, err), -1;
+    return __hurd_dfail (fd, err), errno;
 
   len = strlen (nodename) + 1;
   if (len > buflen)
     {
       errno = EINVAL;
-      return -1;
+      return errno;
     }
 
   memcpy (buf, nodename, len);

Modified: fsf/glibc-2_11-branch/libc/sysdeps/posix/cuserid.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/posix/cuserid.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/posix/cuserid.c Wed May 12 00:06:29 2010
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 1998, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 1998, 1999, 2001, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -44,5 +44,6 @@
 
   if (s == NULL)
     s = name;
-  return strncpy (s, pwptr->pw_name, L_cuserid);
+  s[L_cuserid - 1] = '\0';
+  return strncpy (s, pwptr->pw_name, L_cuserid - 1);
 }

Modified: fsf/glibc-2_11-branch/libc/sysdeps/posix/getaddrinfo.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/posix/getaddrinfo.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/posix/getaddrinfo.c Wed May 12 00:06:29 2010
@@ -702,6 +702,7 @@
 
 	  while (!no_more)
 	    {
+	      no_data = 0;
 	      nss_gethostbyname4_r fct4
 		= __nss_lookup_function (nip, "gethostbyname4_r");
 	      if (fct4 != NULL)

Modified: fsf/glibc-2_11-branch/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c Wed May 12 00:06:29 2010
@@ -203,7 +203,10 @@
    swapping).  */
 #define BODY								\
   {									\
-    if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH)				\
+    /* The hardware instruction currently fails to report an error for	\
+       isolated low surrogates so we have to disable the instruction	\
+       until this gets resolved.  */					\
+    if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */			\
       {									\
 	HARDWARE_CONVERT ("cu24 %0, %1, 1");				\
 	if (inptr != inend)						\
@@ -229,6 +232,12 @@
       }									\
     else								\
       {									\
+        /* An isolated low-surrogate was found.  This has to be         \
+	   considered ill-formed.  */					\
+        if (__builtin_expect (u1 >= 0xdc00, 0))				\
+	  {								\
+	    STANDARD_FROM_LOOP_ERR_HANDLER (2);				\
+	  }								\
 	/* It's a surrogate character.  At least the first word says	\
 	   it is.  */							\
 	if (__builtin_expect (inptr + 4 > inend, 0))			\

Modified: fsf/glibc-2_11-branch/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c Wed May 12 00:06:29 2010
@@ -345,9 +345,12 @@
    Operation.  */
 #define BODY								\
   {									\
-    if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH)				\
-      {									\
-	HARDWARE_CONVERT ("cu21 %0, %1");				\
+    /* The hardware instruction currently fails to report an error for	\
+       isolated low surrogates so we have to disable the instruction	\
+       until this gets resolved.  */					\
+    if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */			\
+      {									\
+	HARDWARE_CONVERT ("cu21 %0, %1, 1");				\
 	if (inptr != inend)						\
 	  {								\
 	    /* Check if the third byte is				\
@@ -388,7 +391,7 @@
 									\
 	outptr += 2;							\
       }									\
-    else if (c >= 0x0800 && c <= 0xd7ff)				\
+    else if ((c >= 0x0800 && c <= 0xd7ff) || c > 0xdfff)		\
       {									\
 	/* Three byte UTF-8 char.  */					\
 									\

Modified: fsf/glibc-2_11-branch/libc/sysdeps/unix/bsd/ptsname.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/unix/bsd/ptsname.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/unix/bsd/ptsname.c Wed May 12 00:06:29 2010
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998,2002,2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -44,6 +44,7 @@
 __ptsname_r (int fd, char *buf, size_t buflen)
 {
   int save_errno = errno;
+  int err;
   struct stat st;
 
   if (buf == NULL)
@@ -62,8 +63,12 @@
       return ERANGE;
     }
 
-  if (__ttyname_r (fd, buf, buflen) != 0)
-    return errno;
+  err = __ttyname_r (fd, buf, buflen);
+  if (err != 0)
+    {
+      __set_errno (err);
+      return errno;
+    }
 
   buf[sizeof (_PATH_DEV) - 1] = 't';
 

Modified: fsf/glibc-2_11-branch/libc/sysdeps/unix/getlogin.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/unix/getlogin.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/unix/getlogin.c Wed May 12 00:06:29 2010
@@ -33,6 +33,7 @@
 {
   char tty_pathname[2 + 2 * NAME_MAX];
   char *real_tty_path = tty_pathname;
+  int err;
   char *result = NULL;
   static char name[UT_NAMESIZE + 1];
   struct utmp *ut, line, buffer;
@@ -46,8 +47,12 @@
      thing to do.  Note that ttyname(open("/dev/tty")) on those
      systems returns /dev/tty, so that is not a possible solution for
      getlogin().  */
-  if (__ttyname_r (0, real_tty_path, sizeof (tty_pathname)) != 0)
-    return NULL;
+  err = __ttyname_r (0, real_tty_path, sizeof (tty_pathname));
+  if (err != 0)
+    {
+      __set_errno (err);
+      return NULL;
+    }
 
   real_tty_path += 5;		/* Remove "/dev/".  */
 

Modified: fsf/glibc-2_11-branch/libc/sysdeps/unix/readdir_r.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/unix/readdir_r.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/unix/readdir_r.c Wed May 12 00:06:29 2010
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,02
+/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,02,10
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -113,7 +113,17 @@
   while (dp->d_ino == 0);
 
   if (dp != NULL)
-    *result = memcpy (entry, dp, reclen);
+    {
+#ifdef GETDENTS_64BIT_ALIGNED
+      /* The d_reclen value might include padding which is not part of
+	 the DIRENT_TYPE data structure.  */
+      reclen = MIN (reclen, sizeof (DIRENT_TYPE));
+#endif
+      *result = memcpy (entry, dp, reclen);
+#ifdef GETDENTS_64BIT_ALIGNED
+      entry->d_reclen = reclen;
+#endif
+    }
   else
     *result = NULL;
 

Modified: fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/fallocate.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/fallocate.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/fallocate.c Wed May 12 00:06:29 2010
@@ -30,7 +30,13 @@
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
-  return __call_fallocate (fd, mode, offset, len);
+  int err = __call_fallocate (fd, mode, offset, len);
+  if (__builtin_expect (err, 0))
+    {
+      __set_errno (err);
+      err = -1;
+    }
+  return err;
 #else
   __set_errno (ENOSYS);
   return -1;

Modified: fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c Wed May 12 00:06:29 2010
@@ -30,7 +30,13 @@
 fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
 {
 #ifdef __NR_fallocate
-  return __call_fallocate (fd, mode, offset, len);
+  int err = __call_fallocate (fd, mode, offset, len);
+  if (__builtin_expect (err, 0))
+    {
+      __set_errno (err);
+      err = -1;
+    }
+  return err;
 #else
   __set_errno (ENOSYS);
   return -1;

Modified: fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/readdir64_r.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/readdir64_r.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/i386/readdir64_r.c Wed May 12 00:06:29 2010
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2004, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
 #define __READDIR_R __readdir64_r
 #define __GETDENTS __getdents64
 #define DIRENT_TYPE struct dirent64
+#define GETDENTS_64BIT_ALIGNED 1
 
 #include <sysdeps/unix/readdir_r.c>
 

Modified: fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/ifaddrs.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/ifaddrs.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/ifaddrs.c Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* getifaddrs -- get names and addresses of all network interfaces
-   Copyright (C) 2003-2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2003-2008, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -315,17 +315,19 @@
       else if (map[i] == index)
 	return i;
     }
-  /* This should never be reached. If this will be reached, we have
-     a very big problem.  */
-  abort ();
+
+  /* This means interfaces changed inbetween the reading of the
+     RTM_GETLINK and RTM_GETADDR information.  We have to repeat
+     everything.  */
+  return -1;
 }
 
 
 /* Create a linked list of `struct ifaddrs' structures, one for each
    network interface on the host machine.  If successful, store the
    list in *IFAP and return 0.  On errors, return -1 and set `errno'.  */
-int
-getifaddrs (struct ifaddrs **ifap)
+static int
+getifaddrs_internal (struct ifaddrs **ifap)
 {
   struct netlink_handle nh = { 0, 0, 0, NULL, NULL };
   struct netlink_res *nlp;
@@ -481,6 +483,13 @@
 		 kernel.  */
 	      ifa_index = map_newlink (ifim->ifi_index - 1, ifas,
 				       map_newlink_data, newlink);
+	      if (__builtin_expect (ifa_index == -1, 0))
+		{
+		try_again:
+		  result = -EAGAIN;
+		  free (ifas);
+		  goto exit_free;
+		}
 	      ifas[ifa_index].ifa.ifa_flags = ifim->ifi_flags;
 
 	      while (RTA_OK (rta, rtasize))
@@ -565,9 +574,11 @@
 		 that we have holes in the interface part of the list,
 		 but we always have already the interface for this address.  */
 	      ifa_index = newlink + newaddr_idx;
-	      ifas[ifa_index].ifa.ifa_flags
-		= ifas[map_newlink (ifam->ifa_index - 1, ifas,
-				    map_newlink_data, newlink)].ifa.ifa_flags;
+	      int idx = map_newlink (ifam->ifa_index - 1, ifas,
+				     map_newlink_data, newlink);
+	      if (__builtin_expect (idx == -1, 0))
+		goto try_again;
+	      ifas[ifa_index].ifa.ifa_flags = ifas[idx].ifa.ifa_flags;
 	      if (ifa_index > 0)
 		ifas[ifa_index - 1].ifa.ifa_next = &ifas[ifa_index].ifa;
 	      ++newaddr_idx;
@@ -747,9 +758,13 @@
 	      /* If we didn't get the interface name with the
 		 address, use the name from the interface entry.  */
 	      if (ifas[ifa_index].ifa.ifa_name == NULL)
-		ifas[ifa_index].ifa.ifa_name
-		  = ifas[map_newlink (ifam->ifa_index - 1, ifas,
-				      map_newlink_data, newlink)].ifa.ifa_name;
+		{
+		  int idx = map_newlink (ifam->ifa_index - 1, ifas,
+					 map_newlink_data, newlink);
+		  if (__builtin_expect (idx == -1, 0))
+		    goto try_again;
+		  ifas[ifa_index].ifa.ifa_name = ifas[idx].ifa.ifa_name;
+		}
 
 	      /* Calculate the netmask.  */
 	      if (ifas[ifa_index].ifa.ifa_addr
@@ -826,6 +841,22 @@
 
   return result;
 }
+
+
+/* Create a linked list of `struct ifaddrs' structures, one for each
+   network interface on the host machine.  If successful, store the
+   list in *IFAP and return 0.  On errors, return -1 and set `errno'.  */
+int
+getifaddrs (struct ifaddrs **ifap)
+{
+  int res;
+
+  do
+    res = getifaddrs_internal (ifap);
+  while (res == -EAGAIN);
+
+  return res;
+}
 libc_hidden_def (getifaddrs)
 
 

Modified: fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c Wed May 12 00:06:29 2010
@@ -46,7 +46,7 @@
 	    {								\
 	      if ((oss.ss_flags & SS_ONSTACK) == 0			\
 		  || ((uintptr_t) (oss.ss_sp + oss.ss_size) - new_sp	\
-		      >= oss.ss_size))					\
+		      < oss.ss_size))					\
 		__fortify_fail ("longjmp causes uninitialized stack frame");\
 	    }								\
 	}								\

Modified: fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c Wed May 12 00:06:29 2010
@@ -46,7 +46,7 @@
 	    {								\
 	      if ((oss.ss_flags & SS_ONSTACK) == 0			\
 		  || ((uintptr_t) (oss.ss_sp + oss.ss_size) - new_sp	\
-		      >= oss.ss_size))					\
+		      < oss.ss_size))					\
 		__fortify_fail ("longjmp causes uninitialized stack frame");\
 	    }								\
 	}								\

Modified: fsf/glibc-2_11-branch/libc/sysdeps/x86_64/dl-machine.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/x86_64/dl-machine.h (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/x86_64/dl-machine.h Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  x86-64 version.
-   Copyright (C) 2001-2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2006, 2008, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@xxxxxxx>.
 
@@ -419,7 +419,7 @@
 	case R_X86_64_PC32:
 	  value += reloc->r_addend - (Elf64_Addr) reloc_addr;
 	  *(unsigned int *) reloc_addr = value;
-	  if (__builtin_expect (value != (unsigned int) value, 0))
+	  if (__builtin_expect (value != (int) value, 0))
 	    {
 	      fmt = "\
 %s: Symbol `%s' causes overflow in R_X86_64_PC32 relocation\n";

Modified: fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/init-arch.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/init-arch.c (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/init-arch.c Wed May 12 00:06:29 2010
@@ -1,6 +1,6 @@
 /* Initialize CPU feature data.
    This file is part of the GNU C Library.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <atomic.h>
 #include <cpuid.h>
 #include "init-arch.h"
 
@@ -26,7 +27,7 @@
 
 
 static void
-get_common_indeces (void)
+get_common_indeces (unsigned int *family, unsigned int *model)
 {
   __cpuid (1, __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax,
 	   __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ebx,
@@ -34,8 +35,8 @@
 	   __cpu_features.cpuid[COMMON_CPUID_INDEX_1].edx);
 
   unsigned int eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax;
-  __cpu_features.family = (eax >> 8) & 0x0f;
-  __cpu_features.model = (eax >> 4) & 0x0f;
+  *family = (eax >> 8) & 0x0f;
+  *model = (eax >> 4) & 0x0f;
 }
 
 
@@ -45,36 +46,44 @@
   unsigned int ebx;
   unsigned int ecx;
   unsigned int edx;
+  unsigned int family = 0;
+  unsigned int model = 0;
+  enum cpu_features_kind kind;
 
   __cpuid (0, __cpu_features.max_cpuid, ebx, ecx, edx);
 
   /* This spells out "GenuineIntel".  */
   if (ebx == 0x756e6547 && ecx == 0x6c65746e && edx == 0x49656e69)
     {
-      __cpu_features.kind = arch_kind_intel;
+      kind = arch_kind_intel;
 
-      get_common_indeces ();
+      get_common_indeces (&family, &model);
 
       unsigned int eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax;
       unsigned int extended_family = (eax >> 20) & 0xff;
       unsigned int extended_model = (eax >> 12) & 0xf0;
       if (__cpu_features.family == 0x0f)
 	{
-	  __cpu_features.family += extended_family;
-	  __cpu_features.model += extended_model;
+	  family += extended_family;
+	  model += extended_model;
 	}
       else if (__cpu_features.family == 0x06)
-	__cpu_features.model += extended_model;
+	model += extended_model;
     }
   /* This spells out "AuthenticAMD".  */
   else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
     {
-      __cpu_features.kind = arch_kind_amd;
+      kind = arch_kind_amd;
 
-      get_common_indeces ();
+      get_common_indeces (&family, &model);
     }
   else
-    __cpu_features.kind = arch_kind_other;
+    kind = arch_kind_other;
+
+  __cpu_features.family = family;
+  __cpu_features.model = model;
+  atomic_write_barrier ();
+  __cpu_features.kind = kind;
 }
 
 #undef __get_cpu_features

Modified: fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/init-arch.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/init-arch.h (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/init-arch.h Wed May 12 00:06:29 2010
@@ -1,5 +1,5 @@
 /* This file is part of the GNU C Library.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -27,7 +27,7 @@
 
 extern struct cpu_features
 {
-  enum
+  enum cpu_features_kind
     {
       arch_kind_unknown = 0,
       arch_kind_intel,