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

Re: [SRM] Uploading new upstream stable version to Squeeze?



On Mon, Dec 12, 2011 at 11:03:49PM +0000, Adam D. Barratt wrote:
> On Sun, 2011-10-30 at 19:27 +0100, Aurelien Jarno wrote:
> > On Sun, Oct 30, 2011 at 05:36:27PM +0000, Adam D. Barratt wrote:
> > > Did the 2.11.4 release happen?  I'm conscious of the fact that we're now
> > > a little way past 6.0.3; apologies for not following up again sooner.
> > 
> > I have asked for it, but I have no answer so far. That said everything
> > is already committed in the upstream git/svn, the only difference with
> > version 2.11.4 will be the version number. Maybe we should just upload
> > the current version without waiting so that it is widely tested, and
> > later upload the final 2.11.4 if released in time.
> 
> Ugh, I hadn't realised this was so long ago. :-(  Last time we discussed
> this on IRC, iirc you mentioned that there were a few more commits you
> were planning on including?
> 

Upstream hasn't released anything yet, so I think we should stop
waiting, especially given we are starting to get complains about bugs
#615120, #635885, #637239 and #646549, especially now that new hardware
(Intel Sandy Bridge and AMD Bulldozer) is more and more common.

I have attached a new version of what we plan to upload. It includes a
few more fixes backported from the unstable version (look at the end of
the changelog), and also a few more fixes from upstream (no new stable 
version have been released, but the stable branch has still evolved a 
bit). I am using this version (actually this one minus the two last 
commits) for a few weeks at home and on a dozen of computers at work, so
it's already a bit tested.

Would it be possible to upload this, and do a call for test for people
wanting to test it before the actual point release? That would also help
people having problems due the bugs mentioned above.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net
diff -Nru eglibc-2.11.2/ChangeLog eglibc-2.11.3/ChangeLog
--- eglibc-2.11.2/ChangeLog	2010-06-10 19:20:45.000000000 +0000
+++ eglibc-2.11.3/ChangeLog	2010-12-06 20:55:10.000000000 +0000
@@ -1,3 +1,305 @@
+2010-05-31  Petr Baudis  <pasky@suse.cz>
+
+	[BZ #11149]
+	* elf/ldconfig.c (main): Allow aux_cache_file open()ing to fail
+	silently even in the chroot mode.
+
+2010-05-31  Petr Baudis <pasky@suse.cz>
+
+	[BZ #10085]
+	* nis/nss_compat/compat-initgroups.c (internal_getgrent_r): Fix
+	initialization of skip_initgroups_dyn.
+
+2010-09-27  Andreas Schwab  <schwab@redhat.com>
+
+	[BZ #11611]
+	* sysdeps/unix/sysv/linux/internal_statvfs.c (INTERNAL_STATVFS):
+	Mask out sign-bit copies when constructing f_fsid.
+
+2010-11-19  Ulrich Drepper  <drepper@gmail.com>
+
+	* sysdeps/unix/sysv/linux/i386/bits/mman.h: Define MAP_HUGETLB.
+	* sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Likewise.
+
+2010-11-16  Ulrich Drepper  <drepper@gmail.com>
+
+	* sysdeps/unix/sysv/linux/sys/swap.h (SWAP_FLAG_DISCARD): Define.
+
+2010-11-11  Andreas Schwab  <schwab@redhat.com>
+
+	* posix/fnmatch_loop.c (NEW_PATTERN): Fix use of alloca.
+	* posix/Makefile (tests): Add $(objpfx)tst-fnmatch-mem.
+	(tst-fnmatch-ENV): Set MALLOC_TRACE.
+	($(objpfx)tst-fnmatch-mem): New rule.
+	(generated): Add tst-fnmatch-mem and tst-fnmatch.mtrace.
+	* posix/tst-fnmatch.c (main): Call mtrace.
+
+2010-08-09  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #11883]
+	* posix/fnmatch.c: Keep track of alloca use and fall back on malloc.
+	* posix/fnmatch_loop.c: Likewise.
+
+2010-11-10  Luis Machado  <luisgpm@br.ibm.com>
+
+	* sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c (__ieee754_sqrtl): Force
+	  signed comparison.
+
+2010-11-08  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #12194]
+	* sysdeps/i386/bits/byteswap.h: Avoid warning in __bswap_16.
+	* sysdeps/x86_64/bits/byteswap.h: Likewise.
+
+2010-09-06  Andreas Schwab  <schwab@redhat.com>
+
+	* manual/Makefile: Don't mix pattern rules with normal rules.
+
+2010-08-12  Andreas Schwab  <schwab@redhat.com>
+
+	[BZ #11904]
+	* locale/programs/locale.c (print_assignment): New function.
+	(show_locale_vars): Use it.
+
+2010-10-26  Ulrich Drepper  <drepper@gmail.com>
+
+	* elf/rtld.c (dl_main): Move assertion after the point where rtld map
+	is added to the list.
+
+2010-10-20  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+	    Ulrich Drepper  <drepper@gmail.com>
+
+	* elf/dl-object.c (_dl_new_object): Don't append the new object to
+	the global list here.  Move code to...
+	(_dl_add_to_namespace_list): ...here.  New function.
+	* elf/rtld.c (dl_main): Invoke _dl_add_to_namespace_list.
+	* sysdeps/generic/ldsodefs.h (_dl_add_to_namespace_list): Declare.
+	* elf/dl-load.c (lose): Don't remove the element from the list.
+	(_dl_map_object_from_fd): Invoke _dl_add_to_namespace_list.
+	(_dl_map_object): Likewise.
+
+2010-10-24  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #12140]
+	* malloc/malloc.c (_int_free): Fill correct number of bytes when
+	perturbing.
+
+2010-09-09  Andreas Schwab  <schwab@redhat.com>
+
+	* Makeconfig (sysd-rules-patterns): Add rtld-%:rtld-%.
+	(sysd-rules-targets): Remove duplicates.
+	* elf/rtld-Rules ($(objpfx)rtld-%.os): Add pattern rules with
+	rtld-%.$o dependency.
+
+2010-10-18  Andreas Schwab  <schwab@redhat.com>
+
+	* elf/dl-open.c (dl_open_worker): Don't expand DST here, let
+	_dl_map_object do it.
+
+2010-10-15  Andreas Schwab  <schwab@redhat.com>
+
+	* scripts/data/localplt-s390-linux-gnu.data: New file.
+	* scripts/data/localplt-s390x-linux-gnu.data: New file.
+
+2010-10-12  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #12078]
+	* posix/regcomp.c (parse_branch): One more memory leak plugged.
+	* posix/bug-regex31.input: Add test case.
+
+2010-10-11  Ulrich Drepper  <drepper@gmail.com>
+
+	* posix/bug-regex31.c: Rewrite to run multiple tests from stdin.
+	* posix/bug-regex31.input: New file.
+
+	[BZ #12078]
+	* posix/regcomp.c (parse_branch): Free memory when allocation failed.
+	(parse_sub_exp): Fix last change, use postorder.
+
+	* posix/bug-regex31.c: New file.
+	* posix/Makefile: Add rules to build and run bug-regex31.
+
+	* posix/regcomp.c (parse_bracket_exp): Add missing re_free calls.
+
+	[BZ #12078]
+	* posix/regcomp.c (parse_sub_exp): Free tree data when it is not used.
+
+	[BZ #12093]
+	* sysdeps/unix/sysv/linux/check_pf.c (__check_pf): ->ifa_addr might
+	be NULL.
+
+2010-09-15  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): When
+	implementing getdents64 using getdents syscall, set d_type if
+	__ASSUME_GETDENTS32_D_TYPE.
+
+2010-09-14  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/s390/s390-32/__longjmp.c (__longjmp): Define register
+	variables after CHECK_SP call.
+	* sysdeps/s390/s390-64/__longjmp.c (__longjmp): Likewise.
+
+2010-09-08  Chung-Lin Tang  <cltang@codesourcery.com>
+	    Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #11968]
+	* sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+	(____longjmp_chk): Use %ebx for saving value across system call.
+	Add unwind info.
+
+2010-08-31  Mike Frysinger  <vapier@gentoo.org>
+
+	* sysdeps/unix/sysv/linux/sparc/sys/epoll.h (epoll_create2): Delete.
+	(epoll_create1): Declare.
+
+	* sysdeps/unix/sysv/linux/x86_64/sys/epoll.h: Fix typo.
+
+2010-08-31  Andreas Schwab  <schwab@redhat.com>
+
+	[BZ #7066]
+	* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix array overflow when
+	shifting retval into place.
+
+2010-09-14  Ulrich Drepper  <drepper@redhat.com>
+
+	* resolv/res_init.c (__res_vinit): Count the default server we added.
+
+2010-08-25  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #10851]
+	* resolv/res_init.c (__res_vinit): When no server address at all
+	is given default to loopback.
+
+2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* sysdeps/i386/elf/Makefile: New file.
+
+2010-07-31  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* hurd/hurdselect.c (_hurd_select): Round timeout up instead of down
+	when converting to ms.
+
+2010-07-29  Roland McGrath  <roland@redhat.com>
+
+	[BZ 11856]
+	* manual/locale.texi (Yes-or-No Questions): Fix example code.
+
+2010-07-27  Andreas Schwab  <schwab@redhat.com>
+
+	* manual/memory.texi (Malloc Tunable Parameters): Document
+	M_PERTURB.
+
+2010-07-26  Roland McGrath  <roland@redhat.com>
+
+	[BZ #11840]
+	* configure.in (-fgnu89-inline check): Set and substitute
+	gnu89_inline, not libc_cv_gnu89_inline.
+	* configure: Regenerated.
+	* config.make.in (gnu89-inline-CFLAGS): Use @gnu89_inline@.
+
+2010-07-20  Roland McGrath  <roland@redhat.com>
+
+	* elf/dl-sysdep.c (_dl_important_hwcaps): Add dsocaps mask to
+	dl_hwcap_mask as well as dl_hwcap.  Without this, dsocaps matching in
+	ld.so.cache was broken.  With it, there is no way to disable dsocaps
+	like LD_HWCAP_MASK can disable hwcaps.
+
+2010-07-05  Roland McGrath  <roland@redhat.com>
+
+	* manual/arith.texi (Rounding Functions): Fix rint description
+	implicit in round description.
+
+2010-07-02  Ulrich Drepper  <drepper@redhat.com>
+
+	* elf/Makefile: Fix linking for a few tests to make recent linker
+	happy.
+
+2010-06-02  Emilio Pozuelo Monfort  <pochu27@gmail.com>
+
+	* hurd/lookup-at.c (__file_name_lookup_at): Accept
+	AT_SYMLINK_FOLLOW in AT_FLAGS.  Fail with EINVAL if both
+	AT_SYMLINK_FOLLOW and AT_SYMLINK_NOFOLLOW are present
+	in AT_FLAGS.
+	* hurd/hurd/fd.h (__file_name_lookup_at): Update comment.
+	* sysdeps/mach/hurd/linkat.c (linkat): Pass O_NOLINK in FLAGS.
+
+2010-11-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #12191]
+	* sysdeps/x86_64/cacheinfo.c (init_cacheinfo): Round
+	__x86_64_data_cache_size_half, __x86_64_data_cache_size
+	__x86_64_shared_cache_size_half and __x86_64_shared_cache_size,
+	to multiple of 256 bytes.
+
+2010-11-03  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #12167]
+	* sysdeps/unix/sysv/linux/ttyname.c (ttyname): Recognize new mangling
+	of inacessible symlinks.  Verify result of symlink before returning it.
+	* sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Likewise.
+	Patch mostly by Miklos Szeredi <miklos@szeredi.hu>.
+
+2010-10-25  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #12159]
+	* sysdeps/x86_64/multiarch/strchr.S: Fix propagation of search byte
+	into all bytes of SSE register.
+	Patch by Richard Li <richardpku@gmail.com>.
+
+2010-10-22  Andreas Schwab  <schwab@redhat.com>
+
+	* include/dlfcn.h (__RTLD_SECURE): Define.
+	* elf/dl-load.c (_dl_map_object): Remove preloaded parameter.  Use
+	mode & __RTLD_SECURE instead.
+	(open_path): Rename preloaded parameter to secure.
+	* sysdeps/generic/ldsodefs.h (_dl_map_object): Adjust declaration.
+	* elf/dl-open.c (dl_open_worker): Adjust call to _dl_map_object.
+	* elf/dl-deps.c (openaux): Likewise.
+	* elf/rtld.c (struct map_args): Remove is_preloaded.
+	(map_doit): Don't use it.
+	(dl_main): Likewise.
+	(do_preload): Use __RTLD_SECURE instead of is_preloaded.
+	(dlmopen_doit): Add __RTLD_SECURE to mode bits.
+
+2010-10-06  Ulrich Drepper  <drepper@gmail.com>
+
+	* string/bug-strstr1.c: New file.
+	* string/Makefile: Add rules to build and run bug-strstr1.
+
+2010-10-05  Eric Blake  <eblake@redhat.com>
+
+	[BZ #12092]
+	* string/str-two-way.h (two_way_long_needle): Always clear memory
+	when skipping input due to the shift table.
+
+2010-10-03  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #12005]
+	* malloc/mcheck.c: Handle large requests.
+
+	[BZ #12077]
+	* sysdeps/x86_64/strcmp.S: Fix handling of remaining bytes in buffer
+	for strncmp and strncasecmp.
+	* string/stratcliff.c: Add tests for strcmp and strncmp.
+	* wcsmbs/wcsatcliff.c: Adjust for stratcliff change.
+
+2010-06-02  Kirill A. Shutemov  <kirill@shutemov.name>
+
+	* elf/dl-reloc.c: Flush cache after solving TEXTRELs if arch
+	requires it.
+
+2010-06-02  Andreas Schwab  <schwab@redhat.com>
+
+	* nis/nss_nis/nis-initgroups.c (get_uid): Properly resize buffer.
+
+2010-06-07  Jakub Jelinek  <jakub@redhat.com>
+
+	* libio/stdio.h (sscanf, vsscanf): Use __REDIRECT_NTH instead of
+	__REDIRECT followed by __THROW.
+	* wcsmbs/wchar.h (swscanf, vswscanf): Likewise.
+	* posix/getopt.h (getopt): Likewise.
+
 2010-05-26  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #11640]
diff -Nru eglibc-2.11.2/INSTALL eglibc-2.11.3/INSTALL
--- eglibc-2.11.2/INSTALL	2007-02-19 19:48:39.000000000 +0000
+++ eglibc-2.11.3/INSTALL	2010-12-06 20:55:10.000000000 +0000
@@ -329,11 +329,12 @@
      Check the FAQ for any special compiler issues on particular
      platforms.
 
-   * GNU `binutils' 2.15 or later
+   * GNU `binutils'
 
      You must use GNU `binutils' (as and ld) to build the GNU C library.
      No other assembler or linker has the necessary functionality at the
-     moment.
+     moment.  The configure scripts checks for the appropriate version
+     for the platform.  Too-old versions will prevent building glibc.
 
    * GNU `texinfo' 3.12f
 
diff -Nru eglibc-2.11.2/Makeconfig eglibc-2.11.3/Makeconfig
--- eglibc-2.11.2/Makeconfig	2009-06-24 16:26:34.000000000 +0000
+++ eglibc-2.11.3/Makeconfig	2010-12-06 20:55:10.000000000 +0000
@@ -694,7 +694,7 @@
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
 	   $(CPPFLAGS-$(suffix $@)) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
-		         $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
+			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
 override CFLAGS	= -std=gnu99 $(gnu89-inline-CFLAGS) \
 		  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
@@ -983,7 +983,7 @@
 # emitted into sysd-rules.  A sysdeps Makeconfig fragment can
 # add its own special object file prefix to this list with e.g. foo-%:%
 # to have foo-*.? compiled from *.? using $(foo-CPPFLAGS).
-sysd-rules-patterns := %:% rtld-%:% m_%:s_%
+sysd-rules-patterns := %:% rtld-%:rtld-% rtld-%:% m_%:s_%
 
 # Let sysdeps/ subdirs contain a Makeconfig fragment for us to include here.
 sysdep-makeconfigs := $(wildcard $(+sysdep_dirs:=/Makeconfig))
@@ -992,8 +992,8 @@
 endif
 
 # Compute just the target patterns.  Makeconfig has set sysd-rules-patterns.
-sysd-rules-targets := $(foreach p,$(sysd-rules-patterns),\
-		      		$(firstword $(subst :, ,$p)))
+sysd-rules-targets := $(sort $(foreach p,$(sysd-rules-patterns),\
+					 $(firstword $(subst :, ,$p))))
 
 endif # Makeconfig not yet included
 
diff -Nru eglibc-2.11.2/config.make.in eglibc-2.11.3/config.make.in
--- eglibc-2.11.2/config.make.in	2009-07-29 15:58:14.000000000 +0000
+++ eglibc-2.11.3/config.make.in	2010-12-06 20:55:10.000000000 +0000
@@ -58,7 +58,7 @@
 enable-check-abi = @enable_check_abi@
 have-forced-unwind = @libc_cv_forced_unwind@
 have-fpie = @libc_cv_fpie@
-gnu89-inline-CFLAGS = @libc_cv_gnu89_inline@
+gnu89-inline-CFLAGS = @gnu89_inline@
 have-ssp = @libc_cv_ssp@
 have-selinux = @have_selinux@
 have-libaudit = @have_libaudit@
diff -Nru eglibc-2.11.2/configure eglibc-2.11.3/configure
--- eglibc-2.11.2/configure	2009-11-11 15:45:19.000000000 +0000
+++ eglibc-2.11.3/configure	2010-12-06 20:55:10.000000000 +0000
@@ -681,7 +681,7 @@
 exceptions
 no_whole_archive
 libc_cv_have_initfini
-libc_cv_gnu89_inline
+gnu89_inline
 libc_cv_ssp
 fno_unit_at_a_time
 libc_cv_hashstyle
@@ -6937,9 +6937,9 @@
 { $as_echo "$as_me:$LINENO: result: $libc_cv_gnu89_inline" >&5
 $as_echo "$libc_cv_gnu89_inline" >&6; }
 if test $libc_cv_gnu89_inline = yes; then
-  libc_cv_gnu89_inline=-fgnu89-inline
+  gnu89_inline=-fgnu89-inline
 else
-  libc_cv_gnu89_inline=
+  gnu89_inline=
 fi
 
 
diff -Nru eglibc-2.11.2/configure.in eglibc-2.11.3/configure.in
--- eglibc-2.11.2/configure.in	2009-11-11 15:45:19.000000000 +0000
+++ eglibc-2.11.3/configure.in	2010-12-06 20:55:10.000000000 +0000
@@ -1773,11 +1773,11 @@
 fi
 rm -f conftest*])
 if test $libc_cv_gnu89_inline = yes; then
-  libc_cv_gnu89_inline=-fgnu89-inline
+  gnu89_inline=-fgnu89-inline
 else
-  libc_cv_gnu89_inline=
+  gnu89_inline=
 fi
-AC_SUBST(libc_cv_gnu89_inline)
+AC_SUBST(gnu89_inline)
 
 if test $elf != yes; then
   AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
diff -Nru eglibc-2.11.2/debian/changelog eglibc-2.11.3/debian/changelog
--- eglibc-2.11.2/debian/changelog	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/changelog	2011-12-13 13:41:29.000000000 +0000
@@ -1,3 +1,65 @@
+eglibc (2.11.3-1) unstable; urgency=low
+
+  * Update from stable upstream version, and update from the upstream 
+    stable branch:
+    - fix wrong memmove/bcopy optimization with gcc-4.6.  Closes: #619963.
+    - fix an integer overflow in fnmatch() (CVE-2011-1659).  Closes: #626370.
+    - fix spurious warning in bswap_16() with -Wconversion.  Closes: #561249.
+    - fix auxiliary cache file creation.  Closes: #588218.
+    - fix memory corruption in fnmatch() that can lead to code execution 
+      (CVE-2011-1071).  Closes: #615120
+    - fix strchr() on x86-64 CPU with SSE4.2.  Closes: #635885
+  * Update patches:
+    - patches/locale/locale-print-LANGUAGE.diff
+    - patches/hppa/local-stack-grows-up.diff
+    - patches/m68k/cvs-tls-support.patch
+    - patches/any/local-disable-test-tgmath2.diff
+    - patches/any/submitted-longdouble.diff
+    - patches/any/submitted-bits-fcntl_h-at.diff
+    - patches/kfreebsd/local-readdir_r.diff
+  * Drop obsolete patches:
+    - patches/any/cvs-redirect-throw.diff
+    - patches/any/cvs-flush-cache-textrels.diff
+    - patches/hurd-i386/cvs-linkat.diff
+    - patches/hurd-i386/cvs-select.diff
+    - patches/sparc/submitted-epoll.diff
+    - patches/any/cvs-dont-expand-dst-twice.diff
+    - patches/amd64/cvs-avx-tcb-alignment.diff
+    - patches/any/submitted-etc-resolv.conf.diff
+    - patches/any/cvs-audit-suid.diff
+  * kfreebsd/local-sysdeps.diff, update to r3763 (from squeeze glibc-bsd).
+    - fixes LD_PRELOAD with a kfreebsd-9 kernel. Closes: #630695.
+    - uses upstream RFTSIGZMB for exit signal selection when available.
+    - fixes a crash in if_nameindex() with more than 3 interfaces.
+    - alter faccessat() X_OK tests similarly as access(). See #640334.
+    - fix __libc_sa_len() for AF_LOCAL. See #645527.
+  * Fix preinst script wrt 3.0 kernel. Patch by Colin Watson.  Closes: 
+    #630077.
+  * Update submitted-resolv.conf-thread.diff from upstream to fix a 
+    deadlock in some rare cases.
+  * Add patches/any/cvs-resolv-different-nameserver.diff and
+    patches/any/submitted-resolv-assert.diff to try a different
+    nameserver if the first one returns REFUSED.  Closes: #535504.
+  * Add patches/any/cvs-getaddrinfo-single-lookup.diff to fix fallback to
+    single lookup dns requests.  Closes: #541167.
+  * Add patches/any/cvs-pthread-setgroups.diff to fix setgroups() with
+    multiple threads.
+  * Add debian/patches/cvs-dl_close-scope-handling.diff from upstream to
+    fix issues with dl_close() when resolving locally-defined symbols.
+    Closes: #625250.
+  * patches/i386/local-cpuid-level2.diff: fix a typo.  Closes: #609389.
+  * patches/any/cvs-nptl-pthread-race.diff: fix a race in NPTL code that
+    sometimes causes a deadlock when calling fork() from a thread.
+  * patches/amd64/cvs-avx-detection.diff: do not use AVX if hardware support
+    is present, but not enabled in the kernel.  Closes: #646549.
+  * patches/any/cvs-statvfs-mount-flags.diff: get the mount flags directly
+    from the kernel when possible instead of parsing /proc/mounts.  Closes: 
+    #639897.
+  * patches/any/cvs-dlopen-tls.diff:  fix handling of static TLS in
+    dlopen'ed objects.  Closes: #637239.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Tue, 13 Dec 2011 11:23:12 +0100
+
 eglibc (2.11.2-10) unstable; urgency=low
 
   * Add patches/amd64/cvs-avx-tcb-alignment.diff from upstream to fix 
diff -Nru eglibc-2.11.2/debian/debhelper.in/libc.preinst eglibc-2.11.3/debian/debhelper.in/libc.preinst
--- eglibc-2.11.2/debian/debhelper.in/libc.preinst	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/debhelper.in/libc.preinst	2011-12-13 13:41:29.000000000 +0000
@@ -25,8 +25,8 @@
 }
 
 linux_compare_versions () {
-    verA=$(($(echo "$1" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100 + \3/')))
-    verB=$(($(echo "$3" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100 + \3/')))
+    verA=$(($(echo "$1" | sed 's/^\([0-9]*\.[0-9]*\)\([^.0-9]\|$\)/\1.0\2/; s/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100 + \3/')))
+    verB=$(($(echo "$3" | sed 's/^\([0-9]*\.[0-9]*\)\([^.0-9]\|$\)/\1.0\2/; s/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100 + \3/')))
 
     test $verA -$2 $verB
 }
@@ -268,7 +268,7 @@
   then
       # Test to make sure z < 255, in x.y.z-n form of kernel version
       # Also make sure we don't trip on x.y.zFOO-n form
-      kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/')
+      kernel_rev=$(uname -r | sed 's/\([0-9]*\.\)\{1,2\}\([0-9]*\)\(.*\)/\2/')
       if [ "$kernel_rev" -ge 255 ]
       then
           echo "WARNING: Your kernel version indicates a revision number"
diff -Nru eglibc-2.11.2/debian/local/manpages/gencat.1 eglibc-2.11.3/debian/local/manpages/gencat.1
--- eglibc-2.11.2/debian/local/manpages/gencat.1	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/local/manpages/gencat.1	2011-12-13 13:41:29.000000000 +0000
@@ -1,5 +1,5 @@
 .rn '' }`
-.\" $RCSfile: gencat.1,v $$Revision: 1.1 $$Date: 2008-08-08 21:49:44 +0200 (ven. 08 août 2008) $
+.\" $RCSfile: gencat.1,v $$Revision: 1.1 $$Date: 2011-02-06 16:48:38 +0100 (dim. 06 févr. 2011) $
 .\"
 .\" $Log: gencat.1,v $
 .\" Revision 1.1  2003/11/03 17:37:27  jbailey
diff -Nru eglibc-2.11.2/debian/local/manpages/iconvconfig.8 eglibc-2.11.3/debian/local/manpages/iconvconfig.8
--- eglibc-2.11.2/debian/local/manpages/iconvconfig.8	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/local/manpages/iconvconfig.8	2011-12-13 13:41:29.000000000 +0000
@@ -1,5 +1,5 @@
 .rn '' }`
-.\" $RCSfile: iconvconfig.8,v $$Revision: 1.1 $$Date: 2008-08-08 21:49:44 +0200 (ven. 08 août 2008) $
+.\" $RCSfile: iconvconfig.8,v $$Revision: 1.1 $$Date: 2011-02-06 16:48:38 +0100 (dim. 06 févr. 2011) $
 .\"
 .\" $Log: iconvconfig.8,v $
 .\" Revision 1.1  2003/11/03 17:37:27  jbailey
diff -Nru eglibc-2.11.2/debian/local/manpages/mtrace.1 eglibc-2.11.3/debian/local/manpages/mtrace.1
--- eglibc-2.11.2/debian/local/manpages/mtrace.1	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/local/manpages/mtrace.1	2011-12-13 13:41:29.000000000 +0000
@@ -1,5 +1,5 @@
 .rn '' }`
-.\" $RCSfile: mtrace.1,v $$Revision: 1.1 $$Date: 2008-08-08 21:49:44 +0200 (ven. 08 août 2008) $
+.\" $RCSfile: mtrace.1,v $$Revision: 1.1 $$Date: 2011-02-06 16:48:38 +0100 (dim. 06 févr. 2011) $
 .\"
 .\" $Log: mtrace.1,v $
 .\" Revision 1.1  2003/11/03 17:37:27  jbailey
diff -Nru eglibc-2.11.2/debian/patches/amd64/cvs-avx-detection.diff eglibc-2.11.3/debian/patches/amd64/cvs-avx-detection.diff
--- eglibc-2.11.2/debian/patches/amd64/cvs-avx-detection.diff	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/debian/patches/amd64/cvs-avx-detection.diff	2011-12-13 13:41:29.000000000 +0000
@@ -0,0 +1,164 @@
+2011-07-23  Ulrich Drepper  <drepper@gmail.com>
+
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix one more
+	typo.
+	(_dl_x86_64_save_sse): Likewise.
+
+2011-07-22  Ulrich Drepper  <drepper@gmail.com>
+ 
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix test for
+	OSXSAVE.
+	(_dl_x86_64_save_sse): Likewise.
+
+2011-07-21  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix last
+	change.
+	(_dl_x86_64_save_sse): Use correct AVX check.
+
+2011-07-20  Ulrich Drepper  <drepper@gmail.com>
+ 
+	[BZ #13007]
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): More complete
+	check for AVX enablement so that we don't crash with old kernels and
+	new hardware.
+	* elf/tst-audit4.c: Add same checks here.
+	* elf/tst-audit6.c: Likewise.
+
+---
+ elf/tst-audit4.c               |   22 ++++++++++++++++++----
+ elf/tst-audit6.c               |   22 ++++++++++++++++++----
+ sysdeps/x86_64/dl-trampoline.S |   36 +++++++++++++++++++++++++++---------
+ 3 files changed, 63 insertions(+), 17 deletions(-)
+
+--- a/elf/tst-audit4.c
++++ b/elf/tst-audit4.c
+@@ -6,16 +6,30 @@
+ #include <cpuid.h>
+ #include <immintrin.h>
+ 
++
++static int
++avx_enabled (void)
++{
++  unsigned int eax, ebx, ecx, edx;
++
++  if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
++      || (ecx & (bit_AVX | bit_OSXSAVE)) != (bit_AVX | bit_OSXSAVE))
++    return 0;
++
++  /* Check the OS has AVX and SSE saving enabled.  */
++  asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
++
++  return (eax & 6) == 6;
++}
++
++
+ extern __m256i audit_test (__m256i, __m256i, __m256i, __m256i,
+ 			   __m256i, __m256i, __m256i, __m256i);
+ int
+ main (void)
+ {
+-  unsigned int eax, ebx, ecx, edx;
+-
+   /* Run AVX test only if AVX is supported.  */
+-  if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
+-      && (ecx & bit_AVX))
++  if (avx_enabled ())
+     {
+       __m256i ymm = _mm256_setzero_si256 ();
+       __m256i ret = audit_test (ymm, ymm, ymm, ymm, ymm, ymm, ymm, ymm);
+--- a/elf/tst-audit6.c
++++ b/elf/tst-audit6.c
+@@ -9,14 +9,28 @@
+ extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i,
+ 			   __m128i, __m128i, __m128i, __m128i);
+ 
+-int
+-main (void)
++
++static int
++avx_enabled (void)
+ {
+   unsigned int eax, ebx, ecx, edx;
+ 
++  if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
++      || (ecx & (bit_AVX | bit_OSXSAVE)) != (bit_AVX | bit_OSXSAVE))
++    return 0;
++
++  /* Check the OS has AVX and SSE saving enabled.  */
++  asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
++
++  return (eax & 6) == 6;
++}
++
++
++int
++main (void)
++{
+   /* Run AVX test only if AVX is supported.  */
+-  if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
+-      && (ecx & bit_AVX))
++  if (avx_enabled ())
+     {
+       __m128i xmm = _mm_setzero_si128 ();
+       __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm);
+--- a/sysdeps/x86_64/dl-trampoline.S
++++ b/sysdeps/x86_64/dl-trampoline.S
+@@ -1,5 +1,5 @@
+ /* PLT trampolines.  x86-64 version.
+-   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2004, 2005, 2007, 2009, 2011 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
+@@ -139,11 +139,20 @@
+ 	movl	$1, %eax
+ 	cpuid
+ 	movq	%r11,%rbx		# Restore rbx
+-	movl	$1, %eax
+-	testl	$(1 << 28), %ecx
++	xorl	%eax, %eax
++	// AVX and XSAVE supported?
++	andl	$((1 << 28) | (1 << 27)), %ecx
++	cmpl	$((1 << 28) | (1 << 27)), %ecx
+ 	jne	2f
+-	negl	%eax
+-2:	movl	%eax, L(have_avx)(%rip)
++	xorl	%ecx, %ecx
++	// Get XFEATURE_ENABLED_MASK
++	xgetbv
++	andl	$0x6, %eax
++	cmpl	$0x6, %eax
++	// Nonzero if SSE and AVX state saving is enabled.
++	sete	%al
++2:	leal	-1(%eax,%eax), %eax
++	movl	%eax, L(have_avx)(%rip)
+ 	cmpl	$0, %eax
+ 
+ 1:	js	L(no_avx)
+@@ -176,11 +185,20 @@
+ 	movl	$1, %eax
+ 	cpuid
+ 	movq	%r11,%rbx		# Restore rbx
+-	movl	$1, %eax
+-	testl	$(1 << 28), %ecx
++	xorl	%eax, %eax
++	// AVX and XSAVE supported?
++	andl	$((1 << 28) | (1 << 27)), %ecx
++	cmpl	$((1 << 28) | (1 << 27)), %ecx
+ 	jne	2f
+-	negl	%eax
+-2:	movl	%eax, L(have_avx)(%rip)
++	xorl	%ecx, %ecx
++	// Get XFEATURE_ENABLED_MASK
++	xgetbv
++	andl	$0x6, %eax
++	cmpl	$0x6, %eax
++	// Nonzero if SSE and AVX state saving is enabled.
++	sete	%al
++2:	leal	-1(%eax,%eax), %eax
++	movl	%eax, L(have_avx)(%rip)
+ 	cmpl	$0, %eax
+ 
+ 1:	js	L(no_avx5)
diff -Nru eglibc-2.11.2/debian/patches/amd64/cvs-avx-tcb-alignment.diff eglibc-2.11.3/debian/patches/amd64/cvs-avx-tcb-alignment.diff
--- eglibc-2.11.2/debian/patches/amd64/cvs-avx-tcb-alignment.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/amd64/cvs-avx-tcb-alignment.diff	1970-01-01 00:00:00.000000000 +0000
@@ -1,41 +0,0 @@
-2010-10-13  H.J. Lu  <hongjiu.lu@intel.com>
-
-	[BZ #12113]
-	* sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
-	* sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
-	of "struct pthread".
-
-diff --git a/nptl/sysdeps/x86_64/pthreaddef.h b/nptl/sysdeps/x86_64/pthreaddef.h
-index be63a8c..8ec135c 100644
---- a/nptl/sysdeps/x86_64/pthreaddef.h
-+++ b/nptl/sysdeps/x86_64/pthreaddef.h
-@@ -27,8 +27,9 @@
- /* Minimal stack size after allocating thread descriptor and guard size.  */
- #define MINIMAL_REST_STACK	2048
- 
--/* Alignment requirement for TCB.  */
--#define TCB_ALIGNMENT		16
-+/* Alignment requirement for TCB.  Need to store post-AVX vector registers
-+   in the TCB and we want the storage to be aligned at 32-byte.  */
-+#define TCB_ALIGNMENT		32
- 
- 
- /* Location of current stack frame.  The frame pointer is not usable.  */
-diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h
-index e39eb5f..41b5e6d 100644
---- a/nptl/sysdeps/x86_64/tls.h
-+++ b/nptl/sysdeps/x86_64/tls.h
-@@ -117,12 +117,7 @@ typedef struct
- # define TLS_TCB_SIZE sizeof (struct pthread)
- 
- /* Alignment requirements for the TCB.  */
--//# define TLS_TCB_ALIGN __alignof__ (struct pthread)
--// Normally the above would be correct  But we have to store post-AVX
--// vector registers in the TCB and we want the storage to be aligned.
--// unfortunately there isn't yet a type for these values and hence no
--// 32-byte alignment requirement.  Make this explicit, for now.
--# define TLS_TCB_ALIGN 32
-+# define TLS_TCB_ALIGN __alignof__ (struct pthread)
- 
- /* The TCB can have any size and the memory following the address the
-    thread pointer points to is unspecified.  Allocate the TCB there.  */
diff -Nru eglibc-2.11.2/debian/patches/any/cvs-audit-suid.diff eglibc-2.11.3/debian/patches/any/cvs-audit-suid.diff
--- eglibc-2.11.2/debian/patches/any/cvs-audit-suid.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/cvs-audit-suid.diff	1970-01-01 00:00:00.000000000 +0000
@@ -1,215 +0,0 @@
-2010-10-22  Andreas Schwab  <schwab@redhat.com>
-
-	* include/dlfcn.h (__RTLD_SECURE): Define.
-	* elf/dl-load.c (_dl_map_object): Remove preloaded parameter.  Use
-	mode & __RTLD_SECURE instead.
-	(open_path): Rename preloaded parameter to secure.
-	* sysdeps/generic/ldsodefs.h (_dl_map_object): Adjust declaration.
-	* elf/dl-open.c (dl_open_worker): Adjust call to _dl_map_object.
-	* elf/dl-deps.c (openaux): Likewise.
-	* elf/rtld.c (struct map_args): Remove is_preloaded.
-	(map_doit): Don't use it.
-	(dl_main): Likewise.
-	(do_preload): Use __RTLD_SECURE instead of is_preloaded.
-	(dlmopen_doit): Add __RTLD_SECURE to mode bits.
-
-diff --git a/elf/dl-deps.c b/elf/dl-deps.c
-index a58de5c..a51fb6e 100644
---- a/elf/dl-deps.c
-+++ b/elf/dl-deps.c
-@@ -62,7 +62,7 @@ openaux (void *a)
- {
-   struct openaux_args *args = (struct openaux_args *) a;
- 
--  args->aux = _dl_map_object (args->map, args->name, 0,
-+  args->aux = _dl_map_object (args->map, args->name,
- 			      (args->map->l_type == lt_executable
- 			       ? lt_library : args->map->l_type),
- 			      args->trace_mode, args->open_mode,
-diff --git a/elf/dl-load.c b/elf/dl-load.c
-index a7162eb..aa8738f 100644
---- a/elf/dl-load.c
-+++ b/elf/dl-load.c
-@@ -1812,7 +1812,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
-    if MAY_FREE_DIRS is true.  */
- 
- static int
--open_path (const char *name, size_t namelen, int preloaded,
-+open_path (const char *name, size_t namelen, int secure,
- 	   struct r_search_path_struct *sps, char **realname,
- 	   struct filebuf *fbp, struct link_map *loader, int whatcode,
- 	   bool *found_other_class)
-@@ -1894,7 +1894,7 @@ open_path (const char *name, size_t namelen, int preloaded,
- 	  /* Remember whether we found any existing directory.  */
- 	  here_any |= this_dir->status[cnt] != nonexisting;
- 
--	  if (fd != -1 && __builtin_expect (preloaded, 0)
-+	  if (fd != -1 && __builtin_expect (secure, 0)
- 	      && INTUSE(__libc_enable_secure))
- 	    {
- 	      /* This is an extra security effort to make sure nobody can
-@@ -1963,7 +1963,7 @@ open_path (const char *name, size_t namelen, int preloaded,
- 
- struct link_map *
- internal_function
--_dl_map_object (struct link_map *loader, const char *name, int preloaded,
-+_dl_map_object (struct link_map *loader, const char *name,
- 		int type, int trace_mode, int mode, Lmid_t nsid)
- {
-   int fd;
-@@ -2067,7 +2067,8 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
- 	  for (l = loader; l; l = l->l_loader)
- 	    if (cache_rpath (l, &l->l_rpath_dirs, DT_RPATH, "RPATH"))
- 	      {
--		fd = open_path (name, namelen, preloaded, &l->l_rpath_dirs,
-+		fd = open_path (name, namelen, mode & __RTLD_SECURE,
-+				&l->l_rpath_dirs,
- 				&realname, &fb, loader, LA_SER_RUNPATH,
- 				&found_other_class);
- 		if (fd != -1)
-@@ -2082,14 +2083,15 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
- 	      && main_map != NULL && main_map->l_type != lt_loaded
- 	      && cache_rpath (main_map, &main_map->l_rpath_dirs, DT_RPATH,
- 			      "RPATH"))
--	    fd = open_path (name, namelen, preloaded, &main_map->l_rpath_dirs,
-+	    fd = open_path (name, namelen, mode & __RTLD_SECURE,
-+			    &main_map->l_rpath_dirs,
- 			    &realname, &fb, loader ?: main_map, LA_SER_RUNPATH,
- 			    &found_other_class);
- 	}
- 
-       /* Try the LD_LIBRARY_PATH environment variable.  */
-       if (fd == -1 && env_path_list.dirs != (void *) -1)
--	fd = open_path (name, namelen, preloaded, &env_path_list,
-+	fd = open_path (name, namelen, mode & __RTLD_SECURE, &env_path_list,
- 			&realname, &fb,
- 			loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
- 			LA_SER_LIBPATH, &found_other_class);
-@@ -2098,12 +2100,12 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
-       if (fd == -1 && loader != NULL
- 	  && cache_rpath (loader, &loader->l_runpath_dirs,
- 			  DT_RUNPATH, "RUNPATH"))
--	fd = open_path (name, namelen, preloaded,
-+	fd = open_path (name, namelen, mode & __RTLD_SECURE,
- 			&loader->l_runpath_dirs, &realname, &fb, loader,
- 			LA_SER_RUNPATH, &found_other_class);
- 
-       if (fd == -1
--	  && (__builtin_expect (! preloaded, 1)
-+	  && (__builtin_expect (! (mode & __RTLD_SECURE), 1)
- 	      || ! INTUSE(__libc_enable_secure)))
- 	{
- 	  /* Check the list of libraries in the file /etc/ld.so.cache,
-@@ -2169,7 +2171,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
- 	  && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
- 	      || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
- 	  && rtld_search_dirs.dirs != (void *) -1)
--	fd = open_path (name, namelen, preloaded, &rtld_search_dirs,
-+	fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
- 			&realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
- 
-       /* Add another newline when we are tracing the library loading.  */
-diff --git a/elf/dl-open.c b/elf/dl-open.c
-index c394b3f..cf8e8cc 100644
---- a/elf/dl-open.c
-+++ b/elf/dl-open.c
-@@ -223,7 +223,7 @@ dl_open_worker (void *a)
- 
-   /* Load the named object.  */
-   struct link_map *new;
--  args->map = new = _dl_map_object (call_map, file, 0, lt_loaded, 0,
-+  args->map = new = _dl_map_object (call_map, file, lt_loaded, 0,
- 				    mode | __RTLD_CALLMAP, args->nsid);
- 
-   /* If the pointer returned is NULL this means the RTLD_NOLOAD flag is
-diff --git a/elf/rtld.c b/elf/rtld.c
-index 5ecc4fe..06b534a 100644
---- a/elf/rtld.c
-+++ b/elf/rtld.c
-@@ -589,7 +589,6 @@ struct map_args
-   /* Argument to map_doit.  */
-   char *str;
-   struct link_map *loader;
--  int is_preloaded;
-   int mode;
-   /* Return value of map_doit.  */
-   struct link_map *map;
-@@ -627,16 +626,17 @@ static void
- map_doit (void *a)
- {
-   struct map_args *args = (struct map_args *) a;
--  args->map = _dl_map_object (args->loader, args->str,
--			      args->is_preloaded, lt_library, 0, args->mode,
--			      LM_ID_BASE);
-+  args->map = _dl_map_object (args->loader, args->str, lt_library, 0,
-+			      args->mode, LM_ID_BASE);
- }
- 
- static void
- dlmopen_doit (void *a)
- {
-   struct dlmopen_args *args = (struct dlmopen_args *) a;
--  args->map = _dl_open (args->fname, RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT,
-+  args->map = _dl_open (args->fname,
-+			(RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT
-+			 | __RTLD_SECURE),
- 			dl_main, LM_ID_NEWLM, _dl_argc, INTUSE(_dl_argv),
- 			__environ);
- }
-@@ -806,8 +806,7 @@ do_preload (char *fname, struct link_map *main_map, const char *where)
- 
-   args.str = fname;
-   args.loader = main_map;
--  args.is_preloaded = 1;
--  args.mode = 0;
-+  args.mode = __RTLD_SECURE;
- 
-   unsigned int old_nloaded = GL(dl_ns)[LM_ID_BASE]._ns_nloaded;
- 
-@@ -1054,7 +1053,6 @@ of this helper program; chances are you did not intend to run this program.\n\
- 
- 	  args.str = rtld_progname;
- 	  args.loader = NULL;
--	  args.is_preloaded = 0;
- 	  args.mode = __RTLD_OPENEXEC;
- 	  (void) _dl_catch_error (&objname, &err_str, &malloced, map_doit,
- 				  &args);
-@@ -1066,7 +1064,7 @@ of this helper program; chances are you did not intend to run this program.\n\
-       else
- 	{
- 	  HP_TIMING_NOW (start);
--	  _dl_map_object (NULL, rtld_progname, 0, lt_library, 0,
-+	  _dl_map_object (NULL, rtld_progname, lt_library, 0,
- 			  __RTLD_OPENEXEC, LM_ID_BASE);
- 	  HP_TIMING_NOW (stop);
- 
-diff --git a/include/dlfcn.h b/include/dlfcn.h
-index a67426d..af92483 100644
---- a/include/dlfcn.h
-+++ b/include/dlfcn.h
-@@ -9,6 +9,7 @@
- #define __RTLD_OPENEXEC	0x20000000
- #define __RTLD_CALLMAP	0x10000000
- #define __RTLD_AUDIT	0x08000000
-+#define __RTLD_SECURE	0x04000000 /* Apply additional security checks.  */
- 
- #define __LM_ID_CALLER	-2
- 
-diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
-index fcc943b..fa4b6b2 100644
---- a/sysdeps/generic/ldsodefs.h
-+++ b/sysdeps/generic/ldsodefs.h
-@@ -824,11 +824,9 @@ extern void _dl_receive_error (receiver_fct fct, void (*operate) (void *),
- 
- /* Open the shared object NAME and map in its segments.
-    LOADER's DT_RPATH is used in searching for NAME.
--   If the object is already opened, returns its existing map.
--   For preloaded shared objects PRELOADED is set to a non-zero
--   value to allow additional security checks.  */
-+   If the object is already opened, returns its existing map.  */
- extern struct link_map *_dl_map_object (struct link_map *loader,
--					const char *name, int preloaded,
-+					const char *name,
- 					int type, int trace_mode, int mode,
- 					Lmid_t nsid)
-      internal_function attribute_hidden;
diff -Nru eglibc-2.11.2/debian/patches/any/cvs-dl_close-scope-handling.diff eglibc-2.11.3/debian/patches/any/cvs-dl_close-scope-handling.diff
--- eglibc-2.11.2/debian/patches/any/cvs-dl_close-scope-handling.diff	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/cvs-dl_close-scope-handling.diff	2011-12-13 13:41:29.000000000 +0000
@@ -0,0 +1,23 @@
+2011-08-24  Andreas Schwab  <schwab@redhat.com>
+
+	* elf/dl-close.c (_dl_close_worker): Reset private search list if
+	it wasn't used.
+
+diff --git a/elf/dl-close.c b/elf/dl-close.c
+index 4cf98c3..8fb55d0 100644
+--- a/elf/dl-close.c
++++ b/elf/dl-close.c
+@@ -430,6 +430,13 @@ _dl_close_worker (struct link_map *map)
+ 
+ 	      imap->l_scope_max = new_size;
+ 	    }
++	  else if (new_list != NULL)
++	    {
++	      /* We didn't change the scope array, so reset the search
++		 list.  */
++	      imap->l_searchlist.r_list = NULL;
++	      imap->l_searchlist.r_nlist = 0;
++	    }
+ 
+ 	  /* The loader is gone, so mark the object as not having one.
+ 	     Note: l_idx != IDX_STILL_USED -> object will be removed.  */
diff -Nru eglibc-2.11.2/debian/patches/any/cvs-dlopen-tls.diff eglibc-2.11.3/debian/patches/any/cvs-dlopen-tls.diff
--- eglibc-2.11.2/debian/patches/any/cvs-dlopen-tls.diff	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/cvs-dlopen-tls.diff	2011-12-13 13:41:29.000000000 +0000
@@ -0,0 +1,93 @@
+2011-05-14  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #12453]
+	* elf/dl-open.c (dl_open_worker): Delay calls to _dl_update_slotinfo
+	until all modules are registered in the DTV.
+	Patch mostly by Martin von Gagern <Martin.vGagern@gmx.net>.
+
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -347,6 +347,7 @@ dl_open_worker (void *a)
+   /* If the file is not loaded now as a dependency, add the search
+      list of the newly loaded object to the scope.  */
+   bool any_tls = false;
++  unsigned int first_static_tls = new->l_searchlist.r_nlist;
+   for (unsigned int i = 0; i < new->l_searchlist.r_nlist; ++i)
+     {
+       struct link_map *imap = new->l_searchlist.r_list[i];
+@@ -425,30 +426,9 @@ dl_open_worker (void *a)
+ 	     might have to increase its size.  */
+ 	  _dl_add_to_slotinfo (imap);
+ 
+-	  if (imap->l_need_tls_init)
+-	    {
+-	      /* For static TLS we have to allocate the memory here
+-		 and now.  This includes allocating memory in the DTV.
+-		 But we cannot change any DTV other than our own. So,
+-		 if we cannot guarantee that there is room in the DTV
+-		 we don't even try it and fail the load.
+-
+-		 XXX We could track the minimum DTV slots allocated in
+-		 all threads.  */
+-	      if (! RTLD_SINGLE_THREAD_P && imap->l_tls_modid > DTV_SURPLUS)
+-		_dl_signal_error (0, "dlopen", NULL, N_("\
+-cannot load any more object with static TLS"));
+-
+-	      imap->l_need_tls_init = 0;
+-#ifdef SHARED
+-	      /* Update the slot information data for at least the
+-		 generation of the DSO we are allocating data for.  */
+-	      _dl_update_slotinfo (imap->l_tls_modid);
+-#endif
+-
+-	      GL(dl_init_static_tls) (imap);
+-	      assert (imap->l_need_tls_init == 0);
+-	    }
++	  if (imap->l_need_tls_init
++	      && first_static_tls == new->l_searchlist.r_nlist)
++	    first_static_tls = i;
+ 
+ 	  /* We have to bump the generation counter.  */
+ 	  any_tls = true;
+@@ -460,6 +440,40 @@ cannot load any more object with static TLS"));
+     _dl_fatal_printf (N_("\
+ TLS generation counter wrapped!  Please report this."));
+ 
++  /* We need a second pass for static tls data, because _dl_update_slotinfo
++     must not be run while calls to _dl_add_to_slotinfo are still pending. */
++  for (unsigned int i = first_static_tls; i < new->l_searchlist.r_nlist; ++i)
++    {
++      struct link_map *imap = new->l_searchlist.r_list[i];
++
++      if (imap->l_need_tls_init
++	  && ! imap->l_init_called
++	  && imap->l_tls_blocksize > 0)
++	{
++	  /* For static TLS we have to allocate the memory here and
++	     now.  This includes allocating memory in the DTV.  But we
++	     cannot change any DTV other than our own. So, if we
++	     cannot guarantee that there is room in the DTV we don't
++	     even try it and fail the load.
++
++	     XXX We could track the minimum DTV slots allocated in
++	     all threads.  */
++	  if (! RTLD_SINGLE_THREAD_P && imap->l_tls_modid > DTV_SURPLUS)
++	    _dl_signal_error (0, "dlopen", NULL, N_("\
++cannot load any more object with static TLS"));
++
++	  imap->l_need_tls_init = 0;
++#ifdef SHARED
++	  /* Update the slot information data for at least the
++	     generation of the DSO we are allocating data for.  */
++	  _dl_update_slotinfo (imap->l_tls_modid);
++#endif
++
++	  GL(dl_init_static_tls) (imap);
++	  assert (imap->l_need_tls_init == 0);
++	}
++    }
++
+   /* Run the initializer functions of new objects.  */
+   _dl_init (new, args->argc, args->argv, args->env);
+ 
+
diff -Nru eglibc-2.11.2/debian/patches/any/cvs-dont-expand-dst-twice.diff eglibc-2.11.3/debian/patches/any/cvs-dont-expand-dst-twice.diff
--- eglibc-2.11.2/debian/patches/any/cvs-dont-expand-dst-twice.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/cvs-dont-expand-dst-twice.diff	1970-01-01 00:00:00.000000000 +0000
@@ -1,45 +0,0 @@
-2010-10-18  Andreas Schwab  <schwab@redhat.com>
-
-	* elf/dl-open.c (dl_open_worker): Don't expand DST here, let
-	_dl_map_object do it.
-
-diff --git a/elf/dl-open.c b/elf/dl-open.c
-index 754a263..c394b3f 100644
---- a/elf/dl-open.c
-+++ b/elf/dl-open.c
-@@ -221,35 +221,6 @@ dl_open_worker (void *a)
- 
-   assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT);
- 
--  /* Maybe we have to expand a DST.  */
--  if (__builtin_expect (dst != NULL, 0))
--    {
--      size_t len = strlen (file);
--
--      /* Determine how much space we need.  We have to allocate the
--	 memory locally.  */
--      size_t required = DL_DST_REQUIRED (call_map, file, len,
--					 _dl_dst_count (dst, 0));
--
--      /* Get space for the new file name.  */
--      char *new_file = (char *) alloca (required + 1);
--
--      /* Generate the new file name.  */
--      _dl_dst_substitute (call_map, file, new_file, 0);
--
--      /* If the substitution failed don't try to load.  */
--      if (*new_file == '\0')
--	_dl_signal_error (0, "dlopen", NULL,
--			  N_("empty dynamic string token substitution"));
--
--      /* Now we have a new file name.  */
--      file = new_file;
--
--      /* It does not matter whether call_map is set even if we
--	 computed it only because of the DST.  Since the path contains
--	 a slash the value is not used.  See dl-load.c.  */
--    }
--
-   /* Load the named object.  */
-   struct link_map *new;
-   args->map = new = _dl_map_object (call_map, file, 0, lt_loaded, 0,
diff -Nru eglibc-2.11.2/debian/patches/any/cvs-flush-cache-textrels.diff eglibc-2.11.3/debian/patches/any/cvs-flush-cache-textrels.diff
--- eglibc-2.11.2/debian/patches/any/cvs-flush-cache-textrels.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/cvs-flush-cache-textrels.diff	1970-01-01 00:00:00.000000000 +0000
@@ -1,27 +0,0 @@
-2010-06-02  Kirill A. Shutemov  <kirill@shutemov.name>
-
-	* elf/dl-reloc.c: Flush cache after solving TEXTRELs if arch
-	requires it.
-
-diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
-index 6c00691..23cb59c 100644
---- a/elf/dl-reloc.c
-+++ b/elf/dl-reloc.c
-@@ -1,5 +1,5 @@
- /* Relocate a shared object and resolve its references to other loaded objects.
--   Copyright (C) 1995-2006, 2008, 2009 Free Software Foundation, Inc.
-+   Copyright (C) 1995-2006, 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
-@@ -307,6 +307,10 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
- 	  goto call_error;
- 	}
- 
-+#ifdef CLEAR_CACHE
-+      CLEAR_CACHE (textrels->start, textrels->start + textrels->len);
-+#endif
-+
-       textrels = textrels->next;
-     }
- 
diff -Nru eglibc-2.11.2/debian/patches/any/cvs-getaddrinfo-single-lookup.diff eglibc-2.11.3/debian/patches/any/cvs-getaddrinfo-single-lookup.diff
--- eglibc-2.11.2/debian/patches/any/cvs-getaddrinfo-single-lookup.diff	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/cvs-getaddrinfo-single-lookup.diff	2011-12-13 13:41:29.000000000 +0000
@@ -0,0 +1,19 @@
+2011-06-27  Ulrich Drepper  <drepper@gmail.com>
+ 
+	[BZ #12350]
+	* nscd/aicache.c (addhstaiX):  Restore only RES_USE_INET6
+	bit from old_res_options.
+
+diff --git a/nscd/aicache.c b/nscd/aicache.c
+index 3190a13..6c8d83a 100644
+--- a/nscd/aicache.c
++++ b/nscd/aicache.c
+@@ -534,7 +534,7 @@ next_nip:
+    }
+ 
+  out:
+-  _res.options = old_res_options;
++  _res.options |= old_res_options & RES_USE_INET6;
+ 
+   if (dataset != NULL && !alloca_used)
+     {
diff -Nru eglibc-2.11.2/debian/patches/any/cvs-nptl-pthread-race.diff eglibc-2.11.3/debian/patches/any/cvs-nptl-pthread-race.diff
--- eglibc-2.11.2/debian/patches/any/cvs-nptl-pthread-race.diff	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/cvs-nptl-pthread-race.diff	2011-12-13 13:41:29.000000000 +0000
@@ -0,0 +1,167 @@
+2011-09-15  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/pthread/list.h: Define only list_t if __need_list_t is
+	defined.
+	(list_add): Add atomic_write_barrier.
+	* descr.h: Define __need_list_t before including <list.h>.
+	* nptl-init.c: Include <list.h>
+	* allocatestack.c: Likewise.
+
+---
+ nptl/allocatestack.c        |    1 +
+ nptl/descr.h                |    1 +
+ nptl/nptl-init.c            |    1 +
+ nptl/sysdeps/pthread/list.h |   31 +++++++++++++++++++++++--------
+ nptl_db/ChangeLog           |    4 ++++
+ nptl_db/thread_dbP.h        |    3 ++-
+ 6 files changed, 32 insertions(+), 9 deletions(-)
+
+--- a/nptl/allocatestack.c
++++ b/nptl/allocatestack.c
+@@ -27,6 +27,7 @@
+ #include <sys/param.h>
+ #include <dl-sysdep.h>
+ #include <tls.h>
++#include <list.h>
+ #include <lowlevellock.h>
+ #include <kernel-features.h>
+ 
+--- a/nptl/descr.h
++++ b/nptl/descr.h
+@@ -26,6 +26,7 @@
+ #include <stdbool.h>
+ #include <sys/types.h>
+ #include <hp-timing.h>
++#define __need_list_t
+ #include <list.h>
+ #include <lowlevellock.h>
+ #include <pthreaddef.h>
+--- a/nptl/nptl-init.c
++++ b/nptl/nptl-init.c
+@@ -29,6 +29,7 @@
+ #include <atomic.h>
+ #include <ldsodefs.h>
+ #include <tls.h>
++#include <list.h>
+ #include <fork.h>
+ #include <version.h>
+ #include <shlib-compat.h>
+--- a/nptl/sysdeps/pthread/list.h
++++ b/nptl/sysdeps/pthread/list.h
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2002, 2009 Free Software Foundation, Inc.
++/* Copyright (C) 2002, 2009, 2011 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+ 
+@@ -18,27 +18,39 @@
+    02111-1307 USA.  */
+ 
+ #ifndef _LIST_H
+-#define _LIST_H	1
++
++#ifndef __need_list_t
++# define _LIST_H	1
++#endif
+ 
+ /* The definitions of this file are adopted from those which can be
+    found in the Linux kernel headers to enable people familiar with
+    the latter find their way in these sources as well.  */
+ 
+ 
++#if defined __need_list_t || defined _LIST_H
++# ifndef __list_t_defined
++#  define __list_t_defined
+ /* Basic type for the double-link list.  */
+ typedef struct list_head
+ {
+   struct list_head *next;
+   struct list_head *prev;
+ } list_t;
++# endif
++# undef __need_list_t
++#endif
++
++#ifdef _LIST_H
+ 
++# include <atomic.h>
+ 
+ /* Define a variable with the head and tail of the list.  */
+-#define LIST_HEAD(name) \
++# define LIST_HEAD(name) \
+   list_t name = { &(name), &(name) }
+ 
+ /* Initialize a new list head.  */
+-#define INIT_LIST_HEAD(ptr) \
++# define INIT_LIST_HEAD(ptr) \
+   (ptr)->next = (ptr)->prev = (ptr)
+ 
+ 
+@@ -49,6 +61,7 @@
+   newp->next = head->next;
+   newp->prev = head;
+   head->next->prev = newp;
++  atomic_write_barrier ();
+   head->next = newp;
+ }
+ 
+@@ -78,26 +91,28 @@
+ 
+ 
+ /* Get typed element from list at a given position.  */
+-#define list_entry(ptr, type, member) \
++# define list_entry(ptr, type, member) \
+   ((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member)))
+ 
+ 
+ 
+ /* Iterate forward over the elements of the list.  */
+-#define list_for_each(pos, head) \
++# define list_for_each(pos, head) \
+   for (pos = (head)->next; pos != (head); pos = pos->next)
+ 
+ 
+ /* Iterate forward over the elements of the list.  */
+-#define list_for_each_prev(pos, head) \
++# define list_for_each_prev(pos, head) \
+   for (pos = (head)->prev; pos != (head); pos = pos->prev)
+ 
+ 
+ /* Iterate backwards over the elements list.  The list elements can be
+    removed from the list while doing this.  */
+-#define list_for_each_prev_safe(pos, p, head) \
++# define list_for_each_prev_safe(pos, p, head) \
+   for (pos = (head)->prev, p = pos->prev; \
+        pos != (head); \
+        pos = p, p = pos->prev)
+ 
++#endif /* _LIST_H */
++
+ #endif	/* list.h */
+--- a/nptl_db/ChangeLog
++++ b/nptl_db/ChangeLog
+@@ -1,3 +1,7 @@
++2011-09-15  Andreas Schwab  <schwab@redhat.com>
++
++	* thread_dbP.h: Include <list.h>
++
+ 2009-08-23  Roland McGrath  <roland@redhat.com>
+ 
+ 	* td_ta_map_lwp2thr.c (__td_ta_lookup_th_unique): Move ta_ok check
+--- a/nptl_db/thread_dbP.h
++++ b/nptl_db/thread_dbP.h
+@@ -1,5 +1,5 @@
+ /* Private header for thread debug library
+-   Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
++   Copyright (C) 2003, 2004, 2007, 2011 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,6 +29,7 @@
+ #include "proc_service.h"
+ #include "thread_db.h"
+ #include "../nptl/pthreadP.h"  	/* This is for *_BITMASK only.  */
++#include <list.h>
+ 
+ /* Indeces for the symbol names.  */
+ enum
diff -Nru eglibc-2.11.2/debian/patches/any/cvs-pthread-setgroups.diff eglibc-2.11.3/debian/patches/any/cvs-pthread-setgroups.diff
--- eglibc-2.11.2/debian/patches/any/cvs-pthread-setgroups.diff	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/cvs-pthread-setgroups.diff	2011-12-13 13:41:29.000000000 +0000
@@ -0,0 +1,113 @@
+2011-01-14  Ulrich Drepper  <drepper@gmail.com>
+ 
+	[BZ #10563]
+	* sysdeps/unix/sysv/linux/i386/setgroups.c: Use INLINE_SETXID_SYSCALL
+	to make the syscall.
+	* sysdeps/unix/sysv/linux/setgroups.c: New file.
+	* nptl/sysdeps/pthread/setxid.h (__SETXID_1): Add cast to assignment.
+	(__SETXID_2): Likewise.
+	(__SETXID_3): Likewise.
+
+diff --git a/nptl/sysdeps/pthread/setxid.h b/nptl/sysdeps/pthread/setxid.h
+index aebdbd2..043ffd2 100644
+--- a/nptl/sysdeps/pthread/setxid.h
++++ b/nptl/sysdeps/pthread/setxid.h
+@@ -20,11 +20,11 @@
+ #include <sysdep.h>
+ 
+ #define __SETXID_1(cmd, arg1) \
+-  cmd.id[0] = arg1
++  cmd.id[0] = (long int) arg1
+ #define __SETXID_2(cmd, arg1, arg2) \
+-  __SETXID_1 (cmd, arg1); cmd.id[1] = arg2
++  __SETXID_1 (cmd, arg1); cmd.id[1] = (long int) arg2
+ #define __SETXID_3(cmd, arg1, arg2, arg3) \
+-  __SETXID_2 (cmd, arg1, arg2); cmd.id[2] = arg3
++  __SETXID_2 (cmd, arg1, arg2); cmd.id[2] = (long int) arg3
+ 
+ #ifdef SINGLE_THREAD
+ # define INLINE_SETXID_SYSCALL(name, nr, args...) \
+diff --git a/sysdeps/unix/sysv/linux/i386/setgroups.c b/sysdeps/unix/sysv/linux/i386/setgroups.c
+index 10f5b7c..42f7702 100644
+--- a/sysdeps/unix/sysv/linux/i386/setgroups.c
++++ b/sysdeps/unix/sysv/linux/i386/setgroups.c
+@@ -25,6 +26,7 @@
+ #include <sys/syscall.h>
+ #include <bp-checks.h>
+ 
++#include <setxid.h>
+ #include <linux/posix_types.h>
+ #include <kernel-features.h>
+ 
+@@ -44,7 +46,7 @@ int
+ setgroups (size_t n, const gid_t *groups)
+ {
+ #if __ASSUME_32BITUIDS > 0
+-  return INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
++  return INLINE_SETXID_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
+ #else
+   if (n > (size_t) __sysconf (_SC_NGROUPS_MAX))
+     {
+@@ -62,7 +64,8 @@ setgroups (size_t n, const gid_t *groups)
+ 	  int result;
+ 	  int saved_errno = errno;
+ 
+-	  result = INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
++	  result = INLINE_SETXID_SYSCALL (setgroups32, 2, n,
++					  CHECK_N (groups, n));
+ 	  if (result == 0 || errno != ENOSYS)
+ 	    return result;
+ 
+@@ -80,7 +83,8 @@ setgroups (size_t n, const gid_t *groups)
+ 	    }
+ 	}
+ 
+-      return INLINE_SYSCALL (setgroups, 2, n, CHECK_N (kernel_groups, n));
++      return INLINE_SETXID_SYSCALL (setgroups, 2, n,
++				    CHECK_N (kernel_groups, n));
+     }
+ #endif
+ }
+diff --git a/sysdeps/unix/sysv/linux/setgroups.c b/sysdeps/unix/sysv/linux/setgroups.c
+new file mode 100644
+index 0000000..9649974
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/setgroups.c
+@@ -0,0 +1,37 @@
++/* Copyright (C) 1997,1998,2000,2002,2004,2006,2011
++   Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <errno.h>
++#include <grp.h>
++#include <setxid.h>
++#include <sysdep.h>
++
++
++/* Set the group set for the current user to GROUPS (N of them).  For
++   Linux we must convert the array of groups into the format that the
++   kernel expects.  */
++int
++setgroups (size_t n, const gid_t *groups)
++{
++#ifdef __NR_setgroups32
++# error "wrong setgroups.c file used"
++#endif
++  return INLINE_SETXID_SYSCALL (setgroups, 2, n, groups);
++}
++libc_hidden_def (setgroups)
diff -Nru eglibc-2.11.2/debian/patches/any/cvs-redirect-throw.diff eglibc-2.11.3/debian/patches/any/cvs-redirect-throw.diff
--- eglibc-2.11.2/debian/patches/any/cvs-redirect-throw.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/cvs-redirect-throw.diff	1970-01-01 00:00:00.000000000 +0000
@@ -1,99 +0,0 @@
-2010-06-07  Jakub Jelinek  <jakub@redhat.com>
-
-	* libio/stdio.h (sscanf, vsscanf): Use __REDIRECT_NTH instead of
-	__REDIRECT followed by __THROW.
-	* wcsmbs/wchar.h (swscanf, vswscanf): Likewise.
-	* posix/getopt.h (getopt): Likewise.
-
-diff --git a/libio/stdio.h b/libio/stdio.h
-index 85542b1..bf16b3f 100644
---- a/libio/stdio.h
-+++ b/libio/stdio.h
-@@ -447,9 +447,9 @@ extern int __REDIRECT (fscanf, (FILE *__restrict __stream,
- 		       __isoc99_fscanf) __wur;
- extern int __REDIRECT (scanf, (__const char *__restrict __format, ...),
- 		       __isoc99_scanf) __wur;
--extern int __REDIRECT (sscanf, (__const char *__restrict __s,
--				__const char *__restrict __format, ...),
--		       __isoc99_sscanf) __THROW;
-+extern int __REDIRECT_NTH (sscanf, (__const char *__restrict __s,
-+				    __const char *__restrict __format, ...),
-+			   __isoc99_sscanf);
- # else
- extern int __isoc99_fscanf (FILE *__restrict __stream,
- 			    __const char *__restrict __format, ...) __wur;
-@@ -501,11 +501,11 @@ extern int __REDIRECT (vfscanf,
- extern int __REDIRECT (vscanf, (__const char *__restrict __format,
- 				_G_va_list __arg), __isoc99_vscanf)
-      __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
--extern int __REDIRECT (vsscanf,
--		       (__const char *__restrict __s,
--			__const char *__restrict __format, _G_va_list __arg),
--		       __isoc99_vsscanf)
--     __THROW __attribute__ ((__format__ (__scanf__, 2, 0)));
-+extern int __REDIRECT_NTH (vsscanf,
-+			   (__const char *__restrict __s,
-+			    __const char *__restrict __format,
-+			    _G_va_list __arg), __isoc99_vsscanf)
-+     __attribute__ ((__format__ (__scanf__, 2, 0)));
- #  else
- extern int __isoc99_vfscanf (FILE *__restrict __s,
- 			     __const char *__restrict __format,
-diff --git a/posix/getopt.h b/posix/getopt.h
-index ff0251d..6e2fa27 100644
---- a/posix/getopt.h
-+++ b/posix/getopt.h
-@@ -1,5 +1,5 @@
- /* Declarations for getopt.
--   Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2009
-+   Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2009,2010
-    Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-@@ -158,9 +158,9 @@ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
-    additional functionality can be disable at runtime.  This redirection
-    helps to also do this at runtime.  */
- #  ifdef __REDIRECT
--  extern int __REDIRECT (getopt, (int ___argc, char *const *___argv,
--				  const char *__shortopts),
--			 __posix_getopt) __THROW;
-+  extern int __REDIRECT_NTH (getopt, (int ___argc, char *const *___argv,
-+				      const char *__shortopts),
-+			     __posix_getopt);
- #  else
- extern int __posix_getopt (int ___argc, char *const *___argv,
- 			   const char *__shortopts) __THROW;
-diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
-index 5a4e10e..061b105 100644
---- a/wcsmbs/wchar.h
-+++ b/wcsmbs/wchar.h
-@@ -658,10 +658,10 @@ extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream,
- extern int __REDIRECT (wscanf, (__const wchar_t *__restrict __format, ...),
- 		       __isoc99_wscanf)
-      /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
--extern int __REDIRECT (swscanf, (__const wchar_t *__restrict __s,
--				 __const wchar_t *__restrict __format, ...),
--		       __isoc99_swscanf)
--     __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
-+extern int __REDIRECT_NTH (swscanf, (__const wchar_t *__restrict __s,
-+				     __const wchar_t *__restrict __format,
-+				     ...), __isoc99_swscanf)
-+     /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
- #  else
- extern int __isoc99_fwscanf (__FILE *__restrict __stream,
- 			     __const wchar_t *__restrict __format, ...);
-@@ -712,10 +712,10 @@ extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s,
- extern int __REDIRECT (vwscanf, (__const wchar_t *__restrict __format,
- 				 __gnuc_va_list __arg), __isoc99_vwscanf)
-      /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
--extern int __REDIRECT (vswscanf, (__const wchar_t *__restrict __s,
--				  __const wchar_t *__restrict __format,
--				  __gnuc_va_list __arg), __isoc99_vswscanf)
--     __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
-+extern int __REDIRECT_NTH (vswscanf, (__const wchar_t *__restrict __s,
-+				      __const wchar_t *__restrict __format,
-+				      __gnuc_va_list __arg), __isoc99_vswscanf)
-+     /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
- #  else
- extern int __isoc99_vfwscanf (__FILE *__restrict __s,
- 			      __const wchar_t *__restrict __format,
diff -Nru eglibc-2.11.2/debian/patches/any/cvs-resolv-different-nameserver.diff eglibc-2.11.3/debian/patches/any/cvs-resolv-different-nameserver.diff
--- eglibc-2.11.2/debian/patches/any/cvs-resolv-different-nameserver.diff	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/cvs-resolv-different-nameserver.diff	2011-12-13 13:41:29.000000000 +0000
@@ -0,0 +1,52 @@
+2011-06-15  Ulrich Drepper  <drepper@gmail.com>
+
+	* resolv/res_send.c (__libc_res_nsend): Fix typos in last patch.  We
+	need to dereference resplen2.
+
+2011-05-30  Ulrich Drepper  <drepper@gmail.com>
+ 
+	[BZ #12684]
+	* resolv/res_send.c (__libc_res_nsend): Only go to the next name server
+	if both request failed.
+	(send_dg): In case of server errors clear resplen or *resplen2.
+
+---
+ resolv/res_send.c |   12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+--- a/resolv/res_send.c
++++ b/resolv/res_send.c
+@@ -546,7 +546,7 @@
+ 				    ns, ansp, ansp2, nansp2, resplen2);
+ 			if (n < 0)
+ 				return (-1);
+-			if (n == 0)
++			if (n == 0 && (buf2 == NULL || *resplen2 == 0))
+ 				goto next_ns;
+ 		} else {
+ 			/* Use datagrams. */
+@@ -556,7 +556,7 @@
+ 				    ansp2, nansp2, resplen2);
+ 			if (n < 0)
+ 				return (-1);
+-			if (n == 0)
++			if (n == 0 && (buf2 == NULL || *resplen2 == 0))
+ 				goto next_ns;
+ 			if (v_circuit)
+ 			  // XXX Check whether both requests failed or
+@@ -1279,10 +1279,14 @@
+ 				(*thisresplen > *thisanssiz)
+ 				? *thisanssiz : *thisresplen);
+ 
+-			if (recvresp1 || (buf2 != NULL && recvresp2))
++			if (recvresp1 || (buf2 != NULL && recvresp2)) {
++			  *resplen2 = 0;
+ 			  return resplen;
++			}
+ 			if (buf2 != NULL)
+ 			  {
++			    /* No data from the first reply.  */
++			    resplen = 0;
+ 			    /* We are waiting for a possible second reply.  */
+ 			    if (hp->id == anhp->id)
+ 			      recvresp1 = 1;
diff -Nru eglibc-2.11.2/debian/patches/any/cvs-statvfs-mount-flags.diff eglibc-2.11.3/debian/patches/any/cvs-statvfs-mount-flags.diff
--- eglibc-2.11.2/debian/patches/any/cvs-statvfs-mount-flags.diff	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/cvs-statvfs-mount-flags.diff	2011-12-13 13:41:29.000000000 +0000
@@ -0,0 +1,191 @@
+2011-02-28  Aurelien Jarno  <aurelien@aurel32.net>
+ 
+	* ports/sysdeps/unix/sysv/linux/alpha/bits/statfs.h (struct statfs,
+	struct statfs64): Add f_flags field.
+
+2010-08-12  Joseph Myers  <joseph@codesourcery.com>
+ 
+	* ports/sysdeps/unix/sysv/linux/mips/bits/statfs.h (struct statfs,
+	struct statfs64): Add f_flags field.
+
+2010-08-11  Ulrich Drepper  <drepper@redhat.com>
+ 
+	* sysdeps/unix/sysv/linux/bits/statfs.h (struct statfs): Add f_flags
+	field.
+	(struct statfs64): Likewise.
+	(_STATFS_F_FLAGS): Define.
+	* sysdeps/unix/sysv/linux/s390/bits/statfs.h: Likewise.
+	* sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags):
+	Don't define if __ASSUME_STATFS_F_FLAGS is defined.
+	(ST_VALID): Define locally.
+	(INTERNAL_STATVFS): If f_flags has ST_VALID set don't call
+	__statvfs_getflags, use the provided value.
+	* sysdeps/unix/sysv/linux/kernel-features.h: Define
+	__ASSUME_STATFS_F_FLAGS.
+
+---
+ ports/sysdeps/unix/sysv/linux/alpha/bits/statfs.h |    6 ++++--
+ ports/sysdeps/unix/sysv/linux/mips/bits/statfs.h  |    6 ++++--
+ sysdeps/unix/sysv/linux/bits/statfs.h             |    7 +++++--
+ sysdeps/unix/sysv/linux/internal_statvfs.c        |   22 +++++++++++++++++-----
+ sysdeps/unix/sysv/linux/kernel-features.h         |    5 +++++
+ sysdeps/unix/sysv/linux/s390/bits/statfs.h        |    7 +++++--
+ 6 files changed, 40 insertions(+), 13 deletions(-)
+
+--- a/sysdeps/unix/sysv/linux/bits/statfs.h
++++ b/sysdeps/unix/sysv/linux/bits/statfs.h
+@@ -42,7 +42,8 @@
+     __fsid_t f_fsid;
+     __SWORD_TYPE f_namelen;
+     __SWORD_TYPE f_frsize;
+-    __SWORD_TYPE f_spare[5];
++    __SWORD_TYPE f_flags;
++    __SWORD_TYPE f_spare[4];
+   };
+ 
+ #ifdef __USE_LARGEFILE64
+@@ -58,10 +59,12 @@
+     __fsid_t f_fsid;
+     __SWORD_TYPE f_namelen;
+     __SWORD_TYPE f_frsize;
+-    __SWORD_TYPE f_spare[5];
++    __SWORD_TYPE f_flags;
++    __SWORD_TYPE f_spare[4];
+   };
+ #endif
+ 
+ /* Tell code we have these members.  */
+ #define _STATFS_F_NAMELEN
+ #define _STATFS_F_FRSIZE
++#define _STATFS_F_FLAGS
+--- a/sysdeps/unix/sysv/linux/internal_statvfs.c
++++ b/sysdeps/unix/sysv/linux/internal_statvfs.c
+@@ -29,6 +29,11 @@
+ #include <sys/statfs.h>
+ #include <sys/statvfs.h>
+ #include "linux_fsinfo.h"
++#include "kernel-features.h"
++
++
++/* Special internal-only bit value.  */
++#define ST_VALID 0x0020
+ 
+ 
+ #ifndef STATFS
+@@ -37,6 +42,7 @@
+ # define INTERNAL_STATVFS __internal_statvfs
+ 
+ 
++# ifndef __ASSUME_STATFS_F_FLAGS
+ int
+ __statvfs_getflags (const char *name, int fstype, struct stat64 *st)
+ {
+@@ -193,6 +199,7 @@
+ 
+   return result;
+ }
++# endif
+ #else
+ extern int __statvfs_getflags (const char *name, int fstype,
+ 			       struct stat64 *st);
+@@ -234,9 +241,14 @@
+   /* XXX I have no idea how to compute f_favail.  Any idea???  */
+   buf->f_favail = buf->f_ffree;
+ 
+-  /* Determining the flags is tricky.  We have to read /proc/mounts or
+-     the /etc/mtab file and search for the entry which matches the given
+-     file.  The way we can test for matching filesystem is using the
+-     device number.  */
+-  buf->f_flag = __statvfs_getflags (name, fsbuf->f_type, st);
++#ifndef __ASSUME_STATFS_F_FLAGS
++  if ((fsbuf->f_flags & ST_VALID) == 0)
++    /* Determining the flags is tricky.  We have to read /proc/mounts or
++       the /etc/mtab file and search for the entry which matches the given
++       file.  The way we can test for matching filesystem is using the
++       device number.  */
++    buf->f_flag = __statvfs_getflags (name, fsbuf->f_type, st);
++  else
++#endif
++    buf->f_flag = fsbuf->f_flags ^ ST_VALID;
+ }
+--- a/sysdeps/unix/sysv/linux/kernel-features.h
++++ b/sysdeps/unix/sysv/linux/kernel-features.h
+@@ -565,3 +565,8 @@
+ #if __LINUX_KERNEL_VERSION >= 0x020620
+ # define __ASSUME_F_GETOWN_EX	1
+ #endif
++
++/* statfs fills in f_flags since 2.6.36.  */
++#if __LINUX_KERNEL_VERSION >= 0x020624
++# define __ASSUME_STATFS_F_FLAGS	1
++#endif
+--- a/sysdeps/unix/sysv/linux/s390/bits/statfs.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/statfs.h
+@@ -42,7 +42,8 @@
+     __fsid_t f_fsid;
+     int f_namelen;
+     int f_frsize;
+-    int f_spare[5];
++    int f_flags;
++    int f_spare[4];
+   };
+ 
+ #ifdef __USE_LARGEFILE64
+@@ -58,10 +59,12 @@
+     __fsid_t f_fsid;
+     int f_namelen;
+     int f_frsize;
+-    int f_spare[5];
++    int f_flags;
++    int f_spare[4];
+   };
+ #endif
+ 
+ /* Tell code we have this member.  */
+ #define _STATFS_F_NAMELEN
+ #define _STATFS_F_FRSIZE
++#define _STATFS_F_FLAGS
+--- a/ports/sysdeps/unix/sysv/linux/mips/bits/statfs.h
++++ b/ports/sysdeps/unix/sysv/linux/mips/bits/statfs.h
+@@ -45,7 +45,8 @@
+ 	/* Linux specials */
+     __fsid_t f_fsid;
+     long int f_namelen;
+-    long int f_spare[6];
++    long int f_flags;
++    long int f_spare[5];
+   };
+ 
+ #ifdef __USE_LARGEFILE64
+@@ -64,7 +65,8 @@
+ 	/* Linux specials */
+     __fsid_t f_fsid;
+     long int f_namelen;
+-    long int f_spare[6];
++    long int f_flags;
++    long int f_spare[5];
+   };
+ #endif
+ 
+--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/statfs.h
++++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/statfs.h
+@@ -42,7 +42,8 @@
+     __fsid_t f_fsid;
+     int f_namelen;
+     int f_frsize;
+-    int f_spare[5];
++    int f_flags;
++    int f_spare[4];
+   };
+ 
+ #ifdef __USE_LARGEFILE64
+@@ -58,7 +59,8 @@
+     __fsid_t f_fsid;
+     int f_namelen;
+     int f_frsize;
+-    int f_spare[5];
++    int f_flags;
++    int f_spare[4];
+   };
+ #endif
+ 
diff -Nru eglibc-2.11.2/debian/patches/any/local-disable-test-tgmath2.diff eglibc-2.11.3/debian/patches/any/local-disable-test-tgmath2.diff
--- eglibc-2.11.2/debian/patches/any/local-disable-test-tgmath2.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/local-disable-test-tgmath2.diff	2011-12-13 13:41:29.000000000 +0000
@@ -4,12 +4,12 @@
 
 --- a/math/Makefile
 +++ b/math/Makefile
-@@ -92,7 +92,7 @@
- # Rules for the test suite.
+@@ -93,7 +93,7 @@
  tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
  	test-misc test-fpucw tst-definitions test-tgmath test-tgmath-ret \
--	bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int test-tgmath2
-+	bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int
+ 	bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int \
+-	test-tgmath2 test-powl
++	test-powl
  # We do the `long double' tests only if this data type is available and
  # distinct from `double'.
  test-longdouble-yes = test-ldouble test-ildoubl
diff -Nru eglibc-2.11.2/debian/patches/any/submitted-bits-fcntl_h-at.diff eglibc-2.11.3/debian/patches/any/submitted-bits-fcntl_h-at.diff
--- eglibc-2.11.2/debian/patches/any/submitted-bits-fcntl_h-at.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/submitted-bits-fcntl_h-at.diff	2011-12-13 13:41:29.000000000 +0000
@@ -28,27 +28,27 @@
 	constants.
 
 ---
- io/fcntl.h                                       |   12 ------------
- ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h |   13 +++++++++++++
- ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h  |   15 +++++++++++++++
- ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h   |   13 +++++++++++++
- ports/sysdeps/unix/sysv/linux/cris/bits/fcntl.h  |   13 +++++++++++++
- ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h  |   13 +++++++++++++
- ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h  |   13 +++++++++++++
- ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h  |   13 +++++++++++++
- sysdeps/mach/hurd/bits/fcntl.h                   |   13 +++++++++++++
- sysdeps/unix/sysv/linux/i386/bits/fcntl.h        |   13 +++++++++++++
- sysdeps/unix/sysv/linux/ia64/bits/fcntl.h        |   13 +++++++++++++
- sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h     |   13 +++++++++++++
- sysdeps/unix/sysv/linux/s390/bits/fcntl.h        |   13 +++++++++++++
- sysdeps/unix/sysv/linux/sh/bits/fcntl.h          |   13 +++++++++++++
- sysdeps/unix/sysv/linux/sparc/bits/fcntl.h       |   13 +++++++++++++
- sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h      |   13 +++++++++++++
- 16 files changed, 197 insertions(+), 12 deletions(-)
+ io/fcntl.h                                       |   14 --------------
+ ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h |   15 +++++++++++++++
+ ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h  |   17 +++++++++++++++++
+ ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h   |   15 +++++++++++++++
+ ports/sysdeps/unix/sysv/linux/cris/bits/fcntl.h  |   15 +++++++++++++++
+ ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h  |   15 +++++++++++++++
+ ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h  |   15 +++++++++++++++
+ ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h  |   15 +++++++++++++++
+ sysdeps/mach/hurd/bits/fcntl.h                   |   15 +++++++++++++++
+ sysdeps/unix/sysv/linux/i386/bits/fcntl.h        |   15 +++++++++++++++
+ sysdeps/unix/sysv/linux/ia64/bits/fcntl.h        |   15 +++++++++++++++
+ sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h     |   15 +++++++++++++++
+ sysdeps/unix/sysv/linux/s390/bits/fcntl.h        |   15 +++++++++++++++
+ sysdeps/unix/sysv/linux/sh/bits/fcntl.h          |   15 +++++++++++++++
+ sysdeps/unix/sysv/linux/sparc/bits/fcntl.h       |   15 +++++++++++++++
+ sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h      |   15 +++++++++++++++
+ 16 files changed, 227 insertions(+), 14 deletions(-)
 
 --- a/io/fcntl.h
 +++ b/io/fcntl.h
-@@ -56,18 +56,6 @@
+@@ -102,20 +102,6 @@
  # define SEEK_END	2	/* Seek from end of file.  */
  #endif	/* XPG */
  
@@ -60,6 +60,8 @@
 -# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 -					   unlinking file.  */
 -# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
+-# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
+-					   traversal.  */
 -# define AT_EACCESS		0x200	/* Test access permitted for
 -					   effective IDs, not real IDs.  */
 -#endif
@@ -69,7 +71,7 @@
  
 --- a/sysdeps/mach/hurd/bits/fcntl.h
 +++ b/sysdeps/mach/hurd/bits/fcntl.h
-@@ -219,3 +219,16 @@
+@@ -219,3 +219,18 @@
  # define POSIX_FADV_DONTNEED	4 /* Don't need these pages.  */
  # define POSIX_FADV_NOREUSE	5 /* Data will be accessed once.  */
  #endif
@@ -83,12 +85,14 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
 --- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
 +++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
-@@ -227,6 +227,19 @@
+@@ -234,6 +234,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -101,6 +105,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -110,7 +116,7 @@
  #ifdef __USE_GNU
 --- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
 +++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
-@@ -221,6 +221,19 @@
+@@ -229,6 +229,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -123,6 +129,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -132,7 +140,7 @@
  #ifdef __USE_GNU
 --- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
 +++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
-@@ -227,6 +227,19 @@
+@@ -234,6 +234,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -145,6 +153,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -154,7 +164,7 @@
  #ifdef __USE_GNU
 --- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
 +++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
-@@ -247,6 +247,19 @@
+@@ -255,6 +255,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -167,6 +177,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -176,7 +188,7 @@
  #ifdef __USE_GNU
 --- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
 +++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
-@@ -227,6 +227,19 @@
+@@ -235,6 +235,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -189,6 +201,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -198,7 +212,7 @@
  #ifdef __USE_GNU
 --- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
 +++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
-@@ -246,6 +246,19 @@
+@@ -245,6 +245,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -211,6 +225,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -220,7 +236,7 @@
  #ifdef __USE_GNU
 --- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
 +++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
-@@ -241,6 +241,19 @@
+@@ -249,6 +249,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -233,6 +249,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -242,7 +260,7 @@
  #ifdef __USE_GNU
 --- a/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
 +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
-@@ -215,6 +215,19 @@
+@@ -223,6 +223,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -255,6 +273,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -264,7 +284,7 @@
  #ifdef __USE_GNU
 --- a/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
 +++ b/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
-@@ -179,3 +179,18 @@
+@@ -179,3 +179,20 @@
  # define POSIX_FADV_DONTNEED	4 /* Don't need these pages.  */
  # define POSIX_FADV_NOREUSE	5 /* Data will be accessed once.  */
  #endif
@@ -278,6 +298,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -285,7 +307,7 @@
 +
 --- a/ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
 +++ b/ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
-@@ -227,6 +227,19 @@
+@@ -234,6 +234,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -298,6 +320,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -307,7 +331,7 @@
  #ifdef __USE_GNU
 --- a/ports/sysdeps/unix/sysv/linux/cris/bits/fcntl.h
 +++ b/ports/sysdeps/unix/sysv/linux/cris/bits/fcntl.h
-@@ -182,6 +182,19 @@
+@@ -182,6 +182,21 @@
  # define POSIX_FADV_NOREUSE	5 /* Data will be accessed once.  */
  #endif
  
@@ -320,6 +344,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -329,7 +355,7 @@
  /* Provide kernel hint to read ahead.  */
 --- a/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
 +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
-@@ -198,6 +198,19 @@
+@@ -229,6 +229,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -342,6 +368,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -351,7 +379,7 @@
  #ifdef __USE_GNU
 --- a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
 +++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
-@@ -226,6 +226,19 @@
+@@ -233,6 +233,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -364,6 +392,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
@@ -373,7 +403,7 @@
  #ifdef __USE_GNU
 --- a/ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
 +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
-@@ -240,6 +240,19 @@
+@@ -247,6 +247,21 @@
  # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
  #endif
  
@@ -386,6 +416,8 @@
 +# define AT_REMOVEDIR		0x200	/* Remove directory instead of
 +					   unlinking file.  */
 +# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
 +# define AT_EACCESS		0x200	/* Test access permitted for
 +					   effective IDs, not real IDs.  */
 +#endif
diff -Nru eglibc-2.11.2/debian/patches/any/submitted-etc-resolv.conf.diff eglibc-2.11.3/debian/patches/any/submitted-etc-resolv.conf.diff
--- eglibc-2.11.2/debian/patches/any/submitted-etc-resolv.conf.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/submitted-etc-resolv.conf.diff	1970-01-01 00:00:00.000000000 +0000
@@ -1,42 +0,0 @@
-2009-11-08  Aurelien Jarno  <aurelien@aurel32.net>
-
-	* resolv/res_init.c (__res_vinit): Initialize nameserver to the
-	loopback address if none specified.
-
----
- resolv/res_init.c |   17 ++++++++++-------
- 1 file changed, 10 insertions(+), 7 deletions(-)
-
---- a/resolv/res_init.c
-+++ b/resolv/res_init.c
-@@ -176,13 +176,6 @@
- 		statp->id = res_randomid();
- 	}
- 
--#ifdef USELOOPBACK
--	statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
--#else
--	statp->nsaddr.sin_addr.s_addr = INADDR_ANY;
--#endif
--	statp->nsaddr.sin_family = AF_INET;
--	statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
- 	statp->nscount = 0;
- 	statp->ndots = 1;
- 	statp->pfcode = 0;
-@@ -433,6 +426,16 @@
- #endif
- 	    (void) fclose(fp);
- 	}
-+	if (statp->nscount == 0) {
-+	    statp->nscount = 1;
-+#ifdef USELOOPBACK
-+	    statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
-+#else
-+	    statp->nsaddr.sin_addr.s_addr = INADDR_ANY;
-+#endif
-+	    statp->nsaddr.sin_family = AF_INET;
-+	    statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
-+	}
- 	if (statp->defdname[0] == 0 &&
- 	    __gethostname(buf, sizeof(statp->defdname) - 1) == 0 &&
- 	    (cp = strchr(buf, '.')) != NULL)
diff -Nru eglibc-2.11.2/debian/patches/any/submitted-longdouble.diff eglibc-2.11.3/debian/patches/any/submitted-longdouble.diff
--- eglibc-2.11.2/debian/patches/any/submitted-longdouble.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/submitted-longdouble.diff	2011-12-13 13:41:29.000000000 +0000
@@ -4,10 +4,10 @@
 
 --- a/math/Makefile
 +++ b/math/Makefile
-@@ -93,13 +93,17 @@
- tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
+@@ -94,13 +94,17 @@
  	test-misc test-fpucw tst-definitions test-tgmath test-tgmath-ret \
- 	bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int
+ 	bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int \
+ 	test-powl
 -# We do the `long double' tests only if this data type is available and
 -# distinct from `double'.
 +# We do the `long double' tests only if this data type is available.
@@ -25,7 +25,7 @@
  	test-ifloat test-idouble
  libm-tests.o = $(addsuffix .o,$(libm-tests))
  
-@@ -173,11 +177,15 @@
+@@ -175,11 +179,15 @@
  ifneq ($(long-double-fcts),yes)
  # The `double' and `long double' types are the same on this machine.
  # We won't compile the `long double' code at all.  Tell the `double' code
diff -Nru eglibc-2.11.2/debian/patches/any/submitted-resolv-assert.diff eglibc-2.11.3/debian/patches/any/submitted-resolv-assert.diff
--- eglibc-2.11.2/debian/patches/any/submitted-resolv-assert.diff	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/submitted-resolv-assert.diff	2011-12-13 13:41:29.000000000 +0000
@@ -0,0 +1,59 @@
+2011-07-21  Aurelien Jarno  <aurel32@debian.org>
+
+	* resolv/res_query.c(__libc_res_nquery): Assign hp and hp2 
+	depending n and resplen2 to catch cases where answer 
+	equals answerp2.
+
+diff --git a/resolv/res_query.c b/resolv/res_query.c
+index 2f7cfaa..405fa68 100644
+--- a/resolv/res_query.c
++++ b/resolv/res_query.c
+@@ -122,6 +122,7 @@ __libc_res_nquery(res_state statp,
+ 		  int *resplen2)
+ {
+ 	HEADER *hp = (HEADER *) answer;
++	HEADER *hp2;
+ 	int n, use_malloc = 0;
+ 	u_int oflags = statp->_flags;
+ 
+@@ -239,26 +240,25 @@ __libc_res_nquery(res_state statp,
+ 	  /* __libc_res_nsend might have reallocated the buffer.  */
+ 	  hp = (HEADER *) *answerp;
+ 
+-	/* We simplify the following tests by assigning HP to HP2.  It
+-	   is easy to verify that this is the same as ignoring all
+-	   tests of HP2.  */
+-	HEADER *hp2 = answerp2 ? (HEADER *) *answerp2 : hp;
+-
+-	if (n < (int) sizeof (HEADER) && answerp2 != NULL
+-	    && *resplen2 > (int) sizeof (HEADER))
++	/* We simplify the following tests by assigning HP to HP2 or
++	   vice versa.  It is easy to verify that this is the same as
++	   ignoring all tests of HP or HP2.  */
++	if (answerp2 == NULL || *resplen2 < (int) sizeof (HEADER))
+ 	  {
+-	    /* Special case of partial answer.  */
+-	    assert (hp != hp2);
+-	    hp = hp2;
++	    hp2 = hp;
+ 	  }
+-	else if (answerp2 != NULL && *resplen2 < (int) sizeof (HEADER)
+-		 && n > (int) sizeof (HEADER))
++	else
+ 	  {
+-	    /* Special case of partial answer.  */
+-	    assert (hp != hp2);
+-	    hp2 = hp;
++	    hp2 = (HEADER *) *answerp2;
++	    if (n < (int) sizeof (HEADER))
++	      {
++	        hp = hp2;
++	      }
+ 	  }
+ 
++	/* Make sure both hp and hp2 are defined */
++	assert((hp != NULL) && (hp2 != NULL));
++
+ 	if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0)
+ 	    && (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) {
+ #ifdef DEBUG
diff -Nru eglibc-2.11.2/debian/patches/any/submitted-resolv.conf-thread.diff eglibc-2.11.3/debian/patches/any/submitted-resolv.conf-thread.diff
--- eglibc-2.11.2/debian/patches/any/submitted-resolv.conf-thread.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/any/submitted-resolv.conf-thread.diff	2011-12-13 13:41:29.000000000 +0000
@@ -1,3 +1,8 @@
+2011-06-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+	* resolv/res_libc.c (__res_initstamp): Declare unconditionally.
+	(__res_maybe_init): Avoid double-checked locking.
+
 2010-09-15  Aurelien Jarno  <aurelien@aurel32.net>
  
 	* resolv/res_libc (__res_maybe_init): Ask other threads to
@@ -6,6 +11,22 @@
 
 --- a/resolv/res_libc.c
 +++ b/resolv/res_libc.c
+@@ -28,6 +28,7 @@
+    out) since res_init() should go into libc.so but the rest of that
+    file should not.  */
+ 
++__libc_lock_define_initialized (static, lock);
+ extern unsigned long long int __res_initstamp attribute_hidden;
+ /* We have atomic increment operations on 64-bit platforms.  */
+ #if __WORDSIZE == 64
+@@ -35,7 +36,6 @@
+ # define atomicincunlock(lock) (void) 0
+ # define atomicinc(var) catomic_increment (&(var))
+ #else
+-__libc_lock_define_initialized (static, lock);
+ # define atomicinclock(lock) __libc_lock_lock (lock)
+ # define atomicincunlock(lock) __libc_lock_unlock (lock)
+ # define atomicinc(var) ++var
 @@ -100,10 +100,13 @@
  
  	if (resp->options & RES_INIT) {
@@ -14,12 +35,12 @@
 -		    || ((ret == 0) && (last_mtime != statbuf.st_mtime))) {
 -			if (ret == 0)
 -				last_mtime = statbuf.st_mtime;
++		__libc_lock_lock (lock);
 +		if ((ret == 0) && (last_mtime != statbuf.st_mtime)) {
 +			last_mtime = statbuf.st_mtime;
-+			atomicinclock (lock);
 +			atomicinc (__res_initstamp);
-+			atomicincunlock (lock);
 +		}
++		__libc_lock_unlock (lock);
 +		if (__res_initstamp != resp->_u._ext.initstamp) {
  			if (resp->nscount > 0)
  				__res_iclose (resp, true);
diff -Nru eglibc-2.11.2/debian/patches/hppa/local-stack-grows-up.diff eglibc-2.11.3/debian/patches/hppa/local-stack-grows-up.diff
--- eglibc-2.11.2/debian/patches/hppa/local-stack-grows-up.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/hppa/local-stack-grows-up.diff	2011-12-13 13:41:29.000000000 +0000
@@ -8,12 +8,6 @@
 
 --- a/nptl/allocatestack.c
 +++ b/nptl/allocatestack.c
-@@ -1,4 +1,4 @@
--/* Copyright (C) 2002-2007, 2009 Free Software Foundation, Inc.
-+/* Copyright (C) 2002-2007, 2009, 2010 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
- 
 @@ -353,6 +353,15 @@
    if (__builtin_expect (attr->flags & ATTR_FLAG_STACKADDR, 0))
      {
diff -Nru eglibc-2.11.2/debian/patches/hurd-i386/cvs-linkat.diff eglibc-2.11.3/debian/patches/hurd-i386/cvs-linkat.diff
--- eglibc-2.11.2/debian/patches/hurd-i386/cvs-linkat.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/hurd-i386/cvs-linkat.diff	1970-01-01 00:00:00.000000000 +0000
@@ -1,68 +0,0 @@
-This fixes linkat() with AT_SYMLINK_FOLLOW in flags, which is currently
-returning EINVAL.
-
-2010-06-02  Emilio Pozuelo Monfort  <pochu27@gmail.com>
-
-	* hurd/lookup-at.c (__file_name_lookup_at): Accept
-	AT_SYMLINK_FOLLOW in at_flags.  Fail with EINVAL if both
-	AT_SYMLINK_FOLLOW and AT_SYMLINK_NOFOLLOW are present
-	in at_flags.
-	* hurd/hurd/fd.h (__file_name_lookup_at): Update comment.
-	* sysdeps/mach/hurd/linkat.c (linkat): Pass O_NOLINK in flags.
-
----
- hurd/hurd/fd.h             |    5 +++--
- hurd/lookup-at.c           |    6 ++++++
- sysdeps/mach/hurd/linkat.c |    4 +++-
- 3 files changed, 12 insertions(+), 3 deletions(-)
-
-diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h
-index d1aa867..2473476 100644
---- a/hurd/hurd/fd.h
-+++ b/hurd/hurd/fd.h
-@@ -254,8 +254,9 @@ extern int _hurd_select (int nfds, struct pollfd *pollfds,
- 			 const sigset_t *sigmask);
-
- /* Variant of file_name_lookup used in *at function implementations.
--   AT_FLAGS should contain only AT_SYMLINK_NOFOLLOW; other bits
--   cause EINVAL.  */
-+   AT_FLAGS may only contain AT_SYMLINK_FOLLOW or AT_SYMLINK_NOFOLLOW,
-+   which will remove and add O_NOLINK from FLAGS respectively.
-+   Other bits cause EINVAL.  */
- extern file_t __file_name_lookup_at (int fd, int at_flags,
- 				     const char *file_name,
- 				     int flags, mode_t mode);
-diff --git a/hurd/lookup-at.c b/hurd/lookup-at.c
-index 7f55527..728a970 100644
---- a/hurd/lookup-at.c
-+++ b/hurd/lookup-at.c
-@@ -30,8 +30,14 @@ __file_name_lookup_at (int fd, int at_flags,
-   error_t err;
-   file_t result;
-
-+  if ((at_flags & AT_SYMLINK_FOLLOW) && (at_flags & AT_SYMLINK_NOFOLLOW))
-+    return (__hurd_fail (EINVAL), MACH_PORT_NULL);
-+
-   flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
-   at_flags &= ~AT_SYMLINK_NOFOLLOW;
-+  if (at_flags & AT_SYMLINK_FOLLOW)
-+    flags &= ~O_NOLINK;
-+  at_flags &= ~AT_SYMLINK_FOLLOW;
-   if (at_flags != 0)
-     return (__hurd_fail (EINVAL), MACH_PORT_NULL);
-
-diff --git a/sysdeps/mach/hurd/linkat.c b/sysdeps/mach/hurd/linkat.c
-index 1942144..f8406a5 100644
---- a/sysdeps/mach/hurd/linkat.c
-+++ b/sysdeps/mach/hurd/linkat.c
-@@ -38,7 +38,9 @@ linkat (fromfd, from, tofd, to, flags)
-   file_t oldfile, linknode, todir;
-   char *toname;
-
--  oldfile = __file_name_lookup_at (fromfd, flags, from, 0, 0);
-+  /* POSIX says linkat() doesn't follow symlinks by default, so pass
-+     O_NOLINK.  That can be overriden by AT_SYMLINK_FOLLOW in FLAGS.  */
-+  oldfile = __file_name_lookup_at (fromfd, flags, from, O_NOLINK, 0);
-   if (oldfile == MACH_PORT_NULL)
-     return -1;
-
diff -Nru eglibc-2.11.2/debian/patches/hurd-i386/cvs-select.diff eglibc-2.11.3/debian/patches/hurd-i386/cvs-select.diff
--- eglibc-2.11.2/debian/patches/hurd-i386/cvs-select.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/hurd-i386/cvs-select.diff	1970-01-01 00:00:00.000000000 +0000
@@ -1,20 +0,0 @@
-http://sourceware.org/ml/libc-alpha/2010-08/msg00002.html
-
-2010-07-31  Samuel Thibault  <samuel.thibault@ens-lyon.org>
-
-        * hurd/hurdselect.c (_hurd_select): Round timeout up instead of down
-        when converting to ms.
-
-diff --git a/hurd/hurdselect.c b/hurd/hurdselect.c
-index 544eee9..a7228f0 100644
---- a/hurd/hurdselect.c
-+++ b/hurd/hurdselect.c
-@@ -52,7 +52,7 @@ _hurd_select (int nfds,
-   int firstfd, lastfd;
-   mach_msg_timeout_t to = (timeout != NULL ?
- 			   (timeout->tv_sec * 1000 +
--			    timeout->tv_nsec / 1000000) :
-+			    (timeout->tv_nsec + 999999) / 1000000) :
- 			   0);
-   struct
-     {
diff -Nru eglibc-2.11.2/debian/patches/i386/local-cpuid-level2.diff eglibc-2.11.3/debian/patches/i386/local-cpuid-level2.diff
--- eglibc-2.11.2/debian/patches/i386/local-cpuid-level2.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/i386/local-cpuid-level2.diff	2011-12-13 13:41:29.000000000 +0000
@@ -7,7 +7,7 @@
  handle_intel (int name, unsigned int maxidx)
  {
 -  assert (maxidx >= 2);
-+  if (maxidx <= 2)
++  if (maxidx < 2)
 +    {
 +      /* This should never happen as all Intel i686 CPU support a CPUID
 +	 level of 2 minimum.  However valgrind sometimes load the i686
diff -Nru eglibc-2.11.2/debian/patches/kfreebsd/local-readdir_r.diff eglibc-2.11.3/debian/patches/kfreebsd/local-readdir_r.diff
--- eglibc-2.11.2/debian/patches/kfreebsd/local-readdir_r.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/kfreebsd/local-readdir_r.diff	2011-12-13 13:41:29.000000000 +0000
@@ -1,17 +1,18 @@
 ---
- sysdeps/unix/readdir_r.c |   30 +++++++++++++++++++++++++++++-
- 1 file changed, 29 insertions(+), 1 deletion(-)
+ sysdeps/unix/readdir_r.c |   33 +++++++++++++++++++++++++--------
+ 1 file changed, 25 insertions(+), 8 deletions(-)
 
 --- a/sysdeps/unix/readdir_r.c
 +++ b/sysdeps/unix/readdir_r.c
-@@ -114,14 +114,32 @@
+@@ -114,15 +114,32 @@
  
    if (dp != NULL)
      {
 -#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));
+-      reclen = MIN (reclen,
+-		    offsetof (DIRENT_TYPE, d_name) + sizeof (dp->d_name));
 -#endif
 +	/* The required size of *entry, according to POSIX, is
 +	offsetof (DIRENT_TYPE, d_name[0]) + NAME_MAX + 1.
diff -Nru eglibc-2.11.2/debian/patches/kfreebsd/local-sysdeps.diff eglibc-2.11.3/debian/patches/kfreebsd/local-sysdeps.diff
--- eglibc-2.11.2/debian/patches/kfreebsd/local-sysdeps.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/kfreebsd/local-sysdeps.diff	2011-12-13 13:41:29.000000000 +0000
@@ -3175,6 +3175,46 @@
 +#define _DIRENT_HAVE_D_NAMLEN 1
 +#define _DIRENT_HAVE_D_TYPE 1
 --- /dev/null
++++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/elf.h
+@@ -0,0 +1,37 @@
++/* This file defines standard ELF types, structures, and macros.
++   Copyright (C) 1995-2003,2004,2005,2006,2007,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
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifndef _BITS_ELF_H
++#define _BITS_ELF_H
++
++__BEGIN_DECLS
++
++#define	AT_EXECPATH	15	/* Path to the executable. */
++#define	AT_CANARY	16	/* Canary for SSP. */
++#define	AT_CANARYLEN	17	/* Length of the canary. */
++#define	AT_OSRELDATE	18	/* OSRELDATE. */
++#define	AT_NCPUS	19	/* Number of CPUs. */
++#define	AT_PAGESIZES	20	/* Pagesizes. */
++#define	AT_PAGESIZESLEN	21	/* Number of pagesizes. */
++#define	AT_STACKPROT	23	/* Initial stack protection. */
++
++__END_DECLS
++
++#endif	/* elf.h */
+--- /dev/null
 +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/errno.h
 @@ -0,0 +1,183 @@
 +/*-
@@ -7291,7 +7331,7 @@
 +#include <sysdeps/unix/clock_settime.c>
 --- /dev/null
 +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/clone.c
-@@ -0,0 +1,108 @@
+@@ -0,0 +1,143 @@
 +/* Create a thread.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -7320,6 +7360,28 @@
 +#include <stddef.h>
 +#undef __clone
 +
++
++#include <sys/sysctl.h>
++
++static inline int
++__kernel_osreldate(void)
++{
++    static int osreldate;
++
++    int mib[2];
++    size_t size;
++
++    if (osreldate == 0)
++    {
++	mib[0] = CTL_KERN;
++	mib[1] = KERN_OSRELDATE;
++	size = sizeof osreldate;
++	if (__sysctl(mib, 2, &osreldate, &size, NULL, 0) == -1)
++		return (-1);
++    }		
++    return (osreldate);
++}
++
 +/* __start_thread (flags, child_stack, fn, arg)
 +   is roughly equivalent to
 +
@@ -7357,6 +7419,19 @@
 +    }
 +
 +  if ((flags & CSIGNAL) != SIGCHLD)
++  {
++    if (__kernel_osreldate() >= 802510)
++                /* we slightly cheat here, */
++                /* the 9.x snapshot prior to r223966 does not support it too */
++    {
++      if ((flags & CSIGNAL) & ~RFTSIGMASK)
++	{
++	  __set_errno (EINVAL);
++	  return -1;
++	}
++        rfork_flags |= (RFTSIGZMB | RFTSIGFLAGS(flags & CSIGNAL));
++    }
++    else
 +    {
 +      if ((flags & CSIGNAL) & ~RFTHPNMASK)
 +	{
@@ -7368,7 +7443,7 @@
 +      else
 +        rfork_flags |= (RFLINUXTHPN | ((flags & CSIGNAL) <<  RFTHPNSHIFT));
 +    }
-+
++  } 
 +  if (flags & CLONE_VM)
 +    rfork_flags |= RFMEM;
 +
@@ -8495,10 +8570,58 @@
 +}
 +
 --- /dev/null
++++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-support.c
+@@ -0,0 +1,44 @@
++/* Dynamic linker system dependencies for GNU/kFreeBSD.
++   Copyright (C) 2011 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#define _dl_aux_init _dl_aux_init_ignored_code
++#include <elf/dl-support.c>
++#include <bits/elf.h>
++#undef _dl_aux_init
++
++#ifdef HAVE_AUX_VECTOR
++void
++internal_function
++_dl_aux_init (ElfW(auxv_t) *av)
++{
++  for (; av->a_type != AT_NULL; ++av)
++    switch (av->a_type)
++      {
++      case AT_PAGESZ:
++	GLRO(dl_pagesize) = av->a_un.a_val;
++	break;
++      case AT_PHDR:
++	GL(dl_phdr) = (void *) av->a_un.a_val;
++	break;
++      case AT_PHNUM:
++	GL(dl_phnum) = av->a_un.a_val;
++	break;
++      }
++}
++#endif
+--- /dev/null
 +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-sysdep.c
-@@ -0,0 +1,56 @@
+@@ -0,0 +1,253 @@
 +/* Dynamic linker system dependencies for GNU/kFreeBSD.
-+   Copyright (C) 2008 Free Software Foundation, Inc.
++   Copyright (C) 1995-1998,2000-2008,2009,2010,2011
++        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
@@ -8527,7 +8650,203 @@
 +#include <kernel-features.h>
 +
 +#ifdef SHARED
++# define _dl_sysdep_start _dl_sysdep_start_ignored_code
++# define _dl_show_auxv _dl_show_auxv_ignored_code
 +# include <elf/dl-sysdep.c>
++# include <bits/elf.h>
++# undef _dl_sysdep_start
++# undef _dl_show_auxv
++
++extern const char *_self_program_name_from_auxv attribute_hidden;
++
++ElfW(Addr)
++_dl_sysdep_start (void **start_argptr,
++		  void (*dl_main) (const ElfW(Phdr) *phdr, ElfW(Word) phnum,
++				   ElfW(Addr) *user_entry))
++{
++  const ElfW(Phdr) *phdr = NULL;
++  ElfW(Word) phnum = 0;
++  ElfW(Addr) user_entry;
++  ElfW(auxv_t) *av;
++  uid_t uid = 0;
++  gid_t gid = 0;
++#ifdef NEED_DL_SYSINFO
++  uintptr_t new_sysinfo = 0;
++#endif
++
++  __libc_stack_end = DL_STACK_END (start_argptr);
++  DL_FIND_ARG_COMPONENTS (start_argptr, _dl_argc, INTUSE(_dl_argv), _environ,
++			  _dl_auxv);
++
++  user_entry = (ElfW(Addr)) ENTRY_POINT;
++  GLRO(dl_platform) = NULL; /* Default to nothing known about the platform.  */
++
++  for (av = _dl_auxv; av->a_type != AT_NULL; av++)
++    switch (av->a_type)
++      {
++      case AT_PHDR:
++	phdr = (void *) av->a_un.a_val;
++	break;
++      case AT_PHNUM:
++	phnum = av->a_un.a_val;
++	break;
++      case AT_PAGESZ:
++	GLRO(dl_pagesize) = av->a_un.a_val;
++	break;
++      case AT_ENTRY:
++	user_entry = av->a_un.a_val;
++	break;
++      case AT_EXECPATH:
++	_self_program_name_from_auxv = (char *) av->a_un.a_val;
++	break;
++#ifdef NEED_DL_BASE_ADDR
++      case AT_BASE:
++	_dl_base_addr = av->a_un.a_val;
++	break;
++#endif
++      }
++
++    {
++      /* Fill in the values we have not gotten from the kernel through the
++	 auxiliary vector.  */
++#  undef SEE
++#  define SEE(UID, var, uid) \
++   var ^= __get##uid ()
++      SEE (UID, uid, uid);
++      SEE (EUID, uid, euid);
++      SEE (GID, gid, gid);
++      SEE (EGID, gid, egid);
++
++      /* If one of the two pairs of IDs does not match this is a setuid
++	 or setgid run.  */
++      INTUSE(__libc_enable_secure) = uid | gid;
++    }
++
++#ifndef HAVE_AUX_PAGESIZE
++  if (GLRO(dl_pagesize) == 0)
++    GLRO(dl_pagesize) = __getpagesize ();
++#endif
++
++#if defined NEED_DL_SYSINFO
++  /* Only set the sysinfo value if we also have the vsyscall DSO.  */
++  if (GLRO(dl_sysinfo_dso) != 0 && new_sysinfo)
++    GLRO(dl_sysinfo) = new_sysinfo;
++#endif
++
++#ifdef DL_SYSDEP_INIT
++  DL_SYSDEP_INIT;
++#endif
++
++#ifdef DL_PLATFORM_INIT
++  DL_PLATFORM_INIT;
++#endif
++
++  /* Determine the length of the platform name.  */
++  if (GLRO(dl_platform) != NULL)
++    GLRO(dl_platformlen) = strlen (GLRO(dl_platform));
++
++  if (__sbrk (0) == &_end)
++    /* The dynamic linker was run as a program, and so the initial break
++       starts just after our bss, at &_end.  The malloc in dl-minimal.c
++       will consume the rest of this page, so tell the kernel to move the
++       break up that far.  When the user program examines its break, it
++       will see this new value and not clobber our data.  */
++    __sbrk (GLRO(dl_pagesize)
++	    - ((&_end - (void *) 0) & (GLRO(dl_pagesize) - 1)));
++
++  /* If this is a SUID program we make sure that FDs 0, 1, and 2 are
++     allocated.  If necessary we are doing it ourself.  If it is not
++     possible we stop the program.  */
++  if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
++    __libc_check_standard_fds ();
++
++  (*dl_main) (phdr, phnum, &user_entry);
++  return user_entry;
++}
++
++void
++internal_function
++_dl_show_auxv (void)
++{
++  char buf[64];
++  ElfW(auxv_t) *av;
++
++  /* Terminate string.  */
++  buf[63] = '\0';
++
++  /* The following code assumes that the AT_* values are encoded
++     starting from 0 with AT_NULL, 1 for AT_IGNORE, and all other values
++     close by (otherwise the array will be too large).  In case we have
++     to support a platform where these requirements are not fulfilled
++     some alternative implementation has to be used.  */
++  for (av = _dl_auxv; av->a_type != AT_NULL; ++av)
++    {
++      static const struct
++      {
++	const char label[17];
++	enum { unknown = 0, dec, hex, str, ignore } form : 8;
++      } auxvars[] =
++	{
++	  [AT_EXECFD - 2] =		{ "EXECFD:       ", dec },
++	  [AT_PHDR - 2] =		{ "PHDR:         0x", hex },
++	  [AT_PHENT - 2] =		{ "PHENT:        ", dec },
++	  [AT_PHNUM - 2] =		{ "PHNUM:        ", dec },
++	  [AT_PAGESZ - 2] =		{ "PAGESZ:       ", dec },
++	  [AT_BASE - 2] =		{ "BASE:         0x", hex },
++	  [AT_FLAGS - 2] =		{ "FLAGS:        0x", hex },
++	  [AT_ENTRY - 2] =		{ "ENTRY:        0x", hex },
++#ifndef __powerpc__
++	  /* For some odd reason these are not in sys/powerpc/include/elf.h.  */
++	  [AT_NOTELF - 2] =		{ "NOTELF:       ", hex },
++	  [AT_UID - 2] =		{ "UID:          ", dec },
++	  [AT_EUID - 2] =		{ "EUID:         ", dec },
++	  [AT_GID - 2] =		{ "GID:          ", dec },
++	  [AT_EGID - 2] =		{ "EGID:         ", dec },
++#endif
++	  [AT_EXECPATH - 2] =		{ "EXECPATH:     ", str },
++	  [AT_CANARY - 2] =		{ "CANARY:       0x", hex },
++	  [AT_CANARYLEN - 2] =		{ "CANARYLEN:    ", dec },
++	  [AT_OSRELDATE - 2] =		{ "OSRELDATE:    ", dec },
++	  [AT_NCPUS - 2] =		{ "NCPUS:        ", dec },
++	  [AT_PAGESIZES - 2] =		{ "PAGESIZES:    0x", hex },
++	  [AT_PAGESIZESLEN - 2] =	{ "PAGESIZESLEN: ", dec },
++	  [AT_STACKPROT - 2] =		{ "STACKPROT:    0x", hex },
++	};
++      unsigned int idx = (unsigned int) (av->a_type - 2);
++
++      if ((unsigned int) av->a_type < 2u || auxvars[idx].form == ignore)
++	continue;
++
++      assert (AT_NULL == 0);
++      assert (AT_IGNORE == 1);
++
++      if (idx < sizeof (auxvars) / sizeof (auxvars[0])
++	  && auxvars[idx].form != unknown)
++	{
++	  const char *val = (char *) av->a_un.a_val;
++
++	  if (__builtin_expect (auxvars[idx].form, dec) == dec)
++	    val = _itoa ((unsigned long int) av->a_un.a_val,
++			 buf + sizeof buf - 1, 10, 0);
++	  else if (__builtin_expect (auxvars[idx].form, hex) == hex)
++	    val = _itoa ((unsigned long int) av->a_un.a_val,
++			 buf + sizeof buf - 1, 16, 0);
++
++	  _dl_printf ("AT_%s%s\n", auxvars[idx].label, val);
++
++	  continue;
++	}
++
++      /* Unknown value: print a generic line.  */
++      char buf2[17];
++      buf2[sizeof (buf2) - 1] = '\0';
++      const char *val2 = _itoa ((unsigned long int) av->a_un.a_val,
++				buf2 + sizeof buf2 - 1, 16, 0);
++      const char *val =  _itoa ((unsigned long int) av->a_type,
++				buf + sizeof buf - 1, 16, 0);
++      _dl_printf ("AT_??? (0x%s): 0x%s\n", val, val2);
++    }
++}
 +#endif
 +
 +int
@@ -8584,7 +8903,7 @@
 +#endif
 --- /dev/null
 +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/faccessat.c
-@@ -0,0 +1,172 @@
+@@ -0,0 +1,199 @@
 +/* Test for access to file, relative to open directory.  Linux version.
 +   Copyright (C) 2006 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -8619,6 +8938,16 @@
 +extern int __syscall_faccessat (int fd, const char *path, int mode, int flag);
 +libc_hidden_proto (__syscall_faccessat)
 +
++/*
++   The FreeBSD kernel do not test file access correctly when the 
++   process' real user ID is superuser. In particular, they always return
++   zero when testing execute permissions without regard to whether the 
++   file is executable.
++
++   While this behaviour conforms to POSIX.1-2008, it is explicitely 
++   discouraged. This wrapper implements the recommended behaviour.
++ */
++
 +int
 +faccessat (fd, file, mode, flag)
 +     int fd;
@@ -8636,7 +8965,24 @@
 +	__have_atfcts = -1;
 +      else
 +# endif
++      {
++        if ((result == 0) && (mode & X_OK))
++        {
++          uid_t uid = (flag & AT_EACCESS) ? __geteuid () : __getuid ();
++          if (uid == 0)
++          {
++            struct stat64 stats;
++            if (fstatat64 (fd, file, &stats, flag & AT_SYMLINK_NOFOLLOW))
++              return -1;
++            if ((stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0)
++            {
++              __set_errno (EACCES);
++              return -1;
++	    }
++          }
++	}
 +	return result;
++      }	
 +    }
 +
 +#ifndef __ASSUME_ATFCTS
@@ -11599,7 +11945,7 @@
 +#endif /* _BITS_SIGCONTEXT_H */
 --- /dev/null
 +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/dl-machine.h
-@@ -0,0 +1,149 @@
+@@ -0,0 +1,145 @@
 +/* Machine-dependent ELF dynamic relocation inline functions.
 +   FreeBSD i386 specific version of dl_platform_init()
 +   Copyright (C) 2006 Free Software Foundation, Inc.
@@ -11694,16 +12040,12 @@
 +    );
 +}
 +
-+extern const char *_self_program_name_from_auxv attribute_hidden;
-+
 +static inline void __attribute__ ((unused))
 +dl_platform_kfreebsd_i386_init (void)
 +{
 +	/* we don't have reasonable AT_PLATFORM from kernel
 +	   try to use cpuid to get one, also guess AT_HWCAP */
 +
-+        _self_program_name_from_auxv = GLRO(dl_platform);
-+        
 +	int val, hwcap;
 +
 +	val = try_flip_flags(X86_EFLAGS_AC | X86_EFLAGS_ID);
@@ -14132,8 +14474,8 @@
 +    {
 +      size_t new_allocated =
 +	(l->c_len + n < 2 * l->c_allocated + 1
-+	 ? l->c_len + n
-+	 : 2 * l->c_allocated + 1);
++	 ? 2 * l->c_allocated + 1
++	 : l->c_len + n);
 +      char *new_array = (char *) realloc (l->c_array, new_allocated);
 +      if (new_array == NULL)
 +	{
@@ -20000,7 +20342,7 @@
 +    case AF_IPX:
 +      return sizeof (struct sockaddr_ipx);
 +    case AF_LOCAL:
-+      return sizeof (struct sockaddr_un);
++      return sizeof (struct sockaddr_un) - 4;
 +    }
 +  return 0;
 +}
@@ -22341,7 +22683,7 @@
 +#endif
 --- /dev/null
 +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/rfork.h
-@@ -0,0 +1,91 @@
+@@ -0,0 +1,98 @@
 +/* Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -22415,6 +22757,13 @@
 +#define RFTHREAD	(1<<13)	/* enable kernel thread support */
 +#define RFSIGSHARE	(1<<14)	/* share signal handlers */
 +#define RFLINUXTHPN     (1<<16) /* do linux clone exit parent notification */
++#define	RFSTOPPED	(1<<17) /* leave child in a stopped state */
++#define	RFHIGHPID	(1<<18) /* use a pid higher than 10 (idleproc) */
++#define	RFTSIGZMB	(1<<19) /* select signal for exit parent notification */
++#define	RFTSIGSHIFT	20      /* selected signal number is in bits 20-27  */
++#define	RFTSIGMASK	0xFF
++#define	RFTSIGNUM(flags)	(((flags) >> RFTSIGSHIFT) & RFTSIGMASK)
++#define	RFTSIGFLAGS(signum)	((signum) << RFTSIGSHIFT)
 +#define RFPPWAIT	(1<<31) /* parent sleeps until child exits (vfork) */
 +
 +#define RFTHPNSHIFT	24	/* reserve bits 24-30 */
@@ -25609,7 +25958,7 @@
 +#include <sysdeps/unix/sysv/linux/x86_64/dl-cache.h>
 --- /dev/null
 +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/dl-machine.h
-@@ -0,0 +1,137 @@
+@@ -0,0 +1,133 @@
 +/* Machine-dependent ELF dynamic relocation inline functions.  FreeBSD/amd64 version.
 +   Copyright (C) 2006 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -25729,9 +26078,6 @@
 +    );
 +}
 +
-+extern const char *_self_program_name_from_auxv attribute_hidden;
-+
-+                           
 +static inline void __attribute__ ((unused))
 +dl_platform_kfreebsd_x86_64_init (void)
 +{
@@ -25742,7 +26088,6 @@
 +
 +	cpuid(1, &val, &hwcap);
 +	GLRO(dl_hwcap) = hwcap;
-+	_self_program_name_from_auxv = GLRO(dl_platform);
 +	GLRO(dl_platform) = ELF_MACHINE_NAME;
 +}
 +
diff -Nru eglibc-2.11.2/debian/patches/locale/locale-print-LANGUAGE.diff eglibc-2.11.3/debian/patches/locale/locale-print-LANGUAGE.diff
--- eglibc-2.11.2/debian/patches/locale/locale-print-LANGUAGE.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/locale/locale-print-LANGUAGE.diff	2011-12-13 13:41:29.000000000 +0000
@@ -12,19 +12,19 @@
 
 --- a/locale/programs/locale.c
 +++ b/locale/programs/locale.c
-@@ -773,6 +773,7 @@
+@@ -796,6 +796,7 @@
  {
    size_t cat_no;
-   const char *lcall = getenv ("LC_ALL");
-+  const char *language = getenv ("LANGUAGE");
+   const char *lcall = getenv ("LC_ALL") ? : "";
++  const char *language = getenv ("LANGUAGE") ? : "";
    const char *lang = getenv ("LANG") ? : "";
  
    auto void get_source (const char *name);
-@@ -791,6 +792,9 @@
+@@ -814,6 +815,9 @@
    /* LANG has to be the first value.  */
-   printf ("LANG=%s\n", lang);
+   print_assignment ("LANG", lang, false);
  
-+  if (language != NULL && getenv ("POSIXLY_CORRECT") == NULL)
++  if (getenv ("POSIXLY_CORRECT") == NULL)
 +    printf ("LANGUAGE=%s\n", language);
 +
    /* Now all categories in an unspecified order.  */
diff -Nru eglibc-2.11.2/debian/patches/m68k/cvs-tls-support.patch eglibc-2.11.3/debian/patches/m68k/cvs-tls-support.patch
--- eglibc-2.11.2/debian/patches/m68k/cvs-tls-support.patch	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/m68k/cvs-tls-support.patch	2011-12-13 13:41:29.000000000 +0000
@@ -20,9 +20,9 @@
 +	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Change misleading
 +	names of parameters of sync_file_range.
 +
- 2009-11-17  Joseph Myers  <joseph@codesourcery.com>
+ 2011-01-18  Andreas Schwab  <schwab@linux-m68k.org>
  
- 	[BZ #10972]
+ 	* sysdeps/unix/sysv/linux/m68k/bits/mman.h (MADV_HUGEPAGE)
 diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
 index 6fc7a0a..c6dd1a8 100644
 --- a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
@@ -3816,7 +3816,7 @@
 +
  2010-05-22  Andreas Schwab  <schwab@linux-m68k.org>
  
- 	* data/ports/c++-types-m68k-linux-gnu.data: New file.
+ 	* data/c++-types-m68k-linux-gnu.data: New file.
 diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h
 index 0140810..832609d 100644
 --- a/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h
diff -Nru eglibc-2.11.2/debian/patches/series eglibc-2.11.3/debian/patches/series
--- eglibc-2.11.2/debian/patches/series	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/series	2011-12-13 13:41:29.000000000 +0000
@@ -1,4 +1,4 @@
-#svn-updates.diff
+svn-updates.diff
 
 locale/check-unknown-symbols.diff
 locale/fix-LC_COLLATE-rules.diff
@@ -64,7 +64,7 @@
 amd64/local-clone.diff
 amd64/local-linuxthreads-gscope.diff
 amd64/submitted-tst-audit6-avx.diff
-amd64/cvs-avx-tcb-alignment.diff
+amd64/cvs-avx-detection.diff
 
 arm/local-atomic.diff
 arm/local-eabi-wchar.diff
@@ -126,11 +126,9 @@
 hurd-i386/cvs-setsid.diff
 hurd-i386/local-locarchive.diff
 hurd-i386/submitted-regex_internal.diff
-hurd-i386/cvs-linkat.diff
 hurd-i386/cvs-ttyname.diff
 hurd-i386/cvs-getnprocs.diff
 hurd-i386/local-mkdir_root.diff
-hurd-i386/cvs-select.diff
 hurd-i386/local-i686.diff
 hurd-i386/local-no-hp-timing.diff
 hurd-i386/cvs-sched_param.diff
@@ -177,7 +175,6 @@
 sparc/local-sparcv9-target.diff
 sparc/submitted-timing.diff
 sparc/cvs-sparcv9-memchr.diff
-sparc/submitted-epoll.diff
 sparc/submitted-msgrcv.diff
 
 all/local-alias-UTF-8.diff
@@ -239,7 +236,6 @@
 any/local-getaddrinfo-interface.diff
 any/submitted-autotools.diff
 any/submitted-accept4-hidden.diff
-any/submitted-etc-resolv.conf.diff
 any/submitted-localedef-mmap.diff
 any/submitted-missing-etc-hosts.diff
 any/submitted-bits-fcntl_h-at.diff
@@ -261,11 +257,14 @@
 any/local-dlfptr.diff
 any/submitted-string2-strcmp.diff
 any/submitted-group_member.diff
-any/cvs-redirect-throw.diff
-#any/cvs-flush-cache-textrels.diff
 any/cvs-__block.diff
 any/cvs-sunrpc-license.diff
 any/submitted-resolv.conf-thread.diff
-any/cvs-audit-suid.diff
-any/cvs-dont-expand-dst-twice.diff
 any/cvs-ignore-origin-privileged.diff
+any/cvs-resolv-different-nameserver.diff
+any/submitted-resolv-assert.diff
+any/cvs-getaddrinfo-single-lookup.diff
+any/cvs-pthread-setgroups.diff
+any/cvs-dl_close-scope-handling.diff
+any/cvs-nptl-pthread-race.diff
+any/cvs-statvfs-mount-flags.diff
diff -Nru eglibc-2.11.2/debian/patches/sparc/submitted-epoll.diff eglibc-2.11.3/debian/patches/sparc/submitted-epoll.diff
--- eglibc-2.11.2/debian/patches/sparc/submitted-epoll.diff	2011-12-13 13:41:27.000000000 +0000
+++ eglibc-2.11.3/debian/patches/sparc/submitted-epoll.diff	1970-01-01 00:00:00.000000000 +0000
@@ -1,39 +0,0 @@
-2010-08-31  Mike Frysinger  <vapier@gentoo.org>
-
-	* sysdeps/unix/sysv/linux/sparc/sys/epoll.h (epoll_create2): Delete.
-	(epoll_create1): Add.
----
- sysdeps/unix/sysv/linux/sparc/sys/epoll.h |    9 +++++----
- 1 files changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/sysdeps/unix/sysv/linux/sparc/sys/epoll.h b/sysdeps/unix/sysv/linux/sparc/sys/epoll.h
-index cc0ddef..82a3490 100644
---- a/sysdeps/unix/sysv/linux/sparc/sys/epoll.h
-+++ b/sysdeps/unix/sysv/linux/sparc/sys/epoll.h
-@@ -1,4 +1,4 @@
--/* Copyright (C) 2002-2006, 2007, 2008 Free Software Foundation, Inc.
-+/* Copyright (C) 2002-2008, 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
-@@ -31,7 +31,7 @@ typedef __sigset_t sigset_t;
- #endif
- 
- 
--/* Flags to be passed to epoll_create2.  */
-+/* Flags to be passed to epoll_create1.  */
- enum
-   {
-     EPOLL_CLOEXEC = 0x400000,
-@@ -101,8 +101,9 @@ __BEGIN_DECLS
-    returned by epoll_create() should be closed with close().  */
- extern int epoll_create (int __size) __THROW;
- 
--/* Same as epoll_create but with an additional FLAGS parameter.  */
--extern int epoll_create2 (int __size, int __flags) __THROW;
-+/* Same as epoll_create but with an FLAGS parameter.  The unused SIZE
-+   parameter has been dropped.  */
-+extern int epoll_create1 (int __flags) __THROW;
- 
- 
- /* Manipulate an epoll instance "epfd". Returns 0 in case of success,
diff -Nru eglibc-2.11.2/debian/patches/svn-updates.diff eglibc-2.11.3/debian/patches/svn-updates.diff
--- eglibc-2.11.2/debian/patches/svn-updates.diff	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/debian/patches/svn-updates.diff	2011-12-13 13:41:29.000000000 +0000
@@ -0,0 +1,3384 @@
+SVN update of svn://svn.eglibc.org/branches/eglibc-2_11 from revision 12231
+
+--- a/stdlib/bug-getcontext.c	(revision 0)
++++ b/stdlib/bug-getcontext.c	(revision 16211)
+@@ -0,0 +1,48 @@
++/* BZ 12420 */
++
++#include <errno.h>
++#include <fenv.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <ucontext.h>
++
++static int
++do_test (void)
++{
++  int except_mask =  FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW;
++  int status = feenableexcept (except_mask);
++
++  except_mask = fegetexcept ();
++  if (except_mask == -1)
++    {
++      printf("\nBefore getcontext(): fegetexcept returned: %d\n",
++	     except_mask);
++      return 1;
++    }
++
++  ucontext_t ctx;
++  status = getcontext(&ctx);
++  if (status)
++    {
++      printf("\ngetcontext failed, errno: %d.\n", errno);
++      return 1;
++    }
++
++  printf ("\nDone with getcontext()!\n");
++  fflush (NULL);
++
++  int mask = fegetexcept ();
++  if (mask != except_mask)
++    {
++      printf("\nAfter getcontext(): fegetexcept returned: %d, expected: %d.\n",
++	     mask, except_mask);
++      return 1;
++    }
++
++  printf("\nAt end fegetexcept() returned %d, expected: %d.\n",
++	 mask, except_mask);
++  return 0;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+--- a/stdlib/msort.c	(revision 12231)
++++ b/stdlib/msort.c	(revision 16211)
+@@ -25,6 +25,7 @@
+ #include <unistd.h>
+ #include <memcopy.h>
+ #include <errno.h>
++#include <atomic.h>
+ 
+ struct msort_param
+ {
+@@ -182,7 +183,7 @@
+       static long int phys_pages;
+       static int pagesize;
+ 
+-      if (phys_pages == 0)
++      if (pagesize == 0)
+ 	{
+ 	  phys_pages = __sysconf (_SC_PHYS_PAGES);
+ 
+@@ -197,6 +198,9 @@
+ 	     a quarter of the physical memory.  */
+ 	  phys_pages /= 4;
+ 
++	  /* Make sure phys_pages is written to memory.  */
++	  atomic_write_barrier ();
++
+ 	  pagesize = __sysconf (_SC_PAGESIZE);
+ 	}
+ 
+--- a/stdlib/Makefile	(revision 12231)
++++ b/stdlib/Makefile	(revision 16211)
+@@ -1,4 +1,4 @@
+-# Copyright (C) 1991-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++# Copyright (C) 1991-2009, 2011 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
+@@ -80,7 +80,7 @@
+ 		   test-a64l tst-qsort tst-system bug-strtod2		    \
+ 		   tst-atof1 tst-atof2 tst-strtod2 tst-rand48-2             \
+ 		   tst-makecontext tst-qsort2 tst-makecontext2 tst-strtod6  \
+-		   tst-unsetenv1
++		   tst-unsetenv1 bug-getcontext
+ tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+ 		+= tst-strtod3 tst-strtod4 tst-strtod5 testmb2
+ tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
+@@ -159,3 +159,10 @@
+ $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os
+ 	$(build-module)
+ CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
++
++ifeq ($(build-shared),yes)
++link-libm = $(common-objpfx)math/libm.so
++else
++link-libm = $(common-objpfx)math/libm.a
++endif
++$(objpfx)bug-getcontext: $(link-libm)
+--- a/nscd/hstcache.c	(revision 12231)
++++ b/nscd/hstcache.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Cache handling for host lookup.
+-   Copyright (C) 1998-2008, 2009 Free Software Foundation, Inc.
++   Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+ 
+@@ -77,6 +77,20 @@
+ };
+ 
+ 
++/* This is the standard reply in case there are temporary problems.  */
++static const hst_response_header tryagain =
++{
++  .version = NSCD_VERSION,
++  .found = 0,
++  .h_name_len = 0,
++  .h_aliases_cnt = 0,
++  .h_addrtype = -1,
++  .h_length = -1,
++  .h_addr_list_cnt = 0,
++  .error = TRY_AGAIN
++};
++
++
+ static void
+ cache_addhst (struct database_dyn *db, int fd, request_header *req,
+ 	      const void *key, struct hostent *hst, uid_t owner,
+@@ -111,11 +125,15 @@
+       else
+ 	{
+ 	  /* We have no data.  This means we send the standard reply for this
+-	     case.  */
++	     case.  Possibly this is only temporary.  */
+ 	  ssize_t total = sizeof (notfound);
++	  assert (sizeof (notfound) == sizeof (tryagain));
+ 
++	  const hst_response_header *resp = (errval == EAGAIN
++					     ? &tryagain : &notfound);
++
+ 	  if (fd != -1 &&
+-	      TEMP_FAILURE_RETRY (send (fd, &notfound, total,
++	      TEMP_FAILURE_RETRY (send (fd, resp, total,
+ 					MSG_NOSIGNAL)) != total)
+ 	    all_written = false;
+ 
+@@ -135,7 +153,7 @@
+ 					   ? db->negtimeout : ttl);
+ 
+ 	      /* This is the reply.  */
+-	      memcpy (&dataset->resp, &notfound, total);
++	      memcpy (&dataset->resp, resp, total);
+ 
+ 	      /* Copy the key data.  */
+ 	      memcpy (dataset->strdata, key, req->key_len);
+@@ -490,6 +508,7 @@
+ 	      /* We set the error to indicate this is (possibly) a
+ 		 temporary error and that it does not mean the entry
+ 		 is not available at all.  */
++	      h_errno = TRY_AGAIN;
+ 	      errval = EAGAIN;
+ 	      break;
+ 	    }
+--- a/libio/fmemopen.c	(revision 12231)
++++ b/libio/fmemopen.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Fmemopen implementation.
+-   Copyright (C) 2000, 2002, 2005, 2006, 2008, 2009
++   Copyright (C) 2000, 2002, 2005, 2006, 2008, 2009, 2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    Contributed by Hanno Mueller, kontakt@hanno.de, 2000.
+@@ -243,7 +243,7 @@
+   if (mode[0] == 'w')
+     c->buffer[0] = '\0';
+ 
+-  c->maxpos = strlen (c->buffer);
++  c->maxpos = strnlen (c->buffer, len);
+ 
+   if (mode[0] == 'a')
+     c->pos = c->maxpos;
+--- a/libio/fileops.c	(revision 12231)
++++ b/libio/fileops.c	(revision 16211)
+@@ -291,7 +291,7 @@
+ #ifdef _LIBC
+   last_recognized = mode;
+ #endif
+-  for (i = 1; i < 6; ++i)
++  for (i = 1; i < 7; ++i)
+     {
+       switch (*++mode)
+ 	{
+@@ -1005,18 +1005,18 @@
+       /* Adjust for read-ahead (bytes is buffer). */
+       offset -= fp->_IO_read_end - fp->_IO_read_ptr;
+       if (fp->_offset == _IO_pos_BAD)
+-        {
+-          if (mode != 0)
+-            goto dumb;
+-          else
+-            {
+-              result = _IO_SYSSEEK (fp, 0, dir);
+-              if (result == EOF)
+-                return result;
++	{
++	  if (mode != 0)
++	    goto dumb;
++	  else
++	    {
++	      result = _IO_SYSSEEK (fp, 0, dir);
++	      if (result == EOF)
++		return result;
+ 
+-              fp->_offset = result;
+-            }
+-        }
++	      fp->_offset = result;
++	    }
++	}
+       /* Make offset absolute, assuming current pointer is file_ptr(). */
+       offset += fp->_offset;
+       if (offset < 0)
+@@ -1278,7 +1278,7 @@
+ 	{
+ 	  f->_flags |= _IO_ERR_SEEN;
+ 	  break;
+-        }
++	}
+       to_do -= count;
+       data = (void *) ((char *) data + count);
+     }
+@@ -1366,12 +1366,12 @@
+       do_write = to_do - (block_size >= 128 ? to_do % block_size : 0);
+ 
+       if (do_write)
+-        {
++	{
+ 	  count = new_do_write (f, s, do_write);
+ 	  to_do -= count;
+ 	  if (count < do_write)
+ 	    return n - to_do;
+-        }
++	}
+ 
+       /* Now write out the remainder.  Normally, this will fit in the
+ 	 buffer, but it's somewhat messier for line-buffered files,
+--- a/wcsmbs/bits/wchar2.h	(revision 12231)
++++ b/wcsmbs/bits/wchar2.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Checking macros for wchar functions.
+-   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
++   Copyright (C) 2005, 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
+@@ -60,15 +60,13 @@
+ 						   __const wchar_t *__s2,
+ 						   size_t __n), wmemmove);
+ extern wchar_t *__REDIRECT_NTH (__wmemmove_chk_warn,
+-				(wchar_t *__restrict __s1,
+-				 __const wchar_t *__restrict __s2, size_t __n,
+-				 size_t __ns1), __wmemmove_chk)
++				(wchar_t *__s1, __const wchar_t *__s2,
++				 size_t __n, size_t __ns1), __wmemmove_chk)
+      __warnattr ("wmemmove called with length bigger than size of destination "
+ 		 "buffer");
+ 
+ __extern_always_inline wchar_t *
+-__NTH (wmemmove (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
+-		 size_t __n))
++__NTH (wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n))
+ {
+   if (__bos0 (__s1) != (size_t) -1)
+     {
+@@ -129,7 +127,7 @@
+ 		 "buffer");
+ 
+ __extern_always_inline wchar_t *
+-__NTH (wmemset (wchar_t *__restrict __s, wchar_t __c, size_t __n))
++__NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n))
+ {
+   if (__bos0 (__s) != (size_t) -1)
+     {
+@@ -152,7 +150,7 @@
+ 				 __const wchar_t *__restrict __src), wcscpy);
+ 
+ __extern_always_inline wchar_t *
+-__NTH (wcscpy (wchar_t *__dest, __const wchar_t *__src))
++__NTH (wcscpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src))
+ {
+   if (__bos (__dest) != (size_t) -1)
+     return __wcscpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
+@@ -160,14 +158,15 @@
+ }
+ 
+ 
+-extern wchar_t *__wcpcpy_chk (wchar_t *__dest, __const wchar_t *__src,
++extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
++			      __const wchar_t *__restrict __src,
+ 			      size_t __destlen) __THROW;
+-extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias, (wchar_t *__dest,
+-						 __const wchar_t *__src),
+-				wcpcpy);
++extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias,
++				(wchar_t *__restrict __dest,
++				 __const wchar_t *__restrict __src), wcpcpy);
+ 
+ __extern_always_inline wchar_t *
+-__NTH (wcpcpy (wchar_t *__dest, __const wchar_t *__src))
++__NTH (wcpcpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src))
+ {
+   if (__bos (__dest) != (size_t) -1)
+     return __wcpcpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
+@@ -190,7 +189,8 @@
+ 		 "buffer");
+ 
+ __extern_always_inline wchar_t *
+-__NTH (wcsncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
++__NTH (wcsncpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src,
++		size_t __n))
+ {
+   if (__bos (__dest) != (size_t) -1)
+     {
+@@ -220,7 +220,8 @@
+ 		 "buffer");
+ 
+ __extern_always_inline wchar_t *
+-__NTH (wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
++__NTH (wcpncpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src,
++		size_t __n))
+ {
+   if (__bos (__dest) != (size_t) -1)
+     {
+@@ -243,7 +244,7 @@
+ 				 __const wchar_t *__restrict __src), wcscat);
+ 
+ __extern_always_inline wchar_t *
+-__NTH (wcscat (wchar_t *__dest, __const wchar_t *__src))
++__NTH (wcscat (wchar_t *__restrict __dest, __const wchar_t *__restrict __src))
+ {
+   if (__bos (__dest) != (size_t) -1)
+     return __wcscat_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
+@@ -260,7 +261,8 @@
+ 				 size_t __n), wcsncat);
+ 
+ __extern_always_inline wchar_t *
+-__NTH (wcsncat (wchar_t *__dest, __const wchar_t *__src, size_t __n))
++__NTH (wcsncat (wchar_t *__restrict __dest, __const wchar_t *__restrict __src,
++		size_t __n))
+ {
+   if (__bos (__dest) != (size_t) -1)
+     return __wcsncat_chk (__dest, __src, __n,
+@@ -428,14 +430,16 @@
+ #endif
+ 
+ 
+-extern size_t __wcrtomb_chk (char *__s, wchar_t __wchar, mbstate_t *__p,
+-			  size_t __buflen) __THROW __wur;
++extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
++			     mbstate_t *__restrict __p,
++			     size_t __buflen) __THROW __wur;
+ extern size_t __REDIRECT_NTH (__wcrtomb_alias,
+ 			      (char *__restrict __s, wchar_t __wchar,
+ 			       mbstate_t *__restrict __ps), wcrtomb) __wur;
+ 
+ __extern_always_inline __wur size_t
+-__NTH (wcrtomb (char *__s, wchar_t __wchar, mbstate_t *__ps))
++__NTH (wcrtomb (char *__restrict __s, wchar_t __wchar,
++		mbstate_t *__restrict __ps))
+ {
+   /* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
+      But this would only disturb the namespace.  So we define our own
+--- a/wcsmbs/wchar.h	(revision 12231)
++++ b/wcsmbs/wchar.h	(revision 16211)
+@@ -319,8 +319,7 @@
+ #endif
+ 
+ /* Compare N wide characters of S1 and S2.  */
+-extern int wmemcmp (__const wchar_t *__restrict __s1,
+-		    __const wchar_t *__restrict __s2, size_t __n)
++extern int wmemcmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n)
+      __THROW __attribute_pure__;
+ 
+ /* Copy N wide characters of SRC to DEST.  */
+@@ -561,11 +560,13 @@
+ #ifdef	__USE_XOPEN2K8
+ /* Copy SRC to DEST, returning the address of the terminating L'\0' in
+    DEST.  */
+-extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) __THROW;
++extern wchar_t *wcpcpy (wchar_t *__restrict __dest,
++			__const wchar_t *__restrict __src) __THROW;
+ 
+ /* Copy no more than N characters of SRC to DEST, returning the address of
+    the last character written into DEST.  */
+-extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n)
++extern wchar_t *wcpncpy (wchar_t *__restrict __dest,
++			 __const wchar_t *__restrict __src, size_t __n)
+      __THROW;
+ #endif	/* use GNU */
+ 
+--- a/include/alloca.h	(revision 12231)
++++ b/include/alloca.h	(revision 16211)
+@@ -14,6 +14,7 @@
+ 
+ extern int __libc_use_alloca (size_t size) __attribute__ ((const));
+ extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const));
++libc_hidden_proto (__libc_alloca_cutoff)
+ 
+ #define __MAX_ALLOCA_CUTOFF	65536
+ 
+--- a/include/atomic.h	(revision 12231)
++++ b/include/atomic.h	(revision 16211)
+@@ -33,7 +33,7 @@
+      the multi-thread case.  The interfaces have the prefix
+      "catomic_".
+ 
+-   - support functions like barriers.  They also have the preifx
++   - support functions like barriers.  They also have the prefix
+      "atomic_".
+ 
+    Architectures must provide a few lowlevel macros (the compare
+--- a/ChangeLog	(revision 12231)
++++ b/ChangeLog	(revision 16211)
+@@ -1,3 +1,369 @@
++2011-05-29  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12350]
++	* sysdeps/posix/getaddrinfo.c (gethosts): Restore only RES_USE_IENT6
++	bit from old_res_options.
++	(gaih_inet): Likewise.
++
++2011-05-28  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12811]
++	* posix/regex_internal.c (build_wcs_buffer): Don't signal we have to
++	grow the buffers more if it already has to be sufficient.
++	(build_wcs_upper_buffer): Likewise.
++	* posix/regexec.c (check_matching): Likewise.
++	(clean_state_log_if_needed): Likewise.
++	(extend_buffers): Don't enlarge buffers beyond size of the input
++	buffer.
++	Patches mostly by Emil Wojak <emil@wojak.eu>.
++	* posix/bug-regex32.c: New file.
++	* posix/Makefile (tests): Add bug-regex32.
++
++2011-05-14  Ulrich Drepper  <drepper@gmail.com>
++
++	* iconv/loop.c (SINGLE) [STORE_REST]: Add input bytes to bytebuf before
++	storing incomplete byte sequence in state object.
++
++2011-05-17  H.J. Lu  <hongjiu.lu@intel.com>
++
++	[BZ #12775]
++	* sysdeps/x86_64/fpu/e_powl.S: Fix a typo.
++	* math/Makefile (tests): Add test-powl.
++	(CFLAGS-test-powl.c): Define.
++	* math/test-powl.c: New file.
++
++2011-05-16  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12766]
++	* misc/error.c (error_at_line): Ensure file_name and old_file_name
++	point to strings before performing equality test for error_one_per_line
++	mode.
++
++	[BZ #11697]
++	* login/programs/pt_chown.c (do_pt_chown): Always call chown.
++
++2011-05-14  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12083]
++	* sysdeps/pthread/aio_misc.c (__aio_init): Compute optim.aio_num
++	correctly.
++
++	* libio/fileops.c (_IO_new_file_close_it): Initialize write_status.
++
++	* iconv/loop.c (SINGLE) [STORE_REST]: Add input bytes to bytebuf before
++	storing incomplete byte sequence in state object.  Avoid testing for
++	guaranteed too small input if we know there is enough data available.
++
++2011-05-12  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12511]
++	* elf/dl-lookup.c (enter): Don't test for copy relocation here and
++	don't set DF_1_NODELETE here.
++	(do_lookup_x): When entering new entry test for copy relocation
++	and if necessary set DF_1_NODELETE flag.
++	Patch by Piotr Bury <pbury@goahead.com>.
++
++2011-05-11  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12052]
++	* sysdeps/posix/spawni.c (__spawni): Fix sched_setscheduler call.
++
++	[BZ #12625]
++	* misc/mntent_r.c (addmntent): Flush the stream after the output
++
++	[BZ #12393]
++	* elf/dl-load.c (is_trusted_path): Remove unnecessary test.
++	(is_trusted_path_normalize): Skip initial colon.  Append slash
++	to empty buffer.  Duplicate is_trusted_path code but allow
++	constructed patch to be prefix.
++	(is_dst): Allow $ORIGIN followed by /.
++	(_dl_dst_substitute): Correct clearing of check_for_trusted.
++	Correct testing of result of is_trusted_path_normalize
++	(decompose_rpath): Fix warning.
++
++2011-05-07  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12734]
++	* resolv/resolv.h: Define RES_NOTLDQUERY.
++	* resolv/res_init.c (res_setoptions): Recognize no_tld_query and
++	no-tld-query and set RES_NOTLDQUERY.
++	* resolv/res_debug.c (p_option): Handle RES_NOTLDQUERY.
++	* resolv/res_query.c (__libc_res_nsearch): Backport changes from
++	modern BIND to search name as TLD unless forbidden.
++
++2011-05-07  Petr Baudis  <pasky@suse.cz>
++	    Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12393]
++	* elf/dl-load.c (fillin_rpath): Move trusted path check...
++	(is_trusted_path): ...to here.
++	(is_norm_trusted_path): Add wrapper for /../ and /./ normalization.
++	(_dl_dst_substitute): Verify expanded $ORIGIN path elements
++	using is_norm_trusted_path() in setuid scripts.
++
++2011-05-03  Andreas Schwab  <schwab@redhat.com>
++
++	* elf/ldconfig.c (add_dir): Don't crash on empty path.
++
++2011-04-30  Bruno Haible  <bruno@clisp.org>
++
++	[BZ #12717]
++	* conform/data/netdb.h-data (getnameinfo): Make POSIX compliant.
++	* resolv/netdb.h (getnameinfo): Change type of flags parameter
++	to 'int'.
++	* inet/getnameinfo.c (getnameinfo): Likewise.
++
++2011-04-22  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12685]
++	* libio/fileops.c (_IO_new_file_fopen): Scan up to 7 bytes of the
++	mode string.
++	Patch by Eric Blake <eblake@redhat.com>.
++
++2011-04-17  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12420]
++	* sysdeps/unix/sysv/linux/x86_64/getcontext.S: Reload context after
++	storing it.
++	* stdlib/bug-getcontext.c: New file.
++	* stdlib/Makefile: Add rules to build and run bug-getcontext.
++
++2011-04-10  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12650]
++	* sysdeps/i386/dl-tls.h: Define TLS_DTV_UNALLOCATED.
++	* sysdeps/ia64/dl-tls.h: Likewise.
++	* sysdeps/powerpc/dl-tls.h: Likewise.
++	* sysdeps/s390/dl-tls.h: Likewise.
++	* sysdeps/sh/dl-tls.h: Likewise.
++	* sysdeps/sparc/dl-tls.h: Likewise.
++	* sysdeps/x86_64/dl-tls.h: Likewise.
++	* elf/dl-tls.c: Don't define TLS_DTV_UNALLOCATED here.
++
++2011-03-14  Andreas Schwab  <schwab@redhat.com>
++
++	* elf/dl-load.c (_dl_dst_substitute): When skipping the first
++	rpath element also skip the following colon.
++	(expand_dynamic_string_token): Add is_path parameter and pass
++	down to DL_DST_REQUIRED and _dl_dst_substitute.
++	(decompose_rpath): Call expand_dynamic_string_token with
++	non-zero is_path.  Ignore empty rpaths.
++	(_dl_map_object_from_fd): Call expand_dynamic_string_token
++	with zero is_path.
++
++2011-04-07  Andreas Schwab  <schwab@redhat.com>
++
++	* sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S (CALL_FAIL):
++	Maintain aligned stack.
++	(CHECK_RSP): Remove unused macro.
++
++2011-03-18  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12583]
++	* posix/fnmatch.c (fnmatch): Check size of pattern in wide
++	character representation.
++	Partly based on a patch by Tomas Hoger <thoger@redhat.com>.
++
++2011-03-16  Ryan S. Arnold  <rsa@us.ibm.com>
++
++	* sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S (isnanf): Fix
++	END(__isnan) to END(__isnanf) to match function entry point/label
++	EALIGN(__isnanf,...).
++
++2011-03-10  Jakub Jelinek  <jakub@redhat.com>
++
++	* wcsmbs/wchar.h (wmemcmp): Remove __restrict qualifiers.
++
++2011-03-10  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12510]
++	* elf/dl-lookup.c (do_lookup_x): For copy relocations of unique objects
++	copy from the symbol referenced in the relocation to initialize the
++	used variable.
++	Patch by Piotr Bury <pbury@goahead.com>.
++
++2011-03-06  Ulrich Drepper  <drepper@gmail.com>
++
++	* elf/dl-load.c (_dl_map_object): If we are looking for the first
++	to-be-loaded object along a path to loader is ld.so.
++
++2011-03-03  Andreas Schwab  <schwab@redhat.com>
++
++	* libio/fmemopen.c (fmemopen): Don't read past end of buffer.
++
++2011-02-17  Andreas Schwab  <schwab@redhat.com>
++
++	[BZ #12454]
++	* elf/dl-deps.c (_dl_map_object_deps): Signal error early when
++	dependencies are missing.
++
++2011-02-22  Samuel Thibault  <samuel.thibault@ens-lyon.org>
++
++	Fix __if_freereq crash: Unlike the generic version which uses free,
++	Hurd needs munmap.
++	* sysdeps/mach/hurd/ifreq.h: New file.
++
++2011-01-27  Petr Baudis  <pasky@suse.cz>
++	    Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12445]
++	* stdio-common/vfprintf.c (vfprintf): Pass correct newlen
++	to extend_alloca().
++	* stdio-common/bug23.c: New file.
++	* stdio-common/Makefile (tests): Add bug23.
++
++2011-02-16  Ryan S. Arnold  <rsa@us.ibm.com>
++
++	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h:
++	(INTERNAL_VSYSCALL_NCS INTERNAL_SYSCALL_NCS): Remove erroneous (int)
++	cast from r3.
++	* sysdeps/wordsize-64/Makefile: New file.  Add tst-writev to
++	'tests' variable.
++	* sysdeps/wordsize-64/tst-writev.c: New file.
++
++2011-02-15  Ryan S. Arnold  <rsa@us.ibm.com>
++
++	* sysdeps/powerpc/powerpc64/power7/Makefile: New file which adds
++	-mno-vsx to the CFLAGS-rtld.c variable to avoid using VSX registers and
++	insns in _dl_start to prevent a TOC reference before relocs are
++	resolved.
++
++2011-02-11  Jakub Jelinek  <jakub@redhat.com>
++
++	* stdio-common/printf-parsemb.c (__parse_one_specmb): Handle
++	arginfo fn returning -1.
++
++	* stdio-common/_i18n_number.h (_i18n_number_rewrite): Ensure decimal
++	and thousands string is zero terminated.
++
++2011-02-02  Ulrich Drepper  <drepper@gmail.com>
++
++	* elf/dl-runtime.c (_dl_call_pltexit): Pass correct address of the
++	function to the callback.
++	Patch partly by Jiri Olsa <jolsa@redhat.com>.
++
++2011-02-02  Andreas Schwab  <schwab@redhat.com>
++
++	* shadow/sgetspent.c: Check return value of __sgetspent_r instead
++	of errno.
++
++2010-10-01  Andreas Schwab  <schwab@redhat.com>
++
++	* sysdeps/posix/getaddrinfo.c (gaih_inet): Don't discard result of
++	decoding ACE if AI_CANONIDN.
++
++2011-01-17  Ulrich Drepper  <drepper@gmail.com>
++
++	* io/fcntl.h: Define AT_NO_AUTOMOUNT.
++
++	* sysdeps/unix/sysv/linux/i386/bits/mman.h: Define MADV_HUGEPAGE and
++	MADV_NOHUGEPAGE.
++	* sysdeps/unix/sysv/linux/ia64/bits/mman.h: Likewise.
++	* sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Likewise.
++	* sysdeps/unix/sysv/linux/s390/bits/mman.h: Likewise.
++	* sysdeps/unix/sysv/linux/sh/bits/mman.h: Likewise.
++	* sysdeps/unix/sysv/linux/sparc/bits/mman.h: Likewise.
++	* sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Likewise.
++
++	* sysdeps/unix/sysv/linux/bits/socket.h: Define AF_CAIF, AF_ALG,
++	PF_CAIF, and PF_ALG.
++	* sysdeps/unix/sysv/linux/sparc/bits/socket.h: Likewise.
++
++2011-01-15  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #6812]
++	* nscd/hstcache.c (tryagain): Define.
++	(cache_addhst): Return tryagain not notfound for temporary errors.
++	(addhstbyX): Also set h_errno to TRY_AGAIN when memory allocation
++	failed.
++
++2011-01-13  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12397]
++	* sysdeps/unix/sysv/linux/mkdirat.c (mkdirat): Fix handling of missing
++	syscall.
++
++	[BZ #10484]
++	* nss/nss_files/files-hosts.c (HOST_DB_LOOKUP): Handle overflows of
++	temporary buffer used to handle multi lookups locally.
++	* include/alloca.h: Add libc_hidden_proto for __libc_alloca_cutoff.
++
++2011-01-12  Ulrich Drepper  <drepper@gmail.com>
++
++	* elf/dl-dst.h (DL_DST_REQUIRED): Allow l_origin to be NULL when
++	loader is ld.so.
++
++2010-03-12  Andreas Schwab  <schwab@redhat.com>
++
++	* elf/dl-dst.h: Include "trusted-dirs.h".
++	(DL_DST_REQUIRED): Take $LIB into account.
++
++2011-01-10  Paul Pluzhnikov  <ppluzhnikov@google.com>
++
++	* sysdeps/i386/Makefile: stdlib/cxa_finalize.c needs 16-byte stack
++	alignment for SSE2.
++
++2011-01-12  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12394]
++	* stdio-common/printf_fp.c (__printf_fp): Add more room for grouping
++	characters.  When rounding increased number of integer digits recompute
++	number of groups.
++	* stdio-common/tst-grouping.c: New file.
++	* stdio-common/Makefile: Add rules to build and run tst-grouping.
++
++2011-01-04  David S. Miller  <davem@sunset.davemloft.net>
++
++	[BZ #11155]
++	* sysdeps/unix/sysv/linux/sparc/sparc64/fxstat.c: Use i386's
++	implementation just like for lxstat, fxstatat, et al.
++
++2010-12-27  Jim Meyering  <meyering@redhat.com>
++
++	[BZ #12348]
++	* posix/regexec.c (build_trtable): Return failure indication upon
++	calloc failure.  Otherwise, re_search_internal could infloop on OOM.
++
++2010-12-25  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12207]
++	* malloc/malloc.c (do_check_malloc_state): Use fastbin macro.
++
++2010-12-19  Ulrich Drepper  <drepper@gmail.com>
++
++	* sysdeps/unix/readdir_r.c (__READDIR_R): Compute reclen more
++	accurately.
++	* sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Define
++	GETDENTS_64BIT_ALIGNED.
++
++2010-12-10  Andreas Schwab  <schwab@redhat.com>
++
++	* wcsmbs/wchar.h (wcpcpy, wcpncpy): Add __restrict.
++	* wcsmbs/bits/wchar2.h (__wmemmove_chk_warn, wmemmove, wmemset):
++	Remove __restrict.
++	(wcscpy, __wcpcpy_chk, __wcpcpy_alias, wcpcpy, wcsncpy, wcpncpy)
++	(wcscat, wcsncat, __wcrtomb_chk, wcrtomb): Add __restrict.
++
++2010-12-09  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #11655]
++	* stdlib/msort.c (qsort_r): Make sure both phys_pages and pagesize
++	are initialized.
++
++2010-12-09  Jakub Jelinek  <jakub@redhat.com>
++
++	* string/bits/string3.h (memmove, bcopy): Remove __restrict.
++
++2010-11-30  Ulrich Drepper  <drepper@gmail.com>
++
++	* sysdeps/i386/fpu/libm-test-ulps: Relax ynf(10,0.75) test expectations.
++
++2010-11-24  Andreas Schwab  <schwab@redhat.com>
++
++	* resolv/nss_dns/dns-host.c (getanswer_r): Don't handle ttl == 0
++	specially.
++	(gaih_getanswer_slice): Likewise.
++
+ 2010-05-31  Petr Baudis  <pasky@suse.cz>
+ 
+ 	[BZ #11149]
+--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S	(revision 12231)
++++ b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* isnanf().  PowerPC32 version.
+-   Copyright (C) 2008 Free Software Foundation, Inc.
++   Copyright (C) 2008, 2011 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
+@@ -39,8 +39,7 @@
+ L(NaN):
+ 	li	r3,1		/* else return 1 */
+ 	blr
+-	END (__isnan)
++	END (__isnanf)
+ 
+ hidden_def (__isnanf)
+ weak_alias (__isnanf, isnanf)
+-
+--- a/sysdeps/powerpc/dl-tls.h	(revision 12231)
++++ b/sysdeps/powerpc/dl-tls.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Thread-local storage handling in the ELF dynamic linker.  PowerPC version.
+-   Copyright (C) 2003 Free Software Foundation, Inc.
++   Copyright (C) 2003, 2011 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
+@@ -47,3 +47,6 @@
+ # define GET_ADDR_OFFSET	(ti->ti_offset + TLS_DTV_OFFSET)
+ # define __TLS_GET_ADDR(__ti)	(__tls_get_addr (__ti) - TLS_DTV_OFFSET)
+ #endif
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/sysdeps/unix/sysv/linux/s390/bits/mman.h	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/s390/bits/mman.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Definitions for POSIX memory map interface.  Linux/s390 version.
+-   Copyright (C) 2000-2003,2005,2006,2009 Free Software Foundation, Inc.
++   Copyright (C) 2000-2003,2005,2006,2009,2011 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
+@@ -94,6 +94,8 @@
+ # define MADV_DOFORK	  11	/* Do inherit across fork.  */
+ # define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
++# define MADV_HUGEPAGE	  14	/* Worth backing with hugepages.  */
++# define MADV_NOHUGEPAGE  15	/* Not worth backing with hugepages.  */
+ # define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+ #endif
+ 
+--- a/sysdeps/unix/sysv/linux/sparc/sparc64/fxstat.c	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/sparc/sparc64/fxstat.c	(revision 16211)
+@@ -1 +1 @@
+-#include "../../fxstat.c"
++#include "../../i386/fxstat.c"
+--- a/sysdeps/unix/sysv/linux/sparc/bits/mman.h	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/sparc/bits/mman.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Definitions for POSIX memory map interface.  Linux/SPARC version.
+-   Copyright (C) 1997,1999,2000,2003,2005,2006,2009
++   Copyright (C) 1997,1999,2000,2003,2005,2006,2009,2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -97,6 +97,8 @@
+ # define MADV_DOFORK	  11	/* Do inherit across fork.  */
+ # define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
++# define MADV_HUGEPAGE	  14	/* Worth backing with hugepages.  */
++# define MADV_NOHUGEPAGE  15	/* Not worth backing with hugepages.  */
+ # define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+ #endif
+ 
+--- a/sysdeps/unix/sysv/linux/sparc/bits/socket.h	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/sparc/bits/socket.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* System-specific socket constants and types.  Linux/SPARC version.
+-   Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009
++   Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009, 2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -108,7 +108,9 @@
+ #define PF_ISDN		34	/* mISDN sockets.  */
+ #define PF_PHONET	35	/* Phonet sockets.  */
+ #define PF_IEEE802154	36	/* IEEE 802.15.4 sockets.  */
+-#define	PF_MAX		37	/* For now..  */
++#define PF_CAIF		37	/* CAIF sockets.  */
++#define PF_ALG		38	/* Algorithm sockets.  */
++#define	PF_MAX		39	/* For now..  */
+ 
+ /* Address families.  */
+ #define	AF_UNSPEC	PF_UNSPEC
+@@ -149,6 +151,8 @@
+ #define AF_ISDN		PF_ISDN
+ #define AF_PHONET	PF_PHONET
+ #define AF_IEEE802154	PF_IEEE802154
++#define AF_CAIF		PF_CAIF
++#define AF_ALG		PF_ALG
+ #define	AF_MAX		PF_MAX
+ 
+ /* Socket level values.  Others are defined in the appropriate headers.
+@@ -233,8 +237,8 @@
+ #define	MSG_MORE	MSG_MORE
+ 
+     MSG_CMSG_CLOEXEC	= 0x40000000	/* Set close_on_exit for file
+-                                           descriptor received through
+-                                           SCM_RIGHTS.  */
++					   descriptor received through
++					   SCM_RIGHTS.  */
+ #define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
+   };
+ 
+--- a/sysdeps/unix/sysv/linux/i386/bits/mman.h	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/i386/bits/mman.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Definitions for POSIX memory map interface.  Linux/i386 version.
+-   Copyright (C) 1997,2000,2003,2005,2006,2009,2010
++   Copyright (C) 1997,2000,2003,2005,2006,2009,2010,2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -96,6 +96,8 @@
+ # define MADV_DOFORK	  11	/* Do inherit across fork.  */
+ # define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
++# define MADV_HUGEPAGE	  14	/* Worth backing with hugepages.  */
++# define MADV_NOHUGEPAGE  15	/* Not worth backing with hugepages.  */
+ # define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+ #endif
+ 
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h	(revision 16211)
+@@ -172,7 +172,7 @@
+        : "r9", "r10", "r11", "r12",					\
+          "cr0", "ctr", "lr", "memory");					\
+ 	  err = (long int) r0;						\
+-    (int) r3;								\
++    r3;								\
+   })
+ 
+ #undef INLINE_SYSCALL
+@@ -219,7 +219,7 @@
+        : "r9", "r10", "r11", "r12",					\
+          "cr0", "ctr", "memory");					\
+ 	  err = r0;  \
+-    (int) r3;  \
++    r3;  \
+   })
+ #define INTERNAL_SYSCALL(name, err, nr, args...)			\
+   INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, args)
+--- a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Definitions for POSIX memory map interface.  Linux/PowerPC version.
+-   Copyright (C) 1997,2000,2003,2005,2006,2008,2009
++   Copyright (C) 1997,2000,2003,2005,2006,2008,2009,2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -96,6 +96,8 @@
+ # define MADV_DOFORK	  11	/* Do inherit across fork.  */
+ # define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
++# define MADV_HUGEPAGE	  14	/* Worth backing with hugepages.  */
++# define MADV_NOHUGEPAGE  15	/* Not worth backing with hugepages.  */
+ # define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+ #endif
+ 
+--- a/sysdeps/unix/sysv/linux/mkdirat.c	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/mkdirat.c	(revision 16211)
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
++/* Copyright (C) 2005, 2006, 2009, 2011 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
+@@ -43,7 +43,7 @@
+     {
+       res = INLINE_SYSCALL (mkdirat, 3, fd, file, mode);
+ # ifndef __ASSUME_ATFCTS
+-      if (res == -1 && res == ENOSYS)
++      if (res == -1 && errno == ENOSYS)
+ 	__have_atfcts = -1;
+       else
+ # endif
+--- a/sysdeps/unix/sysv/linux/bits/socket.h	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/bits/socket.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* System-specific socket constants and types.  Linux version.
+-   Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009
++   Copyright (C) 1991, 1992, 1994-2001, 2004, 2006-2010, 2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -109,7 +109,9 @@
+ #define PF_ISDN		34	/* mISDN sockets.  */
+ #define PF_PHONET	35	/* Phonet sockets.  */
+ #define PF_IEEE802154	36	/* IEEE 802.15.4 sockets.  */
+-#define	PF_MAX		37	/* For now..  */
++#define PF_CAIF		37	/* CAIF sockets.  */
++#define PF_ALG		38	/* Algorithm sockets.  */
++#define	PF_MAX		39	/* For now..  */
+ 
+ /* Address families.  */
+ #define	AF_UNSPEC	PF_UNSPEC
+@@ -150,6 +152,8 @@
+ #define AF_ISDN		PF_ISDN
+ #define AF_PHONET	PF_PHONET
+ #define AF_IEEE802154	PF_IEEE802154
++#define AF_CAIF		PF_CAIF
++#define AF_ALG		PF_ALG
+ #define	AF_MAX		PF_MAX
+ 
+ /* Socket level values.  Others are defined in the appropriate headers.
+--- a/sysdeps/unix/sysv/linux/sh/bits/mman.h	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/sh/bits/mman.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Definitions for POSIX memory map interface.  Linux/SH version.
+-   Copyright (C) 1997,1999,2000,2003,2005,2006,2009
++   Copyright (C) 1997,1999,2000,2003,2005,2006,2009,2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -94,6 +94,8 @@
+ # define MADV_DOFORK	  11	/* Do inherit across fork.  */
+ # define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
++# define MADV_HUGEPAGE	  14	/* Worth backing with hugepages.  */
++# define MADV_NOHUGEPAGE  15	/* Not worth backing with hugepages.  */
+ # define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+ #endif
+ 
+--- a/sysdeps/unix/sysv/linux/x86_64/getcontext.S	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/x86_64/getcontext.S	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Save current context.
+-   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
++   Copyright (C) 2002, 2005, 2011 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    Contributed by Andreas Jaeger <aj@suse.de>, 2002.
+ 
+@@ -62,6 +62,7 @@
+ 	movq	%rcx, oFPREGS(%rdi)
+ 	/* Save the floating-point environment.  */
+ 	fnstenv	(%rcx)
++	fldenv	(%rcx)
+ 	stmxcsr oMXCSR(%rdi)
+ 
+ 	/* Save the current signal mask with
+--- a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S	(revision 16211)
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2001,2004,2005,2006,2009,2010 Free Software Foundation, Inc.
++/* Copyright (C) 2001,2004,2005,2006,2009,2010,2011 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
+@@ -30,19 +30,23 @@
+ //#define __longjmp ____longjmp_chk
+ 
+ #ifdef PIC
+-# define CALL_FAIL	leaq	longjmp_msg(%rip), %rdi;		      \
+-			call	__GI___fortify_fail
++# define CALL_FAIL	subq	$8, %rsp;				      \
++			cfi_remember_state;				      \
++			cfi_def_cfa_offset(16);				      \
++			leaq	longjmp_msg(%rip), %rdi;		      \
++			call	__GI___fortify_fail;			      \
++			nop;						      \
++			cfi_restore_state
+ #else
+-# define CALL_FAIL	movq	$longjmp_msg, %rdi;			      \
+-			call	__fortify_fail
++# define CALL_FAIL	subq	$8, %rsp;				      \
++			cfi_remember_state;				      \
++			cfi_def_cfa_offset(16);				      \
++			movq	$longjmp_msg, %rdi;			      \
++			call	__fortify_fail;				      \
++			nop;						      \
++			cfi_restore_state
+ #endif
+ 
+-#define CHECK_RSP(reg) \
+-	cmpq	reg, %rsp;						      \
+-	jbe	.Lok;							      \
+-	CALL_FAIL;							      \
+-.Lok:
+-
+ /* Jump to the position specified by ENV, causing the
+    setjmp call there to return VAL, or 1 if VAL is 0.
+    void __longjmp (__jmp_buf env, int val).  */
+--- a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h	(revision 16211)
+@@ -1,5 +1,6 @@
+ /* Definitions for POSIX memory map interface.  Linux/x86_64 version.
+-   Copyright (C) 2001,2003,2005,2006,2009,2010 Free Software Foundation, Inc.
++   Copyright (C) 2001,2003,2005,2006,2009,2010,2011
++   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
+@@ -96,6 +97,8 @@
+ # define MADV_DOFORK	  11	/* Do inherit across fork.  */
+ # define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
++# define MADV_HUGEPAGE	  14	/* Worth backing with hugepages.  */
++# define MADV_NOHUGEPAGE  15	/* Not worth backing with hugepages.  */
+ # define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+ #endif
+ 
+--- a/sysdeps/unix/sysv/linux/ia64/bits/mman.h	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/ia64/bits/mman.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Definitions for POSIX memory map interface.  Linux/ia64 version.
+-   Copyright (C) 1997,1998,2000,2003,2005,2006,2009
++   Copyright (C) 1997,1998,2000,2003,2005,2006,2009,2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -95,6 +95,8 @@
+ # define MADV_DOFORK	  11	/* Do inherit across fork.  */
+ # define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
++# define MADV_HUGEPAGE	  14	/* Worth backing with hugepages.  */
++# define MADV_NOHUGEPAGE  15	/* Not worth backing with hugepages.  */
+ # define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+ #endif
+ 
+--- a/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c	(revision 12231)
++++ b/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c	(revision 16211)
+@@ -1,4 +1,5 @@
+ #define readdir64_r __no_readdir64_r_decl
++#define GETDENTS_64BIT_ALIGNED 1
+ #include <sysdeps/unix/readdir_r.c>
+ #undef readdir64_r
+ weak_alias (__readdir_r, readdir64_r)
+--- a/sysdeps/unix/readdir_r.c	(revision 12231)
++++ b/sysdeps/unix/readdir_r.c	(revision 16211)
+@@ -117,7 +117,8 @@
+ #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));
++      reclen = MIN (reclen,
++		    offsetof (DIRENT_TYPE, d_name) + sizeof (dp->d_name));
+ #endif
+       *result = memcpy (entry, dp, reclen);
+ #ifdef GETDENTS_64BIT_ALIGNED
+--- a/sysdeps/pthread/aio_misc.c	(revision 12231)
++++ b/sysdeps/pthread/aio_misc.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Handle general operations.
+-   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2006, 2007, 2009
++   Copyright (C) 1997-2001, 2003, 2004, 2006, 2007, 2009, 2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+@@ -26,6 +26,7 @@
+ #include <pthread.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <aio_misc.h>
+@@ -87,7 +88,7 @@
+ static struct aioinit optim =
+ {
+   20,	/* int aio_threads;	Maximal number of threads.  */
+-  64,	/* int aio_num;		Number of expected simultanious requests. */
++  64,	/* int aio_num;		Number of expected simultaneous requests. */
+   0,
+   0,
+   0,
+@@ -282,9 +283,10 @@
+   if (pool == NULL)
+     {
+       optim.aio_threads = init->aio_threads < 1 ? 1 : init->aio_threads;
++      assert (powerof2 (ENTRIES_PER_ROW));
+       optim.aio_num = (init->aio_num < ENTRIES_PER_ROW
+ 		       ? ENTRIES_PER_ROW
+-		       : init->aio_num & ~ENTRIES_PER_ROW);
++		       : init->aio_num & ~(ENTRIES_PER_ROW - 1));
+     }
+ 
+   if (init->aio_idle_time != 0)
+--- a/sysdeps/i386/dl-tls.h	(revision 12231)
++++ b/sysdeps/i386/dl-tls.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Thread-local storage handling in the ELF dynamic linker.  i386 version.
+-   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
++   Copyright (C) 2002, 2004, 2011 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
+@@ -58,3 +58,6 @@
+ 
+ # endif
+ #endif
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/sysdeps/i386/Makefile	(revision 12231)
++++ b/sysdeps/i386/Makefile	(revision 16211)
+@@ -51,6 +51,7 @@
+ # And a couple of other routines
+ ifeq ($(subdir),stdlib)
+ CFLAGS-exit.c += -mpreferred-stack-boundary=4
++CFLAGS-cxa_finalize.c += -mpreferred-stack-boundary=4
+ endif
+ ifeq ($(subdir),elf)
+ CFLAGS-dl-init.c += -mpreferred-stack-boundary=4
+--- a/sysdeps/i386/fpu/libm-test-ulps	(revision 12231)
++++ b/sysdeps/i386/fpu/libm-test-ulps	(revision 16211)
+@@ -857,8 +857,8 @@
+ ildouble: 2
+ ldouble: 2
+ Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
+-float: 1
+-ifloat: 1
++float: 2
++ifloat: 2
+ ildouble: 4
+ ldouble: 4
+ Test "yn (10, 1.0) == -121618014.278689189288130426667971145":
+--- a/sysdeps/wordsize-64/tst-writev.c	(revision 0)
++++ b/sysdeps/wordsize-64/tst-writev.c	(revision 16211)
+@@ -0,0 +1,107 @@
++/* Copyright (C) 2011 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Contributed by Ryan S. Arnold <rsa@us.ibm.com>, 2011.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <fcntl.h>
++#include <paths.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <sys/uio.h>
++
++
++/* The purpose of this test is to verify that the INTERNAL_[V]SYSCALL_NCS
++   macros on 64-bit platforms don't cast the return type to (int) which would
++   erroneously sign extend the return value should the high bit of the bottom
++   half of the word be '1'.  */
++
++#if 0
++/* Used to test the non power-of-2 code path.  */
++#undef IOV_MAX
++#define IOV_MAX 1000
++#endif
++
++/* writev() should report that it has written EXPECTED number of bytes.  */
++#define EXPECTED ((size_t) INT32_MAX + 1)
++
++static int
++do_test (void)
++{
++  struct iovec iv[IOV_MAX];
++  /* POSIX doesn't guarantee that IOV_MAX is pow of 2 but we're optimistic.  */
++  size_t bufsz = EXPECTED / IOV_MAX;
++  size_t bufrem = EXPECTED % IOV_MAX;
++
++  /* If there's a remainder then IOV_MAX probably isn't a power of 2 and we
++     need to make bufsz bigger so that the last iovec, iv[IOV_MAX-1], is free
++     for the remainder.  */
++  if (bufrem)
++    {
++      bufsz = bufsz + 1;
++      bufrem = EXPECTED - (bufsz * (IOV_MAX - 1));
++    }
++
++  /* We writev to /dev/null since we're just testing writev's return value.  */
++  int fd = open (_PATH_DEVNULL, O_WRONLY);
++  if (fd == -1)
++    {
++      printf ("Unable to open /dev/null for writing.\n");
++      return -1;
++    }
++
++  iv[0].iov_base = malloc (bufsz);
++  if (iv[0].iov_base == NULL)
++    {
++      printf ("malloc (%zu) failed.\n", bufsz);
++      close (fd);
++      return -1;
++    }
++  iv[0].iov_len = bufsz;
++
++  /* We optimistically presume that there isn't a remainder and set all iovec
++     instances to the same base and len as the first instance.  */
++  for (int i = 1; i < IOV_MAX; i++)
++    {
++      /* We don't care what the data is so reuse the allocation from iv[0];  */
++      iv[i].iov_base = iv[0].iov_base;
++      iv[i].iov_len = iv[0].iov_len;
++    }
++
++  /* If there is a remainder then we correct the last iov_len.  */
++  if (bufrem)
++    iv[IOV_MAX - 1].iov_len = bufrem;
++
++  /* Write junk to /dev/null with the writev syscall in order to get a return
++     of INT32_MAX+1 bytes to verify that the INTERNAL_SYSCALL wrappers aren't
++     mangling the result if the signbit of a 32-bit number is set.  */
++  ssize_t ret = writev (fd, iv, IOV_MAX);
++
++  free (iv[0].iov_base);
++  close (fd);
++
++  if (ret != (ssize_t) EXPECTED)
++    {
++      printf ("writev() return value: %zd != EXPECTED: %zd\n", ret, EXPECTED);
++      return 1;
++    }
++
++  return 0;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+--- a/sysdeps/s390/dl-tls.h	(revision 12231)
++++ b/sysdeps/s390/dl-tls.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Thread-local storage handling in the ELF dynamic linker.  s390 version.
+-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
++   Copyright (C) 2003, 2004, 2011 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
+@@ -72,6 +72,9 @@
+ # define __TLS_GET_ADDR(__ti) \
+   ({ extern char _GLOBAL_OFFSET_TABLE_[] attribute_hidden;		  \
+      (void *) __tls_get_offset ((char *) (__ti) - _GLOBAL_OFFSET_TABLE_)  \
+-     + (unsigned long) __builtin_thread_pointer (); }) 
++     + (unsigned long) __builtin_thread_pointer (); })
+ 
+ #endif
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/sysdeps/x86_64/dl-tls.h	(revision 12231)
++++ b/sysdeps/x86_64/dl-tls.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Thread-local storage handling in the ELF dynamic linker.  x86-64 version.
+-   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
++   Copyright (C) 2002, 2005, 2011 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
+@@ -27,3 +27,6 @@
+ 
+ 
+ extern void *__tls_get_addr (tls_index *ti);
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/sysdeps/x86_64/fpu/e_powl.S	(revision 12231)
++++ b/sysdeps/x86_64/fpu/e_powl.S	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* ix87 specific implementation of pow function.
+-   Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2007
++   Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2007, 2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+@@ -154,7 +154,7 @@
+ 	fucompp			// 1.0 : x : y
+ 	fnstsw
+ 	fxch			// x : 1.0 : y
+-	test	$4500,%eax
++	test	$0x4500,%eax
+ 	jz	7f
+ 	fsub	%st(1)		// x-1 : 1.0 : y
+ 	fyl2xp1			// log2(x) : y
+--- a/sysdeps/posix/spawni.c	(revision 12231)
++++ b/sysdeps/posix/spawni.c	(revision 16211)
+@@ -142,9 +142,7 @@
+     }
+   else if ((flags & POSIX_SPAWN_SETSCHEDULER) != 0)
+     {
+-      if (__sched_setscheduler (0, attrp->__policy,
+-				(flags & POSIX_SPAWN_SETSCHEDPARAM) != 0
+-				? &attrp->__sp : NULL) == -1)
++      if (__sched_setscheduler (0, attrp->__policy, &attrp->__sp) == -1)
+ 	_exit (SPAWN_ERROR);
+     }
+ #endif
+--- a/sysdeps/posix/getaddrinfo.c	(revision 12231)
++++ b/sysdeps/posix/getaddrinfo.c	(revision 16211)
+@@ -207,7 +207,7 @@
+       if (herrno == NETDB_INTERNAL)					      \
+ 	{								      \
+ 	  __set_h_errno (herrno);					      \
+-	  _res.options = old_res_options;				      \
++	  _res.options |= old_res_options & RES_USE_INET6;		      \
+ 	  return -EAI_SYSTEM;						      \
+ 	}								      \
+       if (herrno == TRY_AGAIN)						      \
+@@ -842,7 +842,7 @@
+ 		nip = nip->next;
+ 	    }
+ 
+-	  _res.options = old_res_options;
++	  _res.options |= old_res_options & RES_USE_INET6;
+ 
+ 	  if (no_data != 0 && no_inet6_data != 0)
+ 	    {
+@@ -963,6 +963,7 @@
+ 		   make a copy.  */
+ 		if (out == canon)
+ 		  goto make_copy;
++		canon = out;
+ 	      }
+ 	    else
+ #endif
+--- a/sysdeps/ia64/dl-tls.h	(revision 12231)
++++ b/sysdeps/ia64/dl-tls.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Thread-local storage handling in the ELF dynamic linker.  IA-64 version.
+-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++   Copyright (C) 2002, 2003, 2011 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
+@@ -28,3 +28,6 @@
+ #define DONT_USE_TLS_INDEX	1
+ 
+ extern void *__tls_get_addr (size_t m, size_t offset);
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/sysdeps/mach/hurd/ifreq.h	(revision 0)
++++ b/sysdeps/mach/hurd/ifreq.h	(revision 16211)
+@@ -0,0 +1,45 @@
++/* Copyright (C) 1999, 2002, 2003, 2011 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Contributed by Andreas Jaeger <aj@suse.de>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <net/if.h>
++#include <sys/socket.h>
++#include <sys/ioctl.h>
++#include <sys/mman.h>
++
++static inline struct ifreq *
++__if_nextreq (struct ifreq *ifr)
++{
++#ifdef _HAVE_SA_LEN
++  if (ifr->ifr_addr.sa_len > sizeof ifr->ifr_addr)
++    return (struct ifreq *) ((char *) &ifr->ifr_addr + ifr->ifr_addr.sa_len);
++#endif
++  return ifr + 1;
++}
++
++extern void __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd);
++
++
++static inline void
++__if_freereq (struct ifreq *ifreqs, int num_ifs)
++{
++  munmap (ifreqs, num_ifs * sizeof (struct ifreq));
++}
+--- a/sysdeps/sparc/dl-tls.h	(revision 12231)
++++ b/sysdeps/sparc/dl-tls.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Thread-local storage handling in the ELF dynamic linker.  SPARC version.
+-   Copyright (C) 2003 Free Software Foundation, Inc.
++   Copyright (C) 2003, 2011 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
+@@ -27,3 +27,6 @@
+ 
+ 
+ extern void *__tls_get_addr (tls_index *ti);
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/sysdeps/sh/dl-tls.h	(revision 12231)
++++ b/sysdeps/sh/dl-tls.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Thread-local storage handling in the ELF dynamic linker.  SH version.
+-   Copyright (C) 2002 Free Software Foundation, Inc.
++   Copyright (C) 2002, 2011 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
+@@ -27,3 +27,6 @@
+ 
+ 
+ extern void *__tls_get_addr (tls_index *ti);
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/misc/mntent_r.c	(revision 12231)
++++ b/misc/mntent_r.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Utilities for reading/writing fstab, mtab, etc.
+-   Copyright (C) 1995-2000, 2001, 2002, 2003, 2006, 2010
++   Copyright (C) 1995-2000, 2001, 2002, 2003, 2006, 2010, 2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -263,8 +263,8 @@
+ 		   mntcopy.mnt_type,
+ 		   mntcopy.mnt_opts,
+ 		   mntcopy.mnt_freq,
+-		   mntcopy.mnt_passno)
+-	  < 0 ? 1 : 0);
++		   mntcopy.mnt_passno) < 0
++	  || fflush (stream) != 0);
+ }
+ weak_alias (__addmntent, addmntent)
+ 
+--- a/misc/error.c	(revision 12231)
++++ b/misc/error.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Error handler for noninteractive utilities
+-   Copyright (C) 1990-1998, 2000-2005, 2006 Free Software Foundation, Inc.
++   Copyright (C) 1990-1998, 2000-2006, 2011 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
+@@ -277,7 +277,9 @@
+ 
+       if (old_line_number == line_number
+ 	  && (file_name == old_file_name
+-	      || strcmp (old_file_name, file_name) == 0))
++	      || (old_file_name != NULL
++		  && file_name != NULL
++		  && strcmp (old_file_name, file_name) == 0)))
+ 	/* Simply return and print nothing.  */
+ 	return;
+ 
+--- a/inet/getnameinfo.c	(revision 12231)
++++ b/inet/getnameinfo.c	(revision 16211)
+@@ -159,7 +159,7 @@
+ int
+ getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
+ 	     socklen_t hostlen, char *serv, socklen_t servlen,
+-	     unsigned int flags)
++	     int flags)
+ {
+   int serrno = errno;
+   int tmpbuflen = 1024;
+@@ -385,7 +385,7 @@
+ 	break;
+ 
+       default:
+-        return EAI_FAMILY;
++	return EAI_FAMILY;
+     }
+ 
+   if (serv && (servlen > 0))
+--- a/nss/nss_files/files-hosts.c	(revision 12231)
++++ b/nss/nss_files/files-hosts.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Hosts file parser in nss_files module.
+-   Copyright (C) 1996-2001, 2003-2008, 2009 Free Software Foundation, Inc.
++   Copyright (C) 1996-2001, 2003-2009, 2011 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
+@@ -129,19 +129,22 @@
+ 	  && _res_hconf.flags & HCONF_FLAG_MULTI)			      \
+ 	{								      \
+ 	  /* We have to get all host entries from the file.  */		      \
+-	  const size_t tmp_buflen = MIN (buflen, 4096);			      \
+-	  char tmp_buffer[tmp_buflen]					      \
++	  size_t tmp_buflen = MIN (buflen, 4096);			      \
++	  char tmp_buffer_stack[tmp_buflen]				      \
+ 	    __attribute__ ((__aligned__ (__alignof__ (struct hostent_data))));\
++	  char *tmp_buffer = tmp_buffer_stack;				      \
+ 	  struct hostent tmp_result_buf;				      \
+ 	  int naddrs = 1;						      \
+ 	  int naliases = 0;						      \
+ 	  char *bufferend;						      \
++	  bool tmp_buffer_malloced = false;				      \
+ 									      \
+ 	  while (result->h_aliases[naliases] != NULL)			      \
+ 	    ++naliases;							      \
+ 									      \
+ 	  bufferend = (char *) &result->h_aliases[naliases + 1];	      \
+ 									      \
++	again:								      \
+ 	  while ((status = internal_getent (&tmp_result_buf, tmp_buffer,      \
+ 					    tmp_buflen, errnop H_ERRNO_ARG    \
+ 					    EXTRA_ARGS_VALUE))		      \
+@@ -182,7 +185,7 @@
+ 		    }							      \
+ 		  /* If the real name is different add it also to the	      \
+ 		     aliases.  This means that there is a duplication	      \
+-		     in the alias list but this is really the users	      \
++		     in the alias list but this is really the user's	      \
+ 		     problem.  */					      \
+ 		  if (strcmp (old_result->h_name,			      \
+ 			      tmp_result_buf.h_name) != 0)		      \
+@@ -204,7 +207,7 @@
+ 		      *errnop = ERANGE;					      \
+ 		      *herrnop = NETDB_INTERNAL;			      \
+ 		      status = NSS_STATUS_TRYAGAIN;			      \
+-		      break;						      \
++		      goto out;						      \
+ 		    }							      \
+ 									      \
+ 		  new_h_addr_list =					      \
+@@ -268,8 +271,54 @@
+ 		}							      \
+ 	    }								      \
+ 									      \
+-	  if (status != NSS_STATUS_TRYAGAIN)				      \
++	  if (status == NSS_STATUS_TRYAGAIN)				      \
++	    {								      \
++	      size_t newsize = 2 * tmp_buflen;				      \
++	      if (tmp_buffer_malloced)					      \
++		{							      \
++		  char *newp = realloc (tmp_buffer, newsize);		      \
++		  if (newp != NULL)					      \
++		    {							      \
++		      assert ((((uintptr_t) newp)			      \
++			       & (__alignof__ (struct hostent_data) - 1))     \
++			      == 0);					      \
++		      tmp_buffer = newp;				      \
++		      tmp_buflen = newsize;				      \
++		      goto again;					      \
++		    }							      \
++		}							      \
++	      else if (!__libc_use_alloca (buflen + newsize))		      \
++		{							      \
++		  tmp_buffer = malloc (newsize);			      \
++		  if (tmp_buffer != NULL)				      \
++		    {							      \
++		      assert ((((uintptr_t) tmp_buffer)			      \
++			       & (__alignof__ (struct hostent_data) - 1))     \
++			      == 0);					      \
++		      tmp_buffer_malloced = true;			      \
++		      tmp_buflen = newsize;				      \
++		      goto again;					      \
++		    }							      \
++		}							      \
++	      else							      \
++		{							      \
++		  tmp_buffer						      \
++		    = extend_alloca (tmp_buffer, tmp_buflen,		      \
++				     newsize				      \
++				     + __alignof__ (struct hostent_data));    \
++		  tmp_buffer = (char *) (((uintptr_t) tmp_buffer	      \
++					  + __alignof__ (struct hostent_data) \
++					  - 1)				      \
++					 & ~(__alignof__ (struct hostent_data)\
++					     - 1));			      \
++		  goto again;						      \
++		}							      \
++	    }								      \
++	  else								      \
+ 	    status = NSS_STATUS_SUCCESS;				      \
++	out:								      \
++	  if (tmp_buffer_malloced)					      \
++	    free (tmp_buffer);						      \
+ 	}								      \
+ 									      \
+ 									      \
+--- a/string/bits/string3.h	(revision 12231)
++++ b/string/bits/string3.h	(revision 16211)
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
++/* Copyright (C) 2004, 2005, 2007, 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
+@@ -53,8 +53,7 @@
+ }
+ 
+ __extern_always_inline void *
+-__NTH (memmove (void *__restrict __dest, __const void *__restrict __src,
+-		size_t __len))
++__NTH (memmove (void *__dest, __const void *__src, size_t __len))
+ {
+   return __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
+ }
+@@ -88,8 +87,7 @@
+ 
+ #ifdef __USE_BSD
+ __extern_always_inline void
+-__NTH (bcopy (__const void *__restrict __src, void *__restrict __dest,
+-	      size_t __len))
++__NTH (bcopy (__const void *__src, void *__dest, size_t __len))
+ {
+   (void) __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
+ }
+--- a/iconv/loop.c	(revision 12231)
++++ b/iconv/loop.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Conversion loop frame work.
+-   Copyright (C) 1998-2002, 2003, 2005, 2008 Free Software Foundation, Inc.
++   Copyright (C) 1998-2003, 2005, 2008, 2011 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+ 
+@@ -399,6 +399,9 @@
+     {
+       *inptrp = inend;
+ #ifdef STORE_REST
++      while (inptr < inend)
++	bytebuf[inlen++] = *inptr++;
++
+       inptr = bytebuf;
+       inptrp = &inptr;
+       inend = &bytebuf[inlen];
+--- a/math/test-powl.c	(revision 0)
++++ b/math/test-powl.c	(revision 16211)
+@@ -0,0 +1,51 @@
++/* Test for powl
++   Copyright (C) 2011 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <stdio.h>
++#include <math.h>
++#include <float.h>
++#include <ieee754.h>
++
++int
++main (void)
++{
++  int result = 0;
++
++#ifndef NO_LONG_DOUBLE
++# if LDBL_MANT_DIG == 64
++    {
++      long double x = 1e-20;
++      union ieee854_long_double u;
++      u.ieee.mantissa0 = 1;
++      u.ieee.mantissa1 = 1;
++      u.ieee.exponent = 0;
++      u.ieee.negative = 0;
++      (void) powl (0.2, u.d);
++      x = powl (x, 1.5);
++      if (fabsl (x - 1e-30) > 1e-10)
++	{
++	  printf ("powl (1e-20, 1.5): wrong result: %Lg\n", x);
++	  result = 1;
++	}
++    }
++# endif
++#endif
++
++  return result;
++}
+--- a/math/Makefile	(revision 12231)
++++ b/math/Makefile	(revision 16211)
+@@ -92,7 +92,8 @@
+ # Rules for the test suite.
+ tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
+ 	test-misc test-fpucw tst-definitions test-tgmath test-tgmath-ret \
+-	bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int test-tgmath2
++	bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int \
++	test-tgmath2 test-powl
+ # We do the `long double' tests only if this data type is available and
+ # distinct from `double'.
+ test-longdouble-yes = test-ldouble test-ildoubl
+@@ -133,6 +134,7 @@
+ CFLAGS-test-tgmath.c = -fno-builtin
+ CFLAGS-test-tgmath2.c = -fno-builtin
+ CFLAGS-test-tgmath-ret.c = -fno-builtin
++CFLAGS-test-powl.c = -fno-builtin
+ CPPFLAGS-test-ifloat.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__ \
+ 			 -DTEST_FAST_MATH -fno-builtin
+ CPPFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__ \
+--- a/malloc/malloc.c	(revision 12231)
++++ b/malloc/malloc.c	(revision 16211)
+@@ -2832,7 +2832,7 @@
+   max_fast_bin = fastbin_index(get_max_fast ());
+ 
+   for (i = 0; i < NFASTBINS; ++i) {
+-    p = av->fastbins[i];
++    p = fastbin (av, i);
+ 
+     /* The following test can only be performed for the main arena.
+        While mallopt calls malloc_consolidate to get rid of all fast
+--- a/nptl/ChangeLog	(revision 12231)
++++ b/nptl/ChangeLog	(revision 16211)
+@@ -1,3 +1,21 @@
++2011-05-11  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #386]
++	* allocatestack.c (allocate_stack): Convert ENOMEM error to EAGAIN.
++
++2011-04-10  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #12650]
++	* allocatestack.c (get_cached_stack): Deallocate DTV entries before
++	clearing memory.
++	Patch partly by Robert Rex <robert.rex@exasol.com>.
++
++2011-01-13  Ulrich Drepper  <drepper@gmail.com>
++
++	[BZ #10484]
++	* Versions [libc] (GLIBC_PRIVATE): Export __libc_alloca_cutoff.
++	* alloca_cutoff.c: Add libc_hidden_def.
++
+ 2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
+ 
+ 	* nptl/sysdeps/unix/sysv/linux/i386/Makefile: New file.
+--- a/nptl/alloca_cutoff.c	(revision 12231)
++++ b/nptl/alloca_cutoff.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Determine whether block of given size can be allocated on the stack or not.
+-   Copyright (C) 2002 Free Software Foundation, Inc.
++   Copyright (C) 2002, 2011 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,3 +34,4 @@
+ 			  assume the maximum available stack space.  */
+ 		       ?: __MAX_ALLOCA_CUTOFF * 4));
+ }
++libc_hidden_def (__libc_alloca_cutoff)
+--- a/nptl/allocatestack.c	(revision 12231)
++++ b/nptl/allocatestack.c	(revision 16211)
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2002-2007, 2009 Free Software Foundation, Inc.
++/* Copyright (C) 2002-2007, 2009, 2011 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+ 
+@@ -26,6 +26,7 @@
+ #include <sys/mman.h>
+ #include <sys/param.h>
+ #include <dl-sysdep.h>
++#include <dl-tls.h>
+ #include <tls.h>
+ #include <lowlevellock.h>
+ #include <kernel-features.h>
+@@ -238,6 +239,10 @@
+ 
+   /* Clear the DTV.  */
+   dtv_t *dtv = GET_DTV (TLS_TPADJ (result));
++  for (size_t cnt = 0; cnt < dtv[-1].counter; ++cnt)
++    if (! dtv[1 + cnt].pointer.is_static
++	&& dtv[1 + cnt].pointer.val != TLS_DTV_UNALLOCATED)
++      free (dtv[1 + cnt].pointer.val);
+   memset (dtv, '\0', (dtv[-1].counter + 1) * sizeof (dtv_t));
+ 
+   /* Re-initialize the TLS.  */
+@@ -623,7 +628,7 @@
+ 	    {
+ 	      int err;
+ 	    mprot_error:
+-	      err = errno;
++	      err = errno == ENOMEM ? EAGAIN : errno;
+ 
+ 	      lll_lock (stack_cache_lock, LLL_PRIVATE);
+ 
+--- a/nptl/Versions	(revision 12231)
++++ b/nptl/Versions	(revision 16211)
+@@ -27,6 +27,7 @@
+     pthread_cond_broadcast; pthread_cond_timedwait;
+   }
+   GLIBC_PRIVATE {
++    __libc_alloca_cutoff;
+     # Internal libc interface to libpthread
+     __libc_dl_error_tsd;
+   }
+--- a/login/programs/pt_chown.c	(revision 12231)
++++ b/login/programs/pt_chown.c	(revision 16211)
+@@ -64,7 +64,7 @@
+ Copyright (C) %s Free Software Foundation, Inc.\n\
+ This is free software; see the source for copying conditions.  There is NO\n\
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
+-"), "1999");
++"), "2011");
+ }
+ 
+ static char *
+@@ -123,7 +123,7 @@
+ 
+   /* Set the owner to the real user ID, and the group to that special
+      group ID.  */
+-  if (st.st_gid != gid && chown (pty, getuid (), gid) < 0)
++  if (chown (pty, getuid (), gid) < 0)
+     return FAIL_EACCES;
+ 
+   /* Set the permission mode to readable and writable by the owner,
+--- a/shadow/sgetspent.c	(revision 12231)
++++ b/shadow/sgetspent.c	(revision 16211)
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
++/* Copyright (C) 1996, 1997, 2011 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
+@@ -49,8 +49,8 @@
+     }
+ 
+   while (buffer != NULL
+-	 && __sgetspent_r (string, &resbuf, buffer, buffer_size, &result) != 0
+-	 && errno == ERANGE)
++	 && (__sgetspent_r (string, &resbuf, buffer, buffer_size, &result)
++	     == ERANGE))
+     {
+       char *new_buf;
+       buffer_size += BUFLEN_SPWD;
+--- a/posix/regex_internal.c	(revision 12231)
++++ b/posix/regex_internal.c	(revision 16211)
+@@ -237,14 +237,9 @@
+       else
+ 	p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx;
+       mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
+-      if (BE (mbclen == (size_t) -2, 0))
++      if (BE (mbclen == (size_t) -1 || mbclen == 0
++	      || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len), 0))
+ 	{
+-	  /* The buffer doesn't have enough space, finish to build.  */
+-	  pstr->cur_state = prev_st;
+-	  break;
+-	}
+-      else if (BE (mbclen == (size_t) -1 || mbclen == 0, 0))
+-	{
+ 	  /* We treat these cases as a singlebyte character.  */
+ 	  mbclen = 1;
+ 	  wc = (wchar_t) pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
+@@ -252,6 +247,12 @@
+ 	    wc = pstr->trans[wc];
+ 	  pstr->cur_state = prev_st;
+ 	}
++      else if (BE (mbclen == (size_t) -2, 0))
++	{
++	  /* The buffer doesn't have enough space, finish to build.  */
++	  pstr->cur_state = prev_st;
++	  break;
++	}
+ 
+       /* Write wide character and padding.  */
+       pstr->wcs[byte_idx++] = wc;
+@@ -334,9 +335,11 @@
+ 	      for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
+ 		pstr->wcs[byte_idx++] = WEOF;
+ 	    }
+-	  else if (mbclen == (size_t) -1 || mbclen == 0)
++	  else if (mbclen == (size_t) -1 || mbclen == 0
++		   || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len))
+ 	    {
+-	      /* It is an invalid character or '\0'.  Just use the byte.  */
++	      /* It is an invalid character, an incomplete character
++		 at the end of the string, or '\0'.  Just use the byte.  */
+ 	      int ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
+ 	      pstr->mbs[byte_idx] = ch;
+ 	      /* And also cast it to wide char.  */
+@@ -449,7 +452,8 @@
+ 	    for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
+ 	      pstr->wcs[byte_idx++] = WEOF;
+ 	  }
+-	else if (mbclen == (size_t) -1 || mbclen == 0)
++	else if (mbclen == (size_t) -1 || mbclen == 0
++		 || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len))
+ 	  {
+ 	    /* It is an invalid character or '\0'.  Just use the byte.  */
+ 	    int ch = pstr->raw_mbs[pstr->raw_mbs_idx + src_idx];
+--- a/posix/regexec.c	(revision 12231)
++++ b/posix/regexec.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Extended regular expression matching and search library.
+-   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2002-2005,2007,2009,2010,2011 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+ 
+@@ -1120,12 +1120,13 @@
+       re_dfastate_t *old_state = cur_state;
+       int next_char_idx = re_string_cur_idx (&mctx->input) + 1;
+ 
+-      if (BE (next_char_idx >= mctx->input.bufs_len, 0)
+-          || (BE (next_char_idx >= mctx->input.valid_len, 0)
+-              && mctx->input.valid_len < mctx->input.len))
+-        {
+-          err = extend_buffers (mctx);
+-          if (BE (err != REG_NOERROR, 0))
++      if ((BE (next_char_idx >= mctx->input.bufs_len, 0)
++	   && mctx->input.bufs_len < mctx->input.len)
++	  || (BE (next_char_idx >= mctx->input.valid_len, 0)
++	      && mctx->input.valid_len < mctx->input.len))
++	{
++	  err = extend_buffers (mctx);
++	  if (BE (err != REG_NOERROR, 0))
+ 	    {
+ 	      assert (err == REG_ESPACE);
+ 	      return -2;
+@@ -1696,7 +1697,8 @@
+ {
+   int top = mctx->state_log_top;
+ 
+-  if (next_state_log_idx >= mctx->input.bufs_len
++  if ((next_state_log_idx >= mctx->input.bufs_len
++       && mctx->input.bufs_len < mctx->input.len)
+       || (next_state_log_idx >= mctx->input.valid_len
+ 	  && mctx->input.valid_len < mctx->input.len))
+     {
+@@ -3333,6 +3335,8 @@
+ 	{
+ 	  state->trtable = (re_dfastate_t **)
+ 	    calloc (sizeof (re_dfastate_t *), SBC_MAX);
++	  if (BE (state->trtable == NULL, 0))
++	    return 0;
+ 	  return 1;
+ 	}
+       return 0;
+@@ -4066,7 +4070,7 @@
+   re_string_t *pstr = &mctx->input;
+ 
+   /* Double the lengthes of the buffers.  */
+-  ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2);
++  ret = re_string_realloc_buffers (pstr, MIN (pstr->len, pstr->bufs_len * 2));
+   if (BE (ret != REG_NOERROR, 0))
+     return ret;
+ 
+--- a/posix/Makefile	(revision 12231)
++++ b/posix/Makefile	(revision 16211)
+@@ -106,7 +106,7 @@
+ 		   tst-fnmatch2 tst-cpucount tst-cpuset
+ tests-$(OPTION_EGLIBC_LOCALE_CODE)					    \
+ 		+= tst-fnmatch tst-regexloc bug-regex1 bug-regex5 \
+-		   bug-regex23 bug-regex25
++		   bug-regex23 bug-regex25 bug-regex32
+ tests-$(OPTION_EGLIBC_INET) \
+ 	        += tst-getaddrinfo bug-ga1 tst-getaddrinfo2 \
+ 		   tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 tst-getaddrinfo3
+--- a/posix/bug-regex32.c	(revision 0)
++++ b/posix/bug-regex32.c	(revision 16211)
+@@ -0,0 +1,36 @@
++// BZ 12811
++#include <regex.h>
++#include <stdio.h>
++#include <locale.h>
++
++static int
++do_test (void)
++{
++  char buf[1000];
++  regex_t preg;
++  if (setlocale (LC_CTYPE, "de_DE.UTF-8") == NULL)
++    {
++      puts ("setlocale failed");
++      return 1;
++    }
++
++  int e = regcomp (&preg, ".*ab", REG_ICASE);
++  if (e != 0)
++    {
++      regerror (e, &preg, buf, sizeof (buf));
++      printf ("regcomp = %d \"%s\"\n", e, buf);
++      return 1;
++    }
++
++  // Incomplete character at the end of the buffer
++  e = regexec (&preg, "aaaaaaaaaaaa\xc4", 0, NULL, 0);
++
++  regfree (&preg);
++  regerror (e, &preg, buf, sizeof (buf));
++  printf ("regexec = %d \"%s\"\n", e, buf);
++
++  return e != REG_NOMATCH;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+--- a/posix/fnmatch.c	(revision 12231)
++++ b/posix/fnmatch.c	(revision 16211)
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007,2010
++/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007,2010,2011
+ 	Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -379,6 +379,11 @@
+ 	       XXX Do we have to set `errno' to something which mbsrtows hasn't
+ 	       already done?  */
+ 	    return -1;
++	  if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0))
++	    {
++	      __set_errno (ENOMEM);
++	      return -2;
++	    }
+ 	  wpattern_malloc = wpattern
+ 	    = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
+ 	  assert (mbsinit (&ps));
+@@ -423,6 +428,12 @@
+ 	       XXX Do we have to set `errno' to something which mbsrtows hasn't
+ 	       already done?  */
+ 	    goto free_return;
++	  if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0))
++	    {
++	      free (wpattern_malloc);
++	      __set_errno (ENOMEM);
++	      return -2;
++	    }
+ 
+ 	  wstring_malloc = wstring
+ 	    = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
+--- a/stdio-common/printf_fp.c	(revision 12231)
++++ b/stdio-common/printf_fp.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Floating point output for `printf'.
+-   Copyright (C) 1995-2003, 2006, 2007, 2008 Free Software Foundation, Inc.
++   Copyright (C) 1995-2003, 2006-2008, 2011 Free Software Foundation, Inc.
+ 
+    This file is part of the GNU C Library.
+    Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+@@ -906,7 +906,9 @@
+ 	/* Guess the number of groups we will make, and thus how
+ 	   many spaces we need for separator characters.  */
+ 	ngroups = __guess_grouping (intdig_max, grouping);
+-	chars_needed += ngroups;
++	/* Allocate one more character in case rounding increases the
++	   number of groups.  */
++	chars_needed += ngroups + 1;
+       }
+ 
+     /* Allocate buffer for output.  We need two more because while rounding
+@@ -1110,10 +1112,17 @@
+       --wcp;
+ 
+     if (grouping)
+-      /* Add in separator characters, overwriting the same buffer.  */
+-      wcp = group_number (wstartp, wcp, intdig_no, grouping, thousands_sepwc,
+-			  ngroups);
++      {
++	/* Rounding might have changed the number of groups.  We allocated
++	   enough memory but we need here the correct number of groups.  */
++	if (intdig_no != intdig_max)
++	  ngroups = __guess_grouping (intdig_no, grouping);
+ 
++	/* Add in separator characters, overwriting the same buffer.  */
++	wcp = group_number (wstartp, wcp, intdig_no, grouping, thousands_sepwc,
++			    ngroups);
++      }
++
+     /* Write the exponent if it is needed.  */
+     if (type != 'f')
+       {
+@@ -1232,7 +1241,7 @@
+ 
+       tmpptr = buffer;
+       if (__builtin_expect (info->i18n, 0))
+-        {
++	{
+ #ifdef COMPILE_WPRINTF
+ 	  wstartp = _i18n_number_rewrite (wstartp, wcp,
+ 					  wbuffer + wbuffer_to_alloc);
+@@ -1246,7 +1255,7 @@
+ 	  assert ((uintptr_t) buffer <= (uintptr_t) tmpptr);
+ 	  assert ((uintptr_t) tmpptr < (uintptr_t) buffer_end);
+ #endif
+-        }
++	}
+ 
+       PRINT (tmpptr, wstartp, wide ? wcp - wstartp : cp - tmpptr);
+ 
+--- a/stdio-common/tst-grouping.c	(revision 0)
++++ b/stdio-common/tst-grouping.c	(revision 16211)
+@@ -0,0 +1,83 @@
++/* BZ 12394, test by Bruno Haible.  */
++#include <locale.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++
++static int
++do_test (void)
++{
++  char buf1[1000];
++  char buf2[1000];
++  int result = 0;
++
++  if (setlocale (LC_NUMERIC, "de_DE.UTF-8") == NULL)
++    return 1;
++
++  sprintf (buf1, "%'.2f",  999.996);
++  sprintf (buf2, "%'.2f", 1000.004);
++  printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
++  if (strcmp (buf1, buf2) != 0)
++    result |= 2;
++
++  sprintf (buf1, "%'.2f",  999999.996);
++  sprintf (buf2, "%'.2f", 1000000.004);
++  printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
++  if (strcmp (buf1, buf2) != 0)
++    result |= 2;
++
++  sprintf (buf1, "%'.2f",  999999999.996);
++  sprintf (buf2, "%'.2f", 1000000000.004);
++  printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
++  if (strcmp (buf1, buf2) != 0)
++    result |= 2;
++
++  sprintf (buf1, "%'.2f",  999999999999.996);
++  sprintf (buf2, "%'.2f", 1000000000000.004);
++  printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
++  if (strcmp (buf1, buf2) != 0)
++    result |= 2;
++
++  sprintf (buf1, "%'.2f",  999999999999999.996);
++  sprintf (buf2, "%'.2f", 1000000000000000.004);
++  printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
++  if (strcmp (buf1, buf2) != 0)
++    result |= 2;
++
++  sprintf (buf1, "%'.5g",  999.996);
++  sprintf (buf2, "%'.5g", 1000.004);
++  printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
++  if (strcmp (buf1, buf2) != 0)
++    result |= 4;
++
++  sprintf (buf1, "%'.4g",  9999.996);
++  sprintf (buf2, "%'.4g", 10000.004);
++  printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
++  if (strcmp (buf1, buf2) != 0)
++    result |= 8;
++
++  sprintf (buf1, "%'.5g",  99999.996);
++  sprintf (buf2, "%'.5g", 100000.004);
++  printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
++  if (strcmp (buf1, buf2) != 0)
++    result |= 8;
++
++  sprintf (buf1, "%'.6g",  999999.996);
++  sprintf (buf2, "%'.6g", 1000000.004);
++  printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
++  if (strcmp (buf1, buf2) != 0)
++    result |= 8;
++
++  sprintf (buf1, "%'.7g",  9999999.996);
++  sprintf (buf2, "%'.7g", 10000000.004);
++  printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
++  if (strcmp (buf1, buf2) != 0)
++    result |= 8;
++
++  return result;
++}
++
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+--- a/stdio-common/_i18n_number.h	(revision 12231)
++++ b/stdio-common/_i18n_number.h	(revision 16211)
+@@ -33,8 +33,8 @@
+ # define decimal NULL
+ # define thousands NULL
+ #else
+-  char decimal[MB_LEN_MAX];
+-  char thousands[MB_LEN_MAX];
++  char decimal[MB_LEN_MAX + 1];
++  char thousands[MB_LEN_MAX + 1];
+ #endif
+ 
+   /* "to_outpunct" is a map from ASCII decimal point and thousands-sep
+@@ -50,13 +50,19 @@
+       mbstate_t state;
+       memset (&state, '\0', sizeof (state));
+ 
+-      if (__wcrtomb (decimal, wdecimal, &state) == (size_t) -1)
++      size_t n = __wcrtomb (decimal, wdecimal, &state);
++      if (n == (size_t) -1)
+ 	memcpy (decimal, ".", 2);
++      else
++	decimal[n] = '\0';
+ 
+       memset (&state, '\0', sizeof (state));
+ 
+-      if (__wcrtomb (thousands, wthousands, &state) == (size_t) -1)
++      n = __wcrtomb (thousands, wthousands, &state);
++      if (n == (size_t) -1)
+ 	memcpy (thousands, ",", 2);
++      else
++	thousands[n] = '\0';
+     }
+ #endif
+ 
+--- a/stdio-common/bug23.c	(revision 0)
++++ b/stdio-common/bug23.c	(revision 16211)
+@@ -0,0 +1,21 @@
++#include <stdio.h>
++#include <string.h>
++
++static char buf[32768];
++static const char expected[] = "\
++\n\
++a\n\
++abbcd55%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
++
++static int
++do_test (void)
++{
++  snprintf (buf, sizeof (buf),
++	    "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
++	    "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
++	    "a", "b", "c", "d", 5);
++  return strcmp (buf, expected) != 0;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+--- a/stdio-common/Makefile	(revision 12231)
++++ b/stdio-common/Makefile	(revision 16211)
+@@ -1,4 +1,4 @@
+-# Copyright (C) 1991-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++# Copyright (C) 1991-2009, 2011 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
+@@ -68,9 +68,9 @@
+ 	 tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
+ 	 tst-fwrite bug16 bug17 tst-sprintf2 bug18 \
+ 	 bug19 tst-popen2 scanf14 scanf15 bug21 bug22 scanf16 scanf17 \
+-	 tst-setvbuf1
++	 tst-setvbuf1 bug23
+ tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+-      += tst-sscanf tst-swprintf bug15 test-vfprintf bug14 scanf13
++      += tst-sscanf tst-swprintf bug15 test-vfprintf bug14 scanf13 tst-grouping
+ tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
+       += tst-perror bug19a bug20
+ tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
+@@ -142,6 +142,7 @@
+ scanf13-ENV = LOCPATH=$(common-objpfx)localedata
+ bug14-ENV = LOCPATH=$(common-objpfx)localedata
+ bug15-ENV = LOCPATH=$(common-objpfx)localedata
++tst-grouping-ENV = LOCPATH=$(common-objpfx)localedata
+ 
+ ifneq (,$(filter %REENTRANT, $(defines)))
+ CPPFLAGS += -D_IO_MTSAFE_IO
+--- a/stdio-common/vfprintf.c	(revision 12231)
++++ b/stdio-common/vfprintf.c	(revision 16211)
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1991-2008, 2009   Free Software Foundation, Inc.
++/* Copyright (C) 1991-2008, 2009, 2011   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
+@@ -1699,7 +1699,8 @@
+ 	  {
+ 	    /* Extend the array of format specifiers.  */
+ 	    struct printf_spec *old = specs;
+-	    specs = extend_alloca (specs, nspecs_max, 2 * nspecs_max);
++	    specs = extend_alloca (specs, nspecs_max,
++				   2 * nspecs_max * sizeof (*specs));
+ 
+ 	    /* Copy the old array's elements to the new space.  */
+ 	    memmove (specs, old, nspecs * sizeof (struct printf_spec));
+--- a/stdio-common/printf-parsemb.c	(revision 12231)
++++ b/stdio-common/printf-parsemb.c	(revision 16211)
+@@ -295,9 +295,9 @@
+       /* We don't try to get the types for all arguments if the format
+ 	 uses more than one.  The normal case is covered though.  If
+ 	 the call returns -1 we continue with the normal specifiers.  */
+-      || (spec->ndata_args = (*__printf_arginfo_table[spec->info.spec])
+-	  (&spec->info, 1, &spec->data_arg_type,
+-	   &spec->size)) < 0)
++      || (int) (spec->ndata_args = (*__printf_arginfo_table[spec->info.spec])
++				   (&spec->info, 1, &spec->data_arg_type,
++				    &spec->size)) < 0)
+     {
+       /* Find the data argument types of a built-in spec.  */
+       spec->ndata_args = 1;
+--- a/resolv/res_debug.c	(revision 12231)
++++ b/resolv/res_debug.c	(revision 16211)
+@@ -189,7 +189,7 @@
+ 						buf = malloc(buflen += 1024);
+ 					if (buf == NULL) {
+ 						fprintf(file,
+-				              ";; memory allocation failure\n");
++					      ";; memory allocation failure\n");
+ 					      return;
+ 					}
+ 					continue;
+@@ -356,7 +356,7 @@
+ 	{C_HS,		"HESIOD"},
+ 	{C_ANY,		"ANY"},
+ 	{C_NONE,	"NONE"},
+-	{C_IN, 		(char *)0}
++	{C_IN,		(char *)0}
+ };
+ libresolv_hidden_data_def (__p_class_syms)
+ 
+@@ -588,6 +588,7 @@
+ 	case RES_USEBSTRING:	return "ip6-bytstring";
+ 	case RES_USE_EDNS0:	return "edns0";
+ 	case RES_USE_DNSSEC:	return "dnssec";
++	case RES_NOTLDQUERY:	return "no-tld-query";
+ 				/* XXX nonreentrant */
+ 	default:		sprintf(nbuf, "?0x%lx?", (u_long)option);
+ 				return (nbuf);
+--- a/resolv/netdb.h	(revision 12231)
++++ b/resolv/netdb.h	(revision 16211)
+@@ -1,4 +1,4 @@
+-  /* Copyright (C) 1996-2002, 2003, 2004, 2009 Free Software Foundation, Inc.
++  /* Copyright (C) 1996-2004, 2009, 2011 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
+@@ -677,7 +677,7 @@
+ extern int getnameinfo (__const struct sockaddr *__restrict __sa,
+ 			socklen_t __salen, char *__restrict __host,
+ 			socklen_t __hostlen, char *__restrict __serv,
+-			socklen_t __servlen, unsigned int __flags);
++			socklen_t __servlen, int __flags);
+ #endif	/* POSIX */
+ 
+ #ifdef __USE_GNU
+--- a/resolv/res_init.c	(revision 12231)
++++ b/resolv/res_init.c	(revision 16211)
+@@ -545,6 +545,11 @@
+ 		} else if (!strncmp(cp, "single-request",
+ 				    sizeof("single-request") - 1)) {
+ 			statp->options |= RES_SNGLKUP;
++		} else if (!strncmp(cp, "no_tld_query",
++				    sizeof("no_tld_query") - 1) ||
++			   !strncmp(cp, "no-tld-query",
++				    sizeof("no-tld-query") - 1)) {
++			statp->options |= RES_NOTLDQUERY;
+ 		} else {
+ 			/* XXX - print a warning here? */
+ 		}
+--- a/resolv/res_query.c	(revision 12231)
++++ b/resolv/res_query.c	(revision 16211)
+@@ -123,7 +123,7 @@
+ {
+ 	HEADER *hp = (HEADER *) answer;
+ 	int n, use_malloc = 0;
+-        u_int oflags = statp->_flags;
++	u_int oflags = statp->_flags;
+ 
+ 	size_t bufsize = (type == T_UNSPEC ? 2 : 1) * QUERYSIZE;
+ 	u_char *buf = alloca (bufsize);
+@@ -210,7 +210,7 @@
+ 			if (statp->options & RES_DEBUG)
+ 				printf(";; res_nquery: retry without EDNS0\n");
+ #endif
+-                        goto again;
++			goto again;
+ 		}
+ #ifdef DEBUG
+ 		if (statp->options & RES_DEBUG)
+@@ -344,6 +344,7 @@
+ 	int trailing_dot, ret, saved_herrno;
+ 	int got_nodata = 0, got_servfail = 0, root_on_list = 0;
+ 	int tried_as_is = 0;
++	int searched = 0;
+ 
+ 	__set_errno (0);
+ 	RES_SET_H_ERRNO(statp, HOST_NOT_FOUND);  /* True if we never query. */
+@@ -406,6 +407,7 @@
+ 		for (domain = (const char * const *)statp->dnsrch;
+ 		     *domain && !done;
+ 		     domain++) {
++			searched = 1;
+ 
+ 			if (domain[0][0] == '\0' ||
+ 			    (domain[0][0] == '.' && domain[0][1] == '\0'))
+@@ -477,11 +479,11 @@
+ 	}
+ 
+ 	/*
+-	 * If the name has any dots at all, and no earlier 'as-is' query
+-	 * for the name, and "." is not on the search list, then try an as-is
+-	 * query now.
++	 * f the query has not already been tried as is then try it
++	 * unless RES_NOTLDQUERY is set and there were no dots.
+ 	 */
+-	if (dots && !(tried_as_is || root_on_list)) {
++	if ((dots || !searched || (statp->options & RES_NOTLDQUERY) == 0)
++	    && !(tried_as_is || root_on_list)) {
+ 		ret = __libc_res_nquerydomain(statp, name, NULL, class, type,
+ 					      answer, anslen, answerp,
+ 					      answerp2, nanswerp2, resplen2);
+--- a/resolv/resolv.h	(revision 12231)
++++ b/resolv/resolv.h	(revision 16211)
+@@ -102,7 +102,7 @@
+ # define RES_MAXTIME		65535	/* Infinity, in milliseconds. */
+ 
+ struct __res_state {
+-	int	retrans;	 	/* retransmition time interval */
++	int	retrans;		/* retransmition time interval */
+ 	int	retry;			/* number of times to retransmit */
+ 	u_long	options;		/* option flags - see below. */
+ 	int	nscount;		/* number of name servers */
+@@ -219,6 +219,8 @@
+ #define RES_SNGLKUPREOP	0x00400000	/* -"-, but open new socket for each
+ 					   request */
+ #define RES_USE_DNSSEC	0x00800000	/* use DNSSEC using OK bit in OPT */
++#define RES_NOTLDQUERY	0x01000000	/* Do not look up unqualified name
++					   as a TLD.  */
+ 
+ #define RES_DEFAULT	(RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT)
+ 
+--- a/resolv/nss_dns/dns-host.c	(revision 12231)
++++ b/resolv/nss_dns/dns-host.c	(revision 16211)
+@@ -599,7 +599,6 @@
+   int (*name_ok) (const char *);
+   u_char packtmp[NS_MAXCDNAME];
+   int have_to_map = 0;
+-  int32_t ttl = 0;
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+   buffer += pad;
+   if (__builtin_expect (buflen < sizeof (struct host_data) + pad, 0))
+@@ -733,7 +732,7 @@
+       cp += INT16SZ;			/* type */
+       class = __ns_get16 (cp);
+       cp += INT16SZ;			/* class */
+-      ttl = __ns_get32 (cp);
++      int32_t ttl = __ns_get32 (cp);
+       cp += INT32SZ;			/* TTL */
+       n = __ns_get16 (cp);
+       cp += INT16SZ;			/* len */
+@@ -907,7 +906,7 @@
+ 	    {
+ 	      register int nn;
+ 
+-	      if (ttlp != NULL && ttl != 0)
++	      if (ttlp != NULL)
+ 		*ttlp = ttl;
+ 	      if (canonp != NULL)
+ 		*canonp = bp;
+@@ -1163,7 +1162,7 @@
+ 
+       if (*firstp)
+ 	{
+-	  if (ttl != 0 && ttlp != NULL)
++	  if (ttlp != NULL)
+ 	    *ttlp = ttl;
+ 
+ 	  (*pat)->name = canon ?: h_name;
+--- a/conform/data/netdb.h-data	(revision 12231)
++++ b/conform/data/netdb.h-data	(revision 16211)
+@@ -87,7 +87,7 @@
+ function {struct hostent*} gethostbyaddr (const void*, socklen_t, int)
+ function {struct hostent*} gethostbyname (const char*)
+ function {struct hostent*} gethostent (void)
+-function int getnameinfo (const struct sockaddr*, socklen_t, char*, socklen_t, char*, socklen_t, unsigned)
++function int getnameinfo (const struct sockaddr*, socklen_t, char*, socklen_t, char*, socklen_t, int)
+ function {struct netent*} getnetbyaddr (uint32_t, int)
+ function {struct netent*} getnetbyname (const char*)
+ function {struct netent*} getnetent (void)
+--- a/elf/dl-tls.c	(revision 12231)
++++ b/elf/dl-tls.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Thread-local storage handling in the ELF dynamic linker.  Generic version.
+-   Copyright (C) 2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc.
++   Copyright (C) 2002-2006,2008,2011 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,10 +33,7 @@
+    to allow dynamic loading of modules defining IE-model TLS data.  */
+ #define TLS_STATIC_SURPLUS	64 + DL_NNS * 100
+ 
+-/* Value used for dtv entries for which the allocation is delayed.  */
+-#define TLS_DTV_UNALLOCATED	((void *) -1l)
+ 
+-
+ /* Out-of-memory handler.  */
+ #ifdef SHARED
+ static void
+--- a/elf/dl-deps.c	(revision 12231)
++++ b/elf/dl-deps.c	(revision 16211)
+@@ -491,6 +491,10 @@
+   if (errno == 0 && errno_saved != 0)
+     __set_errno (errno_saved);
+ 
++  if (errno_reason)
++    _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
++		      NULL, errstring);
++
+   struct link_map **old_l_initfini = NULL;
+   if (map->l_initfini != NULL && map->l_type == lt_loaded)
+     {
+@@ -666,8 +670,4 @@
+     }
+   if (old_l_initfini != NULL)
+     _dl_scope_free (old_l_initfini);
+-
+-  if (errno_reason)
+-    _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
+-		      NULL, errstring);
+ }
+--- a/elf/dl-dst.h	(revision 12231)
++++ b/elf/dl-dst.h	(revision 16211)
+@@ -1,6 +1,5 @@
+ /* Handling of dynamic sring tokens.
+-   Copyright (C) 1999,2001,2002,2003,2004,2006,2007
+-   Free Software Foundation, Inc.
++   Copyright (C) 1999,2001-2004,2006,2007,2011 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
+@@ -18,6 +17,8 @@
+    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+    02111-1307 USA.  */
+ 
++#include "trusted-dirs.h"
++
+ /* Determine the number of DST elements in the name.  Only if IS_PATH is
+    nonzero paths are recognized (i.e., multiple, ':' separated filenames).  */
+ #define DL_DST_COUNT(name, is_path) \
+@@ -31,6 +32,11 @@
+     __cnt; })
+ 
+ 
++#ifdef SHARED
++# define IS_RTLD(l) (l) == &GL(dl_rtld_map)
++#else
++# define IS_RTLD(l) 0
++#endif
+ /* Guess from the number of DSTs the length of the result string.  */
+ #define DL_DST_REQUIRED(l, name, len, cnt) \
+   ({									      \
+@@ -39,28 +45,32 @@
+ 									      \
+     if (__cnt > 0)							      \
+       {									      \
+-	size_t origin_len;						      \
++	size_t dst_len;							      \
+ 	/* Now we make a guess how many extra characters on top of the	      \
+ 	   length of S we need to represent the result.  We know that	      \
+ 	   we have CNT replacements.  Each at most can use		      \
+-	     MAX (strlen (ORIGIN), strlen (_dl_platform))		      \
+-	   minus 7 (which is the length of "$ORIGIN").			      \
++	     MAX (MAX (strlen (ORIGIN), strlen (_dl_platform)),		      \
++		  strlen (DL_DST_LIB))					      \
++	   minus 4 (which is the length of "$LIB").			      \
+ 									      \
+ 	   First get the origin string if it is not available yet.	      \
+-	   This can only happen for the map of the executable.  */	      \
++	   This can only happen for the map of the executable or, when	      \
++	   auditing, in ld.so.  */					      \
+ 	DL_DST_REQ_STATIC (l)						      \
+ 	if ((l)->l_origin == NULL)					      \
+ 	  {								      \
+-	    assert ((l)->l_name[0] == '\0');				      \
++	    assert ((l)->l_name[0] == '\0' || IS_RTLD (l));		      \
+ 	    (l)->l_origin = _dl_get_origin ();				      \
+-	    origin_len = ((l)->l_origin && (l)->l_origin != (char *) -1	      \
++	    dst_len = ((l)->l_origin && (l)->l_origin != (char *) -1	      \
+ 			  ? strlen ((l)->l_origin) : 0);		      \
+ 	  }								      \
+ 	else								      \
+-	  origin_len = (l)->l_origin == (char *) -1			      \
++	  dst_len = (l)->l_origin == (char *) -1			      \
+ 	    ? 0 : strlen ((l)->l_origin);				      \
+-									      \
+-	__len += __cnt * (MAX (origin_len, GLRO(dl_platformlen)) - 7);	      \
++	dst_len = MAX (MAX (dst_len, GLRO(dl_platformlen)),		      \
++		       strlen (DL_DST_LIB));				      \
++	if (dst_len > 4)						      \
++	  __len += __cnt * (dst_len - 4);				      \
+       }									      \
+ 									      \
+     __len; })
+@@ -72,7 +82,7 @@
+   if ((l) == NULL)							      \
+     {									      \
+       const char *origin = _dl_get_origin ();				      \
+-      origin_len = (origin && origin != (char *) -1 ? strlen (origin) : 0);   \
++      dst_len = (origin && origin != (char *) -1 ? strlen (origin) : 0);      \
+     }									      \
+   else
+ #endif
+--- a/elf/dl-runtime.c	(revision 12231)
++++ b/elf/dl-runtime.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* On-demand PLT fixup for shared objects.
+-   Copyright (C) 1995-2009, 2010 Free Software Foundation, Inc.
++   Copyright (C) 1995-2009, 2010, 2011 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
+@@ -446,6 +446,7 @@
+ 
+   /* Set up the sym parameter.  */
+   ElfW(Sym) sym = *defsym;
++  sym.st_value = DL_FIXUP_VALUE_ADDR (reloc_result->addr);
+ 
+   /* Get the symbol name.  */
+   const char *strtab = (const void *) D_PTR (reloc_result->bound,
+--- a/elf/dl-load.c	(revision 12231)
++++ b/elf/dl-load.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Map in a shared object's segments from the file.
+-   Copyright (C) 1995-2005, 2006, 2007, 2009 Free Software Foundation, Inc.
++   Copyright (C) 1995-2007, 2009, 2011 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
+@@ -168,6 +168,87 @@
+ }
+ 
+ 
++static bool
++is_trusted_path (const char *path, size_t len)
++{
++  const char *trun = system_dirs;
++
++  for (size_t idx = 0; idx < nsystem_dirs_len; ++idx)
++    {
++      if (len == system_dirs_len[idx] && memcmp (trun, path, len) == 0)
++	/* Found it.  */
++	return true;
++
++      trun += system_dirs_len[idx] + 1;
++    }
++
++  return false;
++}
++
++
++static bool
++is_trusted_path_normalize (const char *path, size_t len)
++{
++  if (len == 0)
++    return false;
++
++  if (*path == ':')
++    {
++      ++path;
++      --len;
++    }
++
++  char *npath = (char *) alloca (len + 2);
++  char *wnp = npath;
++  while (*path != '\0')
++    {
++      if (path[0] == '/')
++	{
++	  if (path[1] == '.')
++	    {
++	      if (path[2] == '.' && (path[3] == '/' || path[3] == '\0'))
++		{
++		  while (wnp > npath && *--wnp != '/')
++		    ;
++		  path += 3;
++		  continue;
++		}
++	      else if (path[2] == '/' || path[2] == '\0')
++		{
++		  path += 2;
++		  continue;
++		}
++	    }
++
++	  if (wnp > npath && wnp[-1] == '/')
++	    {
++	      ++path;
++	      continue;
++	    }
++	}
++
++      *wnp++ = *path++;
++    }
++
++  if (wnp == npath || wnp[-1] != '/')
++    *wnp++ = '/';
++
++  const char *trun = system_dirs;
++
++  for (size_t idx = 0; idx < nsystem_dirs_len; ++idx)
++    {
++      if (wnp - npath >= system_dirs_len[idx]
++	  && memcmp (trun, npath, system_dirs_len[idx]) == 0)
++	/* Found it.  */
++	return true;
++
++      trun += system_dirs_len[idx] + 1;
++    }
++
++  return false;
++}
++
++
+ static size_t
+ is_dst (const char *start, const char *name, const char *str,
+ 	int is_path, int secure)
+@@ -200,7 +281,8 @@
+     return 0;
+ 
+   if (__builtin_expect (secure, 0)
+-      && ((name[len] != '\0' && (!is_path || name[len] != ':'))
++      && ((name[len] != '\0' && name[len] != '/'
++	   && (!is_path || name[len] != ':'))
+ 	  || (name != start + 1 && (!is_path || name[-2] != ':'))))
+     return 0;
+ 
+@@ -240,13 +322,14 @@
+ 		    int is_path)
+ {
+   const char *const start = name;
+-  char *last_elem, *wp;
+ 
+   /* Now fill the result path.  While copying over the string we keep
+      track of the start of the last path element.  When we come accross
+      a DST we copy over the value or (if the value is not available)
+      leave the entire path element out.  */
+-  last_elem = wp = result;
++  char *wp = result;
++  char *last_elem = result;
++  bool check_for_trusted = false;
+ 
+   do
+     {
+@@ -265,6 +348,9 @@
+ 	      else
+ #endif
+ 		repl = l->l_origin;
++
++	      check_for_trusted = (INTUSE(__libc_enable_secure)
++				   && l->l_type == lt_executable);
+ 	    }
+ 	  else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0)
+ 	    repl = GLRO(dl_platform);
+@@ -284,6 +370,10 @@
+ 	      name += len;
+ 	      while (*name != '\0' && (!is_path || *name != ':'))
+ 		++name;
++	      /* Also skip following colon if this is the first rpath
++		 element, but keep an empty element at the end.  */
++	      if (wp == result && is_path && *name == ':' && name[1] != '\0')
++		++name;
+ 	    }
+ 	  else
+ 	    /* No DST we recognize.  */
+@@ -293,11 +383,28 @@
+ 	{
+ 	  *wp++ = *name++;
+ 	  if (is_path && *name == ':')
+-	    last_elem = wp;
++	    {
++	      /* In SUID/SGID programs, after $ORIGIN expansion the
++		 normalized path must be rooted in one of the trusted
++		 directories.  */
++	      if (__builtin_expect (check_for_trusted, false)
++		  && !is_trusted_path_normalize (last_elem, wp - last_elem))
++		wp = last_elem;
++	      else
++		last_elem = wp;
++
++	      check_for_trusted = false;
++	    }
+ 	}
+     }
+   while (*name != '\0');
+ 
++  /* In SUID/SGID programs, after $ORIGIN expansion the normalized
++     path must be rooted in one of the trusted directories.  */
++  if (__builtin_expect (check_for_trusted, false)
++      && !is_trusted_path_normalize (last_elem, wp - last_elem))
++    wp = last_elem;
++
+   *wp = '\0';
+ 
+   return result;
+@@ -310,7 +417,7 @@
+    belonging to the map is loaded.  In this case the path element
+    containing $ORIGIN is left out.  */
+ static char *
+-expand_dynamic_string_token (struct link_map *l, const char *s)
++expand_dynamic_string_token (struct link_map *l, const char *s, int is_path)
+ {
+   /* We make two runs over the string.  First we determine how large the
+      resulting string is and then we copy it over.  Since this is now
+@@ -321,7 +428,7 @@
+   char *result;
+ 
+   /* Determine the number of DST elements.  */
+-  cnt = DL_DST_COUNT (s, 1);
++  cnt = DL_DST_COUNT (s, is_path);
+ 
+   /* If we do not have to replace anything simply copy the string.  */
+   if (__builtin_expect (cnt, 0) == 0)
+@@ -335,7 +442,7 @@
+   if (result == NULL)
+     return NULL;
+ 
+-  return _dl_dst_substitute (l, s, result, 1);
++  return _dl_dst_substitute (l, s, result, is_path);
+ }
+ 
+ 
+@@ -407,34 +514,9 @@
+ 	cp[len++] = '/';
+ 
+       /* Make sure we don't use untrusted directories if we run SUID.  */
+-      if (__builtin_expect (check_trusted, 0))
+-	{
+-	  const char *trun = system_dirs;
+-	  size_t idx;
+-	  int unsecure = 1;
++      if (__builtin_expect (check_trusted, 0) && !is_trusted_path (cp, len))
++	continue;
+ 
+-	  /* All trusted directories must be complete names.  */
+-	  if (cp[0] == '/')
+-	    {
+-	      for (idx = 0; idx < nsystem_dirs_len; ++idx)
+-		{
+-		  if (len == system_dirs_len[idx]
+-		      && memcmp (trun, cp, len) == 0)
+-		    {
+-		      /* Found it.  */
+-		      unsecure = 0;
+-		      break;
+-		    }
+-
+-		  trun += system_dirs_len[idx] + 1;
+-		}
+-	    }
+-
+-	  if (unsecure)
+-	    /* Simply drop this directory.  */
+-	    continue;
+-	}
+-
+       /* See if this directory is already known.  */
+       for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next)
+ 	if (dirp->dirnamelen == len && memcmp (cp, dirp->dirname, len) == 0)
+@@ -551,13 +633,21 @@
+ 
+   /* Make a writable copy.  At the same time expand possible dynamic
+      string tokens.  */
+-  copy = expand_dynamic_string_token (l, rpath);
++  copy = expand_dynamic_string_token (l, rpath, 1);
+   if (copy == NULL)
+     {
+       errstring = N_("cannot create RUNPATH/RPATH copy");
+       goto signal_error;
+     }
+ 
++  /* Ignore empty rpaths.  */
++  if (*copy == 0)
++    {
++      free (copy);
++      sps->dirs = (struct r_search_path_elem **) -1;
++      return false;
++    }
++
+   /* Count the number of necessary elements in the result array.  */
+   nelems = 0;
+   for (cp = copy; *cp != '\0'; ++cp)
+@@ -2100,7 +2190,9 @@
+ 	    {
+ #ifdef SHARED
+ 	      // XXX Correct to unconditionally default to namespace 0?
+-	      l = loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded;
++	      l = (loader
++		   ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded
++		   ?: &GL(dl_rtld_map));
+ #else
+ 	      l = loader;
+ #endif
+@@ -2166,7 +2258,7 @@
+     {
+       /* The path may contain dynamic string tokens.  */
+       realname = (loader
+-		  ? expand_dynamic_string_token (loader, name)
++		  ? expand_dynamic_string_token (loader, name, 0)
+ 		  : local_strdup (name));
+       if (realname == NULL)
+ 	fd = -1;
+--- a/elf/ldconfig.c	(revision 12231)
++++ b/elf/ldconfig.c	(revision 16211)
+@@ -387,15 +387,18 @@
+     }
+ 
+   /* Canonify path: for now only remove leading and trailing
+-     whitespace and the trailing slashes slashes.  */
+-  i = strlen (entry->path) - 1;
++     whitespace and the trailing slashes.  */
++  i = strlen (entry->path);
+ 
+-  while (isspace (entry->path[i]) && i > 0)
+-    entry->path[i--] = '\0';
++  while (i > 0 && isspace (entry->path[i - 1]))
++    entry->path[--i] = '\0';
+ 
+-  while (entry->path[i] == '/' && i > 0)
+-    entry->path[i--] = '\0';
++  while (i > 0 && entry->path[i - 1] == '/')
++    entry->path[--i] = '\0';
+ 
++  if (i == 0)
++    return;
++
+   char *path = entry->path;
+   if (opt_chroot)
+     path = chroot_canon (opt_chroot, path);
+--- a/elf/dl-lookup.c	(revision 12231)
++++ b/elf/dl-lookup.c	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Look up a symbol in the loaded objects.
+-   Copyright (C) 1995-2005, 2006, 2007, 2009 Free Software Foundation, Inc.
++   Copyright (C) 1995-2007, 2009, 2011 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
+@@ -312,39 +312,21 @@
+ 		 definition we have to use it.  */
+ 	      void enter (struct unique_sym *table, size_t size,
+ 			  unsigned int hash, const char *name,
+-			  const ElfW(Sym) *sym, struct link_map *map)
++			  const ElfW(Sym) *sym, const struct link_map *map)
+ 	      {
+ 		size_t idx = hash % size;
+ 		size_t hash2 = 1 + hash % (size - 2);
+-		while (1)
++		while (table[idx].name != NULL)
+ 		  {
+-		    if (table[idx].name == NULL)
+-		      {
+-			table[idx].hashval = hash;
+-			table[idx].name = name;
+-			if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
+-			  {
+-			    table[idx].sym = ref;
+-			    table[idx].map = undef_map;
+-			  }
+-			else
+-			  {
+-			    table[idx].sym = sym;
+-			    table[idx].map = map;
+-
+-			    if (map->l_type == lt_loaded)
+-			      /* Make sure we don't unload this object by
+-				 setting the appropriate flag.  */
+-			      map->l_flags_1 |= DF_1_NODELETE;
+-			  }
+-
+-			return;
+-		      }
+-
+ 		    idx += hash2;
+ 		    if (idx >= size)
+ 		      idx -= size;
+ 		  }
++
++		table[idx].hashval = hash;
++		table[idx].name = name;
++		table[idx].sym = sym;
++		table[idx].map = map;
+ 	      }
+ 
+ 	      struct unique_sym_table *tab
+@@ -363,8 +345,19 @@
+ 		      if (entries[idx].hashval == new_hash
+ 			  && strcmp (entries[idx].name, undef_name) == 0)
+ 			{
+-			  result->s = entries[idx].sym;
+-			  result->m = (struct link_map *) entries[idx].map;
++			  if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
++			    {
++			      /* We possibly have to initialize the central
++				 copy from the copy addressed through the
++				 relocation.  */
++			      result->s = sym;
++			      result->m = (struct link_map *) map;
++			    }
++			  else
++			    {
++			      result->s = entries[idx].sym;
++			      result->m = (struct link_map *) entries[idx].map;
++			    }
+ 			  __rtld_lock_unlock_recursive (tab->lock);
+ 			  return 1;
+ 			}
+@@ -425,8 +418,19 @@
+ 		  tab->free = free;
+ 		}
+ 
+-	      enter (entries, size, new_hash, strtab + sym->st_name, sym,
+-		     (struct link_map *) map);
++	      if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
++		enter (entries, size, new_hash, strtab + sym->st_name, ref,
++		       undef_map);
++	      else
++		{
++		  enter (entries, size, new_hash, strtab + sym->st_name, sym,
++			 map);
++
++		  if (map->l_type == lt_loaded)
++		    /* Make sure we don't unload this object by
++		       setting the appropriate flag.  */
++		    ((struct link_map *) map)->l_flags_1 |= DF_1_NODELETE;
++		}
+ 	      ++tab->n_elements;
+ 
+ 	      __rtld_lock_unlock_recursive (tab->lock);
+--- a/io/fcntl.h	(revision 12231)
++++ b/io/fcntl.h	(revision 16211)
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007, 2009
++/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007,2009,2010,2011
+ 	Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -64,6 +64,8 @@
+ # define AT_REMOVEDIR		0x200	/* Remove directory instead of
+ 					   unlinking file.  */
+ # define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
++# define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
++					   traversal.  */
+ # define AT_EACCESS		0x200	/* Test access permitted for
+ 					   effective IDs, not real IDs.  */
+ #endif
+--- a/ports/sysdeps/arm/sysdep.h	(revision 12231)
++++ b/ports/sysdeps/arm/sysdep.h	(revision 16211)
+@@ -18,6 +18,7 @@
+    02111-1307 USA.  */
+ 
+ #include <sysdeps/generic/sysdep.h>
++#include <features.h>
+ 
+ #if (!defined (__ARM_ARCH_2__) && !defined (__ARM_ARCH_3__) \
+      && !defined (__ARM_ARCH_3M__) && !defined (__ARM_ARCH_4__))
+@@ -89,10 +90,16 @@
+ 
+ /* If compiled for profiling, call `mcount' at the start of each function.  */
+ #ifdef	PROF
++#if __GNUC_PREREQ(4,4) && defined(__ARM_EABI__)
+ #define CALL_MCOUNT			\
+ 	str	lr,[sp, #-4]!	;	\
++	bl	PLTJMP(mcount)	;
++#else
++#define CALL_MCOUNT			\
++	str	lr,[sp, #-4]!	;	\
+ 	bl	PLTJMP(mcount)	;	\
+ 	ldr	lr, [sp], #4	;
++#endif
+ #else
+ #define CALL_MCOUNT		/* Do nothing.  */
+ #endif
+@@ -102,8 +109,12 @@
+    on this system, the asm identifier `syscall_error' intrudes on the
+    C name space.  Make sure we use an innocuous name.  */
+ #define	syscall_error	__syscall_error
++#if __GNUC_PREREQ(4,4) && defined(__ARM_EABI__)
++#define mcount		__gnu_mcount_nc
++#else
+ #define mcount		_mcount
+ #endif
++#endif
+ 
+ #if defined(__ARM_EABI__)
+ /* Tag_ABI_align8_preserved: This code preserves 8-byte
+--- a/ports/sysdeps/arm/elf/start.S	(revision 12231)
++++ b/ports/sysdeps/arm/elf/start.S	(revision 16211)
+@@ -134,6 +134,7 @@
+ 	bl abort
+ 
+ #ifdef SHARED
++	.align 2
+ .L_GOT:
+ 	.word _GLOBAL_OFFSET_TABLE_ - .L_GOT
+ 	.word __libc_csu_fini(GOT)
+--- a/ports/sysdeps/unix/sysv/linux/arm/bits/mman.h	(revision 12231)
++++ b/ports/sysdeps/unix/sysv/linux/arm/bits/mman.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Definitions for POSIX memory map interface.  Linux/ARM version.
+-   Copyright (C) 1997, 2000, 2003, 2005, 2006, 2009
++   Copyright (C) 1997, 2000, 2003, 2005, 2006, 2009, 2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -94,6 +94,8 @@
+ # define MADV_DOFORK	  11	/* Do inherit across fork.  */
+ # define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
++# define MADV_HUGEPAGE	  14	/* Worth backing with hugepages.  */
++# define MADV_NOHUGEPAGE  15	/* Not worth backing with hugepages.  */
+ # define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+ #endif
+ 
+--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/mman.h	(revision 12231)
++++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/mman.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Definitions for POSIX memory map interface.  Linux/m68k version.
+-   Copyright (C) 1997, 2000, 2003, 2005, 2008, 2009
++   Copyright (C) 1997, 2000, 2003, 2005, 2008, 2009, 2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -94,6 +94,8 @@
+ # define MADV_DOFORK	  11	/* Do inherit across fork.  */
+ # define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
++# define MADV_HUGEPAGE	  14	/* Worth backing with hugepages.  */
++# define MADV_NOHUGEPAGE  15	/* Not worth backing with hugepages.  */
+ # define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+ #endif
+ 
+--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw.c	(revision 0)
++++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw.c	(revision 16211)
+@@ -0,0 +1 @@
++#include <io/ftw.c>
+--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw64.c	(revision 0)
++++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw64.c	(revision 16211)
+@@ -0,0 +1 @@
++#include <io/ftw64.c>
+--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/statfs64.c	(revision 0)
++++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/statfs64.c	(revision 16211)
+@@ -0,0 +1 @@
++/* Empty.  */
+--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c	(revision 0)
++++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c	(revision 16211)
+@@ -0,0 +1 @@
++/* Empty.  */
+--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list	(revision 0)
++++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list	(revision 16211)
+@@ -0,0 +1,4 @@
++# File name	Caller	Syscall name	# args	Strong name	Weak names
++
++fstatfs		-	fstatfs		i:ip	__fstatfs	fstatfs fstatfs64 __fstatfs64
++statfs		-	statfs		i:sp	__statfs	statfs statfs64 __statfs64
+--- a/ports/sysdeps/unix/sysv/linux/mips/bits/mman.h	(revision 12231)
++++ b/ports/sysdeps/unix/sysv/linux/mips/bits/mman.h	(revision 16211)
+@@ -1,5 +1,5 @@
+ /* Definitions for POSIX memory map interface.  Linux/MIPS version.
+-   Copyright (C) 1997, 2000, 2003, 2004, 2005, 2006, 2009
++   Copyright (C) 1997, 2000, 2003, 2004, 2005, 2006, 2009, 2011
+    Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -96,6 +96,8 @@
+ # define MADV_DOFORK	  11	/* Do inherit across fork.  */
+ # define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
++# define MADV_HUGEPAGE	  14	/* Worth backing with hugepages.  */
++# define MADV_NOHUGEPAGE  15	/* Not worth backing with hugepages.  */
+ # define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+ #endif
+ 
+--- a/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h	(revision 12231)
++++ b/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h	(revision 16211)
+@@ -1,6 +1,6 @@
+ /* System-specific socket constants and types.  Linux/MIPS version.
+    Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006, 2007, 2008,
+-   2009 Free Software Foundation, Inc.
++   2009, 2010, 2011 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
+@@ -109,7 +109,9 @@
+ #define PF_ISDN		34	/* mISDN sockets.  */
+ #define PF_PHONET	35	/* Phonet sockets.  */
+ #define PF_IEEE802154	36	/* IEEE 802.15.4 sockets.  */
+-#define	PF_MAX		37	/* For now..  */
++#define PF_CAIF		37	/* CAIF sockets.  */
++#define PF_ALG		38	/* Algorithm sockets.  */
++#define	PF_MAX		39	/* For now..  */
+ 
+ /* Address families.  */
+ #define	AF_UNSPEC	PF_UNSPEC
+@@ -150,6 +152,8 @@
+ #define AF_ISDN		PF_ISDN
+ #define AF_PHONET	PF_PHONET
+ #define AF_IEEE802154	PF_IEEE802154
++#define AF_CAIF		PF_CAIF
++#define AF_ALG		PF_ALG
+ #define	AF_MAX		PF_MAX
+ 
+ /* Socket level values.  Others are defined in the appropriate headers.
+--- a/ports/ChangeLog.mips	(revision 12231)
++++ b/ports/ChangeLog.mips	(revision 16211)
+@@ -1,3 +1,26 @@
++2011-11-17  Joseph Myers  <joseph@codesourcery.com>
++
++	* sysdeps/unix/sysv/linux/mips/mips64/n64/ftw.c,
++	sysdeps/unix/sysv/linux/mips/mips64/n64/ftw64.c: New.
++
++2011-09-06  Joseph Myers  <joseph@codesourcery.com>
++
++	[BZ #13109]
++	* sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list (fstatfs)
++	(statfs): New.
++	* sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c,
++	sysdeps/unix/sysv/linux/mips/mips64/n64/statfs64.c: New.
++
++2011-01-25  Joseph Myers  <joseph@codesourcery.com>
++
++	* sysdeps/unix/sysv/linux/mips/bits/mman.h (MADV_HUGEPAGE,
++	MADV_NOHUGEPAGE): Define.
++
++2011-01-25  Joseph Myers  <joseph@codesourcery.com>
++
++	* sysdeps/unix/sysv/linux/mips/bits/socket.h (AF_CAIF, AF_ALG,
++	PF_CAIF, PF_ALG): Define.
++
+ 2009-12-16  Joseph Myers  <joseph@codesourcery.com>
+ 
+ 	* sysdeps/mips/dl-lookup.c: Update from generic version.
+--- a/ports/ChangeLog.arm	(revision 12231)
++++ b/ports/ChangeLog.arm	(revision 16211)
+@@ -1,3 +1,19 @@
++2011-06-30  Richard Sandiford  <richard.sandiford@linaro.org>
++
++	* sysdeps/arm/elf/start.S (_start): Align the constant pool to 4 bytes.
++
++2011-02-16  Manjunath Matti  <manjunath81@gmail.com>
++
++	* sysdeps/arm/sysdep.h (CALL_MCOUNT): Use __gnu_mcount_nc
++	interface for EABI with GCC 4.4 or later.
++	(mcount): Define to __gnu_mcount_nc for EABI with GCC 4.4 or
++	later.
++
++2011-01-25  Joseph Myers  <joseph@codesourcery.com>
++
++	* sysdeps/unix/sysv/linux/arm/bits/mman.h (MADV_HUGEPAGE,
++	MADV_NOHUGEPAGE): Define.
++
+ 2009-11-19  Joseph Myers  <joseph@codesourcery.com>
+ 
+ 	* sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_PSELECT,
+--- a/ports/ChangeLog.m68k	(revision 12231)
++++ b/ports/ChangeLog.m68k	(revision 16211)
+@@ -1,3 +1,8 @@
++2011-01-18  Andreas Schwab  <schwab@linux-m68k.org>
++
++	* sysdeps/unix/sysv/linux/m68k/bits/mman.h (MADV_HUGEPAGE)
++	(MADV_NOHUGEPAGE): Define.
++
+ 2009-11-17  Joseph Myers  <joseph@codesourcery.com>
+ 
+ 	[BZ #10972]
diff -Nru eglibc-2.11.2/elf/Makefile eglibc-2.11.3/elf/Makefile
--- eglibc-2.11.2/elf/Makefile	2010-03-22 21:19:13.000000000 +0000
+++ eglibc-2.11.3/elf/Makefile	2010-12-06 20:55:10.000000000 +0000
@@ -766,11 +766,11 @@
 $(objpfx)tst-tls9: $(libdl)
 $(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
 
-$(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so
+$(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so $(objpfx)tst-tlsmod7.so
 
-$(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so
+$(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so $(objpfx)tst-tlsmod9.so
 
-$(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so
+$(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so $(objpfx)tst-tlsmod11.so
 
 $(objpfx)tst-tls13: $(libdl)
 $(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so
diff -Nru eglibc-2.11.2/elf/dl-deps.c eglibc-2.11.3/elf/dl-deps.c
--- eglibc-2.11.2/elf/dl-deps.c	2007-10-08 15:18:44.000000000 +0000
+++ eglibc-2.11.3/elf/dl-deps.c	2010-11-07 12:16:06.000000000 +0000
@@ -62,7 +62,7 @@
 {
   struct openaux_args *args = (struct openaux_args *) a;
 
-  args->aux = _dl_map_object (args->map, args->name, 0,
+  args->aux = _dl_map_object (args->map, args->name,
 			      (args->map->l_type == lt_executable
 			       ? lt_library : args->map->l_type),
 			      args->trace_mode, args->open_mode,
diff -Nru eglibc-2.11.2/elf/dl-load.c eglibc-2.11.3/elf/dl-load.c
--- eglibc-2.11.2/elf/dl-load.c	2009-10-22 19:51:30.000000000 +0000
+++ eglibc-2.11.3/elf/dl-load.c	2010-12-06 20:55:10.000000000 +0000
@@ -801,19 +801,7 @@
   /* The file might already be closed.  */
   if (fd != -1)
     (void) __close (fd);
-  if (l != NULL)
-    {
-      /* Remove the stillborn object from the list and free it.  */
-      assert (l->l_next == NULL);
-      if (l->l_prev == NULL)
-	/* No other module loaded. This happens only in the static library,
-	   or in rtld under --verify.  */
-	GL(dl_ns)[l->l_ns]._ns_loaded = NULL;
-      else
-	l->l_prev->l_next = NULL;
-      --GL(dl_ns)[l->l_ns]._ns_nloaded;
-      free (l);
-    }
+  free (l);
   free (realname);
 
   if (r != NULL)
@@ -898,6 +886,9 @@
 	 never be unloaded.  */
       __close (fd);
 
+      /* Add the map for the mirrored object to the object list.  */
+      _dl_add_to_namespace_list (l, nsid);
+
       return l;
     }
 #endif
@@ -1492,6 +1483,9 @@
     add_name_to_object (l, ((const char *) D_PTR (l, l_info[DT_STRTAB])
 			    + l->l_info[DT_SONAME]->d_un.d_val));
 
+  /* Now that the object is fully initialized add it to the object list.  */
+  _dl_add_to_namespace_list (l, nsid);
+
 #ifdef SHARED
   /* Auditing checkpoint: we have a new object.  */
   if (__builtin_expect (GLRO(dl_naudit) > 0, 0)
@@ -1802,7 +1796,7 @@
    if MAY_FREE_DIRS is true.  */
 
 static int
-open_path (const char *name, size_t namelen, int preloaded,
+open_path (const char *name, size_t namelen, int secure,
 	   struct r_search_path_struct *sps, char **realname,
 	   struct filebuf *fbp, struct link_map *loader, int whatcode,
 	   bool *found_other_class)
@@ -1884,7 +1878,7 @@
 	  /* Remember whether we found any existing directory.  */
 	  here_any |= this_dir->status[cnt] != nonexisting;
 
-	  if (fd != -1 && __builtin_expect (preloaded, 0)
+	  if (fd != -1 && __builtin_expect (secure, 0)
 	      && INTUSE(__libc_enable_secure))
 	    {
 	      /* This is an extra security effort to make sure nobody can
@@ -1953,7 +1947,7 @@
 
 struct link_map *
 internal_function
-_dl_map_object (struct link_map *loader, const char *name, int preloaded,
+_dl_map_object (struct link_map *loader, const char *name,
 		int type, int trace_mode, int mode, Lmid_t nsid)
 {
   int fd;
@@ -2057,7 +2051,8 @@
 	  for (l = loader; l; l = l->l_loader)
 	    if (cache_rpath (l, &l->l_rpath_dirs, DT_RPATH, "RPATH"))
 	      {
-		fd = open_path (name, namelen, preloaded, &l->l_rpath_dirs,
+		fd = open_path (name, namelen, mode & __RTLD_SECURE,
+				&l->l_rpath_dirs,
 				&realname, &fb, loader, LA_SER_RUNPATH,
 				&found_other_class);
 		if (fd != -1)
@@ -2072,14 +2067,15 @@
 	      && main_map != NULL && main_map->l_type != lt_loaded
 	      && cache_rpath (main_map, &main_map->l_rpath_dirs, DT_RPATH,
 			      "RPATH"))
-	    fd = open_path (name, namelen, preloaded, &main_map->l_rpath_dirs,
+	    fd = open_path (name, namelen, mode & __RTLD_SECURE,
+			    &main_map->l_rpath_dirs,
 			    &realname, &fb, loader ?: main_map, LA_SER_RUNPATH,
 			    &found_other_class);
 	}
 
       /* Try the LD_LIBRARY_PATH environment variable.  */
       if (fd == -1 && env_path_list.dirs != (void *) -1)
-	fd = open_path (name, namelen, preloaded, &env_path_list,
+	fd = open_path (name, namelen, mode & __RTLD_SECURE, &env_path_list,
 			&realname, &fb,
 			loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
 			LA_SER_LIBPATH, &found_other_class);
@@ -2088,12 +2084,12 @@
       if (fd == -1 && loader != NULL
 	  && cache_rpath (loader, &loader->l_runpath_dirs,
 			  DT_RUNPATH, "RUNPATH"))
-	fd = open_path (name, namelen, preloaded,
+	fd = open_path (name, namelen, mode & __RTLD_SECURE,
 			&loader->l_runpath_dirs, &realname, &fb, loader,
 			LA_SER_RUNPATH, &found_other_class);
 
       if (fd == -1
-	  && (__builtin_expect (! preloaded, 1)
+	  && (__builtin_expect (! (mode & __RTLD_SECURE), 1)
 	      || ! INTUSE(__libc_enable_secure)))
 	{
 	  /* Check the list of libraries in the file /etc/ld.so.cache,
@@ -2159,7 +2155,7 @@
 	  && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
 	      || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
 	  && rtld_search_dirs.dirs != (void *) -1)
-	fd = open_path (name, namelen, preloaded, &rtld_search_dirs,
+	fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
 			&realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
 
       /* Add another newline when we are tracing the library loading.  */
@@ -2204,7 +2200,7 @@
 	     have.  */
 	  static const Elf_Symndx dummy_bucket = STN_UNDEF;
 
-	  /* Enter the new object in the list of loaded objects.  */
+	  /* Allocate a new object map.  */
 	  if ((name_copy = local_strdup (name)) == NULL
 	      || (l = _dl_new_object (name_copy, name, type, loader,
 				      mode, nsid)) == NULL)
@@ -2222,6 +2218,9 @@
 	  l->l_nbuckets = 1;
 	  l->l_relocated = 1;
 
+	  /* Enter the object in the object list.  */
+	  _dl_add_to_namespace_list (l, nsid);
+
 	  return l;
 	}
       else if (found_other_class)
diff -Nru eglibc-2.11.2/elf/dl-object.c eglibc-2.11.3/elf/dl-object.c
--- eglibc-2.11.2/elf/dl-object.c	2010-01-26 11:29:51.000000000 +0000
+++ eglibc-2.11.3/elf/dl-object.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,5 +1,5 @@
 /* Storage management for the chain of loaded shared objects.
-   Copyright (C) 1995-2002,2004,2006-2008,2009 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002,2004,2006-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
@@ -26,16 +26,36 @@
 #include <assert.h>
 
 
+/* Add the new link_map NEW to the end of the namespace list.  */
+void
+internal_function
+_dl_add_to_namespace_list (struct link_map *new, Lmid_t nsid)
+{
+  if (GL(dl_ns)[nsid]._ns_loaded != NULL)
+    {
+      struct link_map *l = GL(dl_ns)[nsid]._ns_loaded;
+      while (l->l_next != NULL)
+	l = l->l_next;
+      new->l_prev = l;
+      /* new->l_next = NULL;   Would be necessary but we use calloc.  */
+      l->l_next = new;
+    }
+  else
+    GL(dl_ns)[nsid]._ns_loaded = new;
+  ++GL(dl_ns)[nsid]._ns_nloaded;
+  new->l_serial = GL(dl_load_adds);
+  ++GL(dl_load_adds);
+}
+
+
 /* Allocate a `struct link_map' for a new object being loaded,
    and enter it into the _dl_loaded list.  */
-
 struct link_map *
 internal_function
 _dl_new_object (char *realname, const char *libname, int type,
 		struct link_map *loader, int mode, Lmid_t nsid)
 {
   struct link_map *l;
-  int idx;
   size_t libname_len = strlen (libname) + 1;
   struct link_map *new;
   struct libname_list *newname;
@@ -94,25 +114,11 @@
   new->l_scope_max = sizeof (new->l_scope_mem) / sizeof (new->l_scope_mem[0]);
 
   /* Counter for the scopes we have to handle.  */
-  idx = 0;
+  int idx = 0;
 
   if (GL(dl_ns)[nsid]._ns_loaded != NULL)
-    {
-      l = GL(dl_ns)[nsid]._ns_loaded;
-      while (l->l_next != NULL)
-	l = l->l_next;
-      new->l_prev = l;
-      /* new->l_next = NULL;	Would be necessary but we use calloc.  */
-      l->l_next = new;
-
-      /* Add the global scope.  */
-      new->l_scope[idx++] = &GL(dl_ns)[nsid]._ns_loaded->l_searchlist;
-    }
-  else
-    GL(dl_ns)[nsid]._ns_loaded = new;
-  ++GL(dl_ns)[nsid]._ns_nloaded;
-  new->l_serial = GL(dl_load_adds);
-  ++GL(dl_load_adds);
+    /* Add the global scope.  */
+    new->l_scope[idx++] = &GL(dl_ns)[nsid]._ns_loaded->l_searchlist;
 
   /* If we have no loader the new object acts as it.  */
   if (loader == NULL)
diff -Nru eglibc-2.11.2/elf/dl-open.c eglibc-2.11.3/elf/dl-open.c
--- eglibc-2.11.2/elf/dl-open.c	2009-07-29 15:58:14.000000000 +0000
+++ eglibc-2.11.3/elf/dl-open.c	2010-12-06 20:55:10.000000000 +0000
@@ -220,38 +220,9 @@
 
   assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT);
 
-  /* Maybe we have to expand a DST.  */
-  if (__builtin_expect (dst != NULL, 0))
-    {
-      size_t len = strlen (file);
-
-      /* Determine how much space we need.  We have to allocate the
-	 memory locally.  */
-      size_t required = DL_DST_REQUIRED (call_map, file, len,
-					 _dl_dst_count (dst, 0));
-
-      /* Get space for the new file name.  */
-      char *new_file = (char *) alloca (required + 1);
-
-      /* Generate the new file name.  */
-      _dl_dst_substitute (call_map, file, new_file, 0);
-
-      /* If the substitution failed don't try to load.  */
-      if (*new_file == '\0')
-	_dl_signal_error (0, "dlopen", NULL,
-			  N_("empty dynamic string token substitution"));
-
-      /* Now we have a new file name.  */
-      file = new_file;
-
-      /* It does not matter whether call_map is set even if we
-	 computed it only because of the DST.  Since the path contains
-	 a slash the value is not used.  See dl-load.c.  */
-    }
-
   /* Load the named object.  */
   struct link_map *new;
-  args->map = new = _dl_map_object (call_map, file, 0, lt_loaded, 0,
+  args->map = new = _dl_map_object (call_map, file, lt_loaded, 0,
 				    mode | __RTLD_CALLMAP, args->nsid);
 
   /* If the pointer returned is NULL this means the RTLD_NOLOAD flag is
diff -Nru eglibc-2.11.2/elf/dl-reloc.c eglibc-2.11.3/elf/dl-reloc.c
--- eglibc-2.11.2/elf/dl-reloc.c	2009-09-30 15:40:23.000000000 +0000
+++ eglibc-2.11.3/elf/dl-reloc.c	2010-11-07 12:16:06.000000000 +0000
@@ -1,5 +1,5 @@
 /* Relocate a shared object and resolve its references to other loaded objects.
-   Copyright (C) 1995-2006, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1995-2006, 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
@@ -319,6 +319,10 @@
 	  goto call_error;
 	}
 
+#ifdef CLEAR_CACHE
+      CLEAR_CACHE (textrels->start, textrels->start + textrels->len);
+#endif
+
       textrels = textrels->next;
     }
 
diff -Nru eglibc-2.11.2/elf/dl-sysdep.c eglibc-2.11.3/elf/dl-sysdep.c
--- eglibc-2.11.2/elf/dl-sysdep.c	2009-06-24 16:26:34.000000000 +0000
+++ eglibc-2.11.3/elf/dl-sysdep.c	2010-12-06 20:55:10.000000000 +0000
@@ -424,6 +424,11 @@
     {
       const ElfW(Word) mask = ((const ElfW(Word) *) dsocaps)[-1];
       GLRO(dl_hwcap) |= (uint64_t) mask << _DL_FIRST_EXTRA;
+      /* Note that we add the dsocaps to the set already chosen by the
+	 LD_HWCAP_MASK environment variable (or default HWCAP_IMPORTANT).
+	 So there is no way to request ignoring an OS-supplied dsocap
+	 string and bit like you can ignore an OS-supplied HWCAP bit.  */
+      GLRO(dl_hwcap_mask) |= (uint64_t) mask << _DL_FIRST_EXTRA;
       size_t len;
       for (const char *p = dsocaps; p < dsocaps + dsocapslen; p += len + 1)
 	{
diff -Nru eglibc-2.11.2/elf/ldconfig.c eglibc-2.11.3/elf/ldconfig.c
--- eglibc-2.11.2/elf/ldconfig.c	2010-05-13 22:57:47.000000000 +0000
+++ eglibc-2.11.3/elf/ldconfig.c	2010-12-06 20:55:10.000000000 +0000
@@ -1362,14 +1362,9 @@
 
   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);
-    }
+    aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
 
-  if (! opt_ignore_aux_cache)
+  if (! opt_ignore_aux_cache && aux_cache_file)
     load_aux_cache (aux_cache_file);
   else
     init_aux_cache ();
@@ -1379,7 +1374,8 @@
   if (opt_build_cache)
     {
       save_cache (cache_file);
-      save_aux_cache (aux_cache_file);
+      if (aux_cache_file)
+        save_aux_cache (aux_cache_file);
     }
 
   return 0;
diff -Nru eglibc-2.11.2/elf/rtld-Rules eglibc-2.11.3/elf/rtld-Rules
--- eglibc-2.11.2/elf/rtld-Rules	2008-02-20 12:48:46.000000000 +0000
+++ eglibc-2.11.3/elf/rtld-Rules	2010-12-06 20:55:10.000000000 +0000
@@ -1,6 +1,6 @@
 # Subroutine makefile for compiling libc modules linked into dynamic linker.
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002,2003,2005,2006,2008,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
@@ -56,7 +56,7 @@
 # Use the verbose option of ar and tar when not running silently.
 ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
 verbose := v
-else	   					# -s
+else						# -s
 verbose	:=
 endif						# not -s
 
@@ -93,6 +93,12 @@
 # These are the basic compilation rules corresponding to the Makerules ones.
 # The sysd-rules generated makefile already defines pattern rules for rtld-%
 # targets built from sysdeps source files.
+$(objpfx)rtld-%.os: rtld-%.S $(before-compile)
+	$(compile-command.S) $(rtld-CPPFLAGS)
+$(objpfx)rtld-%.os: rtld-%.s $(before-compile)
+	$(compile-command.s) $(rtld-CPPFLAGS)
+$(objpfx)rtld-%.os: rtld-%.c $(before-compile)
+	$(compile-command.c) $(rtld-CPPFLAGS)
 $(objpfx)rtld-%.os: %.S $(before-compile)
 	$(compile-command.S) $(rtld-CPPFLAGS)
 $(objpfx)rtld-%.os: %.s $(before-compile)
@@ -101,6 +107,9 @@
 	$(compile-command.c) $(rtld-CPPFLAGS)
 
 # The rules for generated source files.
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.S $(before-compile); $(compile-command.S)
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.s $(before-compile); $(compile-command.s)
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.c $(before-compile); $(compile-command.c)
 $(objpfx)rtld-%.os: $(objpfx)%.S $(before-compile); $(compile-command.S)
 $(objpfx)rtld-%.os: $(objpfx)%.s $(before-compile); $(compile-command.s)
 $(objpfx)rtld-%.os: $(objpfx)%.c $(before-compile); $(compile-command.c)
diff -Nru eglibc-2.11.2/elf/rtld.c eglibc-2.11.3/elf/rtld.c
--- eglibc-2.11.2/elf/rtld.c	2009-07-29 15:58:14.000000000 +0000
+++ eglibc-2.11.3/elf/rtld.c	2010-12-06 20:55:10.000000000 +0000
@@ -588,7 +588,6 @@
   /* Argument to map_doit.  */
   char *str;
   struct link_map *loader;
-  int is_preloaded;
   int mode;
   /* Return value of map_doit.  */
   struct link_map *map;
@@ -626,16 +625,17 @@
 map_doit (void *a)
 {
   struct map_args *args = (struct map_args *) a;
-  args->map = _dl_map_object (args->loader, args->str,
-			      args->is_preloaded, lt_library, 0, args->mode,
-			      LM_ID_BASE);
+  args->map = _dl_map_object (args->loader, args->str, lt_library, 0,
+			      args->mode, LM_ID_BASE);
 }
 
 static void
 dlmopen_doit (void *a)
 {
   struct dlmopen_args *args = (struct dlmopen_args *) a;
-  args->map = _dl_open (args->fname, RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT,
+  args->map = _dl_open (args->fname,
+			(RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT
+			 | __RTLD_SECURE),
 			dl_main, LM_ID_NEWLM, _dl_argc, INTUSE(_dl_argv),
 			__environ);
 }
@@ -805,8 +805,7 @@
 
   args.str = fname;
   args.loader = main_map;
-  args.is_preloaded = 1;
-  args.mode = 0;
+  args.mode = __RTLD_SECURE;
 
   unsigned int old_nloaded = GL(dl_ns)[LM_ID_BASE]._ns_nloaded;
 
@@ -1052,7 +1051,6 @@
 
 	  args.str = rtld_progname;
 	  args.loader = NULL;
-	  args.is_preloaded = 0;
 	  args.mode = __RTLD_OPENEXEC;
 	  (void) _dl_catch_error (&objname, &err_str, &malloced, map_doit,
 				  &args);
@@ -1064,7 +1062,7 @@
       else
 	{
 	  HP_TIMING_NOW (start);
-	  _dl_map_object (NULL, rtld_progname, 0, lt_library, 0,
+	  _dl_map_object (NULL, rtld_progname, lt_library, 0,
 			  __RTLD_OPENEXEC, LM_ID_BASE);
 	  HP_TIMING_NOW (stop);
 
@@ -1090,11 +1088,15 @@
       main_map = _dl_new_object ((char *) "", "", lt_executable, NULL,
 				 __RTLD_OPENEXEC, LM_ID_BASE);
       assert (main_map != NULL);
-      assert (main_map == GL(dl_ns)[LM_ID_BASE]._ns_loaded);
       main_map->l_phdr = phdr;
       main_map->l_phnum = phnum;
       main_map->l_entry = *user_entry;
 
+      /* Even though the link map is not yet fully initialized we can add
+	 it to the map list since there are no possible users running yet.  */
+      _dl_add_to_namespace_list (main_map, LM_ID_BASE);
+      assert (main_map == GL(dl_ns)[LM_ID_BASE]._ns_loaded);
+
       /* At this point we are in a bit of trouble.  We would have to
 	 fill in the values for l_dev and l_ino.  But in general we
 	 do not know where the file is.  We also do not handle AT_EXECFD
@@ -1237,7 +1239,7 @@
       /* We were invoked directly, so the program might not have a
 	 PT_INTERP.  */
       _dl_rtld_libname.name = GL(dl_rtld_map).l_name;
-      /* _dl_rtld_libname.next = NULL; 	Already zero.  */
+      /* _dl_rtld_libname.next = NULL;	Already zero.  */
       GL(dl_rtld_map).l_libname =  &_dl_rtld_libname;
     }
   else
@@ -1362,6 +1364,9 @@
 	      l->l_libname->name = memcpy (copy, dsoname, len);
 	    }
 
+	  /* Add the vDSO to the object list.  */
+	  _dl_add_to_namespace_list (l, LM_ID_BASE);
+
 	  /* Rearrange the list so this DSO appears after rtld_map.  */
 	  assert (l->l_next == NULL);
 	  assert (l->l_prev == main_map);
diff -Nru eglibc-2.11.2/hurd/hurd/fd.h eglibc-2.11.3/hurd/hurd/fd.h
--- eglibc-2.11.2/hurd/hurd/fd.h	2008-07-07 18:11:39.000000000 +0000
+++ eglibc-2.11.3/hurd/hurd/fd.h	2010-12-06 20:55:10.000000000 +0000
@@ -254,8 +254,9 @@
 			 const sigset_t *sigmask);
 
 /* Variant of file_name_lookup used in *at function implementations.
-   AT_FLAGS should contain only AT_SYMLINK_NOFOLLOW; other bits
-   cause EINVAL.  */
+   AT_FLAGS may only contain AT_SYMLINK_FOLLOW or AT_SYMLINK_NOFOLLOW,
+   which will remove and add O_NOLINK from FLAGS respectively.
+   Other bits cause EINVAL.  */
 extern file_t __file_name_lookup_at (int fd, int at_flags,
 				     const char *file_name,
 				     int flags, mode_t mode);
diff -Nru eglibc-2.11.2/hurd/hurdselect.c eglibc-2.11.3/hurd/hurdselect.c
--- eglibc-2.11.2/hurd/hurdselect.c	2006-08-17 01:18:26.000000000 +0000
+++ eglibc-2.11.3/hurd/hurdselect.c	2010-12-06 20:55:10.000000000 +0000
@@ -52,7 +52,7 @@
   int firstfd, lastfd;
   mach_msg_timeout_t to = (timeout != NULL ?
 			   (timeout->tv_sec * 1000 +
-			    timeout->tv_nsec / 1000000) :
+			    (timeout->tv_nsec + 999999) / 1000000) :
 			   0);
   struct
     {
diff -Nru eglibc-2.11.2/hurd/lookup-at.c eglibc-2.11.3/hurd/lookup-at.c
--- eglibc-2.11.2/hurd/lookup-at.c	2010-05-13 22:57:47.000000000 +0000
+++ eglibc-2.11.3/hurd/lookup-at.c	2010-12-06 20:55:10.000000000 +0000
@@ -30,8 +30,14 @@
   error_t err;
   file_t result;
 
+  if ((at_flags & AT_SYMLINK_FOLLOW) && (at_flags & AT_SYMLINK_NOFOLLOW))
+    return (__hurd_fail (EINVAL), MACH_PORT_NULL);
+
   flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
   at_flags &= ~AT_SYMLINK_NOFOLLOW;
+  if (at_flags & AT_SYMLINK_FOLLOW)
+    flags &= ~O_NOLINK;
+  at_flags &= ~AT_SYMLINK_FOLLOW;
   if (at_flags != 0)
     return (__hurd_fail (EINVAL), MACH_PORT_NULL);
 
diff -Nru eglibc-2.11.2/include/dlfcn.h eglibc-2.11.3/include/dlfcn.h
--- eglibc-2.11.2/include/dlfcn.h	2007-03-18 18:01:40.000000000 +0000
+++ eglibc-2.11.3/include/dlfcn.h	2010-11-07 12:16:06.000000000 +0000
@@ -9,6 +9,7 @@
 #define __RTLD_OPENEXEC	0x20000000
 #define __RTLD_CALLMAP	0x10000000
 #define __RTLD_AUDIT	0x08000000
+#define __RTLD_SECURE	0x04000000 /* Apply additional security checks.  */
 
 #define __LM_ID_CALLER	-2
 
diff -Nru eglibc-2.11.2/libio/stdio.h eglibc-2.11.3/libio/stdio.h
--- eglibc-2.11.2/libio/stdio.h	2009-03-15 15:53:55.000000000 +0000
+++ eglibc-2.11.3/libio/stdio.h	2010-11-07 12:16:06.000000000 +0000
@@ -427,9 +427,9 @@
 		       __isoc99_fscanf) __wur;
 extern int __REDIRECT (scanf, (__const char *__restrict __format, ...),
 		       __isoc99_scanf) __wur;
-extern int __REDIRECT (sscanf, (__const char *__restrict __s,
-				__const char *__restrict __format, ...),
-		       __isoc99_sscanf) __THROW;
+extern int __REDIRECT_NTH (sscanf, (__const char *__restrict __s,
+				    __const char *__restrict __format, ...),
+			   __isoc99_sscanf);
 # else
 extern int __isoc99_fscanf (FILE *__restrict __stream,
 			    __const char *__restrict __format, ...) __wur;
@@ -481,11 +481,11 @@
 extern int __REDIRECT (vscanf, (__const char *__restrict __format,
 				_G_va_list __arg), __isoc99_vscanf)
      __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
-extern int __REDIRECT (vsscanf,
-		       (__const char *__restrict __s,
-			__const char *__restrict __format, _G_va_list __arg),
-		       __isoc99_vsscanf)
-     __THROW __attribute__ ((__format__ (__scanf__, 2, 0)));
+extern int __REDIRECT_NTH (vsscanf,
+			   (__const char *__restrict __s,
+			    __const char *__restrict __format,
+			    _G_va_list __arg), __isoc99_vsscanf)
+     __attribute__ ((__format__ (__scanf__, 2, 0)));
 #  else
 extern int __isoc99_vfscanf (FILE *__restrict __s,
 			     __const char *__restrict __format,
diff -Nru eglibc-2.11.2/locale/programs/locale.c eglibc-2.11.3/locale/programs/locale.c
--- eglibc-2.11.2/locale/programs/locale.c	2009-02-13 18:31:14.000000000 +0000
+++ eglibc-2.11.3/locale/programs/locale.c	2010-12-06 20:55:10.000000000 +0000
@@ -765,6 +765,29 @@
   twalk (all_data, print_names);
 }
 
+/* Print a properly quoted assignment of NAME with VAL, using double
+   quotes iff DQUOTE is true.  */
+static void
+print_assignment (const char *name, const char *val, bool dquote)
+{
+  printf ("%s=", name);
+  if (dquote)
+    putchar ('"');
+  while (*val != '\0')
+    {
+      size_t segment
+	= strcspn (val, dquote ? "$`\"\\" : "~|&;<>()$`\\\"' \t\n");
+      printf ("%.*s", (int) segment, val);
+      val += segment;
+      if (*val == '\0')
+	break;
+      putchar ('\\');
+      putchar (*val++);
+    }
+  if (dquote)
+    putchar ('"');
+  putchar ('\n');
+}
 
 /* We have to show the contents of the environments determining the
    locale.  */
@@ -772,7 +795,7 @@
 show_locale_vars (void)
 {
   size_t cat_no;
-  const char *lcall = getenv ("LC_ALL");
+  const char *lcall = getenv ("LC_ALL") ? : "";
   const char *lang = getenv ("LANG") ? : "";
 
   auto void get_source (const char *name);
@@ -781,15 +804,15 @@
     {
       char *val = getenv (name);
 
-      if ((lcall ?: "")[0] != '\0' || val == NULL)
-	printf ("%s=\"%s\"\n", name,
-		(lcall ?: "")[0] ? lcall : (lang ?: "")[0] ? lang : "POSIX");
+      if (lcall[0] != '\0' || val == NULL)
+	print_assignment (name, lcall[0] ? lcall : lang[0] ? lang : "POSIX",
+			  true);
       else
-	printf ("%s=%s\n", name, val);
+	print_assignment (name, val, false);
     }
 
   /* LANG has to be the first value.  */
-  printf ("LANG=%s\n", lang);
+  print_assignment ("LANG", lang, false);
 
   /* Now all categories in an unspecified order.  */
   for (cat_no = 0; cat_no < NCATEGORIES; ++cat_no)
@@ -797,7 +820,7 @@
       get_source (category[cat_no].name);
 
   /* The last is the LC_ALL value.  */
-  printf ("LC_ALL=%s\n", lcall ? : "");
+  print_assignment ("LC_ALL", lcall, false);
 }
 
 
diff -Nru eglibc-2.11.2/malloc/malloc.c eglibc-2.11.3/malloc/malloc.c
--- eglibc-2.11.2/malloc/malloc.c	2010-05-13 22:57:47.000000000 +0000
+++ eglibc-2.11.3/malloc/malloc.c	2010-12-06 20:55:10.000000000 +0000
@@ -4850,7 +4850,7 @@
       }
 
     if (__builtin_expect (perturb_byte, 0))
-      free_perturb (chunk2mem(p), size - SIZE_SZ);
+      free_perturb (chunk2mem(p), size - 2 * SIZE_SZ);
 
     set_fastchunks(av);
     fb = &fastbin (av, fastbin_index(size));
@@ -4938,7 +4938,7 @@
       }
 
     if (__builtin_expect (perturb_byte, 0))
-      free_perturb (chunk2mem(p), size - SIZE_SZ);
+      free_perturb (chunk2mem(p), size - 2 * SIZE_SZ);
 
     /* consolidate backward */
     if (!prev_inuse(p)) {
diff -Nru eglibc-2.11.2/malloc/mcheck.c eglibc-2.11.3/malloc/mcheck.c
--- eglibc-2.11.2/malloc/mcheck.c	2007-05-24 16:37:12.000000000 +0000
+++ eglibc-2.11.3/malloc/mcheck.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,5 +1,6 @@
 /* Standard debugging hooks for `malloc'.
-   Copyright (C) 1990-1997,1999,2000-2002,2007 Free Software Foundation, Inc.
+   Copyright (C) 1990-1997,1999,2000-2002,2007,2010
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written May 1989 by Mike Haertel.
 
@@ -25,6 +26,7 @@
 # include <stdint.h>
 # include <stdio.h>
 # include <libintl.h>
+# include <errno.h>
 #endif
 
 /* Old hook values.  */
@@ -209,6 +211,12 @@
   if (pedantic)
     mcheck_check_all ();
 
+  if (size > ~((size_t) 0) - (sizeof (struct hdr) + 1))
+    {
+      __set_errno (ENOMEM);
+      return NULL;
+    }
+
   __malloc_hook = old_malloc_hook;
   if (old_malloc_hook != NULL)
     hdr = (struct hdr *) (*old_malloc_hook) (sizeof (struct hdr) + size + 1,
@@ -241,6 +249,12 @@
 
   slop = (sizeof *hdr + alignment - 1) & -alignment;
 
+  if (size > ~((size_t) 0) - (slop + 1))
+    {
+      __set_errno (ENOMEM);
+      return NULL;
+    }
+
   __memalign_hook = old_memalign_hook;
   if (old_memalign_hook != NULL)
     block = (*old_memalign_hook) (alignment, slop + size + 1, caller);
@@ -276,6 +290,12 @@
   if (pedantic)
     mcheck_check_all ();
 
+  if (size > ~((size_t) 0) - (sizeof (struct hdr) + 1))
+    {
+      __set_errno (ENOMEM);
+      return NULL;
+    }
+
   if (ptr)
     {
       hdr = ((struct hdr *) ptr) - 1;
diff -Nru eglibc-2.11.2/nis/nss_compat/compat-initgroups.c eglibc-2.11.3/nis/nss_compat/compat-initgroups.c
--- eglibc-2.11.2/nis/nss_compat/compat-initgroups.c	2009-06-24 16:26:34.000000000 +0000
+++ eglibc-2.11.3/nis/nss_compat/compat-initgroups.c	2010-12-06 20:55:10.000000000 +0000
@@ -474,18 +474,21 @@
 	  /* If the selected module does not support getgrent_r or
 	     initgroups_dyn, abort. We cannot find the needed group
 	     entries.  */
-	  if (nss_getgrent_r == NULL && nss_initgroups_dyn == NULL)
+	  if (nss_initgroups_dyn == NULL || nss_getgrgid_r == NULL)
+	    {
+	      if (nss_setgrent != NULL)
+	        {
+		  nss_setgrent (1);
+		  ent->need_endgrent = true;
+		}
+	      ent->skip_initgroups_dyn = true;
+	    }
+
+	  if (ent->skip_initgroups_dyn && nss_getgrent_r == NULL)
 	    return NSS_STATUS_UNAVAIL;
 
 	  ent->files = false;
 
-	  if (nss_initgroups_dyn == NULL && nss_setgrent != NULL)
-	    {
-	      nss_setgrent (1);
-	      ent->need_endgrent = true;
-	    }
-	  ent->skip_initgroups_dyn = true;
-
 	  return getgrent_next_nss (ent, buffer, buflen, user, group,
 				    start, size, groupsp, limit, errnop);
 	}
diff -Nru eglibc-2.11.2/nis/nss_nis/nis-initgroups.c eglibc-2.11.3/nis/nss_nis/nis-initgroups.c
--- eglibc-2.11.2/nis/nss_nis/nis-initgroups.c	2006-08-17 01:18:26.000000000 +0000
+++ eglibc-2.11.3/nis/nss_nis/nis-initgroups.c	2010-11-07 12:16:06.000000000 +0000
@@ -139,7 +139,7 @@
       if (r != ERANGE)
 	break;
 
-      extend_alloca (buf, buflen, 2 * buflen);
+      buf = extend_alloca (buf, buflen, 2 * buflen);
     }
 
   return 1;
diff -Nru eglibc-2.11.2/nptl/ChangeLog eglibc-2.11.3/nptl/ChangeLog
--- eglibc-2.11.2/nptl/ChangeLog	2009-12-07 21:57:26.000000000 +0000
+++ eglibc-2.11.3/nptl/ChangeLog	2010-12-06 20:55:10.000000000 +0000
@@ -1,3 +1,23 @@
+2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* nptl/sysdeps/unix/sysv/linux/i386/Makefile: New file.
+
+2010-07-01  Ulrich Drepper  <drepper@redhat.com>
+
+	* Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
+
+2010-10-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #12113]
+	* sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
+	* sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
+	of "struct pthread".
+
+2010-06-01  Takashi Yoshii  <takashi.yoshii.zj@renesas.com>
+
+	* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
+	location of ifndef __ASSUME_FUTEX_CLOCK_REALTIME.
+
 2009-11-27  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
diff -Nru eglibc-2.11.2/nptl/Makefile eglibc-2.11.3/nptl/Makefile
--- eglibc-2.11.2/nptl/Makefile	2009-07-29 15:58:14.000000000 +0000
+++ eglibc-2.11.3/nptl/Makefile	2010-12-06 20:55:10.000000000 +0000
@@ -509,7 +509,8 @@
 $(objpfx)tst-_res1mod2.so: $(objpfx)tst-_res1mod1.so
 LDFLAGS-tst-_res1mod1.so = -Wl,-soname,tst-_res1mod1.so
 LDFLAGS-tst-_res1mod2.so = -Wl,-soname,tst-_res1mod2.so
-$(objpfx)tst-_res1: $(objpfx)tst-_res1mod2.so $(shared-thread-library)
+$(objpfx)tst-_res1: $(objpfx)tst-_res1mod1.so $(objpfx)tst-_res1mod2.so \
+		    $(shared-thread-library)
 else
 $(objpfx)tst-cond11: $(common-objpfx)rt/librt.a
 $(objpfx)tst-cond19: $(common-objpfx)rt/librt.a
diff -Nru eglibc-2.11.2/nptl/sysdeps/unix/sysv/linux/i386/Makefile eglibc-2.11.3/nptl/sysdeps/unix/sysv/linux/i386/Makefile
--- eglibc-2.11.2/nptl/sysdeps/unix/sysv/linux/i386/Makefile	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/nptl/sysdeps/unix/sysv/linux/i386/Makefile	2010-12-06 20:55:10.000000000 +0000
@@ -0,0 +1,3 @@
+ifeq ($(subdir),nptl)
+CFLAGS-pt-initfini.s += -fno-asynchronous-unwind-tables
+endif
diff -Nru eglibc-2.11.2/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S eglibc-2.11.3/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
--- eglibc-2.11.2/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S	2009-09-03 14:33:58.000000000 +0000
+++ eglibc-2.11.3/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S	2010-11-07 12:16:06.000000000 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009
+/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -282,6 +282,7 @@
 	rts
 	 mov.l	@r15+, r12
 
+# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
 	.align	2
 # ifdef PIC
 .Lgot:
@@ -293,7 +294,6 @@
 	.long	__have_futex_clock_realtime
 # endif
 
-# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
 .Lreltmo:
 	/* Check for a valid timeout value.  */
 	mov.l	@(4,r6), r1
diff -Nru eglibc-2.11.2/nptl/sysdeps/x86_64/pthreaddef.h eglibc-2.11.3/nptl/sysdeps/x86_64/pthreaddef.h
--- eglibc-2.11.2/nptl/sysdeps/x86_64/pthreaddef.h	2008-08-19 17:24:09.000000000 +0000
+++ eglibc-2.11.3/nptl/sysdeps/x86_64/pthreaddef.h	2010-11-07 12:16:06.000000000 +0000
@@ -27,8 +27,9 @@
 /* Minimal stack size after allocating thread descriptor and guard size.  */
 #define MINIMAL_REST_STACK	2048
 
-/* Alignment requirement for TCB.  */
-#define TCB_ALIGNMENT		16
+/* Alignment requirement for TCB.  Need to store post-AVX vector registers
+   in the TCB and we want the storage to be aligned at 32-byte.  */
+#define TCB_ALIGNMENT		32
 
 
 /* Location of current stack frame.  The frame pointer is not usable.  */
diff -Nru eglibc-2.11.2/nptl/sysdeps/x86_64/tls.h eglibc-2.11.3/nptl/sysdeps/x86_64/tls.h
--- eglibc-2.11.2/nptl/sysdeps/x86_64/tls.h	2009-08-26 02:17:41.000000000 +0000
+++ eglibc-2.11.3/nptl/sysdeps/x86_64/tls.h	2010-11-07 12:16:06.000000000 +0000
@@ -117,12 +117,7 @@
 # define TLS_TCB_SIZE sizeof (struct pthread)
 
 /* Alignment requirements for the TCB.  */
-//# define TLS_TCB_ALIGN __alignof__ (struct pthread)
-// Normally the above would be correct  But we have to store post-AVX
-// vector registers in the TCB and we want the storage to be aligned.
-// unfortunately there isn't yet a type for these values and hence no
-// 32-byte alignment requirement.  Make this explicit, for now.
-# define TLS_TCB_ALIGN 32
+# define TLS_TCB_ALIGN __alignof__ (struct pthread)
 
 /* The TCB can have any size and the memory following the address the
    thread pointer points to is unspecified.  Allocate the TCB there.  */
diff -Nru eglibc-2.11.2/posix/Makefile eglibc-2.11.3/posix/Makefile
--- eglibc-2.11.2/posix/Makefile	2009-11-19 16:22:59.000000000 +0000
+++ eglibc-2.11.3/posix/Makefile	2010-12-06 20:55:10.000000000 +0000
@@ -94,6 +94,7 @@
 		   bug-regex14 bug-regex15 \
 		   bug-regex21 bug-regex24 \
 		   bug-regex27 bug-regex28 bug-regex29 bug-regex30 \
+		   bug-regex31 \
 		   tst-nice tst-nanosleep \
 		   transbug \
 		   tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
@@ -134,10 +135,12 @@
 	     annexc annexc.out wordexp-tst.out bug-regex2-mem \
 	     bug-regex2.mtrace bug-regex14-mem bug-regex14.mtrace \
 	     bug-regex21-mem bug-regex21.mtrace \
+	     bug-regex31-mem bug-regex31.mtrace \
 	     tst-rxspencer-mem tst-rxspencer.mtrace tst-getconf.out \
 	     tst-pcre-mem tst-pcre.mtrace tst-boost-mem tst-boost.mtrace \
 	     bug-ga2.mtrace bug-ga2-mem bug-glob2.mtrace bug-glob2-mem \
-	     tst-vfork3-mem tst-vfork3.mtrace getconf.speclist
+	     tst-vfork3-mem tst-vfork3.mtrace getconf.speclist \
+	     tst-fnmatch-mem tst-fnmatch.mtrace
 
 include ../Rules
 
@@ -254,11 +257,11 @@
 # Run a test on the header files we use.
 # XXX Please note that for now we ignore the result of this test.
 tests: $(objpfx)annexc.out
-# eglibc: ifeq (no,$(cross-compiling))
 tests: $(objpfx)bug-regex2-mem \
   $(objpfx)bug-regex21-mem \
+  $(objpfx)bug-regex31-mem \
   $(objpfx)tst-getconf.out \
-  $(objpfx)bug-glob2-mem $(objpfx)tst-vfork3-mem
+  $(objpfx)bug-glob2-mem $(objpfx)tst-vfork3-mem $(objpfx)tst-fnmatch-mem
 ifeq (y,($OPTION_POSIX_REGEXP_GLIBC))
 tests: $(objpfx)bug-regex14-mem $(objpfx)tst-rxspencer-mem \
   $(objpfx)tst-pcre-mem $(objpfx)tst-boost-mem 
@@ -274,6 +277,11 @@
 $(objpfx)annexc: annexc.c
 	$(native-compile)
 
+tst-fnmatch-ENV += MALLOC_TRACE=$(objpfx)tst-fnmatch.mtrace
+
+$(objpfx)tst-fnmatch-mem: $(objpfx)tst-fnmatch.out
+	$(common-objpfx)malloc/mtrace $(objpfx)tst-fnmatch.mtrace > $@
+
 bug-regex2-ENV = MALLOC_TRACE=$(objpfx)bug-regex2.mtrace
 
 $(objpfx)bug-regex2-mem: $(objpfx)bug-regex2.out
@@ -289,6 +297,11 @@
 $(objpfx)bug-regex21-mem: $(objpfx)bug-regex21.out
 	$(common-objpfx)malloc/mtrace $(objpfx)bug-regex21.mtrace > $@
 
+bug-regex31-ENV = MALLOC_TRACE=$(objpfx)bug-regex31.mtrace
+
+$(objpfx)bug-regex31-mem: $(objpfx)bug-regex31.out
+	$(common-objpfx)malloc/mtrace $(objpfx)bug-regex31.mtrace > $@
+
 tst-vfork3-ENV = MALLOC_TRACE=$(objpfx)tst-vfork3.mtrace
 
 $(objpfx)tst-vfork3-mem: $(objpfx)tst-vfork3.out
diff -Nru eglibc-2.11.2/posix/bug-regex31.c eglibc-2.11.3/posix/bug-regex31.c
--- eglibc-2.11.2/posix/bug-regex31.c	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/posix/bug-regex31.c	2010-12-06 20:55:10.000000000 +0000
@@ -0,0 +1,36 @@
+#include <mcheck.h>
+#include <regex.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+int
+main (void)
+{
+  mtrace ();
+
+  int res = 0;
+  char *buf = NULL;
+  size_t len = 0;
+  while (! feof (stdin))
+    {
+      ssize_t n = getline (&buf, &len, stdin);
+      if (n <= 0)
+	break;
+      if (buf[n - 1] == '\n')
+	buf[n - 1] = '\0';
+
+      regex_t regex;
+      int rc = regcomp (&regex, buf, REG_EXTENDED);
+      if (rc != 0)
+	printf ("%s: Error %d (expected)\n", buf, rc);
+      else
+	{
+	  printf ("%s: succeeded !\n", buf);
+	  res = 1;
+	}
+    }
+
+  free (buf);
+
+  return 0;
+}
diff -Nru eglibc-2.11.2/posix/bug-regex31.input eglibc-2.11.3/posix/bug-regex31.input
--- eglibc-2.11.2/posix/bug-regex31.input	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/posix/bug-regex31.input	2010-12-06 20:55:10.000000000 +0000
@@ -0,0 +1,4 @@
+[[][
+([0]
+([0]a
+([0]([0])
diff -Nru eglibc-2.11.2/posix/fnmatch.c eglibc-2.11.3/posix/fnmatch.c
--- eglibc-2.11.2/posix/fnmatch.c	2007-12-11 23:38:31.000000000 +0000
+++ eglibc-2.11.3/posix/fnmatch.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007,2010
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -45,6 +45,12 @@
 # include <stdlib.h>
 #endif
 
+#ifdef _LIBC
+# include <alloca.h>
+#else
+# define alloca_account(size., var) alloca (size)
+#endif
+
 /* For platform which support the ISO C amendement 1 functionality we
    support user defined character classes.  */
 #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
@@ -334,8 +340,11 @@
       mbstate_t ps;
       size_t n;
       const char *p;
+      wchar_t *wpattern_malloc = NULL;
       wchar_t *wpattern;
+      wchar_t *wstring_malloc = NULL;
       wchar_t *wstring;
+      size_t alloca_used = 0;
 
       /* Convert the strings into wide characters.  */
       memset (&ps, '\0', sizeof (ps));
@@ -347,7 +356,8 @@
 #endif
       if (__builtin_expect (n < 1024, 1))
 	{
-	  wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
+	  wpattern = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
+						 alloca_used);
 	  n = mbsrtowcs (wpattern, &p, n + 1, &ps);
 	  if (__builtin_expect (n == (size_t) -1, 0))
 	    /* Something wrong.
@@ -369,8 +379,11 @@
 	       XXX Do we have to set `errno' to something which mbsrtows hasn't
 	       already done?  */
 	    return -1;
-	  wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
+	  wpattern_malloc = wpattern
+	    = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
 	  assert (mbsinit (&ps));
+	  if (wpattern == NULL)
+	    return -2;
 	  (void) mbsrtowcs (wpattern, &pattern, n + 1, &ps);
 	}
 
@@ -383,13 +396,18 @@
       p = string;
       if (__builtin_expect (n < 1024, 1))
 	{
-	  wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
+	  wstring = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
+						alloca_used);
 	  n = mbsrtowcs (wstring, &p, n + 1, &ps);
 	  if (__builtin_expect (n == (size_t) -1, 0))
-	    /* Something wrong.
-	       XXX Do we have to set `errno' to something which mbsrtows hasn't
-	       already done?  */
-	    return -1;
+	    {
+	      /* Something wrong.
+		 XXX Do we have to set `errno' to something which
+		 mbsrtows hasn't already done?  */
+	    free_return:
+	      free (wpattern_malloc);
+	      return -1;
+	    }
 	  if (p)
 	    {
 	      memset (&ps, '\0', sizeof (ps));
@@ -404,19 +422,32 @@
 	    /* Something wrong.
 	       XXX Do we have to set `errno' to something which mbsrtows hasn't
 	       already done?  */
-	    return -1;
-	  wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
+	    goto free_return;
+
+	  wstring_malloc = wstring
+	    = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
+	  if (wstring == NULL)
+	    {
+	      free (wpattern_malloc);
+	      return -2;
+	    }
 	  assert (mbsinit (&ps));
 	  (void) mbsrtowcs (wstring, &string, n + 1, &ps);
 	}
 
-      return internal_fnwmatch (wpattern, wstring, wstring + n,
-				flags & FNM_PERIOD, flags, NULL);
+      int res = internal_fnwmatch (wpattern, wstring, wstring + n,
+				   flags & FNM_PERIOD, flags, NULL,
+				   alloca_used);
+
+      free (wstring_malloc);
+      free (wpattern_malloc);
+
+      return res;
     }
 # endif  /* mbstate_t and mbsrtowcs or _LIBC.  */
 
   return internal_fnmatch (pattern, string, string + strlen (string),
-			   flags & FNM_PERIOD, flags, NULL);
+			   flags & FNM_PERIOD, flags, NULL, 0);
 }
 
 # ifdef _LIBC
diff -Nru eglibc-2.11.2/posix/fnmatch_loop.c eglibc-2.11.3/posix/fnmatch_loop.c
--- eglibc-2.11.2/posix/fnmatch_loop.c	2009-11-09 13:46:29.000000000 +0000
+++ eglibc-2.11.3/posix/fnmatch_loop.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993,1996-2001,2003-2005,2007
+/* Copyright (C) 1991-1993,1996-2001,2003-2005,2007,2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -30,22 +30,24 @@
    it matches, nonzero if not.  */
 static int FCT (const CHAR *pattern, const CHAR *string,
 		const CHAR *string_end, int no_leading_period, int flags,
-		struct STRUCT *ends)
+		struct STRUCT *ends, size_t alloca_used)
      internal_function;
 static int EXT (INT opt, const CHAR *pattern, const CHAR *string,
-		const CHAR *string_end, int no_leading_period, int flags)
+		const CHAR *string_end, int no_leading_period, int flags,
+		size_t alloca_used)
      internal_function;
 static const CHAR *END (const CHAR *patternp) internal_function;
 
 static int
 internal_function
-FCT (pattern, string, string_end, no_leading_period, flags, ends)
+FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
      const CHAR *pattern;
      const CHAR *string;
      const CHAR *string_end;
      int no_leading_period;
      int flags;
      struct STRUCT *ends;
+     size_t alloca_used;
 {
   register const CHAR *p = pattern, *n = string;
   register UCHAR c;
@@ -74,10 +76,8 @@
 	case L('?'):
 	  if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
 	    {
-	      int res;
-
-	      res = EXT (c, p, n, string_end, no_leading_period,
-			 flags);
+	      int res = EXT (c, p, n, string_end, no_leading_period,
+			     flags, alloca_used);
 	      if (res != -1)
 		return res;
 	    }
@@ -106,10 +106,8 @@
 	case L('*'):
 	  if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
 	    {
-	      int res;
-
-	      res = EXT (c, p, n, string_end, no_leading_period,
-			 flags);
+	      int res = EXT (c, p, n, string_end, no_leading_period,
+			     flags, alloca_used);
 	      if (res != -1)
 		return res;
 	    }
@@ -198,7 +196,7 @@
 
 		  for (--p; n < endp; ++n, no_leading_period = 0)
 		    if (FCT (p, n, string_end, no_leading_period, flags2,
-			     &end) == 0)
+			     &end, alloca_used) == 0)
 		      goto found;
 		}
 	      else if (c == L('/') && (flags & FNM_FILE_NAME))
@@ -207,7 +205,7 @@
 		    ++n;
 		  if (n < string_end && *n == L('/')
 		      && (FCT (p, n + 1, string_end, flags & FNM_PERIOD, flags,
-			       NULL) == 0))
+			       NULL, alloca_used) == 0))
 		    return 0;
 		}
 	      else
@@ -221,7 +219,7 @@
 		  for (--p; n < endp; ++n, no_leading_period = 0)
 		    if (FOLD ((UCHAR) *n) == c
 			&& (FCT (p, n, string_end, no_leading_period, flags2,
-				 &end) == 0))
+				 &end, alloca_used) == 0))
 		      {
 		      found:
 			if (end.pattern == NULL)
@@ -758,7 +756,7 @@
 					       _NL_COLLATE_SYMB_EXTRAMB);
 
 				/* Locate the character in the hashing
-                                   table.  */
+				   table.  */
 				hash = elem_hash (str, c1);
 
 				idx = 0;
@@ -980,9 +978,8 @@
 	case L('!'):
 	  if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
 	    {
-	      int res;
-
-	      res = EXT (c, p, n, string_end, no_leading_period, flags);
+	      int res = EXT (c, p, n, string_end, no_leading_period, flags,
+			     alloca_used);
 	      if (res != -1)
 		return res;
 	    }
@@ -1061,26 +1058,32 @@
 static int
 internal_function
 EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
-     int no_leading_period, int flags)
+     int no_leading_period, int flags, size_t alloca_used)
 {
   const CHAR *startp;
   int level;
   struct patternlist
   {
     struct patternlist *next;
+    CHAR malloced;
     CHAR str[0];
   } *list = NULL;
   struct patternlist **lastp = &list;
   size_t pattern_len = STRLEN (pattern);
+  int any_malloced = 0;
   const CHAR *p;
   const CHAR *rs;
+  int retval = 0;
 
   /* Parse the pattern.  Store the individual parts in the list.  */
   level = 0;
   for (startp = p = pattern + 1; level >= 0; ++p)
     if (*p == L('\0'))
-      /* This is an invalid pattern.  */
-      return -1;
+      {
+	/* This is an invalid pattern.  */
+	retval = -1;
+	goto out;
+      }
     else if (*p == L('['))
       {
 	/* Handle brackets special.  */
@@ -1097,8 +1100,11 @@
 	/* Skip over all characters of the list.  */
 	while (*p != L(']'))
 	  if (*p++ == L('\0'))
-	    /* This is no valid pattern.  */
-	    return -1;
+	    {
+	      /* This is no valid pattern.  */
+	      retval = -1;
+	      goto out;
+	    }
       }
     else if ((*p == L('?') || *p == L('*') || *p == L('+') || *p == L('@')
 	      || *p == L('!')) && p[1] == L('('))
@@ -1111,15 +1117,25 @@
 	    /* This means we found the end of the pattern.  */
 #define NEW_PATTERN \
 	    struct patternlist *newp;					      \
-									      \
-	    if (opt == L('?') || opt == L('@'))				      \
-	      newp = alloca (sizeof (struct patternlist)		      \
-			     + (pattern_len * sizeof (CHAR)));		      \
+	    size_t slen = (opt == L('?') || opt == L('@')		      \
+			   ? pattern_len : (p - startp + 1));		      \
+	    slen = sizeof (struct patternlist) + (slen * sizeof (CHAR));      \
+	    int malloced = ! __libc_use_alloca (alloca_used + slen);	      \
+	    if (__builtin_expect (malloced, 0))				      \
+	      {								      \
+		newp = malloc (slen);					      \
+		if (newp == NULL)					      \
+		  {							      \
+		    retval = -2;					      \
+		    goto out;						      \
+		  }							      \
+		any_malloced = 1;					      \
+	      }								      \
 	    else							      \
-	      newp = alloca (sizeof (struct patternlist)		      \
-			     + ((p - startp + 1) * sizeof (CHAR)));	      \
-	    *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L('\0');    \
+	      newp = alloca_account (slen, alloca_used);		      \
 	    newp->next = NULL;						      \
+	    newp->malloced = malloced;					      \
+	    *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L('\0');    \
 	    *lastp = newp;						      \
 	    lastp = &newp->next
 	    NEW_PATTERN;
@@ -1140,8 +1156,9 @@
   switch (opt)
     {
     case L('*'):
-      if (FCT (p, string, string_end, no_leading_period, flags, NULL) == 0)
-	return 0;
+      if (FCT (p, string, string_end, no_leading_period, flags, NULL,
+	       alloca_used) == 0)
+	goto success;
       /* FALLTHROUGH */
 
     case L('+'):
@@ -1152,7 +1169,7 @@
 	       current pattern.  */
 	    if (FCT (list->str, string, rs, no_leading_period,
 		     flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
-		     NULL) == 0
+		     NULL, alloca_used) == 0
 		/* This was successful.  Now match the rest with the rest
 		   of the pattern.  */
 		&& (FCT (p, rs, string_end,
@@ -1160,7 +1177,7 @@
 			 ? no_leading_period
 			 : rs[-1] == '/' && NO_LEADING_PERIOD (flags) ? 1 : 0,
 			 flags & FNM_FILE_NAME
-			 ? flags : flags & ~FNM_PERIOD, NULL) == 0
+			 ? flags : flags & ~FNM_PERIOD, NULL, alloca_used) == 0
 		    /* This didn't work.  Try the whole pattern.  */
 		    || (rs != string
 			&& FCT (pattern - 1, rs, string_end,
@@ -1169,18 +1186,21 @@
 				: (rs[-1] == '/' && NO_LEADING_PERIOD (flags)
 				   ? 1 : 0),
 				flags & FNM_FILE_NAME
-				? flags : flags & ~FNM_PERIOD, NULL) == 0)))
+				? flags : flags & ~FNM_PERIOD, NULL,
+				alloca_used) == 0)))
 	      /* It worked.  Signal success.  */
-	      return 0;
+	      goto success;
 	}
       while ((list = list->next) != NULL);
 
       /* None of the patterns lead to a match.  */
-      return FNM_NOMATCH;
+      retval = FNM_NOMATCH;
+      break;
 
     case L('?'):
-      if (FCT (p, string, string_end, no_leading_period, flags, NULL) == 0)
-	return 0;
+      if (FCT (p, string, string_end, no_leading_period, flags, NULL,
+	       alloca_used) == 0)
+	goto success;
       /* FALLTHROUGH */
 
     case L('@'):
@@ -1192,13 +1212,14 @@
 	if (FCT (STRCAT (list->str, p), string, string_end,
 		 no_leading_period,
 		 flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
-		 NULL) == 0)
+		 NULL, alloca_used) == 0)
 	  /* It worked.  Signal success.  */
-	  return 0;
+	  goto success;
       while ((list = list->next) != NULL);
 
       /* None of the patterns lead to a match.  */
-      return FNM_NOMATCH;
+      retval = FNM_NOMATCH;
+      break;
 
     case L('!'):
       for (rs = string; rs <= string_end; ++rs)
@@ -1208,7 +1229,7 @@
 	  for (runp = list; runp != NULL; runp = runp->next)
 	    if (FCT (runp->str, string, rs,  no_leading_period,
 		     flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
-		     NULL) == 0)
+		     NULL, alloca_used) == 0)
 	      break;
 
 	  /* If none of the patterns matched see whether the rest does.  */
@@ -1218,21 +1239,34 @@
 		       ? no_leading_period
 		       : rs[-1] == '/' && NO_LEADING_PERIOD (flags) ? 1 : 0,
 		       flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
-		       NULL) == 0))
+		       NULL, alloca_used) == 0))
 	    /* This is successful.  */
-	    return 0;
+	    goto success;
 	}
 
       /* None of the patterns together with the rest of the pattern
 	 lead to a match.  */
-      return FNM_NOMATCH;
+      retval = FNM_NOMATCH;
+      break;
 
     default:
       assert (! "Invalid extended matching operator");
+      retval = -1;
       break;
     }
 
-  return -1;
+ success:
+ out:
+  if (any_malloced)
+    while (list != NULL)
+      {
+	struct patternlist *old = list;
+	list = list->next;
+	if (old->malloced)
+	  free (old);
+      }
+
+  return retval;
 }
 
 
diff -Nru eglibc-2.11.2/posix/getopt.h eglibc-2.11.3/posix/getopt.h
--- eglibc-2.11.2/posix/getopt.h	2009-03-15 15:53:55.000000000 +0000
+++ eglibc-2.11.3/posix/getopt.h	2010-11-07 12:16:06.000000000 +0000
@@ -1,5 +1,5 @@
 /* Declarations for getopt.
-   Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2009
+   Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2009,2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -158,9 +158,9 @@
    additional functionality can be disable at runtime.  This redirection
    helps to also do this at runtime.  */
 #  ifdef __REDIRECT
-  extern int __REDIRECT (getopt, (int ___argc, char *const *___argv,
-				  const char *__shortopts),
-			 __posix_getopt) __THROW;
+  extern int __REDIRECT_NTH (getopt, (int ___argc, char *const *___argv,
+				      const char *__shortopts),
+			     __posix_getopt);
 #  else
 extern int __posix_getopt (int ___argc, char *const *___argv,
 			   const char *__shortopts) __THROW;
diff -Nru eglibc-2.11.2/posix/regcomp.c eglibc-2.11.3/posix/regcomp.c
--- eglibc-2.11.2/posix/regcomp.c	2010-01-26 11:29:51.000000000 +0000
+++ eglibc-2.11.3/posix/regcomp.c	2010-12-06 20:55:10.000000000 +0000
@@ -2164,16 +2164,21 @@
       exp = parse_expression (regexp, preg, token, syntax, nest, err);
       if (BE (*err != REG_NOERROR && exp == NULL, 0))
 	{
+	  if (tree != NULL)
+	    postorder (tree, free_tree, NULL);
 	  return NULL;
 	}
       if (tree != NULL && exp != NULL)
 	{
-	  tree = create_tree (dfa, tree, exp, CONCAT);
-	  if (tree == NULL)
+	  bin_tree_t *newtree = create_tree (dfa, tree, exp, CONCAT);
+	  if (newtree == NULL)
 	    {
+	      postorder (exp, free_tree, NULL);
+	      postorder (tree, free_tree, NULL);
 	      *err = REG_ESPACE;
 	      return NULL;
 	    }
+	  tree = newtree;
 	}
       else if (tree == NULL)
 	tree = exp;
@@ -2422,7 +2427,11 @@
     {
       tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
       if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0))
-	*err = REG_EPAREN;
+	{
+	  if (tree != NULL)
+	    postorder (tree, free_tree, NULL);
+	  *err = REG_EPAREN;
+	}
       if (BE (*err != REG_NOERROR, 0))
 	return NULL;
     }
@@ -3049,6 +3058,10 @@
   if (BE (sbcset == NULL, 0))
 #endif /* RE_ENABLE_I18N */
     {
+      re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+      re_free (mbcset);
+#endif
       *err = REG_ESPACE;
       return NULL;
     }
diff -Nru eglibc-2.11.2/posix/tst-fnmatch.c eglibc-2.11.3/posix/tst-fnmatch.c
--- eglibc-2.11.2/posix/tst-fnmatch.c	2006-08-17 01:18:26.000000000 +0000
+++ eglibc-2.11.3/posix/tst-fnmatch.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,5 +1,5 @@
 /* Tests for fnmatch function.
-   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 2000, 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
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
+#include <mcheck.h>
 
 
 static char *next_input (char **line, int first, int last);
@@ -46,6 +47,8 @@
   size_t escpatternlen = 0;
   int nr = 0;
 
+  mtrace ();
+
   /* Read lines from stdin with the following format:
 
        locale  input-string  match-string  flags  result
diff -Nru eglibc-2.11.2/resolv/res_init.c eglibc-2.11.3/resolv/res_init.c
--- eglibc-2.11.2/resolv/res_init.c	2009-06-30 20:19:02.000000000 +0000
+++ eglibc-2.11.3/resolv/res_init.c	2010-12-06 20:55:10.000000000 +0000
@@ -176,13 +176,6 @@
 		statp->id = res_randomid();
 	}
 
-#ifdef USELOOPBACK
-	statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
-#else
-	statp->nsaddr.sin_addr.s_addr = INADDR_ANY;
-#endif
-	statp->nsaddr.sin_family = AF_INET;
-	statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
 	statp->nscount = 0;
 	statp->ndots = 1;
 	statp->pfcode = 0;
@@ -321,24 +314,24 @@
 			nserv++;
 #ifdef _LIBC
 			nservall++;
-                    } else {
-                        struct in6_addr a6;
-                        char *el;
+		    } else {
+			struct in6_addr a6;
+			char *el;
 
-                        if ((el = strchr(cp, '\n')) != NULL)
-                            *el = '\0';
+			if ((el = strchr(cp, '\n')) != NULL)
+			    *el = '\0';
 			if ((el = strchr(cp, SCOPE_DELIMITER)) != NULL)
 			    *el = '\0';
-                        if ((*cp != '\0') &&
-                            (inet_pton(AF_INET6, cp, &a6) > 0)) {
-                            struct sockaddr_in6 *sa6;
-
-                            sa6 = malloc(sizeof(*sa6));
-                            if (sa6 != NULL) {
-                                sa6->sin6_family = AF_INET6;
-                                sa6->sin6_port = htons(NAMESERVER_PORT);
+			if ((*cp != '\0') &&
+			    (inet_pton(AF_INET6, cp, &a6) > 0)) {
+			    struct sockaddr_in6 *sa6;
+
+			    sa6 = malloc(sizeof(*sa6));
+			    if (sa6 != NULL) {
+				sa6->sin6_family = AF_INET6;
+				sa6->sin6_port = htons(NAMESERVER_PORT);
 				sa6->sin6_flowinfo = 0;
-                                sa6->sin6_addr = a6;
+				sa6->sin6_addr = a6;
 
 				if (__builtin_expect (el == NULL, 1))
 				    sa6->sin6_scope_id = 0;
@@ -365,9 +358,9 @@
 				statp->_u._ext.nsaddrs[nservall] = sa6;
 				statp->_u._ext.nssocks[nservall] = -1;
 				statp->_u._ext.nsmap[nservall] = MAXNS + 1;
-                                nservall++;
-                            }
-                        }
+				nservall++;
+			    }
+			}
 #endif
 		    }
 		    continue;
@@ -433,6 +426,12 @@
 #endif
 	    (void) fclose(fp);
 	}
+	if (__builtin_expect(statp->nscount == 0, 0)) {
+	    statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
+	    statp->nsaddr.sin_family = AF_INET;
+	    statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
+	    statp->nscount = 1;
+	}
 	if (statp->defdname[0] == 0 &&
 	    __gethostname(buf, sizeof(statp->defdname) - 1) == 0 &&
 	    (cp = strchr(buf, '.')) != NULL)
@@ -538,12 +537,12 @@
 		} else if (!strncmp(cp, "no-check-names",
 				    sizeof("no-check-names") - 1)) {
 			statp->options |= RES_NOCHECKNAME;
-                } else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) {
+		} else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) {
 			statp->options |= RES_USE_EDNS0;
-                } else if (!strncmp(cp, "single-request-reopen",
+		} else if (!strncmp(cp, "single-request-reopen",
 				    sizeof("single-request-reopen") - 1)) {
 			statp->options |= RES_SNGLKUPREOP;
-                } else if (!strncmp(cp, "single-request",
+		} else if (!strncmp(cp, "single-request",
 				    sizeof("single-request") - 1)) {
 			statp->options |= RES_SNGLKUP;
 		} else {
diff -Nru eglibc-2.11.2/scripts/data/localplt-s390-linux-gnu.data eglibc-2.11.3/scripts/data/localplt-s390-linux-gnu.data
--- eglibc-2.11.2/scripts/data/localplt-s390-linux-gnu.data	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/scripts/data/localplt-s390-linux-gnu.data	2010-12-06 20:55:10.000000000 +0000
@@ -0,0 +1,7 @@
+libc.so: _Unwind_Find_FDE
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff -Nru eglibc-2.11.2/scripts/data/localplt-s390x-linux-gnu.data eglibc-2.11.3/scripts/data/localplt-s390x-linux-gnu.data
--- eglibc-2.11.2/scripts/data/localplt-s390x-linux-gnu.data	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/scripts/data/localplt-s390x-linux-gnu.data	2010-12-06 20:55:10.000000000 +0000
@@ -0,0 +1,7 @@
+libc.so: _Unwind_Find_FDE
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff -Nru eglibc-2.11.2/stdlib/strtod_l.c eglibc-2.11.3/stdlib/strtod_l.c
--- eglibc-2.11.2/stdlib/strtod_l.c	2009-04-30 21:37:18.000000000 +0000
+++ eglibc-2.11.3/stdlib/strtod_l.c	2010-12-06 20:55:10.000000000 +0000
@@ -1504,7 +1504,9 @@
 			  register int i;
 			  (void) __mpn_lshift (&retval[used
 						       / BITS_PER_MP_LIMB],
-					       retval, RETURN_LIMB_SIZE,
+					       retval,
+					       (RETURN_LIMB_SIZE
+						- used / BITS_PER_MP_LIMB),
 					       used % BITS_PER_MP_LIMB);
 			  for (i = used / BITS_PER_MP_LIMB - 1; i >= 0; --i)
 			    retval[i] = 0;
diff -Nru eglibc-2.11.2/string/Makefile eglibc-2.11.3/string/Makefile
--- eglibc-2.11.2/string/Makefile	2009-04-14 19:46:20.000000000 +0000
+++ eglibc-2.11.3/string/Makefile	2010-11-07 12:16:06.000000000 +0000
@@ -58,7 +58,7 @@
 		   bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap	\
 		   tst-strtok tst-strfry	\
 		   bug-strtok1 $(addprefix test-,$(strop-tests))	\
-		   tst-strxfrm2 tst-endian tst-svc2
+		   tst-strxfrm2 tst-endian tst-svc2 bug-strstr1
 tests-$(OPTION_EGLIBC_ENVZ) += bug-envz1 
 tests-$(OPTION_EGLIBC_LOCALE_CODE) \
 		+= tst-strxfrm bug-strcoll1
@@ -81,6 +81,7 @@
 CFLAGS-stratcliff.c = -fno-builtin
 CFLAGS-test-ffs.c = -fno-builtin
 CFLAGS-tst-inlcall.c = -fno-builtin
+CFLAGS-bug-strstr1.c = -fno-builtin
 
 # eglibc: ifeq ($(cross-compiling),no)
 tests: $(objpfx)tst-svc.out
diff -Nru eglibc-2.11.2/string/bug-strstr1.c eglibc-2.11.3/string/bug-strstr1.c
--- eglibc-2.11.2/string/bug-strstr1.c	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/string/bug-strstr1.c	2010-11-07 12:16:06.000000000 +0000
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <string.h>
+
+int main (int argc, char** argv)
+{
+  const char haystack[] =
+    "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";
+
+  const char needle[] =
+    "_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD";
+
+  const char* sub = strstr (haystack, needle);
+
+  if (sub != NULL)
+    {
+      int j;
+
+      fprintf (stderr, "BUG: expected NULL, got:\n%s\n%s\n", sub, needle);
+      for (j = 0; needle[j] != '\0'; ++j)
+        putchar (needle[j] == sub[j] ? ' ' : '^');
+      puts ("");
+      return 1;
+    }
+
+  return 0;
+}
diff -Nru eglibc-2.11.2/string/str-two-way.h eglibc-2.11.3/string/str-two-way.h
--- eglibc-2.11.2/string/str-two-way.h	2008-05-15 12:10:03.000000000 +0000
+++ eglibc-2.11.3/string/str-two-way.h	2010-11-07 12:16:06.000000000 +0000
@@ -350,8 +350,8 @@
 		     a byte out of place, there can be no match until
 		     after the mismatch.  */
 		  shift = needle_len - period;
-		  memory = 0;
 		}
+	      memory = 0;
 	      j += shift;
 	      continue;
 	    }
diff -Nru eglibc-2.11.2/string/stratcliff.c eglibc-2.11.3/string/stratcliff.c
--- eglibc-2.11.2/string/stratcliff.c	2009-05-09 18:19:07.000000000 +0000
+++ eglibc-2.11.3/string/stratcliff.c	2010-11-07 12:16:06.000000000 +0000
@@ -1,5 +1,6 @@
 /* Test for string function add boundaries of usable memory.
-   Copyright (C) 1996,1997,1999-2003,2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1999-2003,2007,2009,2010
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -47,6 +48,8 @@
 # define MEMCPY memcpy
 # define MEMPCPY mempcpy
 # define MEMCHR memchr
+# define STRCMP strcmp
+# define STRNCMP strncmp
 #endif
 
 
@@ -70,12 +73,12 @@
   if (adr == MAP_FAILED || dest == MAP_FAILED)
     {
       if (errno == ENOSYS)
-        puts ("No test, mmap not available.");
+	puts ("No test, mmap not available.");
       else
-        {
-          printf ("mmap failed: %m");
-          result = 1;
-        }
+	{
+	  printf ("mmap failed: %m");
+	  result = 1;
+	}
     }
   else
     {
@@ -93,8 +96,8 @@
 
       /* strlen/wcslen test */
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
-        {
-          for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+	{
+	  for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
 	    {
 	      adr[inner] = L('\0');
 
@@ -107,12 +110,12 @@
 
 	      adr[inner] = L('T');
 	    }
-        }
+	}
 
       /* strnlen/wcsnlen test */
       for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
-        {
-          for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+	{
+	  for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
 	    {
 	      adr[inner] = L('\0');
 
@@ -126,9 +129,9 @@
 
 	      adr[inner] = L('T');
 	    }
-        }
+	}
       for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
-        {
+	{
 	  for (inner = MAX (outer, nchars - 64); inner <= nchars; ++inner)
 	    {
 	      if (STRNLEN (&adr[outer], inner - outer)
@@ -139,11 +142,11 @@
 		  result = 1;
 		}
 	    }
-        }
+	}
 
       /* strchr/wcschr test */
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
-        {
+	{
 	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
 	    {
 	      for (inner = middle; inner < nchars; ++inner)
@@ -167,7 +170,7 @@
 		  adr[middle] = L('T');
 		}
 	    }
-        }
+	}
 
       /* Special test.  */
       adr[nchars - 1] = L('\0');
@@ -180,7 +183,7 @@
 
       /* strrchr/wcsrchr test */
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
-        {
+	{
 	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
 	    {
 	      for (inner = middle; inner < nchars; ++inner)
@@ -204,11 +207,11 @@
 		  adr[middle] = L('T');
 		}
 	    }
-        }
+	}
 
       /* memchr test */
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
-        {
+	{
 	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
 	    {
 	      adr[middle] = L('V');
@@ -224,9 +227,9 @@
 
 	      adr[middle] = L('T');
 	    }
-        }
+	}
       for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
-        {
+	{
 	  CHAR *cp = MEMCHR (&adr[outer], L('V'), nchars - outer);
 
 	  if (cp != NULL)
@@ -235,13 +238,13 @@
 		      STRINGIFY (MEMCHR), outer);
 	      result = 1;
 	    }
-        }
+	}
 
       /* This function only exists for single-byte characters.  */
 #ifndef WCSTEST
       /* rawmemchr test */
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
-        {
+	{
 	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
 	    {
 	      adr[middle] = L('V');
@@ -257,13 +260,13 @@
 
 	      adr[middle] = L('T');
 	    }
-        }
+	}
 #endif
 
       /* strcpy/wcscpy test */
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
-        {
-          for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+	{
+	  for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
 	    {
 	      adr[inner] = L('\0');
 
@@ -277,7 +280,74 @@
 
 	      adr[inner] = L('T');
 	    }
-        }
+	}
+
+      /* strcmp/wcscmp tests */
+      for (outer = 1; outer < 32; ++outer)
+	for (middle = 0; middle < 16; ++middle)
+	  {
+	    MEMSET (adr + middle, L('T'), 256);
+	    adr[256] = L('\0');
+	    MEMSET (dest + nchars - outer, L('T'), outer - 1);
+	    dest[nchars - 1] = L('\0');
+
+	    if (STRCMP (adr + middle, dest + nchars - outer) <= 0)
+	      {
+		printf ("%s 1 flunked for outer = %d, middle = %d\n",
+			STRINGIFY (STRCMP), outer, middle);
+		result = 1;
+	      }
+
+	    if (STRCMP (dest + nchars - outer, adr + middle) >= 0)
+	      {
+		printf ("%s 2 flunked for outer = %d, middle = %d\n",
+			STRINGIFY (STRCMP), outer, middle);
+		result = 1;
+	      }
+	  }
+
+      /* strncmp/wcsncmp tests */
+      for (outer = 1; outer < 32; ++outer)
+	for (middle = 0; middle < 16; ++middle)
+	  {
+	    MEMSET (adr + middle, L('T'), 256);
+	    adr[256] = L('\0');
+	    MEMSET (dest + nchars - outer, L('T'), outer - 1);
+	    dest[nchars - 1] = L('U');
+
+	    for (inner = 0; inner < outer; ++inner)
+	      {
+		if (STRNCMP (adr + middle, dest + nchars - outer, inner) != 0)
+		  {
+		    printf ("%s 1 flunked for outer = %d, middle = %d, "
+			    "inner = %d\n",
+			    STRINGIFY (STRNCMP), outer, middle, inner);
+		    result = 1;
+		  }
+
+		if (STRNCMP (dest + nchars - outer, adr + middle, inner) != 0)
+		  {
+		    printf ("%s 2 flunked for outer = %d, middle = %d, "
+			    "inner = %d\n",
+			    STRINGIFY (STRNCMP), outer, middle, inner);
+		    result = 1;
+		  }
+	      }
+
+	    if (STRNCMP (adr + middle, dest + nchars - outer, outer) >= 0)
+	      {
+		printf ("%s 1 flunked for outer = %d, middle = %d, full\n",
+			STRINGIFY (STRNCMP), outer, middle);
+		result = 1;
+	      }
+
+	    if (STRNCMP (dest + nchars - outer, adr + middle, outer) <= 0)
+	      {
+		printf ("%s 2 flunked for outer = %d, middle = %d, full\n",
+			STRINGIFY (STRNCMP), outer, middle);
+		result = 1;
+	      }
+	  }
 
       /* strncpy/wcsncpy tests */
       adr[nchars - 1] = L('T');
@@ -295,12 +365,12 @@
 		  result = 1;
 		}
 	    }
-        }
+	}
       adr[nchars - 1] = L('\0');
 
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
-        {
-          for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+	{
+	  for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
 	    {
 	      size_t len;
 
@@ -334,12 +404,12 @@
 
 	      adr[inner] = L('T');
 	    }
-        }
+	}
 
       /* stpcpy/wcpcpy test */
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
-        {
-          for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+	{
+	  for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
 	    {
 	      adr[inner] = L('\0');
 
@@ -352,7 +422,7 @@
 
 	      adr[inner] = L('T');
 	    }
-        }
+	}
 
       /* stpncpy/wcpncpy test */
       adr[nchars - 1] = L('T');
@@ -374,8 +444,8 @@
       adr[nchars - 1] = L('\0');
 
       for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
-        {
-          for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
+	{
+	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
 	    {
 	      adr[middle] = L('\0');
 
@@ -393,7 +463,7 @@
 
 	      adr[middle] = L('T');
 	    }
-        }
+	}
 
       /* memcpy/wmemcpy test */
       for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
diff -Nru eglibc-2.11.2/sysdeps/generic/ldsodefs.h eglibc-2.11.3/sysdeps/generic/ldsodefs.h
--- eglibc-2.11.2/sysdeps/generic/ldsodefs.h	2009-07-29 15:58:14.000000000 +0000
+++ eglibc-2.11.3/sysdeps/generic/ldsodefs.h	2010-12-06 20:55:10.000000000 +0000
@@ -820,11 +820,9 @@
 
 /* Open the shared object NAME and map in its segments.
    LOADER's DT_RPATH is used in searching for NAME.
-   If the object is already opened, returns its existing map.
-   For preloaded shared objects PRELOADED is set to a non-zero
-   value to allow additional security checks.  */
+   If the object is already opened, returns its existing map.  */
 extern struct link_map *_dl_map_object (struct link_map *loader,
-					const char *name, int preloaded,
+					const char *name,
 					int type, int trace_mode, int mode,
 					Lmid_t nsid)
      internal_function attribute_hidden;
@@ -889,8 +887,11 @@
 extern ElfW(Addr) _dl_symbol_value (struct link_map *map, const char *name)
      internal_function;
 
-/* Allocate a `struct link_map' for a new object being loaded,
-   and enter it into the _dl_main_map list.  */
+/* Add the new link_map NEW to the end of the namespace list.  */
+extern void _dl_add_to_namespace_list (struct link_map *new, Lmid_t nsid)
+     internal_function attribute_hidden;
+
+/* Allocate a `struct link_map' for a new object being loaded.  */
 extern struct link_map *_dl_new_object (char *realname, const char *libname,
 					int type, struct link_map *loader,
 					int mode, Lmid_t nsid)
diff -Nru eglibc-2.11.2/sysdeps/i386/bits/byteswap.h eglibc-2.11.3/sysdeps/i386/bits/byteswap.h
--- eglibc-2.11.2/sysdeps/i386/bits/byteswap.h	2008-05-15 12:10:03.000000000 +0000
+++ eglibc-2.11.3/sysdeps/i386/bits/byteswap.h	2010-12-06 20:55:10.000000000 +0000
@@ -1,5 +1,5 @@
 /* Macros to swap the order of bytes in integer values.
-   Copyright (C) 1997, 1998, 2000, 2002, 2003, 2006, 2007, 2008
+   Copyright (C) 1997, 1998, 2000, 2002, 2003, 2006, 2007, 2008, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -27,26 +27,27 @@
 
 /* Swap bytes in 16 bit value.  */
 #define __bswap_constant_16(x) \
-     ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
+     ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
 
 #ifdef __GNUC__
 # if __GNUC__ >= 2
 #  define __bswap_16(x) \
      (__extension__							      \
-      ({ register unsigned short int __v, __x = (x);			      \
+      ({ register unsigned short int __v, __x = (unsigned short int) (x);     \
 	 if (__builtin_constant_p (__x))				      \
 	   __v = __bswap_constant_16 (__x);				      \
 	 else								      \
 	   __asm__ ("rorw $8, %w0"					      \
 		    : "=r" (__v)					      \
- 		    : "0" (__x)						      \
- 		    : "cc");						      \
+		    : "0" (__x)						      \
+		    : "cc");						      \
 	 __v; }))
 # else
 /* This is better than nothing.  */
 #  define __bswap_16(x) \
      (__extension__							      \
-      ({ register unsigned short int __x = (x); __bswap_constant_16 (__x); }))
+      ({ register unsigned short int __x = (unsigned short int) (x);	      \
+	 __bswap_constant_16 (__x); }))
 # endif
 #else
 static __inline unsigned short int
@@ -122,7 +123,7 @@
      (__extension__							      \
       ({ union { __extension__ unsigned long long int __ll;		      \
 		 unsigned long int __l[2]; } __w, __r;			      \
-         if (__builtin_constant_p (x))					      \
+	 if (__builtin_constant_p (x))					      \
 	   __r.__ll = __bswap_constant_64 (x);				      \
 	 else								      \
 	   {								      \
diff -Nru eglibc-2.11.2/sysdeps/i386/elf/Makefile eglibc-2.11.3/sysdeps/i386/elf/Makefile
--- eglibc-2.11.2/sysdeps/i386/elf/Makefile	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.11.3/sysdeps/i386/elf/Makefile	2010-12-06 20:55:10.000000000 +0000
@@ -0,0 +1,4 @@
+ifeq ($(subdir),csu)
+# Turn off -fasynchronous-unwind-tables
+CFLAGS-initfini.s += -fno-asynchronous-unwind-tables
+endif
diff -Nru eglibc-2.11.2/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c eglibc-2.11.3/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
--- eglibc-2.11.2/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c	2006-08-17 01:18:26.000000000 +0000
+++ eglibc-2.11.3/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c	2010-12-06 20:55:10.000000000 +0000
@@ -73,9 +73,9 @@
 	m = ((a.i[2] >> 20) & 0x7ff) - 54;
       }
       m += n;
-      if (m > 0)
+      if ((int) m > 0)
 	a.i[2] = (a.i[2] & 0x800fffff) | (m << 20);
-      else if (m <= -54) {
+      else if ((int) m <= -54) {
 	a.i[2] &= 0x80000000;
 	a.i[3] = 0;
       } else {
diff -Nru eglibc-2.11.2/sysdeps/mach/hurd/linkat.c eglibc-2.11.3/sysdeps/mach/hurd/linkat.c
--- eglibc-2.11.2/sysdeps/mach/hurd/linkat.c	2006-08-17 01:18:26.000000000 +0000
+++ eglibc-2.11.3/sysdeps/mach/hurd/linkat.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,5 +1,5 @@
 /* Make a link between file names relative to open directories.  Hurd version.
-   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
@@ -38,7 +38,9 @@
   file_t oldfile, linknode, todir;
   char *toname;
 
-  oldfile = __file_name_lookup_at (fromfd, flags, from, 0, 0);
+  /* POSIX says linkat doesn't follow symlinks by default, so pass
+     O_NOLINK.  That can be overridden by AT_SYMLINK_FOLLOW in FLAGS.  */
+  oldfile = __file_name_lookup_at (fromfd, flags, from, O_NOLINK, 0);
   if (oldfile == MACH_PORT_NULL)
     return -1;
 
diff -Nru eglibc-2.11.2/sysdeps/s390/s390-32/__longjmp.c eglibc-2.11.3/sysdeps/s390/s390-32/__longjmp.c
--- eglibc-2.11.2/sysdeps/s390/s390-32/__longjmp.c	2009-06-01 13:59:14.000000000 +0000
+++ eglibc-2.11.3/sysdeps/s390/s390-32/__longjmp.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2005, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2005, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
 
@@ -29,16 +29,19 @@
 void
 __longjmp (__jmp_buf env, int val)
 {
-  register int r2 __asm ("%r2") = val == 0 ? 1 : val;
 #ifdef PTR_DEMANGLE
-  register uintptr_t r3 __asm ("%r3") = THREAD_GET_POINTER_GUARD ();
-  register void *r1 __asm ("%r1") = (void *) env;
+  uintptr_t guard = THREAD_GET_POINTER_GUARD ();
 # ifdef CHECK_SP
-  CHECK_SP (env, r3);
+  CHECK_SP (env, guard);
 # endif
 #elif defined CHECK_SP
   CHECK_SP (env, 0);
 #endif
+  register int r2 __asm ("%r2") = val == 0 ? 1 : val;
+#ifdef PTR_DEMANGLE
+  register uintptr_t r3 __asm ("%r3") = guard;
+  register void *r1 __asm ("%r1") = (void *) env;
+#endif
   /* Restore registers and jump back.  */
   asm volatile ("ld   %%f6,48(%1)\n\t"
 		"ld   %%f4,40(%1)\n\t"
diff -Nru eglibc-2.11.2/sysdeps/s390/s390-64/__longjmp.c eglibc-2.11.3/sysdeps/s390/s390-64/__longjmp.c
--- eglibc-2.11.2/sysdeps/s390/s390-64/__longjmp.c	2009-06-01 13:59:14.000000000 +0000
+++ eglibc-2.11.3/sysdeps/s390/s390-64/__longjmp.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2005, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2005, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
 
@@ -29,16 +29,19 @@
 void
 __longjmp (__jmp_buf env, int val)
 {
-  register long int r2 __asm ("%r2") = val == 0 ? 1 : val;
 #ifdef PTR_DEMANGLE
-  register uintptr_t r3 __asm ("%r3") = THREAD_GET_POINTER_GUARD ();
-  register void *r1 __asm ("%r1") = (void *) env;
+  uintptr_t guard = THREAD_GET_POINTER_GUARD ();
 # ifdef CHECK_SP
-  CHECK_SP (env, r3);
+  CHECK_SP (env, guard);
 # endif
 #elif defined CHECK_SP
   CHECK_SP (env, 0);
 #endif
+  register long int r2 __asm ("%r2") = val == 0 ? 1 : val;
+#ifdef PTR_DEMANGLE
+  register uintptr_t r3 __asm ("%r3") = guard;
+  register void *r1 __asm ("%r1") = (void *) env;
+#endif
   /* Restore registers and jump back.  */
   asm volatile ("ld   %%f7,104(%1)\n\t"
 		"ld   %%f5,96(%1)\n\t"
diff -Nru eglibc-2.11.2/sysdeps/unix/sysv/linux/check_pf.c eglibc-2.11.3/sysdeps/unix/sysv/linux/check_pf.c
--- eglibc-2.11.2/sysdeps/unix/sysv/linux/check_pf.c	2008-02-20 12:48:46.000000000 +0000
+++ eglibc-2.11.3/sysdeps/unix/sysv/linux/check_pf.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,5 +1,5 @@
 /* Determine protocol families for which interfaces exist.  Linux version.
-   Copyright (C) 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006, 2007, 2008, 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
@@ -304,10 +304,13 @@
 
   struct ifaddrs *runp;
   for (runp = ifa; runp != NULL; runp = runp->ifa_next)
-    if (runp->ifa_addr->sa_family == PF_INET)
-      *seen_ipv4 = true;
-    else if (runp->ifa_addr->sa_family == PF_INET6)
-      *seen_ipv6 = true;
+    if (runp->ifa_addr != NULL)
+      {
+	if (runp->ifa_addr->sa_family == PF_INET)
+	  *seen_ipv4 = true;
+	else if (runp->ifa_addr->sa_family == PF_INET6)
+	  *seen_ipv6 = true;
+      }
 
   (void) freeifaddrs (ifa);
 #endif
diff -Nru eglibc-2.11.2/sysdeps/unix/sysv/linux/getdents.c eglibc-2.11.3/sysdeps/unix/sysv/linux/getdents.c
--- eglibc-2.11.2/sysdeps/unix/sysv/linux/getdents.c	2007-02-05 17:59:45.000000000 +0000
+++ eglibc-2.11.3/sysdeps/unix/sysv/linux/getdents.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995-2003, 2004, 2006, 2007
+/* Copyright (C) 1993, 1995-2004, 2006, 2007, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -285,7 +285,11 @@
 	DIRENT_SET_DP_INO(dp, kdp->d_ino);
 	dp->d_off = kdp->d_off;
 	dp->d_reclen = new_reclen;
+#ifdef __ASSUME_GETDENTS32_D_TYPE
+	dp->d_type = *((char *) kdp + kdp->d_reclen - 1);
+#else
 	dp->d_type = DT_UNKNOWN;
+#endif
 	memcpy (dp->d_name, kdp->d_name,
 		kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
 
diff -Nru eglibc-2.11.2/sysdeps/unix/sysv/linux/i386/bits/mman.h eglibc-2.11.3/sysdeps/unix/sysv/linux/i386/bits/mman.h
--- eglibc-2.11.2/sysdeps/unix/sysv/linux/i386/bits/mman.h	2009-11-19 16:22:59.000000000 +0000
+++ eglibc-2.11.3/sysdeps/unix/sysv/linux/i386/bits/mman.h	2010-12-06 20:55:10.000000000 +0000
@@ -1,5 +1,6 @@
 /* Definitions for POSIX memory map interface.  Linux/i386 version.
-   Copyright (C) 1997,2000,2003,2005,2006,2009 Free Software Foundation, Inc.
+   Copyright (C) 1997,2000,2003,2005,2006,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
@@ -64,6 +65,7 @@
 # define MAP_POPULATE	0x08000		/* Populate (prefault) pagetables.  */
 # define MAP_NONBLOCK	0x10000		/* Do not block on IO.  */
 # define MAP_STACK	0x20000		/* Allocation is for a stack.  */
+# define MAP_HUGETLB	0x40000		/* Create huge page mapping.  */
 #endif
 
 /* Flags to `msync'.  */
diff -Nru eglibc-2.11.2/sysdeps/unix/sysv/linux/internal_statvfs.c eglibc-2.11.3/sysdeps/unix/sysv/linux/internal_statvfs.c
--- eglibc-2.11.2/sysdeps/unix/sysv/linux/internal_statvfs.c	2007-01-09 13:36:33.000000000 +0000
+++ eglibc-2.11.3/sysdeps/unix/sysv/linux/internal_statvfs.c	2010-12-06 20:55:10.000000000 +0000
@@ -214,7 +214,8 @@
   buf->f_files = fsbuf->f_files;
   buf->f_ffree = fsbuf->f_ffree;
   if (sizeof (buf->f_fsid) == sizeof (fsbuf->f_fsid))
-    buf->f_fsid = (fsbuf->f_fsid.__val[0]
+    buf->f_fsid = ((fsbuf->f_fsid.__val[0]
+		    & ((1UL << (8 * sizeof (fsbuf->f_fsid.__val[0]))) - 1))
 		   | ((unsigned long int) fsbuf->f_fsid.__val[1]
 		      << (8 * (sizeof (buf->f_fsid)
 			       - sizeof (fsbuf->f_fsid.__val[0])))));
diff -Nru eglibc-2.11.2/sysdeps/unix/sysv/linux/sparc/sys/epoll.h eglibc-2.11.3/sysdeps/unix/sysv/linux/sparc/sys/epoll.h
--- eglibc-2.11.2/sysdeps/unix/sysv/linux/sparc/sys/epoll.h	2008-08-19 17:24:09.000000000 +0000
+++ eglibc-2.11.3/sysdeps/unix/sysv/linux/sparc/sys/epoll.h	2010-12-06 20:55:10.000000000 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2006, 2007, 2008, 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
@@ -31,7 +31,7 @@
 #endif
 
 
-/* Flags to be passed to epoll_create2.  */
+/* Flags to be passed to epoll_create1.  */
 enum
   {
     EPOLL_CLOEXEC = 0x400000,
@@ -101,8 +101,9 @@
    returned by epoll_create() should be closed with close().  */
 extern int epoll_create (int __size) __THROW;
 
-/* Same as epoll_create but with an additional FLAGS parameter.  */
-extern int epoll_create2 (int __size, int __flags) __THROW;
+/* Same as epoll_create but with an FLAGS parameter.  The unused SIZE
+   parameter has been dropped.  */
+extern int epoll_create1 (int __flags) __THROW;
 
 
 /* Manipulate an epoll instance "epfd". Returns 0 in case of success,
diff -Nru eglibc-2.11.2/sysdeps/unix/sysv/linux/sys/swap.h eglibc-2.11.3/sysdeps/unix/sysv/linux/sys/swap.h
--- eglibc-2.11.2/sysdeps/unix/sysv/linux/sys/swap.h	2006-08-17 01:18:26.000000000 +0000
+++ eglibc-2.11.3/sysdeps/unix/sysv/linux/sys/swap.h	2010-12-06 20:55:10.000000000 +0000
@@ -1,5 +1,5 @@
 /* Calls to enable and disable swapping on specified locations.  Linux version.
-   Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998, 1999, 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
@@ -28,6 +28,7 @@
 #define	SWAP_FLAG_PREFER	0x8000	/* Set if swap priority is specified. */
 #define	SWAP_FLAG_PRIO_MASK	0x7fff
 #define	SWAP_FLAG_PRIO_SHIFT	0
+#define SWAP_FLAG_DISCARD	0x10000	/* Discard swap cluster after use.  */
 
 __BEGIN_DECLS
 
diff -Nru eglibc-2.11.2/sysdeps/unix/sysv/linux/ttyname.c eglibc-2.11.3/sysdeps/unix/sysv/linux/ttyname.c
--- eglibc-2.11.2/sysdeps/unix/sysv/linux/ttyname.c	2009-10-30 17:58:03.000000000 +0000
+++ eglibc-2.11.3/sysdeps/unix/sysv/linux/ttyname.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,93,1996-2002,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993,1996-2002,2006,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
@@ -131,6 +132,9 @@
   if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
     return NULL;
 
+  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
+    return NULL;
+
   /* We try using the /proc filesystem.  */
   *_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';
 
@@ -161,13 +165,32 @@
     {
       if ((size_t) len >= buflen)
 	return NULL;
+
+#define UNREACHABLE_LEN strlen ("(unreachable)")
+      if (len > UNREACHABLE_LEN
+	  && memcmp (ttyname_buf, "(unreachable)", UNREACHABLE_LEN) == 0)
+	{
+	  memmove (ttyname_buf, ttyname_buf + UNREACHABLE_LEN,
+		   len - UNREACHABLE_LEN);
+	  len -= UNREACHABLE_LEN;
+	}
+
       /* readlink need not terminate the string.  */
       ttyname_buf[len] = '\0';
-      return ttyname_buf;
-    }
 
-  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
-    return NULL;
+      /* Verify readlink result, fall back on iterating through devices.  */
+      if (ttyname_buf[0] == '/'
+	  && __xstat64 (_STAT_VER, ttyname_buf, &st1) == 0
+#ifdef _STATBUF_ST_RDEV
+	  && S_ISCHR (st1.st_mode)
+	  && st1.st_rdev == st.st_rdev
+#else
+	  && st1.st_ino == st.st_ino
+	  && st1.st_dev == st.st_dev
+#endif
+	  )
+	return ttyname_buf;
+    }
 
   if (__xstat64 (_STAT_VER, "/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode))
     {
diff -Nru eglibc-2.11.2/sysdeps/unix/sysv/linux/ttyname_r.c eglibc-2.11.3/sysdeps/unix/sysv/linux/ttyname_r.c
--- eglibc-2.11.2/sysdeps/unix/sysv/linux/ttyname_r.c	2007-01-09 13:36:33.000000000 +0000
+++ eglibc-2.11.3/sysdeps/unix/sysv/linux/ttyname_r.c	2010-12-06 20:55:10.000000000 +0000
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,93,1995-2001,2003,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993,1995-2001,2003,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
@@ -122,6 +123,9 @@
   if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
     return errno;
 
+  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
+    return errno;
+
   /* We try using the /proc filesystem.  */
   *_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';
 
@@ -145,12 +149,30 @@
 #endif
 			, 1))
     {
+#define UNREACHABLE_LEN strlen ("(unreachable)")
+      if (ret > UNREACHABLE_LEN
+	  && memcmp (buf, "(unreachable)", UNREACHABLE_LEN) == 0)
+	{
+	  memmove (buf, buf + UNREACHABLE_LEN, ret - UNREACHABLE_LEN);
+	  ret -= UNREACHABLE_LEN;
+	}
+
+      /* readlink need not terminate the string.  */
       buf[ret] = '\0';
-      return 0;
-    }
 
-  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
-    return errno;
+      /* Verify readlink result, fall back on iterating through devices.  */
+      if (buf[0] == '/'
+	  && __xstat64 (_STAT_VER, buf, &st1) == 0
+#ifdef _STATBUF_ST_RDEV
+	  && S_ISCHR (st1.st_mode)
+	  && st1.st_rdev == st.st_rdev
+#else
+	  && st1.st_ino == st.st_ino
+	  && st1.st_dev == st.st_dev
+#endif
+	  )
+	return 0;
+    }
 
   /* Prepare the result buffer.  */
   memcpy (buf, "/dev/pts/", sizeof ("/dev/pts/"));
diff -Nru eglibc-2.11.2/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S eglibc-2.11.3/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
--- eglibc-2.11.2/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S	2009-08-03 13:36:46.000000000 +0000
+++ eglibc-2.11.3/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S	2010-12-06 20:55:10.000000000 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2004,2005,2006,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
@@ -49,9 +49,9 @@
 	.text
 ENTRY(____longjmp_chk)
 	/* Restore registers.  */
-	movq	(JB_RSP*8)(%rdi),%r8
-	movq	(JB_RBP*8)(%rdi),%r9
-	movq	(JB_PC*8)(%rdi),%rdx
+	movq	(JB_RSP*8)(%rdi), %r8
+	movq	(JB_RBP*8)(%rdi), %r9
+	movq	(JB_PC*8)(%rdi), %rdx
 #ifdef PTR_DEMANGLE
 	PTR_DEMANGLE (%r8)
 	PTR_DEMANGLE (%r9)
@@ -63,7 +63,9 @@
 
 	/* Save function parameters.  */
 	movq	%rdi, %r10
-	movl	%esi, %ecx
+	cfi_register (%rdi, %r10)
+	movl	%esi, %ebx
+	cfi_register (%rsi, %rbx)
 
 	xorl	%edi, %edi
 	leaq	-24(%rsp), %rsi
@@ -84,7 +86,9 @@
 .Lfail:	CALL_FAIL
 
 .Lok2:	movq	%r10, %rdi
-	movl	%ecx, %esi
+	cfi_restore (%rdi)
+	movl	%ebx, %esi
+	cfi_restore (%rsi)
 
 .Lok:	/* We add unwind information for the target here.  */
 	cfi_def_cfa(%rdi, 0)
@@ -96,11 +100,11 @@
 	cfi_offset(%r13,JB_R13*8)
 	cfi_offset(%r14,JB_R14*8)
 	cfi_offset(%r15,JB_R15*8)
-	movq	(JB_RBX*8)(%rdi),%rbx
-	movq	(JB_R12*8)(%rdi),%r12
-	movq	(JB_R13*8)(%rdi),%r13
-	movq	(JB_R14*8)(%rdi),%r14
-	movq	(JB_R15*8)(%rdi),%r15
+	movq	(JB_RBX*8)(%rdi), %rbx
+	movq	(JB_R12*8)(%rdi), %r12
+	movq	(JB_R13*8)(%rdi), %r13
+	movq	(JB_R14*8)(%rdi), %r14
+	movq	(JB_R15*8)(%rdi), %r15
 	/* Set return value for setjmp.  */
 	movl	%esi, %eax
 	movq	%r8,%rsp
diff -Nru eglibc-2.11.2/sysdeps/unix/sysv/linux/x86_64/bits/mman.h eglibc-2.11.3/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
--- eglibc-2.11.2/sysdeps/unix/sysv/linux/x86_64/bits/mman.h	2009-11-19 16:22:59.000000000 +0000
+++ eglibc-2.11.3/sysdeps/unix/sysv/linux/x86_64/bits/mman.h	2010-12-06 20:55:10.000000000 +0000
@@ -1,5 +1,5 @@
 /* Definitions for POSIX memory map interface.  Linux/x86_64 version.
-   Copyright (C) 2001, 2003, 2005, 2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001,2003,2005,2006,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
@@ -65,6 +65,7 @@
 # define MAP_POPULATE	0x08000		/* Populate (prefault) pagetables.  */
 # define MAP_NONBLOCK	0x10000		/* Do not block on IO.  */
 # define MAP_STACK	0x20000		/* Allocation is for a stack.  */
+# define MAP_HUGETLB	0x40000		/* Create huge page mapping.  */
 #endif
 
 /* Flags to `msync'.  */
diff -Nru eglibc-2.11.2/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h eglibc-2.11.3/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h
--- eglibc-2.11.2/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h	2008-08-19 17:24:09.000000000 +0000
+++ eglibc-2.11.3/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h	2010-12-06 20:55:10.000000000 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2008, 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
@@ -31,7 +31,7 @@
 #endif
 
 
-/* Flags to be passed to epoll_create2.  */
+/* Flags to be passed to epoll_create1.  */
 enum
   {
     EPOLL_CLOEXEC = 02000000,
diff -Nru eglibc-2.11.2/sysdeps/x86_64/bits/byteswap.h eglibc-2.11.3/sysdeps/x86_64/bits/byteswap.h
--- eglibc-2.11.2/sysdeps/x86_64/bits/byteswap.h	2008-05-15 12:10:03.000000000 +0000
+++ eglibc-2.11.3/sysdeps/x86_64/bits/byteswap.h	2010-12-06 20:55:10.000000000 +0000
@@ -1,5 +1,5 @@
 /* Macros to swap the order of bytes in integer values.
-   Copyright (C) 1997, 1998, 2000, 2002, 2003, 2007, 2008
+   Copyright (C) 1997, 1998, 2000, 2002, 2003, 2007, 2008, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -29,12 +29,12 @@
 
 /* Swap bytes in 16 bit value.  */
 #define __bswap_constant_16(x) \
-     ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
+     ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
 
 #if defined __GNUC__ && __GNUC__ >= 2
 # define __bswap_16(x) \
      (__extension__							      \
-      ({ register unsigned short int __v, __x = (x);			      \
+      ({ register unsigned short int __v, __x = (unsigned short int) (x);     \
 	 if (__builtin_constant_p (__x))				      \
 	   __v = __bswap_constant_16 (__x);				      \
 	 else								      \
@@ -47,7 +47,8 @@
 /* This is better than nothing.  */
 # define __bswap_16(x) \
      (__extension__							      \
-      ({ register unsigned short int __x = (x); __bswap_constant_16 (__x); }))
+      ({ register unsigned short int __x = (unsigned short int) (x);          \
+	 __bswap_constant_16 (__x); }))
 #endif
 
 
@@ -120,16 +121,16 @@
 #  define __bswap_64(x) \
      (__extension__                                                           \
       ({ union { __extension__ unsigned long long int __ll;                   \
-                 unsigned int __l[2]; } __w, __r;                             \
-         if (__builtin_constant_p (x))                                        \
-           __r.__ll = __bswap_constant_64 (x);                                \
-         else                                                                 \
-           {                                                                  \
-             __w.__ll = (x);                                                  \
-             __r.__l[0] = __bswap_32 (__w.__l[1]);                            \
-             __r.__l[1] = __bswap_32 (__w.__l[0]);                            \
-           }                                                                  \
-         __r.__ll; }))
+		 unsigned int __l[2]; } __w, __r;                             \
+	 if (__builtin_constant_p (x))                                        \
+	   __r.__ll = __bswap_constant_64 (x);                                \
+	 else                                                                 \
+	   {                                                                  \
+	     __w.__ll = (x);                                                  \
+	     __r.__l[0] = __bswap_32 (__w.__l[1]);                            \
+	     __r.__l[1] = __bswap_32 (__w.__l[0]);                            \
+	   }                                                                  \
+	 __r.__ll; }))
 # endif
 #endif
 
diff -Nru eglibc-2.11.2/sysdeps/x86_64/cacheinfo.c eglibc-2.11.3/sysdeps/x86_64/cacheinfo.c
--- eglibc-2.11.2/sysdeps/x86_64/cacheinfo.c	2009-08-09 14:33:15.000000000 +0000
+++ eglibc-2.11.3/sysdeps/x86_64/cacheinfo.c	2010-12-06 20:55:10.000000000 +0000
@@ -453,10 +453,10 @@
 
 
 /* Half the data cache size for use in memory and string routines, typically
-   L1 size.  */
+   L1 size, rounded to multiple of 256 bytes.  */
 long int __x86_64_data_cache_size_half attribute_hidden = 32 * 1024 / 2;
 /* Shared cache size for use in memory and string routines, typically
-   L2 or L3 size.  */
+   L2 or L3 size, rounded to multiple of 256 bytes.  */
 long int __x86_64_shared_cache_size_half attribute_hidden = 1024 * 1024 / 2;
 long int __x86_64_shared_cache_size attribute_hidden = 1024 * 1024;
 
@@ -657,10 +657,16 @@
     }
 
   if (data > 0)
-    __x86_64_data_cache_size_half = data / 2;
+    {
+      /* Round data cache size to multiple of 256 bytes.  */
+      data = data & ~255L;
+      __x86_64_data_cache_size_half = data / 2;
+    }
 
   if (shared > 0)
     {
+      /* Round shared cache size to multiple of 256 bytes.  */
+      shared = shared & ~255L;
       __x86_64_shared_cache_size_half = shared / 2;
       __x86_64_shared_cache_size = shared;
     }
diff -Nru eglibc-2.11.2/sysdeps/x86_64/multiarch/strchr.S eglibc-2.11.3/sysdeps/x86_64/multiarch/strchr.S
--- eglibc-2.11.2/sysdeps/x86_64/multiarch/strchr.S	2009-10-28 16:13:02.000000000 +0000
+++ eglibc-2.11.3/sysdeps/x86_64/multiarch/strchr.S	2010-11-07 12:16:06.000000000 +0000
@@ -1,5 +1,5 @@
 /* strchr with SSE4.2
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 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
@@ -87,13 +87,13 @@
 	pxor	%xmm2, %xmm2
 	movd	%esi, %xmm1
 	movl	%edi, %ecx
+	pshufb  %xmm2, %xmm1
 	andl	$15, %ecx
 	movq	%rdi, %r8
 	je	L(aligned_start)
 
 /* Handle unaligned string.  */
 	andq	$-16, %r8
-	pshufb  %xmm2, %xmm1
 	movdqa	(%r8), %xmm0
 	pcmpeqb	 %xmm0, %xmm2
 	pcmpeqb	 %xmm1, %xmm0
diff -Nru eglibc-2.11.2/sysdeps/x86_64/strcmp.S eglibc-2.11.3/sysdeps/x86_64/strcmp.S
--- eglibc-2.11.2/sysdeps/x86_64/strcmp.S	2009-08-09 14:33:15.000000000 +0000
+++ eglibc-2.11.3/sysdeps/x86_64/strcmp.S	2010-11-07 12:16:06.000000000 +0000
@@ -313,7 +313,7 @@
 	jnz	LABEL(ashr_1_exittail)	/* find null char*/
 
 #ifdef USE_AS_STRNCMP
-	cmp	$14, %r11
+	cmp	$15, %r11
 	jbe	LABEL(ashr_1_exittail)
 #endif
 
@@ -438,7 +438,7 @@
 	jnz	LABEL(ashr_2_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$13, %r11
+	cmp	$14, %r11
 	jbe	LABEL(ashr_2_exittail)
 #endif
 
@@ -560,7 +560,7 @@
 	jnz	LABEL(ashr_3_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$12, %r11
+	cmp	$13, %r11
 	jbe	LABEL(ashr_3_exittail)
 #endif
 
@@ -682,7 +682,7 @@
 	jnz	LABEL(ashr_4_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$11, %r11
+	cmp	$12, %r11
 	jbe	LABEL(ashr_4_exittail)
 #endif
 
@@ -804,7 +804,7 @@
 	jnz	LABEL(ashr_5_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$10, %r11
+	cmp	$11, %r11
 	jbe	LABEL(ashr_5_exittail)
 #endif
 
@@ -926,7 +926,7 @@
 	jnz	LABEL(ashr_6_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$9, %r11
+	cmp	$10, %r11
 	jbe	LABEL(ashr_6_exittail)
 #endif
 
@@ -1048,7 +1048,7 @@
 	jnz	LABEL(ashr_7_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$8, %r11
+	cmp	$9, %r11
 	jbe	LABEL(ashr_7_exittail)
 #endif
 
@@ -1170,7 +1170,7 @@
 	jnz	LABEL(ashr_8_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$7, %r11
+	cmp	$8, %r11
 	jbe	LABEL(ashr_8_exittail)
 #endif
 
@@ -1292,7 +1292,7 @@
 	jnz	LABEL(ashr_9_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$6, %r11
+	cmp	$7, %r11
 	jbe	LABEL(ashr_9_exittail)
 #endif
 
@@ -1414,7 +1414,7 @@
 	jnz	LABEL(ashr_10_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$5, %r11
+	cmp	$6, %r11
 	jbe	LABEL(ashr_10_exittail)
 #endif
 
@@ -1536,7 +1536,7 @@
 	jnz	LABEL(ashr_11_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$4, %r11
+	cmp	$5, %r11
 	jbe	LABEL(ashr_11_exittail)
 #endif
 
@@ -1658,7 +1658,7 @@
 	jnz	LABEL(ashr_12_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$3, %r11
+	cmp	$4, %r11
 	jbe	LABEL(ashr_12_exittail)
 #endif
 
@@ -1780,7 +1780,7 @@
 	jnz	LABEL(ashr_13_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$2, %r11
+	cmp	$3, %r11
 	jbe	LABEL(ashr_13_exittail)
 #endif
 
@@ -1902,7 +1902,7 @@
 	jnz	LABEL(ashr_14_exittail)
 
 #ifdef USE_AS_STRNCMP
-	cmp	$1, %r11
+	cmp	$2, %r11
 	jbe	LABEL(ashr_14_exittail)
 #endif
 
@@ -2026,8 +2026,8 @@
 	jnz	LABEL(ashr_15_exittail)
 
 #ifdef USE_AS_STRNCMP
-	test	%r11, %r11
-	je	LABEL(ashr_15_exittail)
+	cmpq	$1, %r11
+	jbe	LABEL(ashr_15_exittail)
 #endif
 
 	pxor	%xmm0, %xmm0
diff -Nru eglibc-2.11.2/version.h eglibc-2.11.3/version.h
--- eglibc-2.11.2/version.h	2010-06-10 19:20:45.000000000 +0000
+++ eglibc-2.11.3/version.h	2010-12-06 20:55:10.000000000 +0000
@@ -1,4 +1,4 @@
 /* This file just defines the current version number of libc.  */
 
 #define RELEASE "stable"
-#define VERSION "2.11.2"
+#define VERSION "2.11.3"
diff -Nru eglibc-2.11.2/wcsmbs/wchar.h eglibc-2.11.3/wcsmbs/wchar.h
--- eglibc-2.11.2/wcsmbs/wchar.h	2009-03-15 15:53:55.000000000 +0000
+++ eglibc-2.11.3/wcsmbs/wchar.h	2010-11-07 12:16:06.000000000 +0000
@@ -658,10 +658,10 @@
 extern int __REDIRECT (wscanf, (__const wchar_t *__restrict __format, ...),
 		       __isoc99_wscanf)
      /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
-extern int __REDIRECT (swscanf, (__const wchar_t *__restrict __s,
-				 __const wchar_t *__restrict __format, ...),
-		       __isoc99_swscanf)
-     __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+extern int __REDIRECT_NTH (swscanf, (__const wchar_t *__restrict __s,
+				     __const wchar_t *__restrict __format,
+				     ...), __isoc99_swscanf)
+     /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
 #  else
 extern int __isoc99_fwscanf (__FILE *__restrict __stream,
 			     __const wchar_t *__restrict __format, ...);
@@ -712,10 +712,10 @@
 extern int __REDIRECT (vwscanf, (__const wchar_t *__restrict __format,
 				 __gnuc_va_list __arg), __isoc99_vwscanf)
      /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
-extern int __REDIRECT (vswscanf, (__const wchar_t *__restrict __s,
-				  __const wchar_t *__restrict __format,
-				  __gnuc_va_list __arg), __isoc99_vswscanf)
-     __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+extern int __REDIRECT_NTH (vswscanf, (__const wchar_t *__restrict __s,
+				      __const wchar_t *__restrict __format,
+				      __gnuc_va_list __arg), __isoc99_vswscanf)
+     /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
 #  else
 extern int __isoc99_vfwscanf (__FILE *__restrict __s,
 			      __const wchar_t *__restrict __format,
diff -Nru eglibc-2.11.2/wcsmbs/wcsatcliff.c eglibc-2.11.3/wcsmbs/wcsatcliff.c
--- eglibc-2.11.2/wcsmbs/wcsatcliff.c	2009-04-14 19:46:20.000000000 +0000
+++ eglibc-2.11.3/wcsmbs/wcsatcliff.c	2010-11-07 12:16:06.000000000 +0000
@@ -16,6 +16,8 @@
 #define MEMCPY wmemcpy
 #define MEMPCPY wmempcpy
 #define MEMCHR wmemchr
+#define STRCMP wcscmp
+#define STRNCMP wcsncmp
 
 
 #include "../string/stratcliff.c"

Attachment: signature.asc
Description: Digital signature


Reply to: