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

[commits] r8109 - in /fsf/trunk/libc: ./ dirent/ elf/ inet/ localedata/ localedata/locales/ nptl/ nptl/sysdeps/unix/sysv/linux/x86_64/...



Author: eglibc
Date: Mon Mar 16 00:04:52 2009
New Revision: 8109

Log:
Import glibc-mainline for 2009-03-16

Added:
    fsf/trunk/libc/inet/tst-inet6_rth.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/dirent/alphasort.c
    fsf/trunk/libc/dirent/alphasort64.c
    fsf/trunk/libc/dirent/dirent.h
    fsf/trunk/libc/dirent/scandir.c
    fsf/trunk/libc/dirent/versionsort.c
    fsf/trunk/libc/dirent/versionsort64.c
    fsf/trunk/libc/elf/dl-load.c
    fsf/trunk/libc/elf/dl-open.c
    fsf/trunk/libc/elf/dl-reloc.c
    fsf/trunk/libc/elf/rtld.c
    fsf/trunk/libc/inet/Makefile
    fsf/trunk/libc/inet/inet6_rth.c
    fsf/trunk/libc/localedata/ChangeLog
    fsf/trunk/libc/localedata/locales/iso14651_t1_common
    fsf/trunk/libc/localedata/locales/ko_KR
    fsf/trunk/libc/localedata/locales/mt_MT
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
    fsf/trunk/libc/string/strlen.c
    fsf/trunk/libc/sysdeps/generic/ldsodefs.h
    fsf/trunk/libc/sysdeps/wordsize-64/alphasort.c
    fsf/trunk/libc/sysdeps/wordsize-64/versionsort.c
    fsf/trunk/libc/sysdeps/x86_64/dl-trampoline.S

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Mon Mar 16 00:04:52 2009
@@ -1,3 +1,46 @@
+2009-03-15  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #9733]
+	* elf/dl-load.c (_dl_map_object_from_fd): Only call audit hooks
+	if we are not loading a new audit library.
+	* elf/dl-reloc (_dl_relocate_object): Third parameter is now a bitmask.
+	Only use profiling trampoline for auditing if we are not relocating
+	an audit library.
+	* elf/dl-open.c (dl_open_worker): Adjust _dl_relocate_object call.
+	* elf/rtld.c: Likewise.
+	* sysdeps/generic/ldsodefs.h: Adjust _dl_relocate_object prototype.
+
+	* elf/rtld.c (dl_main): Extend help message for --audit option.
+
+	[BZ #9759]
+	* dirent/dirent.h: Adjust prototypes of scandir, scandir64, alphasort,
+	alphasort64, versionsort, and versionsort64 to POSIX 2008.
+	* dirent/alphasort.c: Adjust implementation to type change.
+	* dirent/alphasort64.c: Likewise.
+	* dirent/scandir.c: Likewise.
+	* dirent/versionsort.c: Likewise.
+	* dirent/versionsort64.c: Likewise.
+	* sysdeps/wordsize-64/alphasort.c: Add hack to hide alphasort64
+	declaration.
+	* sysdeps/wordsize-64/versionsort.c: Add hack to hide versionsort64
+	declaration.
+
+	[BZ #9880]
+	* inet/inet6_rth.c (inet6_rth_reverse): Compute number of segments
+	correctly.  Set segleft member in output as required.
+	Patch partly by Yang Hongyang <yanghy@xxxxxxxxxxxxxx>.
+	* inet/tst-inet6_rth.c (do_test): Add tests for inet6_rth_reverse.
+
+	[BZ #9881]
+	* inet/inet6_rth.c (inet6_rth_add): Add some error checking.
+	Patch mostly by Yang Hongyang <yanghy@xxxxxxxxxxxxxx>.
+	* inet/Makefile (tests): Add tst-inet6_rth.
+	* inet/tst-inet6_rth.c: New file.
+
+	[BZ #5807]
+	* string/strlen.c (strlen): Fix omission in the expression to test
+	for NUL bytes.
+
 2009-03-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* crypt/sha256test.c (main): Perform 100,000 'a' test in a second way.
@@ -16,7 +59,7 @@
 
 	[BZ #9893]
 	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix
-	alignement of La_x86_64_regs.  Store xmm parameters.
+	alignment of La_x86_64_regs.  Store xmm parameters.
 	Patch mostly by Jiri Olsa <olsajiri@xxxxxxxxx>.
 
 	[BZ #9913]

Modified: fsf/trunk/libc/dirent/alphasort.c
==============================================================================
--- fsf/trunk/libc/dirent/alphasort.c (original)
+++ fsf/trunk/libc/dirent/alphasort.c Mon Mar 16 00:04:52 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1997, 1998, 2009 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
@@ -20,8 +20,7 @@
 #include <string.h>
 
 int
-alphasort (const void *a, const void *b)
+alphasort (const struct dirent **a, const struct dirent **b)
 {
-  return strcoll ((*(const struct dirent **) a)->d_name,
-		  (*(const struct dirent **) b)->d_name);
+  return strcoll ((*a)->d_name, (*b)->d_name);
 }

Modified: fsf/trunk/libc/dirent/alphasort64.c
==============================================================================
--- fsf/trunk/libc/dirent/alphasort64.c (original)
+++ fsf/trunk/libc/dirent/alphasort64.c Mon Mar 16 00:04:52 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1997, 1998, 2000, 2009 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
@@ -20,8 +20,7 @@
 #include <string.h>
 
 int
-alphasort64 (const void *a, const void *b)
+alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
 {
-  return strcoll ((*(const struct dirent64 **) a)->d_name,
-		  (*(const struct dirent64 **) b)->d_name);
+  return strcoll ((*a)->d_name, (*b)->d_name);
 }

Modified: fsf/trunk/libc/dirent/dirent.h
==============================================================================
--- fsf/trunk/libc/dirent/dirent.h (original)
+++ fsf/trunk/libc/dirent/dirent.h Mon Mar 16 00:04:52 2009
@@ -252,7 +252,8 @@
 extern int scandir (__const char *__restrict __dir,
 		    struct dirent ***__restrict __namelist,
 		    int (*__selector) (__const struct dirent *),
-		    int (*__cmp) (__const void *, __const void *))
+		    int (*__cmp) (__const struct dirent **,
+				  __const struct dirent **))
      __nonnull ((1, 2));
 # else
 #  ifdef __REDIRECT
@@ -260,7 +261,8 @@
 		       (__const char *__restrict __dir,
 			struct dirent ***__restrict __namelist,
 			int (*__selector) (__const struct dirent *),
-			int (*__cmp) (__const void *, __const void *)),
+			int (*__cmp) (__const struct dirent **,
+				      __const struct dirent **)),
 		       scandir64) __nonnull ((1, 2));
 #  else
 #   define scandir scandir64
@@ -273,18 +275,21 @@
 extern int scandir64 (__const char *__restrict __dir,
 		      struct dirent64 ***__restrict __namelist,
 		      int (*__selector) (__const struct dirent64 *),
-		      int (*__cmp) (__const void *, __const void *))
+		      int (*__cmp) (__const struct dirent64 **,
+				    __const struct dirent64 **))
      __nonnull ((1, 2));
 # endif
 
 /* Function to compare two `struct dirent's alphabetically.  */
 # ifndef __USE_FILE_OFFSET64
-extern int alphasort (__const void *__e1, __const void *__e2)
+extern int alphasort (__const struct dirent **__e1,
+		      __const struct dirent **__e2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 # else
 #  ifdef __REDIRECT
 extern int __REDIRECT_NTH (alphasort,
-			   (__const void *__e1, __const void *__e2),
+			   (__const struct dirent **__e1,
+			    __const struct dirent **__e2),
 			   alphasort64) __attribute_pure__ __nonnull ((1, 2));
 #  else
 #   define alphasort alphasort64
@@ -292,51 +297,54 @@
 # endif
 
 # if defined __USE_GNU && defined __USE_LARGEFILE64
-extern int alphasort64 (__const void *__e1, __const void *__e2)
+extern int alphasort64 (__const struct dirent64 **__e1,
+			__const struct dirent64 **__e2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 # endif
-
-
-# if defined __USE_BSD || defined __USE_MISC
+#endif /* Use BSD or misc or XPG7.  */
+
+
+#if defined __USE_BSD || defined __USE_MISC
 /* Read directory entries from FD into BUF, reading at most NBYTES.
    Reading starts at offset *BASEP, and *BASEP is updated with the new
    position after reading.  Returns the number of bytes read; zero when at
    end of directory; or -1 for errors.  */
-#  ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
 extern __ssize_t getdirentries (int __fd, char *__restrict __buf,
 				size_t __nbytes,
 				__off_t *__restrict __basep)
      __THROW __nonnull ((2, 4));
-#  else
-#   ifdef __REDIRECT
+# else
+#  ifdef __REDIRECT
 extern __ssize_t __REDIRECT_NTH (getdirentries,
 				 (int __fd, char *__restrict __buf,
 				  size_t __nbytes,
 				  __off64_t *__restrict __basep),
 				 getdirentries64) __nonnull ((2, 4));
-#   else
-#    define getdirentries getdirentries64
-#   endif
-#  endif
-
-#  ifdef __USE_LARGEFILE64
+#  else
+#   define getdirentries getdirentries64
+#  endif
+# endif
+
+# ifdef __USE_LARGEFILE64
 extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
 				  size_t __nbytes,
 				  __off64_t *__restrict __basep)
      __THROW __nonnull ((2, 4));
-#  endif
-# endif /* Use BSD or misc.  */
-#endif /* Use BSD or misc or XPG7.  */
+# endif
+#endif /* Use BSD or misc.  */
 
 #ifdef __USE_GNU
 /* Function to compare two `struct dirent's by name & version.  */
 # ifndef __USE_FILE_OFFSET64
-extern int versionsort (__const void *__e1, __const void *__e2)
+extern int versionsort (__const struct dirent **__e1,
+			__const struct dirent **__e2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 # else
 #  ifdef __REDIRECT
 extern int __REDIRECT_NTH (versionsort,
-			   (__const void *__e1, __const void *__e2),
+			   (__const struct dirent **__e1,
+			    __const struct dirent **__e2),
 			   versionsort64)
      __attribute_pure__ __nonnull ((1, 2));
 #  else
@@ -345,7 +353,8 @@
 # endif
 
 # ifdef __USE_LARGEFILE64
-extern int versionsort64 (__const void *__e1, __const void *__e2)
+extern int versionsort64 (__const struct dirent64 **__e1,
+			  __const struct dirent64 **__e2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 # endif
 #endif /* Use GNU.  */

Modified: fsf/trunk/libc/dirent/scandir.c
==============================================================================
--- fsf/trunk/libc/dirent/scandir.c (original)
+++ fsf/trunk/libc/dirent/scandir.c Mon Mar 16 00:04:52 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1992-1998,2000,2002,2003,2009 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
@@ -57,7 +57,7 @@
      const char *dir;
      DIRENT_TYPE ***namelist;
      int (*select) (const DIRENT_TYPE *);
-     int (*cmp) (const void *, const void *);
+     int (*cmp) (const DIRENT_TYPE **, const DIRENT_TYPE **);
 {
   DIR *dp = __opendir (dir);
   DIRENT_TYPE **v = NULL;
@@ -134,7 +134,8 @@
     {
       /* Sort the list if we have a comparison function to sort with.  */
       if (cmp != NULL)
-	qsort (v, c.cnt, sizeof (*v), cmp);
+	qsort (v, c.cnt, sizeof (*v),
+	       (int (*) (const void *, const void *)) cmp);
 
       *namelist = v;
     }

Modified: fsf/trunk/libc/dirent/versionsort.c
==============================================================================
--- fsf/trunk/libc/dirent/versionsort.c (original)
+++ fsf/trunk/libc/dirent/versionsort.c Mon Mar 16 00:04:52 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1997, 1998, 2009 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
@@ -20,8 +20,7 @@
 #include <string.h>
 
 int
-versionsort (const void *a, const void *b)
+versionsort (const struct dirent **a, const struct dirent **b)
 {
-  return __strverscmp ((*(const struct dirent **) a)->d_name,
-		       (*(const struct dirent **) b)->d_name);
+  return __strverscmp ((*a)->d_name, (*b)->d_name);
 }

Modified: fsf/trunk/libc/dirent/versionsort64.c
==============================================================================
--- fsf/trunk/libc/dirent/versionsort64.c (original)
+++ fsf/trunk/libc/dirent/versionsort64.c Mon Mar 16 00:04:52 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1997, 1998, 2000, 2009 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
@@ -20,8 +20,7 @@
 #include <string.h>
 
 int
-versionsort64 (const void *a, const void *b)
+versionsort64 (const struct dirent64 **a, const struct dirent64 **b)
 {
-  return __strverscmp ((*(const struct dirent64 **) a)->d_name,
-		       (*(const struct dirent64 **) b)->d_name);
+  return __strverscmp ((*a)->d_name, (*b)->d_name);
 }

Modified: fsf/trunk/libc/elf/dl-load.c
==============================================================================
--- fsf/trunk/libc/elf/dl-load.c (original)
+++ fsf/trunk/libc/elf/dl-load.c Mon Mar 16 00:04:52 2009
@@ -941,7 +941,8 @@
     {
 #ifdef SHARED
       /* Auditing checkpoint: we are going to add new objects.  */
-      if (__builtin_expect (GLRO(dl_naudit) > 0, 0))
+      if ((mode & __RTLD_AUDIT) == 0
+	  && __builtin_expect (GLRO(dl_naudit) > 0, 0))
 	{
 	  struct link_map *head = GL(dl_ns)[nsid]._ns_loaded;
 	  /* Do not call the functions for any auditing object.  */

Modified: fsf/trunk/libc/elf/dl-open.c
==============================================================================
--- fsf/trunk/libc/elf/dl-open.c (original)
+++ fsf/trunk/libc/elf/dl-open.c Mon Mar 16 00:04:52 2009
@@ -1,5 +1,5 @@
 /* Load a shared object at runtime, relocate it, and run its initializer.
-   Copyright (C) 1996-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1996-2007, 2009 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
@@ -207,7 +207,6 @@
   const char *file = args->file;
   int mode = args->mode;
   struct link_map *new;
-  int lazy;
   unsigned int i;
   bool any_tls = false;
   struct link_map *call_map = NULL;
@@ -366,7 +365,9 @@
   _dl_debug_state ();
 
   /* Only do lazy relocation if `LD_BIND_NOW' is not set.  */
-  lazy = (mode & RTLD_BINDING_MASK) == RTLD_LAZY && GLRO(dl_lazy);
+  int reloc_mode = mode & __RTLD_AUDIT;
+  if (GLRO(dl_lazy))
+    reloc_mode |= mode & RTLD_LAZY;
 
   /* Relocate the objects loaded.  We do this in reverse order so that copy
      relocs of earlier objects overwrite the data written by later objects.  */
@@ -388,7 +389,7 @@
 		 start the profiling.  */
 	      struct link_map *old_profile_map = GL(dl_profile_map);
 
-	      _dl_relocate_object (l, l->l_scope, 1, 1);
+	      _dl_relocate_object (l, l->l_scope, reloc_mode | RTLD_LAZY, 1);
 
 	      if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
 		{
@@ -401,7 +402,7 @@
 	    }
 	  else
 #endif
-	    _dl_relocate_object (l, l->l_scope, lazy, 0);
+	    _dl_relocate_object (l, l->l_scope, reloc_mode, 0);
 	}
 
       if (l == new)

Modified: fsf/trunk/libc/elf/dl-reloc.c
==============================================================================
--- fsf/trunk/libc/elf/dl-reloc.c (original)
+++ fsf/trunk/libc/elf/dl-reloc.c Mon Mar 16 00:04:52 2009
@@ -1,5 +1,5 @@
 /* Relocate a shared object and resolve its references to other loaded objects.
-   Copyright (C) 1995-2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1995-2006, 2008, 2009 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
@@ -151,7 +151,7 @@
 
 void
 _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
-		     int lazy, int consider_profiling)
+		     int reloc_mode, int consider_profiling)
 {
   struct textrels
   {
@@ -162,10 +162,12 @@
   } *textrels = NULL;
   /* Initialize it to make the compiler happy.  */
   const char *errstring = NULL;
+  int lazy = reloc_mode & RTLD_LAZY;
 
 #ifdef SHARED
   /* If we are auditing, install the same handlers we need for profiling.  */
-  consider_profiling |= GLRO(dl_audit) != NULL;
+  if ((reloc_mode & __RTLD_AUDIT) == 0)
+    consider_profiling |= GLRO(dl_audit) != NULL;
 #elif defined PROF
   /* Never use dynamic linker profiling for gprof profiling code.  */
 # define consider_profiling 0

Modified: fsf/trunk/libc/elf/rtld.c
==============================================================================
--- fsf/trunk/libc/elf/rtld.c (original)
+++ fsf/trunk/libc/elf/rtld.c Mon Mar 16 00:04:52 2009
@@ -574,7 +574,7 @@
 struct relocate_args
 {
   struct link_map *l;
-  int lazy;
+  int reloc_mode;
 };
 
 struct map_args
@@ -613,7 +613,7 @@
 {
   struct relocate_args *args = (struct relocate_args *) a;
 
-  _dl_relocate_object (args->l, args->l->l_scope, args->lazy, 0);
+  _dl_relocate_object (args->l, args->l->l_scope, args->reloc_mode, 0);
 }
 
 static void
@@ -1011,7 +1011,8 @@
   --library-path PATH   use given PATH instead of content of the environment\n\
                         variable LD_LIBRARY_PATH\n\
   --inhibit-rpath LIST  ignore RUNPATH and RPATH information in object names\n\
-                        in LIST\n");
+                        in LIST\n\
+  --audit LIST          use objects named in LIST as auditors\n");
 
       ++_dl_skip_args;
       --_dl_argc;
@@ -1908,7 +1909,9 @@
 	  struct link_map *l = main_map;
 
 	  /* Relocate the main executable.  */
-	  struct relocate_args args = { .l = l, .lazy = GLRO(dl_lazy) };
+	  struct relocate_args args = { .l = l,
+					.reloc_mode = (GLRO(dl_lazy)
+						       ? RTLD_LAZY : 0) };
 	  _dl_receive_error (print_unresolved, relocate_doit, &args);
 
 	  /* This loop depends on the dependencies of the executable to
@@ -1985,7 +1988,7 @@
 	      struct relocate_args args;
 	      struct link_map *l;
 
-	      args.lazy = GLRO(dl_lazy);
+	      args.reloc_mode = GLRO(dl_lazy) ? RTLD_LAZY : 0;
 
 	      l = main_map;
 	      while (l->l_next != NULL)
@@ -2225,7 +2228,7 @@
 	    }
 
 	  if (l != &GL(dl_rtld_map))
-	    _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy),
+	    _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
 				 consider_profiling);
 
 	  /* Add object to slot information data if necessasy.  */

Modified: fsf/trunk/libc/inet/Makefile
==============================================================================
--- fsf/trunk/libc/inet/Makefile (original)
+++ fsf/trunk/libc/inet/Makefile Mon Mar 16 00:04:52 2009
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1991-2006, 2007, 2009 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,7 +53,7 @@
 
 tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \
 	 tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \
-	 tst-getni1 tst-getni2
+	 tst-getni1 tst-getni2 tst-inet6_rth
 
 include ../Rules
 

Modified: fsf/trunk/libc/inet/inet6_rth.c
==============================================================================
--- fsf/trunk/libc/inet/inet6_rth.c (original)
+++ fsf/trunk/libc/inet/inet6_rth.c Mon Mar 16 00:04:52 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2006.
 
@@ -93,6 +93,9 @@
       struct ip6_rthdr0 *rthdr0;
     case IPV6_RTHDR_TYPE_0:
       rthdr0 = (struct ip6_rthdr0 *) rthdr;
+      if (rthdr0->ip6r0_len * 8 / sizeof (struct in6_addr)
+	  - rthdr0->ip6r0_segleft < 1)
+        return -1;
 
       memcpy (&rthdr0->ip6r0_addr[rthdr0->ip6r0_segleft++],
 	      addr, sizeof (struct in6_addr));
@@ -127,7 +130,7 @@
       /* Copy header, not the addresses.  The memory regions can overlap.  */
       memmove (out_rthdr0, in_rthdr0, sizeof (struct ip6_rthdr0));
 
-      int total = in_rthdr0->ip6r0_segleft * 8 / sizeof (struct in6_addr);
+      int total = in_rthdr0->ip6r0_len * 8 / sizeof (struct in6_addr);
       for (int i = 0; i < total / 2; ++i)
 	{
 	  /* Remember, IN_RTHDR0 and OUT_RTHDR0 might overlap.  */
@@ -137,6 +140,8 @@
 	}
       if (total % 2 != 0 && in != out)
 	out_rthdr0->ip6r0_addr[total / 2] = in_rthdr0->ip6r0_addr[total / 2];
+
+      out_rthdr0->ip6r0_segleft = total;
 
       return 0;
     }

Added: fsf/trunk/libc/inet/tst-inet6_rth.c
==============================================================================
--- fsf/trunk/libc/inet/tst-inet6_rth.c (added)
+++ fsf/trunk/libc/inet/tst-inet6_rth.c Mon Mar 16 00:04:52 2009
@@ -1,0 +1,188 @@
+#include <stdio.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <netinet/ip6.h>
+
+static int
+do_test (void)
+{
+  int res = 0;
+  char buf[1000];
+  void *p = inet6_rth_init (buf, 24, IPV6_RTHDR_TYPE_0, 0);
+  if (p == NULL)
+    {
+      puts ("first inet6_rth_init failed");
+      res = 1;
+    }
+  else if (inet6_rth_add (p, &in6addr_any) == 0)
+    {
+      puts ("first inet6_rth_add succeeded");
+      res = 1;
+    }
+
+  p = inet6_rth_init (buf, 24, IPV6_RTHDR_TYPE_0, 1);
+  if (p == NULL)
+    {
+      puts ("second inet6_rth_init failed");
+      res = 1;
+    }
+  else if (inet6_rth_add (p, &in6addr_any) != 0)
+    {
+      puts ("second inet6_rth_add failed");
+      res = 1;
+    }
+
+  for (int nseg = 4; nseg < 6; ++nseg)
+    {
+      printf ("nseg = %d\n", nseg);
+
+      p = inet6_rth_init (buf, sizeof (buf), IPV6_RTHDR_TYPE_0, nseg);
+      if (p == NULL)
+	{
+	  puts ("third inet6_rth_init failed");
+	  res = 1;
+	}
+      else
+	{
+	  struct in6_addr tmp;
+	  memset (&tmp, '\0', sizeof (tmp));
+
+	  for (int i = 0; i < nseg; ++i)
+	    {
+	      tmp.s6_addr[0] = i;
+	      if (inet6_rth_add (p, &tmp) != 0)
+		{
+		  printf ("call %d of third inet6_rth_add failed\n", i + 1);
+		  res = 1;
+		  goto out;
+		}
+	    }
+	  ((struct ip6_rthdr0 *) p)->ip6r0_segleft = 0;
+	  if (inet6_rth_segments (p) != nseg)
+	    {
+	      puts ("\
+inet6_rth_segments returned wrong value after loop with third inet6_rth_add");
+	      res = 1;
+	      goto out;
+	    }
+
+	  char buf2[1000];
+	  if (inet6_rth_reverse (p, buf2) != 0)
+	    {
+	      puts ("first inet6_rth_reverse call failed");
+	      res = 1;
+	      goto out;
+	    }
+	  if (((struct ip6_rthdr0 *) buf2)->ip6r0_segleft != nseg)
+	    {
+	      puts ("segleft after first inet6_rth_reverse wrong");
+	      res = 1;
+	    }
+
+	  if (inet6_rth_segments (p) != inet6_rth_segments (buf2))
+	    {
+	      puts ("number of seconds after first inet6_rth_reverse differs");
+	      res = 1;
+	      goto out;
+	    }
+
+	  for (int i = 0; i < nseg; ++i)
+	    {
+	      struct in6_addr *addr = inet6_rth_getaddr (buf2, i);
+	      if (addr == NULL)
+		{
+		  printf ("call %d of first inet6_rth_getaddr failed\n",
+			  i + 1);
+		  res = 1;
+		}
+	      else if (addr->s6_addr[0] != nseg - 1 - i
+		       || memcmp (&addr->s6_addr[1], &in6addr_any.s6_addr[1],
+				  sizeof (in6addr_any)
+				  - sizeof (in6addr_any.s6_addr[0])) != 0)
+		{
+		  char addrbuf[100];
+		  inet_ntop (AF_INET6, addr, addrbuf, sizeof (addrbuf));
+		  printf ("\
+address %d after first inet6_rth_reverse wrong (%s)\n",
+			  i + 1, addrbuf);
+		  res = 1;
+		}
+	    }
+	out:
+	  ;
+	}
+
+      p = inet6_rth_init (buf, sizeof (buf), IPV6_RTHDR_TYPE_0, nseg);
+      if (p == NULL)
+	{
+	  puts ("fourth inet6_rth_init failed");
+	  res = 1;
+	}
+      else
+	{
+	  struct in6_addr tmp;
+	  memset (&tmp, '\0', sizeof (tmp));
+
+	  for (int i = 0; i < nseg; ++i)
+	    {
+	      tmp.s6_addr[0] = i;
+	      if (inet6_rth_add (p, &tmp) != 0)
+		{
+		  printf ("call %d of fourth inet6_rth_add failed\n", i + 1);
+		  res = 1;
+		  goto out2;
+		}
+	    }
+	  ((struct ip6_rthdr0 *) p)->ip6r0_segleft = 0;
+	  if (inet6_rth_segments (p) != nseg)
+	    {
+	      puts ("\
+inet6_rth_segments returned wrong value after loop with fourth inet6_rth_add");
+	      res = 1;
+	      goto out2;
+	    }
+
+	  if (inet6_rth_reverse (p, p) != 0)
+	    {
+	      puts ("second inet6_rth_reverse call failed");
+	      res = 1;
+	      goto out2;
+	    }
+	  if (((struct ip6_rthdr0 *) p)->ip6r0_segleft != nseg)
+	    {
+	      puts ("segleft after second inet6_rth_reverse wrong");
+	      res = 1;
+	    }
+
+	  for (int i = 0; i < nseg; ++i)
+	    {
+	      struct in6_addr *addr = inet6_rth_getaddr (p, i);
+	      if (addr == NULL)
+		{
+		  printf ("call %d of second inet6_rth_getaddr failed\n",
+			  i + 1);
+		  res = 1;
+		}
+	      else if (addr->s6_addr[0] != nseg - 1 - i
+		       || memcmp (&addr->s6_addr[1], &in6addr_any.s6_addr[1],
+				  sizeof (in6addr_any)
+				  - sizeof (in6addr_any.s6_addr[0])) != 0)
+		{
+		  char addrbuf[100];
+		  inet_ntop (AF_INET6, addr, addrbuf, sizeof (addrbuf));
+		  printf ("\
+address %d after second inet6_rth_reverse wrong (%s)\n",
+			  i + 1, addrbuf);
+		  res = 1;
+		}
+	    }
+	out2:
+	  ;
+	}
+    }
+
+  return res;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Mon Mar 16 00:04:52 2009
@@ -1,3 +1,15 @@
+2009-03-15  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #9844]
+	* locales/iso14651_t1_common: Move U0138 entry.
+
+	[BZ #9833]
+	* locales/ko_KR: Fix noexpr.  Add nostr.
+
+	[BZ #9891]
+	* locales/mt_MT: Fix spelling of August (Awwissu).
+	Patch by Martin Pitt.
+
 2009-03-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	[BZ #9916]

Modified: fsf/trunk/libc/localedata/locales/iso14651_t1_common
==============================================================================
--- fsf/trunk/libc/localedata/locales/iso14651_t1_common (original)
+++ fsf/trunk/libc/localedata/locales/iso14651_t1_common Mon Mar 16 00:04:52 2009
@@ -917,7 +917,7 @@
 # mlvw- denotes Malayalam vowel
 # ml-visarga - dentos Malayalam Visarga
 # consonant + virama is considered half of consonant or consonant without vowel part
-# so it consonant + virama should be considered as cluster and should be 
+# so it consonant + virama should be considered as cluster and should be
 # sorted before the consonant. All consonants are considered to have an implicit a vowel
 # part associated with it.
 collating-element <ml-chillu-n> from "<U0D28><U0D4D>"
@@ -2362,7 +2362,6 @@
 <U1E33> <k>;<BPT>;<MIN>;IGNORE # 337 ḳ
 <U1E35> <k>;<BMA>;<MIN>;IGNORE # 338 ḵ
 <U0199> <k>;<CRL>;<MIN>;IGNORE # 339 Æ™
-<U0138> <k>;<PCL>;<MIN>;IGNORE # 340 <kk>
 <U006C> <l>;<BAS>;<MIN>;IGNORE # 341 l
 <U013A> <l>;<ACA>;<MIN>;IGNORE # 342 <l'>
 <U013E> <l>;<CAR>;<MIN>;IGNORE # 343 <l<>
@@ -2436,6 +2435,7 @@
 <U1E55> <p>;<ACA>;<MIN>;IGNORE # 411 <p'>
 <U1E57> <p>;<PCT>;<MIN>;IGNORE # 412 <p.>
 <U0071> <q>;<BAS>;<MIN>;IGNORE # 413 q
+<U0138> <q>;<PCL>;<MIN>;IGNORE # 340 <kk>
 <U0072> <r>;<BAS>;<MIN>;IGNORE # 414 r
 <U0155> <r>;<ACA>;<MIN>;IGNORE # 415 <r'>
 <U0159> <r>;<CAR>;<MIN>;IGNORE # 416 <r<>
@@ -4309,7 +4309,7 @@
 <ml-dh>	"<ml-dha><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D22>	"<ml-dha><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-chillu-nn> "<ml-nna><ml-virama>";<BAS>;<MIN>;IGNORE # ണ്‍ = ണ  + ്  + zwj
-<U0D23>	"<ml-nna><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ണ = ണ + ് + അ 
+<U0D23>	"<ml-nna><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ണ = ണ + ് + അ
 <ml-th>	"<ml-tha><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D24>	"<ml-tha><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-thh> "<ml-thha><ml-virama>";<BAS>;<MIN>;IGNORE
@@ -4329,14 +4329,14 @@
 <ml-bh>	"<ml-bha><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D2D>	"<ml-bha><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <U0D02>	"<ml-ma><ml-virama>";<BAS>;<MIN>;IGNORE # ം = മ + ്
-<ml-m>	"<ml-ma><ml-virama>";"<BAS><ml-virama>";<MIN>;IGNORE # ം = മ + ്  
-<U0D2E>	"<ml-ma><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # മ = മ + ് + അ 
+<ml-m>	"<ml-ma><ml-virama>";"<BAS><ml-virama>";<MIN>;IGNORE # ം = മ + ്
+<U0D2E>	"<ml-ma><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # മ = മ + ് + അ
 <ml-y>  "<ml-ya><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D2F>	"<ml-ya><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-chillu-r> "<ml-ra><ml-virama>";<BAS>;<MIN>;IGNORE # ര = ര + ്  + zwj
-<U0D30>	"<ml-ra><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ര = ര + ് + അ 
+<U0D30>	"<ml-ra><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ര = ര + ് + അ
 <ml-chillu-l> <ml-la>;<BAS>;<MIN>;IGNORE # ല്‍ = ല + ്  + zwj
-<U0D32>	"<ml-la><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ല = ല + ് + അ 
+<U0D32>	"<ml-la><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ല = ല + ് + അ
 <ml-v>	"<ml-va><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D35>	"<ml-va><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-ss>	"<ml-ssa><ml-virama>";<BAS>;<MIN>;IGNORE
@@ -4348,7 +4348,7 @@
 <ml-h>	"<ml-ha><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D39>	"<ml-ha><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-chillu-ll> "<ml-lla><ml-virama>";<BAS>;<MIN>;IGNORE # ള്‍ = ള  + ്  + zwj
-<U0D33>	"<ml-lla><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ള = ള + ് + അ 
+<U0D33>	"<ml-lla><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ള = ള + ് + അ
 <ml-zh>	"<ml-zha><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D34>	"<ml-zha><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-rr>	"<ml-rra><ml-virama>";<BAS>;<MIN>;IGNORE

Modified: fsf/trunk/libc/localedata/locales/ko_KR
==============================================================================
--- fsf/trunk/libc/localedata/locales/ko_KR (original)
+++ fsf/trunk/libc/localedata/locales/ko_KR Mon Mar 16 00:04:52 2009
@@ -6202,7 +6202,9 @@
 
 yesexpr	"<U005E><U005B><U0079><U0059><UC608><U005D>"
 
-noexpr	"<U005E><U005B><U006E><U004E><UC544><UB2C8><UC624><U005D>"
+noexpr	"<U005E><U005B><U006E><U004E><UC544><U005D>"
+
+nostr   "<UC544><UB2C8><UC624>"
 
 END LC_MESSAGES
 

Modified: fsf/trunk/libc/localedata/locales/mt_MT
==============================================================================
--- fsf/trunk/libc/localedata/locales/mt_MT (original)
+++ fsf/trunk/libc/localedata/locales/mt_MT Mon Mar 16 00:04:52 2009
@@ -188,7 +188,7 @@
 abmon       "<U004A><U0061><U006E>";"<U0046><U0072><U0061>";/
             "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
             "<U004D><U0065><U006A>";"<U0120><U0075><U006E>";/
-            "<U004C><U0075><U006C>";"<U0041><U0077><U0069>";/
+            "<U004C><U0075><U006C>";"<U0041><U0077><U0077>";/
             "<U0053><U0065><U0074>";"<U004F><U0074><U0074>";/
             "<U004E><U006F><U0076>";"<U0044><U0069><U010B>"
 %
@@ -200,7 +200,7 @@
             "<U004D><U0065><U006A><U006A><U0075>";/
             "<U0120><U0075><U006E><U006A><U0075>";/
             "<U004C><U0075><U006C><U006A><U0075>";/
-            "<U0041><U0077><U0069><U0073><U0073><U0075>";/
+            "<U0041><U0077><U0077><U0069><U0073><U0073><U0075>";/
             "<U0053><U0065><U0074><U0074><U0065><U006D><U0062><U0072><U0075>";/
             "<U004F><U0074><U0074><U0075><U0062><U0072><U0075>";/
             "<U004E><U006F><U0076><U0065><U006D><U0062><U0072><U0075>";/

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Mon Mar 16 00:04:52 2009
@@ -1,3 +1,9 @@
+2009-03-15  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+	(__pthread_cond_timedwait): Change to use cfi directives instead of
+	hand-coded unwind sections.
+
 2009-03-10  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* init.c (nptl_freeres): Compile only for SHARED.

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S Mon Mar 16 00:04:52 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2005, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -37,16 +37,19 @@
 	.type	__pthread_cond_timedwait, @function
 	.align	16
 __pthread_cond_timedwait:
-.LSTARTCODE:
+	cfi_startproc
 	pushq	%r12
-.Lpush_r12:
+	cfi_adjust_cfa_offset(8)
+	cfi_rel_offset(%r12, 0)
 	pushq	%r13
-.Lpush_r13:
+	cfi_adjust_cfa_offset(8)
+	cfi_rel_offset(%r13, 0)
 	pushq	%r14
-.Lpush_r14:
+	cfi_adjust_cfa_offset(8)
+	cfi_rel_offset(%r14, 0)
 #define FRAME_SIZE 80
 	subq	$FRAME_SIZE, %rsp
-.Lsubq:
+	cfi_adjust_cfa_offset(FRAME_SIZE)
 
 	cmpq	$1000000000, 8(%rdx)
 	movl	$EINVAL, %eax
@@ -305,19 +308,25 @@
 	cmoveq	%r14, %rax
 
 18:	addq	$FRAME_SIZE, %rsp
-.Laddq:
+	cfi_adjust_cfa_offset(-FRAME_SIZE)
 	popq	%r14
-.Lpop_r14:
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r14)
 	popq	%r13
-.Lpop_r13:
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r13)
 	popq	%r12
-.Lpop_r12:
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r12)
 
 	retq
 
 	/* Initial locking failed.  */
 1:
-.LSbl1:
+	cfi_adjust_cfa_offset(3 * 8 + FRAME_SIZE)
+	cfi_rel_offset(%r12, FRAME_SIZE + 16)
+	cfi_rel_offset(%r13, FRAME_SIZE + 8)
+	cfi_rel_offset(%r14, FRAME_SIZE)
 #if cond_lock != 0
 	addq	$cond_lock, %rdi
 #endif
@@ -414,97 +423,7 @@
 	js	6b
 	jmp	21b
 #endif
-.LENDCODE:
+	cfi_endproc
 	.size	__pthread_cond_timedwait, .-__pthread_cond_timedwait
 versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
 		  GLIBC_2_3_2)
-
-
-	.section .eh_frame,"a",@progbits
-.LSTARTFRAME:
-	.long	L(ENDCIE)-L(STARTCIE)		# Length of the CIE.
-.LSTARTCIE:
-	.long	0				# CIE ID.
-	.byte	1				# Version number.
-#ifdef SHARED
-	.string	"zR"				# NUL-terminated augmentation
-						# string.
-#else
-	.ascii	"\0"				# NUL-terminated augmentation
-						# string.
-#endif
-	.uleb128 1				# Code alignment factor.
-	.sleb128 -8				# Data alignment factor.
-	.byte	16				# Return address register
-						# column.
-#ifdef SHARED
-	.uleb128 1				# Augmentation value length.
-	.byte	0x1b				# Encoding: DW_EH_PE_pcrel
-						# + DW_EH_PE_sdata4.
-#endif
-	.byte 0x0c				# DW_CFA_def_cfa
-	.uleb128 7
-	.uleb128 8
-	.byte	0x90				# DW_CFA_offset, column 0x8
-	.uleb128 1
-	.align 8
-.LENDCIE:
-
-	.long	.LENDFDE-.LSTARTFDE		# Length of the FDE.
-.LSTARTFDE:
-	.long	.LSTARTFDE-.LSTARTFRAME		# CIE pointer.
-#ifdef SHARED
-	.long	.LSTARTCODE-.			# PC-relative start address
-						# of the code
-#else
-	.long	.LSTARTCODE			# Start address of the code.
-#endif
-	.long	.LENDCODE-.LSTARTCODE		# Length of the code.
-#ifdef SHARED
-	.uleb128 0				# No augmentation data.
-#endif
-	.byte	0x40+.Lpush_r12-.LSTARTCODE	# DW_CFA_advance_loc+N
-	.byte	14				# DW_CFA_def_cfa_offset
-	.uleb128 16
-	.byte	0x8c				# DW_CFA_offset %r12
-	.uleb128 2
-	.byte	0x40+.Lpush_r13-.Lpush_r12	# DW_CFA_advance_loc+N
-	.byte	14				# DW_CFA_def_cfa_offset
-	.uleb128 24
-	.byte	0x8d				# DW_CFA_offset %r13
-	.uleb128 3
-	.byte	0x40+.Lpush_r14-.Lpush_r13	# DW_CFA_advance_loc+N
-	.byte	14				# DW_CFA_def_cfa_offset
-	.uleb128 32
-	.byte	0x84				# DW_CFA_offset %r14
-	.uleb128 4
-	.byte	0x40+.Lsubq-.Lpush_r14		# DW_CFA_advance_loc+N
-	.byte	14				# DW_CFA_def_cfa_offset
-	.uleb128 32+FRAME_SIZE
-	.byte	3				# DW_CFA_advance_loc2
-	.2byte	.Laddq-.Lsubq
-	.byte	14				# DW_CFA_def_cfa_offset
-	.uleb128 32
-	.byte	0x40+.Lpop_r14-.Laddq		# DW_CFA_advance_loc+N
-	.byte	14				# DW_CFA_def_cfa_offset
-	.uleb128 24
-	.byte	0xce				# DW_CFA_restore %r14
-	.byte	0x40+.Lpop_r13-.Lpop_r14	# DW_CFA_advance_loc+N
-	.byte	14				# DW_CFA_def_cfa_offset
-	.uleb128 16
-	.byte	0xcd				# DW_CFA_restore %r13
-	.byte	0x40+.Lpop_r12-.Lpop_r13	# DW_CFA_advance_loc+N
-	.byte	14				# DW_CFA_def_cfa_offset
-	.uleb128 8
-	.byte	0xcc				# DW_CFA_restore %r12
-	.byte	0x40+.LSbl1-.Lpop_r12		# DW_CFA_advance_loc+N
-	.byte	14				# DW_CFA_def_cfa_offset
-	.uleb128 32+FRAME_SIZE
-	.byte	0x8c				# DW_CFA_offset %r12
-	.uleb128 2
-	.byte	0x8d				# DW_CFA_offset %r13
-	.uleb128 3
-	.byte	0x84				# DW_CFA_offset %r14
-	.uleb128 4
-	.align	8
-.LENDFDE:

Modified: fsf/trunk/libc/string/strlen.c
==============================================================================
--- fsf/trunk/libc/string/strlen.c (original)
+++ fsf/trunk/libc/string/strlen.c Mon Mar 16 00:04:52 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1997, 2000, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1993,1997,2000,2003,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Torbjorn Granlund (tege@xxxxxxx),
    with help from Dan Sahlin (dan@xxxxxxx);
@@ -32,7 +32,7 @@
 {
   const char *char_ptr;
   const unsigned long int *longword_ptr;
-  unsigned long int longword, magic_bits, himagic, lomagic;
+  unsigned long int longword, himagic, lomagic;
 
   /* Handle the first few characters by reading one character at a time.
      Do this until CHAR_PTR is aligned on a longword boundary.  */
@@ -56,14 +56,12 @@
 
      The 1-bits make sure that carries propagate to the next 0-bit.
      The 0-bits provide holes for carries to fall into.  */
-  magic_bits = 0x7efefeffL;
   himagic = 0x80808080L;
   lomagic = 0x01010101L;
   if (sizeof (longword) > 4)
     {
       /* 64-bit version of the magic.  */
       /* Do the shift in two steps to avoid a warning if long has 32 bits.  */
-      magic_bits = ((0x7efefefeL << 16) << 16) | 0xfefefeffL;
       himagic = ((himagic << 16) << 16) | himagic;
       lomagic = ((lomagic << 16) << 16) | lomagic;
     }
@@ -75,53 +73,9 @@
      if *any of the four* bytes in the longword in question are zero.  */
   for (;;)
     {
-      /* We tentatively exit the loop if adding MAGIC_BITS to
-	 LONGWORD fails to change any of the hole bits of LONGWORD.
-
-	 1) Is this safe?  Will it catch all the zero bytes?
-	 Suppose there is a byte with all zeros.  Any carry bits
-	 propagating from its left will fall into the hole at its
-	 least significant bit and stop.  Since there will be no
-	 carry from its most significant bit, the LSB of the
-	 byte to the left will be unchanged, and the zero will be
-	 detected.
-
-	 2) Is this worthwhile?  Will it ignore everything except
-	 zero bytes?  Suppose every byte of LONGWORD has a bit set
-	 somewhere.  There will be a carry into bit 8.  If bit 8
-	 is set, this will carry into bit 16.  If bit 8 is clear,
-	 one of bits 9-15 must be set, so there will be a carry
-	 into bit 16.  Similarly, there will be a carry into bit
-	 24.  If one of bits 24-30 is set, there will be a carry
-	 into bit 31, so all of the hole bits will be changed.
-
-	 The one misfire occurs when bits 24-30 are clear and bit
-	 31 is set; in this case, the hole at bit 31 is not
-	 changed.  If we had access to the processor carry flag,
-	 we could close this loophole by putting the fourth hole
-	 at bit 32!
-
-	 So it ignores everything except 128's, when they're aligned
-	 properly.  */
-
       longword = *longword_ptr++;
 
-      if (
-#if 0
-	  /* Add MAGIC_BITS to LONGWORD.  */
-	  (((longword + magic_bits)
-
-	    /* Set those bits that were unchanged by the addition.  */
-	    ^ ~longword)
-
-	   /* Look at only the hole bits.  If any of the hole bits
-	      are unchanged, most likely one of the bytes was a
-	      zero.  */
-	   & ~magic_bits)
-#else
-	  ((longword - lomagic) & himagic)
-#endif
-	  != 0)
+      if (((longword - lomagic) & ~longword & himagic) != 0)
 	{
 	  /* Which of the bytes was the zero?  If none of them were, it was
 	     a misfire; continue the search.  */

Modified: fsf/trunk/libc/sysdeps/generic/ldsodefs.h
==============================================================================
--- fsf/trunk/libc/sysdeps/generic/ldsodefs.h (original)
+++ fsf/trunk/libc/sysdeps/generic/ldsodefs.h Mon Mar 16 00:04:52 2009
@@ -882,10 +882,10 @@
 
 /* Relocate the given object (if it hasn't already been).
    SCOPE is passed to _dl_lookup_symbol in symbol lookups.
-   If LAZY is nonzero, don't relocate its PLT.  */
+   If RTLD_LAZY is set in RELOC-MODE, don't relocate its PLT.  */
 extern void _dl_relocate_object (struct link_map *map,
 				 struct r_scope_elem *scope[],
-				 int lazy, int consider_profiling)
+				 int reloc_mode, int consider_profiling)
      attribute_hidden;
 
 /* Protect PT_GNU_RELRO area.  */

Modified: fsf/trunk/libc/sysdeps/wordsize-64/alphasort.c
==============================================================================
--- fsf/trunk/libc/sysdeps/wordsize-64/alphasort.c (original)
+++ fsf/trunk/libc/sysdeps/wordsize-64/alphasort.c Mon Mar 16 00:04:52 2009
@@ -1,3 +1,7 @@
+#define alphasort64 rename_alphasort64
+
 #include "../../dirent/alphasort.c"
 
+#undef alphasort64
+
 weak_alias (alphasort, alphasort64)

Modified: fsf/trunk/libc/sysdeps/wordsize-64/versionsort.c
==============================================================================
--- fsf/trunk/libc/sysdeps/wordsize-64/versionsort.c (original)
+++ fsf/trunk/libc/sysdeps/wordsize-64/versionsort.c Mon Mar 16 00:04:52 2009
@@ -1,3 +1,7 @@
+#define versionsort64 rename_versionsort64
+
 #include "../../dirent/versionsort.c"
 
+#undef versionsort64
+
 weak_alias (versionsort, versionsort64)

Modified: fsf/trunk/libc/sysdeps/x86_64/dl-trampoline.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/dl-trampoline.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/dl-trampoline.S Mon Mar 16 00:04:52 2009
@@ -35,7 +35,7 @@
 	movq %r8, 40(%rsp)
 	movq %r9, 48(%rsp)
 	movq 64(%rsp), %rsi	# Copy args pushed by PLT in register.
-	movq 56(%rsp), %rdi	# %rdi: link_map, %rsi: reloc_offset
+	movq 56(%rsp), %rdi	# %rdi: link_map, %rsi: reloc_index
 	call _dl_fixup		# Call resolver.
 	movq %rax, %r11		# Save return value
 	movq 48(%rsp), %r9	# Get register content back.
@@ -112,7 +112,7 @@
 	movq %rsp, %rcx		# La_x86_64_regs pointer to %rcx.
 	movq 48(%rbx), %rdx	# Load return address if needed.
 	movq 40(%rbx), %rsi	# Copy args pushed by PLT in register.
-	movq 32(%rbx), %rdi	# %rdi: link_map, %rsi: reloc_offset
+	movq 32(%rbx), %rdi	# %rdi: link_map, %rsi: reloc_index
 	leaq 16(%rbx), %r8
 	call _dl_profile_fixup	# Call resolver.
 
@@ -196,7 +196,7 @@
 
 	movq 24(%rbx), %rdx	# La_x86_64_regs argument to %rdx.
 	movq 40(%rbx), %rsi	# Copy args pushed by PLT in register.
-        movq 32(%rbx), %rdi	# %rdi: link_map, %rsi: reloc_offset
+        movq 32(%rbx), %rdi	# %rdi: link_map, %rsi: reloc_index
 	call _dl_call_pltexit
 
 	movq  (%rsp), %rax	# Restore return registers.