summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog130
-rw-r--r--csu/libc-start.c4
-rw-r--r--debug/pcprofiledump.c17
-rw-r--r--debug/segfault.c6
-rw-r--r--elf/do-lookup.h2
-rw-r--r--elf/elf.h22
-rw-r--r--fedora/branch.mk4
-rw-r--r--fedora/glibc.spec.in9
-rw-r--r--iconv/gconv.c20
-rw-r--r--iconvdata/Makefile4
-rw-r--r--iconvdata/bug-iconv5.c53
-rw-r--r--locale/localeinfo.h4
-rw-r--r--localedata/ChangeLog15
-rw-r--r--localedata/SUPPORTED1
-rw-r--r--localedata/locales/as_IN2
-rw-r--r--localedata/locales/ru_RU4
-rw-r--r--localedata/locales/wo_SN180
-rw-r--r--login/tst-grantpt.c2
-rw-r--r--nis/nis_table.c13
-rw-r--r--nptl/ChangeLog18
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/allocatestack.c20
-rw-r--r--nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S9
-rw-r--r--nptl/tst-tsd6.c89
-rw-r--r--nscd/Makefile3
-rw-r--r--nscd/connections.c2
-rw-r--r--nscd/gethstbyad_r.c3
-rw-r--r--nscd/gethstbynm2_r.c3
-rw-r--r--nscd/hstcache.c36
-rw-r--r--nscd/res_hconf.c13
-rw-r--r--po/nl.po63
-rw-r--r--resolv/arpa/nameser.h5
-rw-r--r--resolv/res_hconf.c4
-rw-r--r--resolv/res_send.c9
-rw-r--r--stdio-common/tempnam.c14
-rw-r--r--string/strfry.c2
-rw-r--r--string/strtok.c5
-rw-r--r--sysdeps/i386/dl-trampoline.S19
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/i386/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/init-first.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/init-first.c49
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/libc-start.c31
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/gettimeofday.S2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/init-first.c (renamed from sysdeps/unix/sysv/linux/x86_64/libc-start.c)8
-rw-r--r--sysdeps/x86_64/cacheinfo.c64
-rw-r--r--sysdeps/x86_64/dl-trampoline.S7
48 files changed, 836 insertions, 152 deletions
diff --git a/ChangeLog b/ChangeLog
index 232f0b3c79..723cb0234c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,133 @@
+2007-08-25  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/x86_64/cacheinfo.c (handle_amd): Fix computation of
+	associativity for fully-associative caches.
+
+	* sysdeps/x86_64/cacheinfo.c (handle_amd): Handle L3 cache
+	requests.  Fill on more associativity values for L2.
+	Patch mostly by Evandro Menezes.
+
+2007-08-24  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/unix/sysv/linux/x86_64/init-first.c
+	(_libc_vdso_platform_setup): Avoid using exported variable by using
+	alias.
+
+	* resolv/arpa/nameser.h (NS_OPT_DNSSEC_OK): Define.
+
+	* sysdeps/unix/sysv/linux/i386/syscalls.list: No reason to mark
+	fallocate64 as EXTRA< it is not referenced if the symbol isn't
+	defined.
+
+2007-08-23  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Correctly
+	align stack for call if pltexit is to be used.
+
+	[BZ #3924]
+	* sysdeps/i386/dl-trampoline.S (_dl_runtime_profile): Correctly
+	align for function call in case pltexit has to be called later.
+
+	* sysdeps/i386/dl-trampoline.S (_dl_runtime_resolve): Avoid
+	implicit atomic operation when storing function pointer.
+	(_dl_runtime_profile): Likewise.
+
+2007-08-17  Jakub Jelinek  <jakub@redhat.com>
+
+	* nis/nis_table.c (nis_list): Don't fail if __follow_path returned
+	NIS_NOTFOUND.
+
+2007-08-21  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #4566]
+	* string/strtok.c: Fix typo in comment.
+
+	[BZ #4582]
+	* debug/segfault.c: Fix typos in comments.
+
+	[BZ #4588]
+	* stdio-common/tempnam.c: Fix comment, it is not checked that
+	TMPDIR points to a writable directory.
+
+	[BZ #4726]
+	* resolv/res_send.c (__libc_res_nsend): Initialize all of the
+	memory allocated for the name server address.
+
+	[BZ #4946]
+	* nscd/connections.c (handle_request): Using sendfile always
+	requires that mmap is used for the database.
+	Patch by Petr Baudis <pasky@suse.cz>.
+
+	[BZ #4905]
+	* nscd/hstcache.c (cache_addhst): When reloading an entry which
+	suddenly has two or more addresses, ignore it and remove the old
+	entry.
+
+	[BZ #4814]
+	* resolv/res_hconf.c: Prepare for compiling outside libc.
+	* nscd/res_hconf.c: New file.
+	* nscd/Makefile (nscd-modules): Add res_hconf.  Add rules to build
+	the new file.
+	* nscd/gethstbynm2_r.c (NEED__RES_HCONF): Define.
+	* nscd/gethstbyad_r.c (NEED__RES_HCONF): Likewise.
+
+	* nscd/hstcache.c (cache_addhst): Minimal optimization.
+
+	[BZ #4925]
+	* debug/pcprofiledump.c: Turn on internationalization by calling
+	setlocale.  Patch mostly by Benno Schulenberg.
+
+	[BZ #4936]
+	* iconv/gconv.c (__gconv): If flush was successful, clear rest of
+	the state.
+	* iconvdata/Makefile: Add rules to build and run bug-iconv5.
+	* iconvdata/bug-iconv5.c: New file.
+
+2007-08-04  Carlos O'Donell  <carlos@systemhalted.org>
+
+	[BZ #4896]
+	* elf/elf.h: Define R_PARISC_PLABEL21L, R_PARISC_PLABEL14R,
+	R_PARISC_GNU_VTENTRY, R_PARISC_GNU_VTINHERIT, R_PARISC_TLS_GD21L,
+	R_PARISC_TLS_GD14R, R_PARISC_TLS_GDCALL, R_PARISC_TLS_LDM21L,
+	R_PARISC_TLS_LDM14R, R_PARISC_TLS_LDMCALL, R_PARISC_TLS_LDO21L,
+	R_PARISC_TLS_LDO14R, R_PARISC_TLS_DTPMOD32, R_PARISC_TLS_DTPMOD64,
+	R_PARISC_TLS_DTPOFF32, R_PARISC_TLS_DTPOFF64, R_PARISC_TLS_LE21L,
+	R_PARISC_TLS_LE14R, R_PARISC_TLS_IE21L, R_PARISC_TLS_IE14R,
+	R_PARISC_TLS_TPREL32, R_PARISC_TLS_TPREL64.
+
+2007-08-21  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #4937]
+	* elf/do-lookup.h (do_lookup_x): Minimal improvement in hash
+	lookup loop.  Suggested by John Reiser.
+
+2007-08-21  Jakub Jelinek  <jakub@redhat.com>
+
+	* sysdeps/unix/sysv/linux/alpha/sysdep.h: Include tls.h.
+
+2007-08-20  Ulrich Drepper  <drepper@redhat.com>
+
+	* csu/libc-start.c: Don't handle VDSO_SETUP here.
+	* sysdeps/unix/sysv/linux/init-first.c: Handle it here instead.
+	* sysdeps/unix/sysv/linux/x86_64/libc-start.c: Renamed to...
+	* sysdeps/unix/sysv/linux/x86_64/init-first.c: ...this.  New file.
+	* sysdeps/unix/sysv/linux/powerpc/libc-start.c: Move VDSO_SETUP code
+	to...
+	* sysdeps/unix/sysv/linux/x86_64/init-first.c: ...here.  New file.
+
+2007-08-18  Ulrich Drepper  <drepper@redhat.com>
+
+	* po/nl.po: Update from translation team.
+
+2007-08-16  Andreas Jaeger  <aj@suse.de>
+
+	* locale/localeinfo.h: Make _nl_category_name_idxs extern.
+        Reported by Peter Festner <peter.festner@ewetel.net>.
+
+2007-08-17  Jakub Jelinek  <jakub@redhat.com>
+
+	* login/tst-grantpt.c (test_einval): Add 3rd argument to open.
+
 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
 
 	* elf/Makefile ($(objpfx)ld.so): Use readelf -s and awk instead of nm -u
diff --git a/csu/libc-start.c b/csu/libc-start.c
index d3eadeb704..a14ed71616 100644
--- a/csu/libc-start.c
+++ b/csu/libc-start.c
@@ -148,10 +148,6 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
 # endif
 #endif
 
-#ifdef VDSO_SETUP
-  VDSO_SETUP ();
-#endif
-
   /* Register the destructor of the dynamic linker if there is any.  */
   if (__builtin_expect (rtld_fini != NULL, 1))
     __cxa_atexit ((void (*) (void *)) rtld_fini, NULL, NULL);
diff --git a/debug/pcprofiledump.c b/debug/pcprofiledump.c
index 210e5089e9..62c0d73f40 100644
--- a/debug/pcprofiledump.c
+++ b/debug/pcprofiledump.c
@@ -1,5 +1,5 @@
 /* Dump information generated by PC profiling.
-   Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
@@ -37,6 +37,7 @@
 
 #include "../version.h"
 
+#define PACKAGE _libc_intl_domainname
 
 #ifndef _
 # define _(Str) gettext (Str)
@@ -75,14 +76,17 @@ static struct argp argp =
 int
 main (int argc, char *argv[])
 {
-  int fd;
-  int remaining;
-  int must_swap;
-  uint32_t word;
+  /* Set locale via LC_ALL.  */
+  setlocale (LC_ALL, "");
+
+  /* Set the text message domain.  */
+  textdomain (PACKAGE);
 
   /* Parse and process arguments.  */
+  int remaining;
   argp_parse (&argp, argc, argv, 0, &remaining, NULL);
 
+  int fd;
   if (remaining == argc)
     fd = STDIN_FILENO;
   else if (remaining + 1 != argc)
@@ -102,11 +106,12 @@ main (int argc, char *argv[])
 
   /* Read the first 4-byte word.  It contains the information about
      the word size and the endianess.  */
+  uint32_t word;
   if (TEMP_FAILURE_RETRY (read (fd, &word, 4)) != 4)
     error (EXIT_FAILURE, errno, _("cannot read header"));
 
   /* Check whether we have to swap the byte order.  */
-  must_swap = (word & 0xfffffff0) == bswap_32 (0xdeb00000);
+  int must_swap = (word & 0xfffffff0) == bswap_32 (0xdeb00000);
   if (must_swap)
     word = bswap_32 (word);
 
diff --git a/debug/segfault.c b/debug/segfault.c
index f141fff661..413f207207 100644
--- a/debug/segfault.c
+++ b/debug/segfault.c
@@ -1,5 +1,5 @@
 /* Catch segmentation faults and print backtrace.
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -42,7 +42,7 @@
 /* Get code to possibly dump the content of all registers.  */
 #include <register-dump.h>
 
-/* We'll use tis a lot.  */
+/* We'll use this a lot.  */
 #define WRITE_STRING(s) write (fd, s, strlen (s))
 
 /* Name of the output file.  */
@@ -67,7 +67,7 @@ write_strsignal (int fd, int signal)
 
 
 /* This function is called when a segmentation fault is caught.  The system
-   is in an instable state now.  This means especially that malloc() might
+   is in an unstable state now.  This means especially that malloc() might
    not work anymore.  */
 static void
 catch_segfault (int signal, SIGCONTEXT ctx)
diff --git a/elf/do-lookup.h b/elf/do-lookup.h
index ab9a510ba1..e17d463526 100644
--- a/elf/do-lookup.h
+++ b/elf/do-lookup.h
@@ -190,7 +190,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
 		  const Elf32_Word *hasharr = &map->l_gnu_chain_zero[bucket];
 
 		  do
-		    if ((*hasharr & ~1u) == (new_hash & ~1u))
+		    if (((*hasharr ^ new_hash) >> 1) == 0)
 		      {
 			symidx = hasharr - map->l_gnu_chain_zero;
 			sym = check_match (&symtab[symidx]);
diff --git a/elf/elf.h b/elf/elf.h
index 6cc547ef60..c541774d98 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -1723,6 +1723,8 @@ typedef Elf32_Addr Elf32_Conflict;
 #define R_PARISC_LTOFF_FPTR14R	62	/* LT-rel. fct ptr, right 14 bits. */
 #define R_PARISC_FPTR64		64	/* 64 bits function address.  */
 #define R_PARISC_PLABEL32	65	/* 32 bits function address.  */
+#define R_PARISC_PLABEL21L	66	/* Left 21 bits of fdesc address.  */
+#define R_PARISC_PLABEL14R	70	/* Right 14 bits of fdesc address.  */
 #define R_PARISC_PCREL64	72	/* 64 bits PC-rel. address.  */
 #define R_PARISC_PCREL22F	74	/* 22 bits PC-rel. address.  */
 #define R_PARISC_PCREL14WR	75	/* PC-rel. address, right 14 bits.  */
@@ -1783,6 +1785,26 @@ typedef Elf32_Addr Elf32_Conflict;
 #define R_PARISC_LTOFF_TP16F	229	/* 16 bits LT-TP-rel. address.  */
 #define R_PARISC_LTOFF_TP16WF	230	/* 16 bits LT-TP-rel. address.  */
 #define R_PARISC_LTOFF_TP16DF	231	/* 16 bits LT-TP-rel. address.  */
+#define R_PARISC_GNU_VTENTRY	232
+#define R_PARISC_GNU_VTINHERIT	233
+#define R_PARISC_TLS_GD21L	234	/* GD 21-bit left.  */
+#define R_PARISC_TLS_GD14R	235	/* GD 14-bit right.  */
+#define R_PARISC_TLS_GDCALL	236	/* GD call to __t_g_a.  */
+#define R_PARISC_TLS_LDM21L	237	/* LD module 21-bit left.  */
+#define R_PARISC_TLS_LDM14R	238	/* LD module 14-bit right.  */
+#define R_PARISC_TLS_LDMCALL	239	/* LD module call to __t_g_a.  */
+#define R_PARISC_TLS_LDO21L	240	/* LD offset 21-bit left.  */
+#define R_PARISC_TLS_LDO14R	241	/* LD offset 14-bit right.  */
+#define R_PARISC_TLS_DTPMOD32	242	/* DTP module 32-bit.  */
+#define R_PARISC_TLS_DTPMOD64	243	/* DTP module 64-bit.  */
+#define R_PARISC_TLS_DTPOFF32	244	/* DTP offset 32-bit.  */
+#define R_PARISC_TLS_DTPOFF64	245	/* DTP offset 32-bit.  */
+#define R_PARISC_TLS_LE21L	R_PARISC_TPREL21L
+#define R_PARISC_TLS_LE14R	R_PARISC_TPREL14R
+#define R_PARISC_TLS_IE21L	R_PARISC_LTOFF_TP21L
+#define R_PARISC_TLS_IE14R	R_PARISC_LTOFF_TP14R
+#define R_PARISC_TLS_TPREL32	R_PARISC_TPREL32
+#define R_PARISC_TLS_TPREL64	R_PARISC_TPREL64
 #define R_PARISC_HIRESERVE	255
 
 /* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr.  */
diff --git a/fedora/branch.mk b/fedora/branch.mk
index a6a31c8035..5ee4e1d033 100644
--- a/fedora/branch.mk
+++ b/fedora/branch.mk
@@ -3,5 +3,5 @@ glibc-branch := fedora
 glibc-base := HEAD
 DIST_BRANCH := devel
 COLLECTION := dist-f8
-fedora-sync-date := 2007-08-16 21:21 UTC
-fedora-sync-tag := fedora-glibc-20070816T2121
+fedora-sync-date := 2007-08-25 18:39 UTC
+fedora-sync-tag := fedora-glibc-20070825T1839
diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in
index dc13a53a20..1292c84457 100644
--- a/fedora/glibc.spec.in
+++ b/fedora/glibc.spec.in
@@ -1,4 +1,4 @@
-%define glibcrelease 11
+%define glibcrelease 12
 %define run_glibc_tests 1
 %define auxarches i586 i686 athlon sparcv9v sparc64v alphaev6
 %define xenarches i686 athlon
@@ -1010,6 +1010,13 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Sat Aug 25 2007 Jakub Jelinek <jakub@redhat.com> 2.6.90-12
+- readd x86_64 gettimeofday stuff, initialize it earlier
+- nis_list fix (#254115)
+- misc fixes (BZ#3924, BZ#4566, BZ#4582, BZ#4588, BZ#4726, BZ#4946,
+  BZ#4905, BZ#4814, BZ#4925, BZ#4936, BZ#4896, BZ#4937, BZ#3842,
+  BZ#4554, BZ#4557, BZ#4938)
+
 * Fri Aug 17 2007 Jakub Jelinek <jakub@redhat.com> 2.6.90-11
 - remove __strtold_internal and __wcstold_internal from ppc*/s390*/sparc*
   *-ldbl.h headers
diff --git a/iconv/gconv.c b/iconv/gconv.c
index cd43d3d6fb..1b64455537 100644
--- a/iconv/gconv.c
+++ b/iconv/gconv.c
@@ -1,6 +1,6 @@
 /* Convert characters in input buffer using conversion descriptor to
    output buffer.
-   Copyright (C) 1997-2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1997-2001, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -55,11 +55,19 @@ __gconv (__gconv_t cd, const unsigned char **inbuf,
 #endif
 
   if (inbuf == NULL || *inbuf == NULL)
-    /* We just flush.  */
-    result = DL_CALL_FCT (fct,
-			  (cd->__steps, cd->__data, NULL, NULL, NULL,
-			   irreversible,
-			   cd->__data[last_step].__outbuf == NULL ? 2 : 1, 0));
+    {
+      /* We just flush.  */
+      result = DL_CALL_FCT (fct,
+			    (cd->__steps, cd->__data, NULL, NULL, NULL,
+			     irreversible,
+			     cd->__data[last_step].__outbuf == NULL ? 2 : 1,
+			     0));
+
+      /* If the flush was successful clear the rest of the state.  */
+      if (result == __GCONV_OK)
+	for (size_t cnt = 0; cnt <= last_step; ++cnt)
+	  cd->__data[cnt].__invocation_counter = 0;
+    }
   else
     {
       const unsigned char *last_start;
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
index 8b49367bd4..26bf61ed5e 100644
--- a/iconvdata/Makefile
+++ b/iconvdata/Makefile
@@ -66,7 +66,7 @@ include ../Makeconfig
 
 ifeq (yes,$(build-shared))
 tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
-	tst-iconv6
+	tst-iconv6 bug-iconv5
 ifeq ($(have-thread-library),yes)
 tests += bug-iconv3
 endif
@@ -354,6 +354,8 @@ $(objpfx)bug-iconv2.out: $(objpfx)gconv-modules \
 $(objpfx)bug-iconv3: $(libdl)
 $(objpfx)bug-iconv3.out: $(objpfx)gconv-modules \
 			 $(addprefix $(objpfx),$(modules.so))
+$(objpfx)bug-iconv5.out: $(objpfx)gconv-modules \
+			 $(addprefix $(objpfx),$(modules.so))
 $(objpfx)tst-loading.out: $(objpfx)gconv-modules \
 			  $(addprefix $(objpfx),$(modules.so))
 $(objpfx)tst-iconv4.out: $(objpfx)gconv-modules \
diff --git a/iconvdata/bug-iconv5.c b/iconvdata/bug-iconv5.c
new file mode 100644
index 0000000000..1b9f50f58a
--- /dev/null
+++ b/iconvdata/bug-iconv5.c
@@ -0,0 +1,53 @@
+#include <iconv.h>
+#include <stdint.h>
+#include <stdio.h>
+
+
+static int
+do_test (void)
+{
+  iconv_t cd = iconv_open ("utf-8", "unicode");
+  if (cd == (iconv_t) -1)
+    {
+      puts ("cannot open iconv module");
+      return 1;
+    }
+
+  static const uint16_t us[] = { 0xfeff, 0x0041, 0x0042, 0x0043 };
+  char buf[100];
+
+  char *inbuf;
+  size_t inlen;
+  char *outbuf;
+  size_t outlen;
+  size_t n;
+
+  inbuf = (char *) us;
+  inlen = sizeof (us);
+  outbuf = buf;
+  outlen = sizeof (buf);
+  n = iconv (cd, &inbuf, &inlen, &outbuf, &outlen);
+  if (n == (size_t) -1 || inlen != 0 || outlen != sizeof (buf) - 3)
+    {
+      puts ("first conversion failed");
+      return 1;
+    }
+
+  iconv (cd, NULL, NULL, NULL, NULL);
+
+  inbuf = (char *) us;
+  inlen = sizeof (us);
+  outbuf = buf;
+  outlen = sizeof (buf);
+  n = iconv (cd, &inbuf, &inlen, &outbuf, &outlen);
+  if (n == (size_t) -1 || inlen != 0 || outlen != sizeof (buf) - 3)
+    {
+      puts ("second conversion failed");
+      return 1;
+    }
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/locale/localeinfo.h b/locale/localeinfo.h
index 5c1f27f7e1..5e3e99ca68 100644
--- a/locale/localeinfo.h
+++ b/locale/localeinfo.h
@@ -1,5 +1,5 @@
 /* Declarations for internal libc locale interfaces
-   Copyright (C) 1995-2003, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-2003, 2005, 2006, 2007 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
@@ -186,7 +186,7 @@ extern const union catnamestr_t
   };
   char str[0];
 } _nl_category_names attribute_hidden;
-const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden;
+extern const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden;
 extern const uint8_t _nl_category_name_sizes[__LC_LAST] attribute_hidden;
 
 /* Name of the standard locales.  */
diff --git a/localedata/ChangeLog b/localedata/ChangeLog
index d27b6d7538..7d39671a07 100644
--- a/localedata/ChangeLog
+++ b/localedata/ChangeLog
@@ -1,3 +1,18 @@
+2007-08-24  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #3842]
+	* locales/ru_RU: Use U00A0 instead of U2002 for thousands separator.
+	The latter might be more correct but usually cannot be displayed.
+
+2007-08-22  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #4554]
+	* locales/wo_SN: New file.
+	* SUPPORTED: Add wo_SN entry.
+
+	[BZ #4557]
+	* locales/as_IN: Change <UNASSIGNED-09CE> to <U09CE>.
+
 2007-08-03  Jakub Jelinek  <jakub@redhat.com>
 
 	* locales/translit_combining: Add U0141 and U0142.
diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
index 8fb561185e..5836db2adb 100644
--- a/localedata/SUPPORTED
+++ b/localedata/SUPPORTED
@@ -368,6 +368,7 @@ vi_VN/UTF-8 \
 wa_BE/ISO-8859-1 \
 wa_BE@euro/ISO-8859-15 \
 wa_BE.UTF-8/UTF-8 \
+wo_SN/UTF-8 \
 xh_ZA.UTF-8/UTF-8 \
 xh_ZA/ISO-8859-1 \
 yi_US.UTF-8/UTF-8 \
diff --git a/localedata/locales/as_IN b/localedata/locales/as_IN
index d3c779b7a6..c61ba30460 100644
--- a/localedata/locales/as_IN
+++ b/localedata/locales/as_IN
@@ -596,7 +596,7 @@ order_start forward;forward;forward;forward
 <U09CC> <X689A>;<X0005>;<X0005>;IGNORE
 <U09CD> <X689C>;<X0005>;<X0005>;IGNORE
 <U09D7> <X689E>;<X0005>;<X0005>;IGNORE
-<UNASSIGNED-09CE> "<XE2E9><X6B20>";<X0005>;"<X0005><X00C0>";IGNORE
+<U09CE> "<XE2E9><X6B20>";<X0005>;"<X0005><X00C0>";IGNORE
 UNDEFINED IGNORE;IGNORE;IGNORE;%...
 
 order_end
diff --git a/localedata/locales/ru_RU b/localedata/locales/ru_RU
index d00f3451db..f290f21285 100644
--- a/localedata/locales/ru_RU
+++ b/localedata/locales/ru_RU
@@ -81,7 +81,7 @@ LC_MONETARY
 int_curr_symbol           "<U0052><U0055><U0042><U0020>"
 currency_symbol           "<U0440><U0443><U0431>"
 mon_decimal_point         "<U002E>"
-mon_thousands_sep         "<U2002>"
+mon_thousands_sep         "<U00A0>"
 mon_grouping              3;3
 positive_sign             ""
 negative_sign             "<U002D>"
@@ -97,7 +97,7 @@ END LC_MONETARY
 
 LC_NUMERIC
 decimal_point             "<U002C>"
-thousands_sep             "<U2002>"
+thousands_sep             "<U00A0>"
 grouping                  3;3
 END LC_NUMERIC
 
diff --git a/localedata/locales/wo_SN b/localedata/locales/wo_SN
new file mode 100644
index 0000000000..ac4e917e3c
--- /dev/null
+++ b/localedata/locales/wo_SN
@@ -0,0 +1,180 @@
+comment_char %
+escape_char  /
+%
+% Wolof locale for Senegal
+% Source: The Debian Project
+% Contact: Christian Perrier/Samba Ndao Diop
+% Email: bubulle@debian.org/samba.ndao.diop@tiscali.fr
+% Tel: +33 - 130699222
+% Language: wo
+% Territory: SN
+% Revision: 1.0
+% Date: 2004-09-15
+% Users: general
+% Charset: UTF-8
+% Distribution and use is free, also
+% for commercial purposes.
+
+LC_IDENTIFICATION
+title      "Wolof locale for Senegal"
+source     "The Debian Project"
+address    ""
+contact    "Christian Perrier"
+email      "bubulle@debian.org"
+tel        ""
+fax        ""
+language   "Wolof"
+territory  "Senegal"
+revision   "1.0"
+date       "2004-09-08"
+%
+category  "mg_MG:2000";LC_IDENTIFICATION
+category  "mg_MG:2000";LC_CTYPE
+category  "mg_MG:2000";LC_COLLATE
+category  "mg_MG:2000";LC_TIME
+category  "mg_MG:2000";LC_NUMERIC
+category  "mg_MG:2000";LC_MONETARY
+category  "mg_MG:2000";LC_MESSAGES
+category  "mg_MG:2000";LC_PAPER
+category  "mg_MG:2000";LC_NAME
+category  "mg_MG:2000";LC_ADDRESS
+category  "mg_MG:2000";LC_TELEPHONE
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "i18n"
+
+translit_start
+
+% Accents are simply omitted if they cannot be represented.
+include "translit_combining";""
+
+translit_end
+
+END LC_CTYPE
+
+LC_COLLATE
+% Copy the template from ISO/IEC 14651
+copy "iso14651_t1"
+END LC_COLLATE
+
+LC_MESSAGES
+% Yes=Waaw
+% No=Déet
+yesexpr "<U005E><U005B><U0077><U0057><U0079><U0059><U005D><U002E><U002A>"
+noexpr  "<U005E><U005B><U0064><U0044><U006E><U004E><U005D><U002E><U002A>"
+END LC_MESSAGES
+
+LC_MONETARY
+int_curr_symbol           "<U0058><U004F><U0046><U0020>"
+currency_symbol           "<U0043><U0046><U0041>"
+mon_decimal_point         "<U002C>"
+mon_thousands_sep         "<U0020>"
+mon_grouping              3;3
+positive_sign             ""
+negative_sign             "<U002D>"
+int_frac_digits           2
+frac_digits               2
+p_cs_precedes             0
+p_sep_by_space            1
+n_cs_precedes             0
+n_sep_by_space            1
+p_sign_posn               1
+n_sign_posn               1
+END LC_MONETARY
+
+LC_NUMERIC
+decimal_point             "<U002C>"
+thousands_sep             ""
+grouping                  0;0
+END LC_NUMERIC
+
+LC_TIME
+% dib'eer (dib), altine (alt), talaata (tal), allarba (all), alxames (alx),
+% ajjuma (ajj), gaawu (gaa)
+% Sunday, Monday....
+abday   "<U0064><U0069><U0062>";"<U0061><U006C><U0074>";/
+        "<U0074><U0061><U006C>";"<U0061><U006C><U006C>";/
+        "<U0061><U006C><U0078>";"<U0061><U006A><U006A>";/
+        "<U0067><U0061><U0061>"
+day     "<U0064><U0069><U0062><U0027><U0065><U0065><U0072>";/
+        "<U0061><U006C><U0074><U0069><U006E><U0065>";/
+        "<U0074><U0061><U006C><U0061><U0061><U0074><U0061>";/
+        "<U0061><U006C><U006C><U0061><U0072><U0062><U0061>";/
+        "<U0061><U006C><U0078><U0061><U006D><U0065><U0073>";/
+        "<U0061><U006A><U006A><U0075><U006D><U0061>";/
+        "<U0067><U0061><U0061><U0077><U0075>"
+% Sanwiy'e,  feebriy'e, mars,  awril, me,  suwen, sulet,  uut, septaambar,
+% oktoobar, nowaambar, desaambar.
+abmon   "<U0073><U0061><U006E>";"<U0066><U0065><U0065>";/
+        "<U006D><U0061><U0072>";"<U0061><U0077><U0072>";/
+        "<U006D><U0065><U0020>";"<U0073><U0075><U0077>";/
+        "<U0073><U0075><U006C>";"<U0075><U0075><U0074>";/
+        "<U0073><U0065><U0070>";"<U006F><U006B><U0074>";/
+        "<U006E><U006F><U0077>";"<U0064><U0065><U0073>"
+mon     "<U0073><U0061><U006E><U0077><U0069><U0079><U0027><U0065>";/
+        "<U0066><U0065><U0065><U0062><U0072><U0069><U0079><U0027><U0065>";/
+        "<U006D><U0061><U0072><U0073>";/
+        "<U0061><U0077><U0072><U0069><U006C>";/
+        "<U006D><U0065>";/
+        "<U0073><U0075><U0077><U0065><U006E>";/
+        "<U0073><U0075><U006C><U0065><U0074>";/
+        "<U0075><U0075><U0074>";/
+        "<U0073><U0065><U0070><U0074><U0061><U0061><U006D><U0062><U0061><U0072>";/
+        "<U006F><U006B><U0074><U006F><U006F><U0062><U0061><U0072>";/
+        "<U006E><U006F><U0077><U0061><U0061><U006D><U0062><U0061><U0072>";/
+        "<U0064><U0065><U0073><U0061><U0061><U006D><U0062><U0061><U0072>"
+% %a %d %b %Y %T %Z
+d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
+% %d.%m.%Y
+d_fmt   "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059>"
+% %T
+t_fmt   "<U0025><U0054>"
+am_pm   "";""
+t_fmt_ampm ""
+% %a %b %e %H:%M:%S %Z %Y
+date_fmt       "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
+<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U005A><U0020><U0025><U0059>"
+END LC_TIME
+
+LC_PAPER
+height   297
+width    210
+END LC_PAPER
+
+LC_TELEPHONE
+% +%C %a %l
+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
+<U006C>"
+% %a %l
+tel_dom_fmt    "<U0025><U0061><U0020><U0025><U006C>"
+% 221
+int_prefix     "<U0032><U0032><U0031>"
+% 00
+int_select     "<U0030><U0030>"
+END LC_TELEPHONE
+
+LC_MEASUREMENT
+measurement    1
+END LC_MEASUREMENT
+
+LC_NAME
+% %d%t%g%t%m%t%f
+name_fmt    "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/
+<U0025><U006D><U0025><U0074><U0025><U0066>"
+END LC_NAME
+
+LC_ADDRESS
+% %f%N%a%N%d%N%b%N%s %h %e %r%N%%z %T%N%c%N
+postal_fmt    "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/
+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
+<U004E><U0025><U0025><U007A><U0020><U0025><U0054><U0025>/
+<U004E><U0025><U0063><U0025><U004E>"
+country_ab2 "<U004D><U0047>"
+country_ab3 "<U004D><U0044><U0047>"
+country_num 450
+END LC_ADDRESS
+
diff --git a/login/tst-grantpt.c b/login/tst-grantpt.c
index 9b993daaca..5078dac26c 100644
--- a/login/tst-grantpt.c
+++ b/login/tst-grantpt.c
@@ -41,7 +41,7 @@ test_einval (void)
   int fd, ret, err;
   const char file[] = "./grantpt-einval";
 
-  fd = open (file, O_RDWR | O_CREAT);
+  fd = open (file, O_RDWR | O_CREAT, 0600);
   if (fd == -1)
     {
       printf ("open(\"%s\", O_RDWR) failed\nerrno %d (%s)\n",
diff --git a/nis/nis_table.c b/nis/nis_table.c
index 70b4701419..3704b0094e 100644
--- a/nis/nis_table.c
+++ b/nis/nis_table.c
@@ -372,7 +372,8 @@ nis_list (const_nis_name name, unsigned int flags,
 					     &bptr);
 		if (clnt_status != NIS_SUCCESS)
 		  {
-		    NIS_RES_STATUS (res) = clnt_status;
+		    if (clnt_status == NIS_NOMEMORY)
+		      NIS_RES_STATUS (res) = clnt_status;
 		    ++done;
 		  }
 		else
@@ -452,10 +453,14 @@ nis_list (const_nis_name name, unsigned int flags,
 		  ++done;
 		else
 		  {
-		    NIS_RES_STATUS (res)
+		    clnt_status
 		      = __follow_path (&tablepath, &tableptr, ibreq, &bptr);
-		    if (NIS_RES_STATUS (res) != NIS_SUCCESS)
-		      ++done;
+		    if (clnt_status != NIS_SUCCESS)
+		      {
+			if (clnt_status == NIS_NOMEMORY)
+			  NIS_RES_STATUS (res) = clnt_status;
+			++done;
+		      }
 		  }
 	      }
 	    break;
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 4edb7af9ab..3fe3676ea5 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,21 @@
+2007-08-21  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #4938]
+	* allocatestack.c (__reclaim_stacks): Clear the TSD in the
+	reclaimed stack if necessary.
+	* Makefile (tests): Add tst-tsd6.
+	* tst-tsd6.c: New file.
+
+2007-08-21  Jakub Jelinek  <jakub@redhat.com>
+
+	* sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
+	Add private argument.
+
+2007-08-20  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+	(__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
+
 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
 
 	* sysdeps/unix/sysv/linux/alpha/lowlevellock.h
diff --git a/nptl/Makefile b/nptl/Makefile
index 4d1a9bcfea..5ed2c21145 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -227,7 +227,7 @@ tests = tst-typesizes \
 	tst-join1 tst-join2 tst-join3 tst-join4 tst-join5 tst-join6 \
 	tst-detach1 \
 	tst-eintr1 tst-eintr2 tst-eintr3 tst-eintr4 tst-eintr5 \
-	tst-tsd1 tst-tsd2 tst-tsd3 tst-tsd4 tst-tsd5 \
+	tst-tsd1 tst-tsd2 tst-tsd3 tst-tsd4 tst-tsd5 tst-tsd6 \
 	tst-tls1 tst-tls2 \
 	tst-fork1 tst-fork2 tst-fork3 tst-fork4 \
 	tst-atfork1 \
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 02a84f4d9b..c894e96a28 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -794,6 +794,26 @@ __reclaim_stacks (void)
 
 	  /* Account for the size of the stack.  */
 	  stack_cache_actsize += curp->stackblock_size;
+
+	  if (curp->specific_used)
+	    {
+	      /* Clear the thread-specific data.  */
+	      memset (curp->specific_1stblock, '\0',
+		      sizeof (curp->specific_1stblock));
+
+	      curp->specific_used = false;
+
+	      for (size_t cnt = 1; cnt < PTHREAD_KEY_1STLEVEL_SIZE; ++cnt)
+		if (curp->specific[cnt] != NULL)
+		  {
+		    memset (curp->specific[cnt], '\0',
+			    sizeof (curp->specific_1stblock));
+
+		    /* We have allocated the block which we do not
+		       free here so re-set the bit.  */
+		    curp->specific_used = true;
+		  }
+	    }
 	}
     }
 
diff --git a/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h
index 9fa321cb3f..93188234cb 100644
--- a/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h
@@ -94,12 +94,12 @@
     INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret;		      \
   })
 
-#define lll_robust_dead(futexv) \
+#define lll_robust_dead(futexv, private) \
   do									      \
     {									      \
       int *__futexp = &(futexv);					      \
       atomic_or (__futexp, FUTEX_OWNER_DIED);				      \
-      lll_futex_wake (__futexp, 1, LLL_SHARED);				      \
+      lll_futex_wake (__futexp, 1, private);				      \
     }									      \
   while (0)
 
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
index a5de670866..d730a7e12d 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -134,8 +134,15 @@ __pthread_cond_timedwait:
 	/* Only clocks 0 and 1 are allowed so far.  Both are handled in the
 	   kernel.  */
 	leaq	24(%rsp), %rsi
-	movl	$__NR_clock_gettime, %eax
+	movq	__vdso_clock_gettime@GOTPCREL(%rip), %rax
+	movq	(%rax), %rax
+	PTR_DEMANGLE (%rax)
+	jz	26f
+	call	*%rax
+	jmp	27f
+26:	movl	$__NR_clock_gettime, %eax
 	syscall
+27:
 # ifndef __ASSUME_POSIX_TIMERS
 	cmpq	$-ENOSYS, %rax
 	je	19f
diff --git a/nptl/tst-tsd6.c b/nptl/tst-tsd6.c
new file mode 100644
index 0000000000..debb1dd367
--- /dev/null
+++ b/nptl/tst-tsd6.c
@@ -0,0 +1,89 @@
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+#define NKEYS 100
+static pthread_key_t keys[NKEYS];
+static pthread_barrier_t b;
+
+
+static void *
+tf (void *arg)
+{
+  void *res = NULL;
+  for (int i = 0; i < NKEYS; ++i)
+    {
+      void *p = pthread_getspecific (keys[i]);
+      pthread_setspecific (keys[i], (void *) 7);
+      if (p != NULL)
+	res = p;
+    }
+  if (arg != NULL)
+    {
+      pthread_barrier_wait (arg);
+      pthread_barrier_wait (arg);
+    }
+  return res;
+}
+
+
+static int
+do_test (void)
+{
+  pthread_barrier_init (&b, NULL, 2);
+
+  for (int i = 0; i < NKEYS; ++i)
+    if (pthread_key_create (&keys[i], NULL) != 0)
+      {
+	puts ("cannot create keys");
+	return 1;
+      }
+
+  pthread_t th;
+  if (pthread_create (&th, NULL, tf, &b) != 0)
+    {
+      puts ("cannot create thread in parent");
+      return 1;
+    }
+
+  pthread_barrier_wait (&b);
+
+  pid_t pid = fork ();
+  if (pid == 0)
+    {
+      if (pthread_create (&th, NULL, tf, NULL) != 0)
+	{
+	  puts ("cannot create thread in child");
+	  exit (1);
+	}
+
+      void *res;
+      pthread_join (th, &res);
+
+      exit (res != NULL);
+    }
+  else if (pid == -1)
+    {
+      puts ("cannot create child process");
+      return 1;
+    }
+
+  int s;
+  if (TEMP_FAILURE_RETRY (waitpid (pid, &s, 0)) != pid)
+    {
+      puts ("failing to wait for child process");
+      return 1;
+    }
+
+  pthread_barrier_wait (&b);
+  pthread_join (th, NULL);
+
+  return !WIFEXITED (s) ? 2 : WEXITSTATUS (s);
+}
+
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/nscd/Makefile b/nscd/Makefile
index ef3ce184f9..ecd8c89998 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -35,7 +35,7 @@ nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \
 		getgrnam_r getgrgid_r hstcache gethstbyad_r gethstbynm2_r \
 		getsrvbynm_r getsrvbypt_r servicescache \
 		dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \
-		xmalloc xstrdup aicache initgrcache gai
+		xmalloc xstrdup aicache initgrcache gai res_hconf
 
 ifeq ($(have-thread-library),yes)
 
@@ -122,6 +122,7 @@ CFLAGS-gai.c += $(nscd-cflags)
 CFLAGS-servicescache.c += $(nscd-cflags)
 CFLAGS-getsrvbynm_r.c += $(nscd-cflags)
 CFLAGS-getsrvbypt_r.c += $(nscd-cflags)
+CFLAGS-res_hconf.c += $(nscd-cflags)
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
 relro-LDFLAGS += -Wl,-z,now
diff --git a/nscd/connections.c b/nscd/connections.c
index 72581071af..cf6ae9a83c 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -1017,7 +1017,7 @@ cannot handle old request version %d; current version is %d"),
 	  ssize_t nwritten;
 
 #ifdef HAVE_SENDFILE
-	  if (db->mmap_used || !cached->notfound)
+	  if (__builtin_expect (db->mmap_used, 1))
 	    {
 	      assert (db->wr_fd != -1);
 	      assert ((char *) cached->data > (char *) db->data);
diff --git a/nscd/gethstbyad_r.c b/nscd/gethstbyad_r.c
index e0cd82c32b..e2e8dfe2cc 100644
--- a/nscd/gethstbyad_r.c
+++ b/nscd/gethstbyad_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2000, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -26,5 +26,6 @@
 #define ADD_VARIABLES	addr, len, type
 #define NEED_H_ERRNO	1
 #define NEED__RES	1
+#define NEED__RES_HCONF 1
 
 #include "../nss/getXXbyYY_r.c"
diff --git a/nscd/gethstbynm2_r.c b/nscd/gethstbynm2_r.c
index abe992cc1c..85e95d4a63 100644
--- a/nscd/gethstbynm2_r.c
+++ b/nscd/gethstbynm2_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 2000, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1998, 2000, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -30,6 +30,7 @@
 #define ADD_PARAMS	const char *name, int af
 #define ADD_VARIABLES	name, af
 #define NEED_H_ERRNO	1
+#define NEED__RES_HCONF 1
 
 #define HANDLE_DIGITS_DOTS	1
 #define HAVE_LOOKUP_BUFFER	1
diff --git a/nscd/hstcache.c b/nscd/hstcache.c
index 3c9a17fee8..54222a3408 100644
--- a/nscd/hstcache.c
+++ b/nscd/hstcache.c
@@ -196,7 +196,7 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
 
       /* Determine the number of addresses.  */
       h_addr_list_cnt = 0;
-      for (cnt = 0; hst->h_addr_list[cnt]; ++cnt)
+      while (hst->h_addr_list[h_addr_list_cnt] != NULL)
 	++h_addr_list_cnt;
 
       if (h_addr_list_cnt == 0)
@@ -221,7 +221,7 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
 	 the current cache handling cannot handle and it is more than
 	 questionable whether it is worthwhile complicating the cache
 	 handling just for handling such a special case. */
-      if (he == NULL && hst->h_addr_list[1] == NULL)
+      if (he == NULL && h_addr_list_cnt == 1)
 	{
 	  dataset = (struct dataset *) mempool_alloc (db,
 						      total + req->key_len);
@@ -298,25 +298,31 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
 	      /* The data has not changed.  We will just bump the
 		 timeout value.  Note that the new record has been
 		 allocated on the stack and need not be freed.  */
+	      assert (h_addr_list_cnt == 1);
 	      dh->timeout = dataset->head.timeout;
 	      ++dh->nreloads;
 	    }
 	  else
 	    {
-	      /* We have to create a new record.  Just allocate
-		 appropriate memory and copy it.  */
-	      struct dataset *newp
-		= (struct dataset *) mempool_alloc (db, total + req->key_len);
-	      if (newp != NULL)
+	      if (h_addr_list_cnt == 1)
 		{
-		  /* Adjust pointers into the memory block.  */
-		  addresses = (char *) newp + (addresses - (char *) dataset);
-		  aliases = (char *) newp + (aliases - (char *) dataset);
-		  assert (key_copy != NULL);
-		  key_copy = (char *) newp + (key_copy - (char *) dataset);
-
-		  dataset = memcpy (newp, dataset, total + req->key_len);
-		  alloca_used = false;
+		  /* We have to create a new record.  Just allocate
+		     appropriate memory and copy it.  */
+		  struct dataset *newp
+		    = (struct dataset *) mempool_alloc (db,
+							total + req->key_len);
+		  if (newp != NULL)
+		    {
+		      /* Adjust pointers into the memory block.  */
+		      addresses = (char *) newp + (addresses
+						   - (char *) dataset);
+		      aliases = (char *) newp + (aliases - (char *) dataset);
+		      assert (key_copy != NULL);
+		      key_copy = (char *) newp + (key_copy - (char *) dataset);
+
+		      dataset = memcpy (newp, dataset, total + req->key_len);
+		      alloca_used = false;
+		    }
 		}
 
 	      /* Mark the old record as obsolete.  */
diff --git a/nscd/res_hconf.c b/nscd/res_hconf.c
new file mode 100644
index 0000000000..14b0e300bc
--- /dev/null
+++ b/nscd/res_hconf.c
@@ -0,0 +1,13 @@
+/* Add the include here so that we can redefine __fxprintf.  */
+#include <stdio.h>
+
+/* Rename symbols for protected names used in libc itself.  */
+#define __ioctl ioctl
+#define __socket socket
+#define __strchrnul strchrnul
+#define __strncasecmp strncasecmp
+
+#define __fxprintf(args...) /* ignore */
+
+
+#include "../resolv/res_hconf.c"
diff --git a/po/nl.po b/po/nl.po
index 30fb4a720d..d4f4518bc8 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: libc 2.6.1\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2007-08-04 11:37+0200\n"
-"PO-Revision-Date: 2007-08-04 21:56+0200\n"
+"PO-Revision-Date: 2007-08-15 22:44+0200\n"
 "Last-Translator: Benno Schulenberg <benno@vertaalt.nl>\n"
 "Language-Team: Dutch <vertaling@vrijschrift.org>\n"
 "MIME-Version: 1.0\n"
@@ -20,12 +20,12 @@ msgstr ""
 #: argp/argp-help.c:228
 #, c-format
 msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
-msgstr "%.*s: Parameter van ARGP_HELP_FMT vereist een waarde"
+msgstr "%.*s: Parameter in ARGP_HELP_FMT vereist een waarde"
 
 #: argp/argp-help.c:238
 #, c-format
 msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
-msgstr "%.*s: Onbekende parameter van ARGP_HELP_FMT"
+msgstr "%.*s: Onbekende parameter in ARGP_HELP_FMT"
 
 #: argp/argp-help.c:251
 #, c-format
@@ -126,9 +126,8 @@ msgid ""
 "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input.  If OUTPUT-FILE\n"
 "is -, output is written to standard output.\n"
 msgstr ""
-"Een berichtencatalogus genereren.\n"
-"\n"
-"Als INVOERBESTAND '-' is, wordt van standaardinvoer gelezen.\n"
+"  \n"
+"Een berichtencatalogus genereren.\vAls INVOERBESTAND '-' is, wordt van standaardinvoer gelezen.\n"
 "Als UITVOERBESTAND '-' is, wordt naar standaarduitvoer geschreven.\n"
 
 #: catgets/gencat.c:124
@@ -264,7 +263,9 @@ msgstr "uitvoer niet bufferen"
 
 #: debug/pcprofiledump.c:57
 msgid "Dump information generated by PC profiling."
-msgstr "Door prestatie-analyse gegenereerde informatie weergeven."
+msgstr ""
+"  \n"
+"Door prestatie-analyse gegenereerde informatie weergeven."
 
 #: debug/pcprofiledump.c:60
 msgid "[FILE]"
@@ -313,6 +314,7 @@ msgid ""
 "For bug reporting instructions, please see:\n"
 "<http://www.gnu.org/software/libc/bugs.html>.\\n"
 msgstr ""
+"  \n"
 "De uitvoering van een programma volgen door steeds de naam van\n"
 "de uitgevoerde functie te printen.\n"
 "\n"
@@ -756,7 +758,9 @@ msgstr "te gebruiken indeling: 'compat' (standaard), 'new', of 'old'"
 
 #: elf/ldconfig.c:152
 msgid "Configure Dynamic Linker Run Time Bindings."
-msgstr "Configureren van de dynamische linker."
+msgstr ""
+"  \n"
+"Configureren van de dynamische linker."
 
 #: elf/ldconfig.c:310
 #, c-format
@@ -892,7 +896,7 @@ msgstr "bij gebruik van '-r' is voor het configuratiebestand een absoluut pad ve
 #: malloc/obstack.c:436 posix/getconf.c:985 posix/getconf.c:1163
 #, c-format
 msgid "memory exhausted"
-msgstr "onvoldoende geheugen"
+msgstr "onvoldoende geheugen beschikbaar"
 
 #: elf/ldconfig.c:1144
 #, c-format
@@ -1062,6 +1066,7 @@ msgid ""
 "Read and display shared object profiling data.\vFor bug reporting instructions, please see:\n"
 "<http://www.gnu.org/software/libc/bugs.html>.\n"
 msgstr ""
+"  \n"
 "Gegevens van prestatie-analyse inlezen en afbeelden.\vVoor het rapporteren van fouten, zie:\n"
 "  <http://www.gnu.org/software/libc/bugs.html>.\n"
 
@@ -1229,7 +1234,9 @@ msgstr "voortgangsinformatie tonen"
 
 #: iconv/iconv_prog.c:74
 msgid "Convert encoding of given files from one encoding to another."
-msgstr "Bestanden converteren van ene codering naar andere."
+msgstr ""
+"  \n"
+"Bestanden converteren van ene codering naar andere."
 
 #: iconv/iconv_prog.c:78
 msgid "[FILE...]"
@@ -1414,7 +1421,7 @@ msgstr "ergens hard gekoppeld"
 
 #: inet/ruserpass.c:170 inet/ruserpass.c:193
 msgid "out of memory"
-msgstr "onvoldoende geheugen"
+msgstr "onvoldoende geheugen beschikbaar"
 
 #: inet/ruserpass.c:184
 msgid "Error: .netrc file is readable by others."
@@ -2393,6 +2400,7 @@ msgid ""
 "Get locale-specific information.\vFor bug reporting instructions, please see:\n"
 "<http://www.gnu.org/software/libc/bugs.html>.\n"
 msgstr ""
+"  \n"
 "Informatie over locales weergeven.\vVoor het rapporteren van fouten, zie:\n"
 "  <http://www.gnu.org/software/libc/bugs.html>.\n"
 
@@ -2499,7 +2507,9 @@ msgstr "te raadplegen aliassenbestand"
 
 #: locale/programs/localedef.c:151
 msgid "Compile locale specification"
-msgstr "Een locale-specificatie compileren."
+msgstr ""
+"  \n"
+"Een locale-specificatie compileren."
 
 #: locale/programs/localedef.c:154
 msgid ""
@@ -2985,7 +2995,7 @@ msgstr "Naam wordt door deze server niet aangeboden"
 
 #: nis/nis_error.h:14
 msgid "Server out of memory"
-msgstr "Server heeft onvoldoende geheugen"
+msgstr "Server heeft onvoldoende geheugen beschikbaar"
 
 #: nis/nis_error.h:15
 msgid "Object with same name exists"
@@ -3805,7 +3815,7 @@ msgstr "%zu bytes in cache %s vrijgegeven"
 #: nscd/mem.c:512
 #, c-format
 msgid "no more memory for database '%s'"
-msgstr "onvoldoende geheugen voor gegevensbank '%s'"
+msgstr "onvoldoende geheugen beschikbaar voor gegevensbank '%s'"
 
 #: nscd/nscd.c:98
 msgid "Read configuration data from NAME"
@@ -3849,7 +3859,9 @@ msgstr "aparte cache gebruiken voor elke gebruiker"
 
 #: nscd/nscd.c:112
 msgid "Name Service Cache Daemon."
-msgstr "Daemon voor namen-cache."
+msgstr ""
+"  \n"
+"Daemon voor namen-cache."
 
 #: nscd/nscd.c:144 nss/getent.c:858 nss/makedb.c:123
 #, c-format
@@ -4211,6 +4223,7 @@ msgid ""
 "Get entries from administrative database.\vFor bug reporting instructions, please see:\n"
 "<http://www.gnu.org/software/libc/bugs.html>.\n"
 msgstr ""
+"  \n"
 "Items uit een gegevensbank weergeven.\vVoor het rapporteren van fouten, zie:\n"
 "  <http://www.gnu.org/software/libc/bugs.html>.\n"
 
@@ -4396,7 +4409,7 @@ msgstr "Ongeldige tekenklassenaam"
 
 #: posix/regcomp.c:147
 msgid "Trailing backslash"
-msgstr "Backslash aan einde"
+msgstr "Backslash aan het eind"
 
 #: posix/regcomp.c:150
 msgid "Invalid back reference"
@@ -4424,7 +4437,7 @@ msgstr "Ongeldig bereikeinde"
 
 #: posix/regcomp.c:168
 msgid "Memory exhausted"
-msgstr "Onvoldoende geheugen"
+msgstr "Onvoldoende geheugen beschikbaar"
 
 #: posix/regcomp.c:171
 msgid "Invalid preceding regular expression"
@@ -5174,7 +5187,7 @@ msgstr "EMT-instructie"
 
 #: sysdeps/generic/siglist.h:63 sysdeps/unix/siglist.c:38
 msgid "Bad system call"
-msgstr "Ongeldige systeemaanroep"
+msgstr "Onjuiste systeemaanroep"
 
 #: sysdeps/generic/siglist.h:66
 msgid "Stack fault"
@@ -5254,7 +5267,7 @@ msgstr "Ongeldige bestandsdescriptor"
 #. TRANS to manipulate.
 #: sysdeps/gnu/errlist.c:126
 msgid "No child processes"
-msgstr "Geen kindprocessen"
+msgstr "Geen dochterprocessen"
 
 #. TRANS Deadlock avoided; allocating a system resource would have resulted in a
 #. TRANS deadlock situation.  The system does not guarantee that it will notice
@@ -5268,7 +5281,7 @@ msgstr "Volledige blokkering van hulpbron is omzeild"
 #. TRANS because its capacity is full.
 #: sysdeps/gnu/errlist.c:148
 msgid "Cannot allocate memory"
-msgstr "Kan geen geheugen meer reserveren"
+msgstr "Onvoldoende geheugen beschikbaar"
 
 #. TRANS Bad address; an invalid pointer was detected.
 #. TRANS In the GNU system, this error never happens; you get a signal instead.
@@ -6039,7 +6052,7 @@ msgstr "Ongeldige waarde voor 'ai_flags'"
 
 #: sysdeps/posix/gai_strerror-strs.h:4
 msgid "Non-recoverable failure in name resolution"
-msgstr "Niet-herstelbare mislukking in naamsherleiding"
+msgstr "Onherstelbare mislukking in naamsherleiding"
 
 #: sysdeps/posix/gai_strerror-strs.h:5
 msgid "ai_family not supported"
@@ -6047,11 +6060,11 @@ msgstr "'ai_family' wordt niet ondersteund"
 
 #: sysdeps/posix/gai_strerror-strs.h:6
 msgid "Memory allocation failure"
-msgstr "Onvoldoende geheugen"
+msgstr "Onvoldoende geheugen beschikbaar"
 
 #: sysdeps/posix/gai_strerror-strs.h:7
 msgid "No address associated with hostname"
-msgstr "Geen adres geassocieerd met hostnaam"
+msgstr "Aan hostnaam is geen adres verbonden"
 
 #: sysdeps/posix/gai_strerror-strs.h:8
 msgid "Name or service not known"
@@ -6091,7 +6104,7 @@ msgstr "Onderbroken door een signaal"
 
 #: sysdeps/posix/gai_strerror-strs.h:17
 msgid "Parameter string not correctly encoded"
-msgstr "Parameter-tekenreeks is niet juist gecodeerd"
+msgstr "Parametertekst is niet juist gecodeerd"
 
 #: sysdeps/unix/siglist.c:26
 msgid "Signal 0"
@@ -6166,7 +6179,7 @@ msgstr "%s: Optie -v is gebruikt op een systeem zonder een adequaat drijvende-ko
 #: timezone/zic.c:392
 #, c-format
 msgid "%s: Memory exhausted: %s\n"
-msgstr "%s: Onvoldoende geheugen: %s\n"
+msgstr "%s: Onvoldoende geheugen beschikbaar: %s\n"
 
 #: timezone/zic.c:451
 #, c-format
diff --git a/resolv/arpa/nameser.h b/resolv/arpa/nameser.h
index f6330a8979..a164221df4 100644
--- a/resolv/arpa/nameser.h
+++ b/resolv/arpa/nameser.h
@@ -424,6 +424,11 @@ typedef enum __ns_cert_types {
 #define NS_NXT_MAX 127
 
 /*
+ * EDNS0 extended flags, host order.
+ */
+#define NS_OPT_DNSSEC_OK        0x8000U
+
+/*
  * Inline versions of get/put short/long.  Pointer is advanced.
  */
 #define NS_GET16(s, cp) do { \
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c
index f45888933f..c53b809ef7 100644
--- a/resolv/res_hconf.c
+++ b/resolv/res_hconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995-2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995-2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David Mosberger (davidm@azstarnet.com).
 
@@ -361,6 +361,7 @@ _res_hconf_init (void)
 }
 
 
+#ifndef NOT_IN_libc
 /* List of known interfaces.  */
 libc_freeres_ptr (
 static struct netaddr
@@ -532,3 +533,4 @@ _res_hconf_trim_domains (struct hostent *hp)
   for (i = 0; hp->h_aliases[i]; ++i)
     _res_hconf_trim_domain (hp->h_aliases[i]);
 }
+#endif
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 27dd1d4351..23306a2fb4 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -425,9 +425,12 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
 				EXT(statp).nsaddrs[n] =
 				    malloc(sizeof (struct sockaddr_in6));
 			if (EXT(statp).nsaddrs[n] != NULL) {
-				memcpy(EXT(statp).nsaddrs[n],
-				       &statp->nsaddr_list[ns],
-				       sizeof (struct sockaddr_in));
+				memset (mempcpy(EXT(statp).nsaddrs[n],
+						&statp->nsaddr_list[ns],
+						sizeof (struct sockaddr_in)),
+					'\0',
+					sizeof (struct sockaddr_in6)
+					- sizeof (struct sockaddr_in));
 				EXT(statp).nssocks[n] = -1;
 				n++;
 			}
diff --git a/stdio-common/tempnam.c b/stdio-common/tempnam.c
index c631d462d3..055604fb79 100644
--- a/stdio-common/tempnam.c
+++ b/stdio-common/tempnam.c
@@ -19,13 +19,13 @@
 #include <stdio.h>
 #include <string.h>
 
-/* Generate a unique temporary filename using up to five characters of PFX
-   if it is not NULL.  The directory to put this file in is searched for
-   as follows: First the environment variable "TMPDIR" is checked.
-   If it contains the name of a writable directory, that directory is used.
-   If not and if DIR is not NULL, that value is checked.  If that fails,
-   P_tmpdir is tried and finally "/tmp".  The storage for the filename
-   is allocated by `malloc'.  */
+/* Generate a unique temporary filename using up to five characters of
+   PFX if it is not NULL.  The directory to put this file in is
+   searched for as follows: First the environment variable "TMPDIR" is
+   checked.  If it contains the name of a directory, that directory is
+   used.  If not and if DIR is not NULL, that value is checked.  If
+   that fails, P_tmpdir is tried and finally "/tmp".  The storage for
+   the filename is allocated by `malloc'.  */
 char *
 tempnam (const char *dir, const char *pfx)
 {
diff --git a/string/strfry.c b/string/strfry.c
index a8b202d176..d392d5526b 100644
--- a/string/strfry.c
+++ b/string/strfry.c
@@ -42,7 +42,7 @@ strfry (char *string)
     {
       int32_t j;
       __random_r (&rdata, &j);
-      j = j % len + 1;
+      j = j % (len - i) + i;
 
       char c = string[i];
       string[i] = string[j];
diff --git a/string/strtok.c b/string/strtok.c
index f45b760f74..9d6bb06779 100644
--- a/string/strtok.c
+++ b/string/strtok.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1996,1997,1999,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1996,1997,1999,2000,2001,2007
+   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,7 +31,7 @@ static char *olds;
 	x = strtok(s, "-");		// x = "abc"
 	x = strtok(NULL, "-=");		// x = "def"
 	x = strtok(NULL, "=");		// x = NULL
-		// s = "abc\0-def\0"
+		// s = "abc\0=-def\0"
 */
 char *
 strtok (s, delim)
diff --git a/sysdeps/i386/dl-trampoline.S b/sysdeps/i386/dl-trampoline.S
index f991797ee9..af9eaf6d56 100644
--- a/sysdeps/i386/dl-trampoline.S
+++ b/sysdeps/i386/dl-trampoline.S
@@ -37,10 +37,10 @@ _dl_runtime_resolve:
 	call _dl_fixup		# Call resolver.
 	popl %edx		# Get register content back.
 	cfi_adjust_cfa_offset (-4)
-	popl %ecx
-	cfi_adjust_cfa_offset (-4)
-	xchgl %eax, (%esp)	# Get %eax contents end store function address.
-	ret $8			# Jump to function address.
+	movl (%esp), %ecx
+	movl %eax, (%esp)	# Store the function address.
+	movl 4(%esp), %eax
+	ret $12			# Jump to function address.
 	cfi_endproc
 	.size _dl_runtime_resolve, .-_dl_runtime_resolve
 
@@ -83,10 +83,10 @@ _dl_runtime_profile:
 	cfi_adjust_cfa_offset (-4)
 	popl %edx		# Get register content back.
 	cfi_adjust_cfa_offset (-4)
-	popl %ecx
-	cfi_adjust_cfa_offset (-4)
-	xchgl %eax, (%esp)	# Get %eax contents end store function address.
-	ret $16			# Jump to function address.
+	movl (%esp), %ecx
+	movl %eax, (%esp)	# Store the function address.
+	movl 4(%esp), %eax
+	ret $20			# Jump to function address.
 
 	/*
 	    +32     return address
@@ -111,9 +111,10 @@ _dl_runtime_profile:
 	cfi_rel_offset (esi, 0)
 	leal 44(%esp), %esi
 	movl %ebx, %ecx
+	orl $4, %ebx		# Increase frame size if necessary to align
+				# stack for the function call
 	movl %esp, %edi
 	subl %ebx, %edi
-	andl $0xfffffff0, %edi	# Align stack
 	movl %esp, %ebx
 	cfi_def_cfa_register (ebx)
 	movl %edi, %esp
diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h
index a22da71d60..f0661d1622 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysdep.h
+++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003, 2004
+/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003, 2004, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
@@ -29,6 +29,8 @@
 /* There is some commonality.  */
 #include <sysdeps/unix/alpha/sysdep.h>
 
+#include <tls.h>
+
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax
diff --git a/sysdeps/unix/sysv/linux/i386/syscalls.list b/sysdeps/unix/sysv/linux/i386/syscalls.list
index c532a78869..324ab3dc1a 100644
--- a/sysdeps/unix/sysv/linux/i386/syscalls.list
+++ b/sysdeps/unix/sysv/linux/i386/syscalls.list
@@ -6,4 +6,4 @@ vm86		-	vm86		i:ip	__vm86		vm86@@GLIBC_2.3.4
 oldgetrlimit	EXTRA	getrlimit	i:ip	__old_getrlimit	getrlimit@GLIBC_2.0
 oldsetrlimit	EXTRA	setrlimit	i:ip	__old_setrlimit	setrlimit@GLIBC_2.0
 waitpid		-	waitpid		Ci:ipi	__waitpid	waitpid	__libc_waitpid
-fallocate64	EXTRA	fallocate	Vi:iiiiii	__fallocate64
+fallocate64	-	fallocate	Vi:iiiiii	__fallocate64
diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c
index b061a848c6..7b2333d4bf 100644
--- a/sysdeps/unix/sysv/linux/init-first.c
+++ b/sysdeps/unix/sysv/linux/init-first.c
@@ -1,5 +1,5 @@
 /* Initialization code run first thing by the ELF startup code.  Linux version.
-   Copyright (C) 1995-2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1995-2004, 2005, 2007 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
@@ -82,6 +82,10 @@ _init (int argc, char **argv, char **envp)
   _dl_non_dynamic_init ();
 #endif
 
+#ifdef VDSO_SETUP
+  VDSO_SETUP ();
+#endif
+
   __init_misc (argc, argv, envp);
 
 #ifdef USE_NONOPTION_FLAGS
diff --git a/sysdeps/unix/sysv/linux/powerpc/init-first.c b/sysdeps/unix/sysv/linux/powerpc/init-first.c
new file mode 100644
index 0000000000..92dacc761f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/init-first.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 2007 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.  */
+
+#ifdef SHARED
+# include <dl-vdso.h>
+# undef __gettimeofday
+# undef __clock_gettime
+# undef __clock_getres
+# include <bits/libc-vdso.h>
+
+void *__vdso_gettimeofday attribute_hidden;
+void *__vdso_clock_gettime;
+void *__vdso_clock_getres;
+void *__vdso_get_tbfreq;
+
+
+static inline void
+_libc_vdso_platform_setup (void)
+{
+  PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565);
+
+  __vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615);
+
+  __vdso_clock_gettime = _dl_vdso_vsym ("__kernel_clock_gettime", &linux2615);
+
+  __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres", &linux2615);
+
+  __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_vdso_get_tbfreq", &linux2615);
+}
+
+# define VDSO_SETUP _libc_vdso_platform_setup
+#endif
+
+#include "../init-first.c"
diff --git a/sysdeps/unix/sysv/linux/powerpc/libc-start.c b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
index d1f321c44d..1e6fce42f7 100644
--- a/sysdeps/unix/sysv/linux/powerpc/libc-start.c
+++ b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
@@ -25,37 +25,6 @@
 #include <bp-sym.h>
 
 
-#ifdef SHARED
-# include <sys/time.h>
-# include <dl-vdso.h>
-# undef __gettimeofday
-# undef __clock_gettime
-# undef __clock_getres
-# include <bits/libc-vdso.h>
-
-void *__vdso_gettimeofday attribute_hidden;
-void *__vdso_clock_gettime;
-void *__vdso_clock_getres;
-void *__vdso_get_tbfreq;
-
-static inline void
-_libc_vdso_platform_setup (void)
-{
-  PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565);
-
-  __vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615);
-
-  __vdso_clock_gettime = _dl_vdso_vsym ("__kernel_clock_gettime", &linux2615);
-
-  __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres", &linux2615);
-
-  __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_vdso_get_tbfreq", &linux2615);
-}
-
-# define VDSO_SETUP _libc_vdso_platform_setup
-#endif
-
-
 int __cache_line_size attribute_hidden;
 /* The main work is done in the generic function.  */
 #define LIBC_START_MAIN generic_start_main
diff --git a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S
index c74fc67cac..f618e738b1 100644
--- a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S
+++ b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S
@@ -28,7 +28,7 @@ ENTRY (__gettimeofday)
 	/* Align stack.  */
 	sub	$0x8, %rsp
 	cfi_adjust_cfa_offset(8)
-#if 0 /* def SHARED */
+#ifdef SHARED
 	movq	__vdso_gettimeofday(%rip), %rax
 	PTR_DEMANGLE (%rax)
 #else
diff --git a/sysdeps/unix/sysv/linux/x86_64/libc-start.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
index dea2e8afe4..e9cf5646b5 100644
--- a/sysdeps/unix/sysv/linux/x86_64/libc-start.c
+++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -22,7 +22,9 @@
 
 int (*__vdso_gettimeofday) (struct timeval *, void *) attribute_hidden;
 
-int (*__vdso_clock_gettime) (clockid_t, struct timespec *);
+int (*__vdso_clock_gettime) (clockid_t, struct timespec *)
+  __attribute__ ((nocommon));
+strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden)
 
 
 static inline void
@@ -40,10 +42,10 @@ _libc_vdso_platform_setup (void)
 
   p = _dl_vdso_vsym ("clock_gettime", &linux26);
   PTR_MANGLE (p);
-  __vdso_clock_gettime = p;
+  __GI___vdso_clock_gettime = p;
 }
 
 # define VDSO_SETUP _libc_vdso_platform_setup
 #endif
 
-#include <csu/libc-start.c>
+#include "../init-first.c"
diff --git a/sysdeps/x86_64/cacheinfo.c b/sysdeps/x86_64/cacheinfo.c
index 8855b6d45f..793dc2d357 100644
--- a/sysdeps/x86_64/cacheinfo.c
+++ b/sysdeps/x86_64/cacheinfo.c
@@ -259,7 +259,8 @@ handle_amd (int name)
 		: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
 		: "0" (0x80000000));
 
-  if (name >= _SC_LEVEL3_CACHE_SIZE)
+  /* No level 4 cache (yet).  */
+  if (name > _SC_LEVEL3_CACHE_LINESIZE)
     return 0;
 
   unsigned int fn = 0x80000005 + (name >= _SC_LEVEL2_CACHE_SIZE);
@@ -280,36 +281,87 @@ handle_amd (int name)
     {
     case _SC_LEVEL1_DCACHE_SIZE:
       return (ecx >> 14) & 0x3fc00;
+
     case _SC_LEVEL1_DCACHE_ASSOC:
       ecx >>= 16;
       if ((ecx & 0xff) == 0xff)
 	/* Fully associative.  */
 	return (ecx << 2) & 0x3fc00;
       return ecx & 0xff;
+
     case _SC_LEVEL1_DCACHE_LINESIZE:
       return ecx & 0xff;
+
     case _SC_LEVEL2_CACHE_SIZE:
       return (ecx & 0xf000) == 0 ? 0 : (ecx >> 6) & 0x3fffc00;
+
     case _SC_LEVEL2_CACHE_ASSOC:
-      ecx >>= 12;
-      switch (ecx & 0xf)
+      switch ((ecx >> 12) & 0xf)
         {
         case 0:
         case 1:
         case 2:
         case 4:
-	  return ecx & 0xf;
+	  return (ecx >> 12) & 0xf;
 	case 6:
 	  return 8;
 	case 8:
 	  return 16;
-	case 0xf:
-	  return (ecx << 6) & 0x3fffc00;
+	case 10:
+	  return 32;
+	case 11:
+	  return 48;
+	case 12:
+	  return 64;
+	case 13:
+	  return 96;
+	case 14:
+	  return 128;
+	case 15:
+	  return ((ecx >> 6) & 0x3fffc00) / (ecx & 0xff);
 	default:
 	  return 0;
         }
+      /* NOTREACHED */
+
     case _SC_LEVEL2_CACHE_LINESIZE:
       return (ecx & 0xf000) == 0 ? 0 : ecx & 0xff;
+
+    case _SC_LEVEL3_CACHE_SIZE:
+      return (edx & 0xf000) == 0 ? 0 : (edx & 0x3ffc0000) << 1;
+
+    case _SC_LEVEL3_CACHE_ASSOC:
+      switch ((edx >> 12) & 0xf)
+	{
+	case 0:
+	case 1:
+	case 2:
+	case 4:
+	  return (edx >> 12) & 0xf;
+	case 6:
+	  return 8;
+	case 8:
+	  return 16;
+	case 10:
+	  return 32;
+	case 11:
+	  return 48;
+	case 12:
+	  return 64;
+	case 13:
+	  return 96;
+	case 14:
+	  return 128;
+	case 15:
+	  return ((edx & 0x3ffc0000) << 1) / (edx & 0xff);
+	default:
+	  return 0;
+	}
+      /* NOTREACHED */
+
+    case _SC_LEVEL3_CACHE_LINESIZE:
+      return (edx & 0xf000) == 0 ? 0 : edx & 0xff;
+
     default:
       assert (! "cannot happen");
     }
diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index c1686dae10..84fe4724b1 100644
--- 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 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2007 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
@@ -120,13 +120,14 @@ _dl_runtime_profile:
 	leaq 104(%rsp), %rsi
 	movq %rsp, %rbx
 	cfi_def_cfa_register (1)
+	movq %r10, %rcx
+	addq $8, %r10
+	andq $0xfffffffffffffff0, %r10
 	subq %r10, %rsp
 	movq %rsp, %rdi
-	movq %r10, %rcx
 	shrq $3, %rcx
 	rep
 	movsq
-	andq $0xfffffffffffffff0, %rsp
 	movq 32(%rbx), %rcx
 	movq 40(%rbx), %rsi
 	movq 48(%rbx), %rdi