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

[commits] r13822 - in /fsf/trunk/libc: ./ assert/ elf/ include/ localedata/ localedata/locales/ stdlib/ sysdeps/posix/ sysdeps/pthread...



Author: eglibc
Date: Sun May 15 00:05:55 2011
New Revision: 13822

Log:
Import glibc-mainline for 2011-05-15

Added:
    fsf/trunk/libc/elf/tst-tls19.c   (with props)
    fsf/trunk/libc/elf/tst-tls19mod1.c
    fsf/trunk/libc/elf/tst-tls19mod2.c
    fsf/trunk/libc/elf/tst-tls19mod3.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/assert/assert-perr.c
    fsf/trunk/libc/assert/assert.c
    fsf/trunk/libc/elf/Makefile
    fsf/trunk/libc/elf/dl-open.c
    fsf/trunk/libc/include/assert.h
    fsf/trunk/libc/include/stdlib.h
    fsf/trunk/libc/localedata/ChangeLog
    fsf/trunk/libc/localedata/locales/en_SG
    fsf/trunk/libc/stdlib/abort.c
    fsf/trunk/libc/sysdeps/posix/libc_fatal.c
    fsf/trunk/libc/sysdeps/pthread/aio_misc.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/libc_fatal.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun May 15 00:05:55 2011
@@ -1,4 +1,36 @@
+2011-05-15  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ #11901]
+	* include/stdlib.h: Move include protection to the right place.
+	Define abort_msg_s.  Declare __abort_msg with it.
+	* stdlib/abort.c (__abort_msg): Adjust type.
+	* assert/assert.c (__assert_fail_base): New function.  Majority
+	of code from __assert_fail.  Allocate memory for __abort_msg with
+	mmap.
+	(__assert_fail): Now call __assert_fail_base.
+	* assert/assert-perr.c: Remove bulk of implementation.  Use
+	__assert_fail_base.
+	* include/assert.hL Declare __assert_fail_base.
+	* sysdeps/posix/libc_fatal.c: Allocate memory for __abort_msg with
+	mmap.
+	* sysdeps/unix/sysv/linux/libc_fatal.c: Likewise.
+
 2011-05-14  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ #11952]
+	[BZ #12453]
+	* elf/dl-open.c (dl_open_worker): Delay calls to _dl_update_slotinfo
+	until all modules are registered in the DTV.
+	* elf/Makefile: Add rules to build and run tst-tls19.
+	* elf/tst-tls19.c: New file.
+	* elf/tst-tls19mod1.c: New file.
+	* elf/tst-tls19mod2.c: New file.
+	* elf/tst-tls19mod3.c: New file.
+	Patch mostly by Martin von Gagern <Martin.vGagern@xxxxxxx>.
+
+	[BZ #12083]
+	* sysdeps/pthread/aio_misc.c (__aio_init): Compute optim.aio_num
+	correctly.
 
 	[BZ #12601]
 	* iconvdata/cp932.c (BODY to UCS4): Fix incrementing inptr in case of

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sun May 15 00:05:55 2011
@@ -9,12 +9,12 @@
 
 * The following bugs are resolved with this release:
 
-  386, 11257, 11258, 11487, 11532, 11578, 11653, 11668, 11724, 11945, 11947,
-  12052, 12158, 12178, 12200, 12346, 12393, 12420, 12432, 12445, 12449,
-  12454, 12460, 12469, 12489, 12509, 12510, 12511, 12518, 12527, 12541,
-  12545, 12551, 12583, 12587, 12597, 12601, 12611, 12625, 12626, 12631,
-  12650, 12653, 12655, 12660, 12681, 12685, 12711, 12713, 12714, 12717,
-  12723, 12724, 12734, 12738
+  386, 11257, 11258, 11487, 11532, 11578, 11653, 11668, 11724, 11901, 11945,
+  11947, 11952, 12052, 12083, 12158, 12178, 12200, 12346, 12393, 12420,
+  12432, 12445, 12449, 12453, 12454, 12460, 12469, 12489, 12509, 12510,
+  12511, 12518, 12527, 12541, 12545, 12551, 12582, 12583, 12587, 12597,
+  12601, 12611, 12625, 12626, 12631, 12650, 12653, 12655, 12660, 12681,
+  12685, 12711, 12713, 12714, 12717, 12723, 12724, 12734, 12738
 
 * The RPC implementation in libc is obsoleted.  Old programs keep working
   but new programs cannot be linked with the routines in libc anymore.

Modified: fsf/trunk/libc/assert/assert-perr.c
==============================================================================
--- fsf/trunk/libc/assert/assert-perr.c (original)
+++ fsf/trunk/libc/assert/assert-perr.c Sun May 15 00:05:55 2011
@@ -1,4 +1,5 @@
-/* Copyright (C) 1994-1998,2001,2002,2005,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1994-1998,2001,2002,2005,2009,2011
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,66 +18,23 @@
    02111-1307 USA.  */
 
 #include <assert.h>
-#include <atomic.h>
 #include <libintl.h>
-#include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
-#include <sysdep.h>
-#include <unistd.h>
 
-
-extern const char *__progname;
-
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-# include <libio/iolibio.h>
-# define fflush(s) INTUSE(_IO_fflush) (s)
-#endif
 
 /* This function, when passed an error number, a filename, and a line
    number, prints a message on the standard error stream of the form:
-   	a.c:10: foobar: Unexpected error: Computer bought the farm
+	a.c:10: foobar: Unexpected error: Computer bought the farm
    It then aborts program execution via a call to `abort'.  */
-
-#ifdef FATAL_PREPARE_INCLUDE
-# include FATAL_PREPARE_INCLUDE
-#endif
-
 void
 __assert_perror_fail (int errnum,
 		      const char *file, unsigned int line,
 		      const char *function)
 {
   char errbuf[1024];
-  char *buf;
 
-#ifdef FATAL_PREPARE
-  FATAL_PREPARE;
-#endif
-
-  if (__asprintf (&buf, _("%s%s%s:%u: %s%sUnexpected error: %s.\n"),
-		  __progname, __progname[0] ? ": " : "",
-		  file, line,
-		  function ? function : "", function ? ": " : "",
-		  __strerror_r (errnum, errbuf, sizeof errbuf)) >= 0)
-    {
-      /* Print the message.  */
-      (void) __fxprintf (NULL, "%s", buf);
-      (void) fflush (stderr);
-
-      /* We have to free the old buffer since the application might
-	 catch the SIGABRT signal.  */
-      char *old = atomic_exchange_acq (&__abort_msg, buf);
-      free (old);
-    }
-  else
-    {
-      /* At least print a minimal message.  */
-      static const char errstr[] = "Unexpected error.\n";
-      __libc_write (STDERR_FILENO, errstr, sizeof (errstr) - 1);
-    }
-
-  abort ();
+  char *e = __strerror_r (errnum, errbuf, sizeof errbuf);
+  __assert_fail_base (_("%s%s%s:%u: %s%sUnexpected error: %s.\n"),
+		      e, file, line, function);
 }
 libc_hidden_def (__assert_perror_fail)

Modified: fsf/trunk/libc/assert/assert.c
==============================================================================
--- fsf/trunk/libc/assert/assert.c (original)
+++ fsf/trunk/libc/assert/assert.c Sun May 15 00:05:55 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1994-1996,1998,2001,2002,2005,2009
+/* Copyright (C) 1991,1994-1996,1998,2001,2002,2005,2009,2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -19,11 +19,13 @@
 
 #include <assert.h>
 #include <atomic.h>
+#include <ldsodefs.h>
 #include <libintl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sysdep.h>
 #include <unistd.h>
+#include <sys/mman.h>
 
 
 extern const char *__progname;
@@ -37,7 +39,7 @@
 /* This function, when passed a string containing an asserted
    expression, a filename, and a line number, prints a message
    on the standard error stream of the form:
-   	a.c:10: foobar: Assertion `a == b' failed.
+	a.c:10: foobar: Assertion `a == b' failed.
    It then aborts program execution via a call to `abort'.  */
 
 #ifdef FATAL_PREPARE_INCLUDE
@@ -45,31 +47,44 @@
 #endif
 
 
-#undef __assert_fail
 void
-__assert_fail (const char *assertion, const char *file, unsigned int line,
-	       const char *function)
+__assert_fail_base (const char *fmt, const char *assertion, const char *file,
+		    unsigned int line, const char *function)
 {
-  char *buf;
+  char *str;
 
 #ifdef FATAL_PREPARE
   FATAL_PREPARE;
 #endif
 
-  if (__asprintf (&buf, _("%s%s%s:%u: %s%sAssertion `%s' failed.\n"),
+  int total;
+  if (__asprintf (&str, fmt,
 		  __progname, __progname[0] ? ": " : "",
 		  file, line,
 		  function ? function : "", function ? ": " : "",
-		  assertion) >= 0)
+		  assertion, &total) >= 0)
     {
       /* Print the message.  */
-      (void) __fxprintf (NULL, "%s", buf);
+      (void) __fxprintf (NULL, "%s", str);
       (void) fflush (stderr);
 
-      /* We have to free the old buffer since the application might
-	 catch the SIGABRT signal.  */
-      char *old = atomic_exchange_acq (&__abort_msg, buf);
-      free (old);
+      total = (total + 1 + GLRO(dl_pagesize) - 1) & ~(GLRO(dl_pagesize) - 1);
+      struct abort_msg_s *buf = __mmap (NULL, total, PROT_READ | PROT_WRITE,
+					MAP_ANON | MAP_PRIVATE, -1, 0);
+      if (__builtin_expect (buf != MAP_FAILED, 1))
+	{
+	  buf->size = total;
+	  strcpy (buf->msg, str);
+
+	  /* We have to free the old buffer since the application might
+	     catch the SIGABRT signal.  */
+	  struct abort_msg_s *old = atomic_exchange_acq (&__abort_msg, buf);
+
+	  if (old != NULL)
+	    __munmap (old, old->size);
+	}
+
+      free (str);
     }
   else
     {
@@ -80,4 +95,14 @@
 
   abort ();
 }
+
+
+#undef __assert_fail
+void
+__assert_fail (const char *assertion, const char *file, unsigned int line,
+	       const char *function)
+{
+  __assert_fail_base (_("%s%s%s:%u: %s%sAssertion `%s' failed.\n%n"),
+		      assertion, file, line, function);
+}
 hidden_def(__assert_fail)

Modified: fsf/trunk/libc/elf/Makefile
==============================================================================
--- fsf/trunk/libc/elf/Makefile (original)
+++ fsf/trunk/libc/elf/Makefile Sun May 15 00:05:55 2011
@@ -76,6 +76,7 @@
 		   tst-tlsmod12.c tst-tls10.h tst-alignmod.c tst-alignmod2.c \
 		   circlemod1.c circlemod1a.c circlemod2.c circlemod2a.c \
 		   circlemod3.c circlemod3a.c nodlopenmod2.c \
+		   tst-tls19mod1.c tst-tls19mod2.c tst-tls19mod3.c \
 		   tls-macros.h \
 		   reldep8mod1.c reldep8mod2.c reldep8mod3.c \
 		   nodel2mod1.c nodel2mod2.c nodel2mod3.c \
@@ -194,7 +195,7 @@
 	 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
 	 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
 	 tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
-	 tst-tls16 tst-tls17 tst-tls18 tst-tls-dlinfo \
+	 tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \
 	 tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \
 	 tst-dlmodcount tst-dlopenrpath tst-deep1 \
 	 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
@@ -240,6 +241,7 @@
 		tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
 		tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
 		$(tlsmod17a-modules) tst-tlsmod17b $(tlsmod18a-modules) \
+		tst-tls19mod1 tst-tls19mod2 tst-tls19mod3 \
 		circlemod1 circlemod1a circlemod2 circlemod2a \
 		circlemod3 circlemod3a \
 		reldep8mod1 reldep8mod2 reldep8mod3 \
@@ -525,6 +527,8 @@
 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
 $(objpfx)tst-tlsmod5.so: $(common-objpfx)libc.so
 $(objpfx)tst-tlsmod6.so: $(common-objpfx)libc.so
+$(objpfx)tst-tls19mod1.so: $(objpfx)tst-tls19mod2.so $(objpfx)tst-tls19mod3.so
+$(objpfx)tst-tls19mod3.so: $(objpfx)ld.so
 $(objpfx)reldep8mod3.so: $(objpfx)reldep8mod1.so $(objpfx)reldep8mod2.so
 $(objpfx)nodel2mod3.so: $(objpfx)nodel2mod1.so $(objpfx)nodel2mod2.so
 $(objpfx)reldep9mod2.so: $(objpfx)reldep9mod1.so
@@ -822,6 +826,9 @@
 	$(compile-command.c) -DN=$*
 $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so
 
+$(objpfx)tst-tls19: $(libdl)
+$(objpfx)tst-tls19.out: $(objpfx)tst-tls19mod1.so
+
 CFLAGS-tst-align.c = $(stack-align-test-flags)
 CFLAGS-tst-align2.c = $(stack-align-test-flags)
 CFLAGS-tst-alignmod.c = $(stack-align-test-flags)

Modified: fsf/trunk/libc/elf/dl-open.c
==============================================================================
--- fsf/trunk/libc/elf/dl-open.c (original)
+++ fsf/trunk/libc/elf/dl-open.c Sun May 15 00:05:55 2011
@@ -1,5 +1,5 @@
 /* Load a shared object at runtime, relocate it, and run its initializer.
-   Copyright (C) 1996-2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1996-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -347,6 +347,7 @@
   /* If the file is not loaded now as a dependency, add the search
      list of the newly loaded object to the scope.  */
   bool any_tls = false;
+  unsigned int first_static_tls = new->l_searchlist.r_nlist;
   for (unsigned int i = 0; i < new->l_searchlist.r_nlist; ++i)
     {
       struct link_map *imap = new->l_searchlist.r_list[i];
@@ -425,30 +426,9 @@
 	     might have to increase its size.  */
 	  _dl_add_to_slotinfo (imap);
 
-	  if (imap->l_need_tls_init)
-	    {
-	      /* For static TLS we have to allocate the memory here
-		 and now.  This includes allocating memory in the DTV.
-		 But we cannot change any DTV other than our own. So,
-		 if we cannot guarantee that there is room in the DTV
-		 we don't even try it and fail the load.
-
-		 XXX We could track the minimum DTV slots allocated in
-		 all threads.  */
-	      if (! RTLD_SINGLE_THREAD_P && imap->l_tls_modid > DTV_SURPLUS)
-		_dl_signal_error (0, "dlopen", NULL, N_("\
-cannot load any more object with static TLS"));
-
-	      imap->l_need_tls_init = 0;
-#ifdef SHARED
-	      /* Update the slot information data for at least the
-		 generation of the DSO we are allocating data for.  */
-	      _dl_update_slotinfo (imap->l_tls_modid);
-#endif
-
-	      GL(dl_init_static_tls) (imap);
-	      assert (imap->l_need_tls_init == 0);
-	    }
+	  if (imap->l_need_tls_init
+	      && first_static_tls == new->l_searchlist.r_nlist)
+	    first_static_tls = i;
 
 	  /* We have to bump the generation counter.  */
 	  any_tls = true;
@@ -459,6 +439,40 @@
   if (any_tls && __builtin_expect (++GL(dl_tls_generation) == 0, 0))
     _dl_fatal_printf (N_("\
 TLS generation counter wrapped!  Please report this."));
+
+  /* We need a second pass for static tls data, because _dl_update_slotinfo
+     must not be run while calls to _dl_add_to_slotinfo are still pending. */
+  for (unsigned int i = first_static_tls; i < new->l_searchlist.r_nlist; ++i)
+    {
+      struct link_map *imap = new->l_searchlist.r_list[i];
+
+      if (imap->l_need_tls_init
+	  && ! imap->l_init_called
+	  && imap->l_tls_blocksize > 0)
+	{
+	  /* For static TLS we have to allocate the memory here and
+	     now.  This includes allocating memory in the DTV.  But we
+	     cannot change any DTV other than our own. So, if we
+	     cannot guarantee that there is room in the DTV we don't
+	     even try it and fail the load.
+
+	     XXX We could track the minimum DTV slots allocated in
+	     all threads.  */
+	  if (! RTLD_SINGLE_THREAD_P && imap->l_tls_modid > DTV_SURPLUS)
+	    _dl_signal_error (0, "dlopen", NULL, N_("\
+cannot load any more object with static TLS"));
+
+	  imap->l_need_tls_init = 0;
+#ifdef SHARED
+	  /* Update the slot information data for at least the
+	     generation of the DSO we are allocating data for.  */
+	  _dl_update_slotinfo (imap->l_tls_modid);
+#endif
+
+	  GL(dl_init_static_tls) (imap);
+	  assert (imap->l_need_tls_init == 0);
+	}
+    }
 
   /* Run the initializer functions of new objects.  */
   _dl_init (new, args->argc, args->argv, args->env);

Added: fsf/trunk/libc/elf/tst-tls19.c
==============================================================================
--- fsf/trunk/libc/elf/tst-tls19.c (added)
+++ fsf/trunk/libc/elf/tst-tls19.c Sun May 15 00:05:55 2011
@@ -1,0 +1,27 @@
+// BZ 12453
+#include <stdio.h>
+#include <dlfcn.h>
+
+
+static int
+do_test (void)
+{
+  void* dl = dlopen ("tst-tls19mod1.so", RTLD_LAZY | RTLD_GLOBAL);
+  if (dl == NULL)
+    {
+      printf ("Error loading tst-tls19mod1.so: %s\n", dlerror ());
+      return 1;
+    }
+
+  int (*fn) (void) = dlsym (dl, "foo");
+  if (fn == NULL)
+    {
+      printf("Error obtaining symbol foo\n");
+      return 1;
+    }
+
+  return fn ();
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Propchange: fsf/trunk/libc/elf/tst-tls19.c
------------------------------------------------------------------------------
    svn:mime-type = text/cpp

Added: fsf/trunk/libc/elf/tst-tls19mod1.c
==============================================================================
--- fsf/trunk/libc/elf/tst-tls19mod1.c (added)
+++ fsf/trunk/libc/elf/tst-tls19mod1.c Sun May 15 00:05:55 2011
@@ -1,0 +1,15 @@
+#include <stdio.h>
+
+extern int bar (void);
+extern int baz (void);
+
+int
+foo (void)
+{
+  int v1 = bar ();
+  int v2 = baz ();
+
+  printf ("bar=%d, baz=%d\n", v1, v2);
+
+  return v1 != 666 || v2 != 42;
+}

Added: fsf/trunk/libc/elf/tst-tls19mod2.c
==============================================================================
--- fsf/trunk/libc/elf/tst-tls19mod2.c (added)
+++ fsf/trunk/libc/elf/tst-tls19mod2.c Sun May 15 00:05:55 2011
@@ -1,0 +1,13 @@
+static int __thread tbar __attribute__ ((tls_model ("initial-exec"))) = 666;
+
+void
+setter (int a)
+{
+  tbar = a;
+}
+
+int
+bar (void)
+{
+  return tbar;
+}

Added: fsf/trunk/libc/elf/tst-tls19mod3.c
==============================================================================
--- fsf/trunk/libc/elf/tst-tls19mod3.c (added)
+++ fsf/trunk/libc/elf/tst-tls19mod3.c Sun May 15 00:05:55 2011
@@ -1,0 +1,16 @@
+#include <stdio.h>
+
+static int __thread tbaz __attribute__ ((tls_model ("local-dynamic"))) = 42;
+
+void
+setter2 (int a)
+{
+  tbaz = a;
+}
+
+int
+baz (void)
+{
+  printf ("&tbaz=%p\n", &tbaz);
+  return tbaz;
+}

Modified: fsf/trunk/libc/include/assert.h
==============================================================================
--- fsf/trunk/libc/include/assert.h (original)
+++ fsf/trunk/libc/include/assert.h Sun May 15 00:05:55 2011
@@ -5,7 +5,7 @@
    so it has to be repeated here.  */
 extern void __assert_fail (__const char *__assertion, __const char *__file,
 			   unsigned int __line, __const char *__function)
-  __THROW __attribute__ ((__noreturn__));
+     __THROW __attribute__ ((__noreturn__));
 
 /* Likewise, but prints the error text for ERRNUM.  */
 extern void __assert_perror_fail (int __errnum, __const char *__file,
@@ -13,6 +13,12 @@
 				  __const char *__function)
      __THROW __attribute__ ((__noreturn__));
 
+/* The real implementation of the two functions above.  */
+extern void __assert_fail_base (const char *fmt, const char *assertion,
+				const char *file, unsigned int line,
+				const char *function)
+     __THROW  __attribute__ ((__noreturn__));
+
 #if !defined NOT_IN_libc || defined IS_IN_rtld
 hidden_proto (__assert_fail)
 hidden_proto (__assert_perror_fail)

Modified: fsf/trunk/libc/include/stdlib.h
==============================================================================
--- fsf/trunk/libc/include/stdlib.h (original)
+++ fsf/trunk/libc/include/stdlib.h Sun May 15 00:05:55 2011
@@ -223,16 +223,21 @@
 # define __cxa_atexit(func, arg, d) INTUSE(__cxa_atexit) (func, arg, d)
 # endif
 
-#endif
-
 extern void *__default_morecore (ptrdiff_t) __THROW;
 libc_hidden_proto (__default_morecore)
 
-extern char *__abort_msg;
+struct abort_msg_s
+{
+  unsigned int size;
+  char msg[0];
+};
+extern struct abort_msg_s *__abort_msg;
 libc_hidden_proto (__abort_msg)
 
 __END_DECLS
 
+#endif
+
 #undef __Need_M_And_C
 
 #endif  /* include/stdlib.h */

Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Sun May 15 00:05:55 2011
@@ -1,3 +1,9 @@
+2011-05-14  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ #12582]
+	* localedata/charmaps/en_SG (LC_TIME): Fix time formats.
+	Patch by KH Teo <b3virq3b@xxxxxxxxx>.
+
 2011-05-09  Ulrich Drepper  <drepper@xxxxxxxxx>
 
 	[BZ #11487]

Modified: fsf/trunk/libc/localedata/locales/en_SG
==============================================================================
--- fsf/trunk/libc/localedata/locales/en_SG (original)
+++ fsf/trunk/libc/localedata/locales/en_SG Sun May 15 00:05:55 2011
@@ -117,19 +117,20 @@
 am_pm       "<U0041><U004D>";"<U0050><U004D>"
 %
 % Appropriate date and time representation
-% %A %d,%B,%Y %I:%M:%S  %Z
-d_t_fmt     "<U0025><U0041><U0020><U0025><U0064><U002C><U0025><U0042><U002C><U0025><U0059><U0020><U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070><U0020><U0025><U005A>"
+% %a %d %b %Y %r
+d_t_fmt     "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0072>"
 %
 % Appropriate date representation
-% %A %d,%B,%Y
-d_fmt       "<U0025><U0041><U0020><U0025><U0064><U002C><U0025><U0042><U002C><U0025><U0059>"
+% %d/%m/%Y
+d_fmt       "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0059>"
 %
 % Appropriate time representation
-% %I:%M:%S  %Z
-t_fmt       "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0020><U0025><U005A>"
+% %T
+t_fmt       "<U0025><U0054>"
 %
 % Appropriate 12 h time representation (%r)
-t_fmt_ampm  "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070><U0020><U0025><U005A>"
+% %I:%M:%S %p
+t_fmt_ampm  "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
 %
 END LC_TIME
 

Modified: fsf/trunk/libc/stdlib/abort.c
==============================================================================
--- fsf/trunk/libc/stdlib/abort.c (original)
+++ fsf/trunk/libc/stdlib/abort.c Sun May 15 00:05:55 2011
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,93,1995-1998,2001,02,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1993,1995-1998,2001,2002,2009,2011
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -37,7 +38,7 @@
 #endif
 
 /* Exported variable to locate abort message in core files etc.  */
-char *__abort_msg __attribute__ ((nocommon));
+struct abort_msg_s *__abort_msg __attribute__ ((nocommon));
 libc_hidden_def (__abort_msg)
 
 /* We must avoid to run in circles.  Therefore we remember how far we

Modified: fsf/trunk/libc/sysdeps/posix/libc_fatal.c
==============================================================================
--- fsf/trunk/libc/sysdeps/posix/libc_fatal.c (original)
+++ fsf/trunk/libc/sysdeps/posix/libc_fatal.c Sun May 15 00:05:55 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-1995,1997,2000,2004,2005,2009
+/* Copyright (C) 1993-1995,1997,2000,2004,2005,2009,2011
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -20,6 +20,7 @@
 #include <atomic.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <ldsodefs.h>
 #include <paths.h>
 #include <stdarg.h>
 #include <stdbool.h>
@@ -125,18 +126,28 @@
       if (TEMP_FAILURE_RETRY (__writev (fd, iov, nlist)) == total)
 	written = true;
 
-      char *buf = do_abort ? malloc (total + 1) : NULL;
-      if (buf != NULL)
+      if (do_abort)
 	{
-	  char *wp = buf;
-	  for (int cnt = 0; cnt < nlist; ++cnt)
-	    wp = mempcpy (wp, iov[cnt].iov_base, iov[cnt].iov_len);
-	  *wp = '\0';
+	  total = ((total + 1 + GLRO(dl_pagesize) - 1)
+		   & ~(GLRO(dl_pagesize) - 1));
+	  struct abort_msg_s *buf = __mmap (NULL, total,
+					    PROT_READ | PROT_WRITE,
+					    MAP_ANON | MAP_PRIVATE, -1, 0);
+	  if (buf != MAP_FAILED)
+	    {
+	      buf->size = total;
+	      char *wp = buf->msg;
+	      for (int cnt = 0; cnt < nlist; ++cnt)
+		wp = mempcpy (wp, iov[cnt].iov_base, iov[cnt].iov_len);
+	      *wp = '\0';
 
-	  /* We have to free the old buffer since the application might
-	     catch the SIGABRT signal.  */
-	  char *old = atomic_exchange_acq (&__abort_msg, buf);
-	  free (old);
+	      /* We have to free the old buffer since the application might
+		 catch the SIGABRT signal.  */
+	      struct abort_msg_s *old = atomic_exchange_acq (&__abort_msg,
+							     buf);
+	      if (old != NULL)
+		__munmap (old, old->size);
+	    }
 	}
     }
 

Modified: fsf/trunk/libc/sysdeps/pthread/aio_misc.c
==============================================================================
--- fsf/trunk/libc/sysdeps/pthread/aio_misc.c (original)
+++ fsf/trunk/libc/sysdeps/pthread/aio_misc.c Sun May 15 00:05:55 2011
@@ -1,5 +1,5 @@
 /* Handle general operations.
-   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2006, 2007, 2009
+   Copyright (C) 1997-2001, 2003, 2004, 2006, 2007, 2009, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -26,6 +26,7 @@
 #include <pthread.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <aio_misc.h>
@@ -87,7 +88,7 @@
 static struct aioinit optim =
 {
   20,	/* int aio_threads;	Maximal number of threads.  */
-  64,	/* int aio_num;		Number of expected simultanious requests. */
+  64,	/* int aio_num;		Number of expected simultaneous requests. */
   0,
   0,
   0,
@@ -282,9 +283,10 @@
   if (pool == NULL)
     {
       optim.aio_threads = init->aio_threads < 1 ? 1 : init->aio_threads;
+      assert (powerof2 (ENTRIES_PER_ROW));
       optim.aio_num = (init->aio_num < ENTRIES_PER_ROW
 		       ? ENTRIES_PER_ROW
-		       : init->aio_num & ~ENTRIES_PER_ROW);
+		       : init->aio_num & ~(ENTRIES_PER_ROW - 1));
     }
 
   if (init->aio_idle_time != 0)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/libc_fatal.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/libc_fatal.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/libc_fatal.c Sun May 15 00:05:55 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-1995,1997,2000,2002-2005,2009
+/* Copyright (C) 1993-1995,1997,2000,2002-2005,2009,2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -20,6 +20,7 @@
 #include <atomic.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <ldsodefs.h>
 #include <paths.h>
 #include <stdarg.h>
 #include <stdbool.h>
@@ -28,6 +29,7 @@
 #include <string.h>
 #include <sysdep.h>
 #include <unistd.h>
+#include <sys/mman.h>
 #include <sys/syslog.h>
 #include <execinfo.h>
 
@@ -134,18 +136,28 @@
       if (cnt == total)
 	written = true;
 
-      char *buf = do_abort ? malloc (total + 1) : NULL;
-      if (buf != NULL)
-	{
-	  char *wp = buf;
-	  for (int cnt = 0; cnt < nlist; ++cnt)
-	    wp = mempcpy (wp, iov[cnt].iov_base, iov[cnt].iov_len);
-	  *wp = '\0';
-
-	  /* We have to free the old buffer since the application might
-	     catch the SIGABRT signal.  */
-	  char *old = atomic_exchange_acq (&__abort_msg, buf);
-	  free (old);
+      if (do_abort)
+	{
+	  total = ((total + 1 + GLRO(dl_pagesize) - 1)
+		   & ~(GLRO(dl_pagesize) - 1));
+	  struct abort_msg_s *buf = __mmap (NULL, total,
+					    PROT_READ | PROT_WRITE,
+					    MAP_ANON | MAP_PRIVATE, -1, 0);
+	  if (__builtin_expect (buf != MAP_FAILED, 1))
+	    {
+	      buf->size = total;
+	      char *wp = buf->msg;
+	      for (int cnt = 0; cnt < nlist; ++cnt)
+		wp = mempcpy (wp, iov[cnt].iov_base, iov[cnt].iov_len);
+	      *wp = '\0';
+
+	      /* We have to free the old buffer since the application might
+		 catch the SIGABRT signal.  */
+	      struct abort_msg_s *old = atomic_exchange_acq (&__abort_msg,
+							     buf);
+	      if (old != NULL)
+		__munmap (old, old->size);
+	    }
 	}
     }