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

[commits] r14663 - in /branches/eglibc-2_14: libc/ libc/debug/ libc/iconvdata/ libc/malloc/ libc/nptl/ libc/nptl/sysdeps/pthread/ libc...



Author: joseph
Date: Fri Jul 22 06:47:34 2011
New Revision: 14663

Log:
Merge changes between r14284 and r14662 from /fsf/glibc-2_14-branch.

Modified:
    branches/eglibc-2_14/libc/ChangeLog
    branches/eglibc-2_14/libc/debug/xtrace.sh
    branches/eglibc-2_14/libc/iconvdata/gb18030.c
    branches/eglibc-2_14/libc/malloc/memusage.sh
    branches/eglibc-2_14/libc/nptl/ChangeLog
    branches/eglibc-2_14/libc/nptl/nptl-init.c
    branches/eglibc-2_14/libc/nptl/pthreadP.h
    branches/eglibc-2_14/libc/nptl/sysdeps/pthread/pthread-functions.h
    branches/eglibc-2_14/libc/nptl/sysdeps/unix/sysv/linux/fork.c
    branches/eglibc-2_14/libc/sysdeps/posix/getaddrinfo.c
    branches/eglibc-2_14/ports/ChangeLog.arm
    branches/eglibc-2_14/ports/sysdeps/arm/elf/start.S

Modified: branches/eglibc-2_14/libc/ChangeLog
==============================================================================
--- branches/eglibc-2_14/libc/ChangeLog (original)
+++ branches/eglibc-2_14/libc/ChangeLog Fri Jul 22 06:47:34 2011
@@ -1,3 +1,29 @@
+2011-06-30  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Make sure RES_USE_INET6
+	is always restored.
+
+2011-06-28  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ #12935]
+	* malloc/memusage.sh: Fix quoting in message.
+	* debug/xtrace.sh: Likewise.
+
+2011-06-27  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* iconvdata/gb18030.c (BODY for TO_LOOP): Fix encoding of non-BMP
+	two-byte characters.
+
+2011-06-22  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Fix last change.
+
+2011-06-21  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ #12885]
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): When looking up only IPv6
+	addresses using gethostbyname4_r ignore IPv4 addresses.
+
 2011-06-15  Ulrich Drepper  <drepper@xxxxxxxxx>
 
 	* resolv/res_send.c (__libc_res_nsend): Fix typos in last patch.  We

Modified: branches/eglibc-2_14/libc/debug/xtrace.sh
==============================================================================
--- branches/eglibc-2_14/libc/debug/xtrace.sh (original)
+++ branches/eglibc-2_14/libc/debug/xtrace.sh Fri Jul 22 06:47:34 2011
@@ -30,7 +30,7 @@
 
 # Refer to --help option.
 help_info() {
-  printf >&2 $"Try \`%s --help' or `%s --usage' for more information.\n" xtrace xtrace
+  printf >&2 $"Try \`%s --help' or \`%s --usage' for more information.\n" xtrace xtrace
   exit 1
 }
 

Modified: branches/eglibc-2_14/libc/iconvdata/gb18030.c
==============================================================================
--- branches/eglibc-2_14/libc/iconvdata/gb18030.c (original)
+++ branches/eglibc-2_14/libc/iconvdata/gb18030.c Fri Jul 22 06:47:34 2011
@@ -18233,17 +18233,17 @@
 	      len = 0;							      \
 	  }								      \
 	else if (ch == 0x20087)						      \
-	  idx = 0xfe51;							      \
+	  cp = (const unsigned char *) "\xfe\x51";			      \
 	else if (ch == 0x20089)						      \
-	  idx = 0xfe52;							      \
+	  cp = (const unsigned char *) "\xfe\x52";			      \
 	else if (ch == 0x200CC)						      \
-	  idx = 0xfe53;							      \
+	  cp = (const unsigned char *) "\xfe\x53";			      \
 	else if (ch == 0x215d7)						      \
-	  idx = 0xfe6c;							      \
+	  cp = (const unsigned char *) "\xfe\x6c";			      \
 	else if (ch == 0x2298F)						      \
-	  idx = 0xfe76;							      \
+	  cp = (const unsigned char *) "\xfe\x76";			      \
 	else if (ch == 0x241FE)						      \
-	  idx = 0xfe91;							      \
+	  cp = (const unsigned char *) "\xfe\x91";			      \
 	else								      \
 	  len = 0;							      \
 									      \

Modified: branches/eglibc-2_14/libc/malloc/memusage.sh
==============================================================================
--- branches/eglibc-2_14/libc/malloc/memusage.sh (original)
+++ branches/eglibc-2_14/libc/malloc/memusage.sh Fri Jul 22 06:47:34 2011
@@ -24,7 +24,7 @@
 
 # Print usage message.
 do_usage() {
-  printf >&2 $"Try \`%s --help' or `%s --usage' for more information.\n" memusage memusage
+  printf >&2 $"Try \`%s --help' or \`%s --usage' for more information.\n" memusage memusage
   exit 1
 }
 

Modified: branches/eglibc-2_14/libc/nptl/ChangeLog
==============================================================================
--- branches/eglibc-2_14/libc/nptl/ChangeLog (original)
+++ branches/eglibc-2_14/libc/nptl/ChangeLog Fri Jul 22 06:47:34 2011
@@ -1,3 +1,13 @@
+2011-06-30  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* nptl-init.c (__nptl_set_robust): New function.
+	(pthread_functions): Add reference.
+	* npthreadP.h: Declare __nptl_set_robust.
+	* sysdeps/pthread/pthread-functions.h (pthread_functions): Add
+	ptr_set_robust member.
+	* sysdeps/unix/sysv/linux/fork.c: Call set_robust_list syscall in
+	child if threads are used.
+
 2011-06-14  Andreas Jaeger  <aj@xxxxxxx>
 
 	* pthread_rwlock_init.c: Include <string.h> for memset declaration.

Modified: branches/eglibc-2_14/libc/nptl/nptl-init.c
==============================================================================
--- branches/eglibc-2_14/libc/nptl/nptl-init.c (original)
+++ branches/eglibc-2_14/libc/nptl/nptl-init.c Fri Jul 22 06:47:34 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2008, 2009, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -66,6 +66,13 @@
 #ifndef SHARED
 extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
 #endif
+
+#ifdef SHARED
+static
+#else
+extern
+#endif
+void __nptl_set_robust (struct pthread *);
 
 #ifdef SHARED
 static void nptl_freeres (void);
@@ -130,7 +137,8 @@
     .ptr__nptl_deallocate_tsd = __nptl_deallocate_tsd,
     .ptr__nptl_setxid = __nptl_setxid,
     /* For now only the stack cache needs to be freed.  */
-    .ptr_freeres = nptl_freeres
+    .ptr_freeres = nptl_freeres,
+    .ptr_set_robust = __nptl_set_robust
   };
 # define ptr_pthread_functions &pthread_functions
 #else
@@ -147,7 +155,17 @@
   __unwind_freeres ();
   __free_stacks (0);
 }
-#endif
+
+
+static
+#endif
+void
+__nptl_set_robust (struct pthread *self)
+{
+  INTERNAL_SYSCALL_DECL (err);
+  INTERNAL_SYSCALL (set_robust_list, err, 2, &self->robust_head,
+		    sizeof (struct robust_list_head));
+}
 
 
 /* For asynchronous cancellation we use a signal.  This is the handler.  */

Modified: branches/eglibc-2_14/libc/nptl/pthreadP.h
==============================================================================
--- branches/eglibc-2_14/libc/nptl/pthreadP.h (original)
+++ branches/eglibc-2_14/libc/nptl/pthreadP.h Fri Jul 22 06:47:34 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2009, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -555,17 +555,20 @@
 
 /* Old cleanup interfaces, still used in libc.so.  */
 extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer,
-                                   void (*routine) (void *), void *arg);
+				   void (*routine) (void *), void *arg);
 extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer,
-                                  int execute);
+				  int execute);
 extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer,
-                                         void (*routine) (void *), void *arg);
+					 void (*routine) (void *), void *arg);
 extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer,
-                                          int execute);
+					  int execute);
 
 extern void __nptl_deallocate_tsd (void) attribute_hidden;
 
 extern int __nptl_setxid (struct xid_command *cmdp) attribute_hidden;
+#ifndef SHARED
+extern void __nptl_set_robust (struct pthread *self);
+#endif
 
 extern void __free_stacks (size_t limit) attribute_hidden;
 

Modified: branches/eglibc-2_14/libc/nptl/sysdeps/pthread/pthread-functions.h
==============================================================================
--- branches/eglibc-2_14/libc/nptl/sysdeps/pthread/pthread-functions.h (original)
+++ branches/eglibc-2_14/libc/nptl/sysdeps/pthread/pthread-functions.h Fri Jul 22 06:47:34 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2003.
 
@@ -97,6 +97,7 @@
   void (*ptr__nptl_deallocate_tsd) (void);
   int (*ptr__nptl_setxid) (struct xid_command *);
   void (*ptr_freeres) (void);
+  void (*ptr_set_robust) (struct pthread *);
 };
 
 /* Variable in libc.so.  */

Modified: branches/eglibc-2_14/libc/nptl/sysdeps/unix/sysv/linux/fork.c
==============================================================================
--- branches/eglibc-2_14/libc/nptl/sysdeps/unix/sysv/linux/fork.c (original)
+++ branches/eglibc-2_14/libc/nptl/sysdeps/unix/sysv/linux/fork.c Fri Jul 22 06:47:34 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2007, 2008, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -29,6 +29,7 @@
 #include <ldsodefs.h>
 #include <bits/stdio-lock.h>
 #include <atomic.h>
+#include <pthreadP.h>
 
 
 unsigned long int *__fork_generation_pointer;
@@ -86,8 +87,8 @@
 	 just go away.  The unloading code works in the order of the
 	 list.
 
-         While executing the registered handlers we are building a
-         list of all the entries so that we can go backward later on.  */
+	 While executing the registered handlers we are building a
+	 list of all the entries so that we can go backward later on.  */
       while (1)
 	{
 	  /* Execute the handler if there is one.  */
@@ -154,6 +155,24 @@
       GL(dl_cpuclock_offset) = now;
 #endif
 
+#ifdef __NR_set_robust_list
+      /* Initialize the robust mutex list which has been reset during
+	 the fork.  We do not check for errors since if it fails here
+	 it failed at process start as well and noone could have used
+	 robust mutexes.  We also do not have to set
+	 self->robust_head.futex_offset since we inherit the correct
+	 value from the parent.  */
+# ifdef SHARED
+      if (__builtin_expect (__libc_pthread_functions_init, 0))
+	PTHFCT_CALL (ptr_set_robust, (self));
+# else
+      extern __typeof (__nptl_set_robust) __nptl_set_robust
+	__attribute__((weak));
+      if (__builtin_expect (__nptl_set_robust != NULL, 0))
+	__nptl_set_robust (self);
+# endif
+#endif
+
       /* Reset the file list.  These are recursive mutexes.  */
       fresetlockfiles ();
 
@@ -170,10 +189,10 @@
 	    allp->handler->child_handler ();
 
 	  /* Note that we do not have to wake any possible waiter.
- 	     This is the only thread in the new process.  The count
- 	     may have been bumped up by other threads doing a fork.
- 	     We reset it to 1, to avoid waiting for non-existing
- 	     thread(s) to release the count.  */
+	     This is the only thread in the new process.  The count
+	     may have been bumped up by other threads doing a fork.
+	     We reset it to 1, to avoid waiting for non-existing
+	     thread(s) to release the count.  */
 	  allp->handler->refcntr = 1;
 
 	  /* XXX We could at this point look through the object pool

Modified: branches/eglibc-2_14/libc/sysdeps/posix/getaddrinfo.c
==============================================================================
--- branches/eglibc-2_14/libc/sysdeps/posix/getaddrinfo.c (original)
+++ branches/eglibc-2_14/libc/sysdeps/posix/getaddrinfo.c Fri Jul 22 06:47:34 2011
@@ -828,6 +828,7 @@
 	      tmpbuf = malloc (tmpbuflen);
 	      if (tmpbuf == NULL)
 		{
+		  _res.options |= old_res_options & RES_USE_INET6;
 		  result = -EAI_MEMORY;
 		  goto free_and_return;
 		}
@@ -872,6 +873,7 @@
 						2 * tmpbuflen);
 			  if (newp == NULL)
 			    {
+			      _res.options |= old_res_options & RES_USE_INET6;
 			      result = -EAI_MEMORY;
 			      goto free_and_return;
 			    }
@@ -881,16 +883,44 @@
 			}
 		    }
 
-		  no_inet6_data = no_data;
-
 		  if (status == NSS_STATUS_SUCCESS)
 		    {
+		      assert (!no_data);
+		      no_data = 1;
+
 		      if ((req->ai_flags & AI_CANONNAME) != 0 && canon == NULL)
 			canon = (*pat)->name;
 
 		      while (*pat != NULL)
-			pat = &((*pat)->next);
+			{
+			  if ((*pat)->family == AF_INET
+			      && req->ai_family == AF_INET6
+			      && (req->ai_flags & AI_V4MAPPED) != 0)
+			    {
+			      uint32_t *pataddr = (*pat)->addr;
+			      (*pat)->family = AF_INET6;
+			      pataddr[3] = pataddr[0];
+			      pataddr[2] = htonl (0xffff);
+			      pataddr[1] = 0;
+			      pataddr[0] = 0;
+			      pat = &((*pat)->next);
+			      no_data = 0;
+			    }
+			  else if (req->ai_family == AF_UNSPEC
+				   || (*pat)->family == req->ai_family)
+			    {
+			      pat = &((*pat)->next);
+
+			      no_data = 0;
+			      if (req->ai_family == AF_INET6)
+				got_ipv6 = true;
+			    }
+			  else
+			    *pat = ((*pat)->next);
+			}
 		    }
+
+		  no_inet6_data = no_data;
 		}
 	      else
 		{
@@ -963,6 +993,8 @@
 				      canonbuf = malloc (max_fqdn_len);
 				      if (canonbuf == NULL)
 					{
+					  _res.options
+					    |= old_res_options & RES_USE_INET6;
 					  result = -EAI_MEMORY;
 					  goto free_and_return;
 					}

Modified: branches/eglibc-2_14/ports/ChangeLog.arm
==============================================================================
--- branches/eglibc-2_14/ports/ChangeLog.arm (original)
+++ branches/eglibc-2_14/ports/ChangeLog.arm Fri Jul 22 06:47:34 2011
@@ -1,3 +1,7 @@
+2011-06-30  Richard Sandiford  <richard.sandiford@xxxxxxxxxx>
+
+	* sysdeps/arm/elf/start.S (_start): Align the constant pool to 4 bytes.
+
 2010-06-20  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/arm/eabi/internal_sendmmsg.S: New.

Modified: branches/eglibc-2_14/ports/sysdeps/arm/elf/start.S
==============================================================================
--- branches/eglibc-2_14/ports/sysdeps/arm/elf/start.S (original)
+++ branches/eglibc-2_14/ports/sysdeps/arm/elf/start.S Fri Jul 22 06:47:34 2011
@@ -134,6 +134,7 @@
 	bl abort
 
 #ifdef SHARED
+	.align 2
 .L_GOT:
 	.word _GLOBAL_OFFSET_TABLE_ - .L_GOT
 	.word __libc_csu_fini(GOT)