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

[commits] r15265 - in /fsf/trunk/libc: ./ elf/ libio/ math/ stdio-common/ string/ sysdeps/i386/fpu/ sysdeps/ieee754/dbl-64/ sysdeps/ie...



Author: eglibc
Date: Sat Sep 10 00:02:39 2011
New Revision: 15265

Log:
Import glibc-mainline for 2011-09-10

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/elf/dl-iteratephdr.c
    fsf/trunk/libc/elf/elf.h
    fsf/trunk/libc/elf/sotruss.ksh
    fsf/trunk/libc/libio/genops.c
    fsf/trunk/libc/math/libm-test.inc
    fsf/trunk/libc/stdio-common/vfscanf.c
    fsf/trunk/libc/string/strncat.c
    fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_jn.c
    fsf/trunk/libc/sysdeps/ieee754/flt-32/e_jnf.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128/e_jnl.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-96/e_jnl.c
    fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/socket.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h
    fsf/trunk/libc/sysdeps/x86_64/fpu/libm-test-ulps

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Sep 10 00:02:39 2011
@@ -1,3 +1,59 @@
+2011-09-09  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/i386/fpu/libm-test-ulps: Adjust ULPs for jn tests.
+
+2011-07-03  Andreas Jaeger  <aj@xxxxxxx>
+
+	* math/libm-test.inc (jn_test): Add tests for BZ#11589.
+	* sysdeps/x86_64/fpu/libm-test-ulps: Add new ULPs for jn_test,
+	regenerate with gen-libm-tests.pl.
+
+2010-05-12  Petr Baudis  <pasky@xxxxxxx>
+
+	[BZ #11589]
+	* sysdeps/ieee754/dbl-64/e_jn.c: Compensate major precision loss
+	around j0() zero points by switching to j1().
+	* sysdeps/ieee754/flt-32/e_jnf.c: Likewise.
+	* sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Likewise.
+	* sysdeps/ieee754/ldbl-96/e_jnl.c: Likewise.
+
+2011-09-09  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/unix/bsd/bsd4.4/bits/socket.h (__cmsg_nxthdr): Use NULL
+	instead of 0.
+	* sysdeps/unix/sysv/linux/bits/socket.h (__cmsg_nxthdr): Use (void*)0
+	instead of 0.                              .
+	* sysdeps/unix/sysv/linux/sparc/bits/socket.h: Likewise.
+	Patch in part by Pavel Roskin <proski@xxxxxxx>.
+
+	[BZ #13138]
+	* stdio-common/vfscanf.c (ADDW): Allocate large memory block with
+	realloc.
+	(_IO_vfscanf_internal): Remove reteof.  Use errout after setting done.
+	Free memory block if necessary.
+
+	[BZ #12847]
+	* libio/genops.c (INTDEF): For string streams the _lock pointer can
+	be NULL.  Don't lock in this case.
+
+2011-09-09  Roland McGrath  <roland@xxxxxxxxxxxxx>
+
+	* elf/elf.h (ELFOSABI_GNU): New macro.
+	(ELFOSABI_LINUX): Define to that.
+
+2011-07-29  Denis Zaitceff  <zaitceff@xxxxxxxxx>
+
+	* string/strncat.c (strncat): Undef the symbol in case it has been
+	defined in bits/string.h.
+
+2011-09-09  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* elf/sotruss.ksh: Clean up, fix, and complete help messages.
+
+	* elf/dl-iteratephdr.c (__dl_iterate_phdr): Fill in data from the real
+	link map.
+
 2011-08-17  Andreas Jaeger  <aj@xxxxxxx>
 
 	* elf/sprof.c (load_shobj): Remove unused variable log_hashfraction.

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sat Sep 10 00:02:39 2011
@@ -9,8 +9,9 @@
 
 * The following bugs are resolved with this release:
 
-  9696, 12403, 12868, 12852, 12874, 12885, 12907, 12922, 12935, 13007,
-  13021, 13068, 13092, 13114, 13118, 13123, 13134, 13150
+  9696, 11589, 12403, 12847, 12868, 12852, 12874, 12885, 12907, 12922,
+  12935, 13007, 13021, 13068, 13092, 13114, 13118, 13123, 13134, 13138,
+  13150
 
 * New program pldd to list loaded object of a process
   Implemented by Ulrich Drepper.

Modified: fsf/trunk/libc/elf/dl-iteratephdr.c
==============================================================================
--- fsf/trunk/libc/elf/dl-iteratephdr.c (original)
+++ fsf/trunk/libc/elf/dl-iteratephdr.c Sat Sep 10 00:02:39 2011
@@ -1,5 +1,5 @@
 /* Get loaded objects program headers.
-   Copyright (C) 2001-2004, 2006-2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2009, 2010, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@xxxxxxxxxx>, 2001.
 
@@ -62,16 +62,16 @@
 
   for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
     {
-      info.dlpi_addr = l->l_addr;
-      info.dlpi_name = l->l_name;
-      info.dlpi_phdr = l->l_phdr;
-      info.dlpi_phnum = l->l_phnum;
+      info.dlpi_addr = l->l_real->l_addr;
+      info.dlpi_name = l->l_real->l_name;
+      info.dlpi_phdr = l->l_real->l_phdr;
+      info.dlpi_phnum = l->l_real->l_phnum;
       info.dlpi_adds = GL(dl_load_adds);
       info.dlpi_subs = GL(dl_load_adds) - nloaded;
       info.dlpi_tls_data = NULL;
-      info.dlpi_tls_modid = l->l_tls_modid;
+      info.dlpi_tls_modid = l->l_real->l_tls_modid;
       if (info.dlpi_tls_modid != 0)
-	info.dlpi_tls_data = GLRO(dl_tls_get_addr_soft) (l);
+	info.dlpi_tls_data = GLRO(dl_tls_get_addr_soft) (l->l_real);
       ret = callback (&info, sizeof (struct dl_phdr_info), data);
       if (ret)
 	break;

Modified: fsf/trunk/libc/elf/elf.h
==============================================================================
--- fsf/trunk/libc/elf/elf.h (original)
+++ fsf/trunk/libc/elf/elf.h Sat Sep 10 00:02:39 2011
@@ -142,7 +142,8 @@
 #define ELFOSABI_SYSV		0	/* Alias.  */
 #define ELFOSABI_HPUX		1	/* HP-UX */
 #define ELFOSABI_NETBSD		2	/* NetBSD.  */
-#define ELFOSABI_LINUX		3	/* Linux.  */
+#define ELFOSABI_GNU		3	/* Object uses GNU ELF extensions.  */
+#define ELFOSABI_LINUX		ELFOSABI_GNU /* Compatibility alias.  */
 #define ELFOSABI_SOLARIS	6	/* Sun Solaris.  */
 #define ELFOSABI_AIX		7	/* IBM AIX.  */
 #define ELFOSABI_IRIX		8	/* SGI Irix.  */

Modified: fsf/trunk/libc/elf/sotruss.ksh
==============================================================================
--- fsf/trunk/libc/elf/sotruss.ksh (original)
+++ fsf/trunk/libc/elf/sotruss.ksh Sat Sep 10 00:02:39 2011
@@ -31,22 +31,23 @@
 
 function do_help {
   echo $"Usage: sotruss [OPTION...] [--] EXECUTABLE [EXECUTABLE-OPTION...]
-  -F, --from FROMLIST     trace calls from objects on FORMLIST
-  -T, --to TOLIST         trace calls to objects on TOLIST
+  -F, --from FROMLIST     Trace calls from objects on FROMLIST
+  -T, --to TOLIST         Trace calls to objects on TOLIST
 
-  -e, --exit              also show exits from the function calls
-  -f, --follow            trace child processes
-  -o, --output FILENAME   write output to FILENAME (or FILENAME.$PID in case
+  -e, --exit              Also show exits from the function calls
+  -f, --follow            Trace child processes
+  -o, --output FILENAME   Write output to FILENAME (or FILENAME.$PID in case
 			  -f is also used) instead of standard error
 
-      --help              print this help and exit
-      --version           print version information and exit"
+  -?, --help              Give this help list
+      --usage             Give a short usage message
+      --version           Print program version"
 
   echo
   printf $"Mandatory arguments to long options are also mandatory for any corresponding\nshort options.\n"
   echo
 
-  echo $"For bug reporting instructions, please see:
+  printf $"For bug reporting instructions, please see:
 <http://www.gnu.org/software/libc/bugs.html>.
 "
   exit 0
@@ -80,12 +81,14 @@
     printf $"Written by %s.\n" "Ulrich Drepper"
     exit 0
     ;;
-  --h | --he | --hel | --help)
+  -\? | --h | --he | --hel | --help)
     do_help
     ;;
   --u | --us | --usa | --usag | --usage)
     printf $"Usage: %s [-ef] [-F FROMLIST] [-o FILENAME] [-T TOLIST] [--exit]
-	    [--follow] [--from FROMLIST] [--output FILENAME] [--to TOLIST]\n" sotruss
+	    [--follow] [--from FROMLIST] [--output FILENAME] [--to TOLIST]
+	    [--help] [--usage] [--version] [--]
+	    EXECUTABLE [EXECUTABLE-OPTION...]\n" sotruss
     exit 0
     ;;
   -F | --fr | --fro | --from)

Modified: fsf/trunk/libc/libio/genops.c
==============================================================================
--- fsf/trunk/libc/libio/genops.c (original)
+++ fsf/trunk/libc/libio/genops.c Sat Sep 10 00:02:39 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1995,1997-2002, 2003, 2004, 2006, 2007
+/* Copyright (C) 1993,1995,1997-2002, 2003, 2004, 2006, 2007, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -471,7 +471,7 @@
 	      f->_IO_write_ptr += count;
 #endif
 	      s += count;
-            }
+	    }
 	  else if (count)
 	    {
 	      char *p = f->_IO_write_ptr;
@@ -479,9 +479,9 @@
 	      for (i = count; --i >= 0; )
 		*p++ = *s++;
 	      f->_IO_write_ptr = p;
-            }
+	    }
 	  more -= count;
-        }
+	}
       if (more == 0 || _IO_OVERFLOW (f, (unsigned char) *s++) == EOF)
 	break;
       more--;
@@ -534,9 +534,9 @@
 	      while (--i >= 0)
 		*s++ = *p++;
 	      fp->_IO_read_ptr = p;
-            }
-            more -= count;
-        }
+	    }
+	    more -= count;
+	}
       if (more == 0 || __underflow (fp) == EOF)
 	break;
     }
@@ -959,7 +959,7 @@
 	  int cnt;
 #define MAXTRIES 2
 	  for (cnt = 0; cnt < MAXTRIES; ++cnt)
-	    if (_IO_lock_trylock (*fp->_lock) == 0)
+	    if (fp->_lock == NULL || _IO_lock_trylock (*fp->_lock) == 0)
 	      break;
 	    else
 	      /* Give the other thread time to finish up its use of the
@@ -978,7 +978,7 @@
 
 	  _IO_SETBUF (fp, NULL, 0);
 
-	  if (cnt < MAXTRIES)
+	  if (cnt < MAXTRIES && fp->_lock != NULL)
 	    _IO_lock_unlock (*fp->_lock);
 	}
 

Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Sat Sep 10 00:02:39 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@xxxxxxx>, 1997.
 
@@ -3285,6 +3285,16 @@
   TEST_ff_f (jn, 10, 2.0, 0.251538628271673670963516093751820639e-6L);
   TEST_ff_f (jn, 10, 10.0, 0.207486106633358857697278723518753428L);
 
+  /* BZ #11589 .*/
+  TEST_ff_f (jn, 2, 2.4048255576957729, 0.43175480701968038399746111312430703L);
+  TEST_ff_f (jn, 3, 2.4048255576957729, 0.19899990535769083404042146764530813L);
+  TEST_ff_f (jn, 4, 2.4048255576957729, 0.647466661641779720084932282551219891E-1L);
+  TEST_ff_f (jn, 5, 2.4048255576957729, 0.163892432048058525099230549946147698E-1L);
+  TEST_ff_f (jn, 6, 2.4048255576957729, 0.34048184720278336646673682895929161E-2L);
+  TEST_ff_f (jn, 7, 2.4048255576957729, 0.60068836573295394221291569249883076E-3L);
+  TEST_ff_f (jn, 8, 2.4048255576957729, 0.92165786705344923232879022467054148E-4L);
+  TEST_ff_f (jn, 9, 2.4048255576957729, 0.12517270977961513005428966643852564E-4L)
+
   END (jn);
 }
 

Modified: fsf/trunk/libc/stdio-common/vfscanf.c
==============================================================================
--- fsf/trunk/libc/stdio-common/vfscanf.c (original)
+++ fsf/trunk/libc/stdio-common/vfscanf.c Sat Sep 10 00:02:39 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2006, 2007, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2006, 2007, 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
@@ -48,7 +48,7 @@
 #if INT_MAX == LONG_MAX
 # define need_long	0
 #else
-# define need_long 	1
+# define need_long	1
 #endif
 
 /* Those are flags in the conversion format. */
@@ -102,9 +102,9 @@
 # define __strtof_internal	__wcstof_internal
 
 # define L_(Str)	L##Str
-# define CHAR_T	  	wchar_t
+# define CHAR_T		wchar_t
 # define UCHAR_T	unsigned int
-# define WINT_T	  	wint_t
+# define WINT_T		wint_t
 # undef EOF
 # define EOF		WEOF
 #else
@@ -128,7 +128,7 @@
 			    return EOF
 
 # define L_(Str)	Str
-# define CHAR_T	  	char
+# define CHAR_T		char
 # define UCHAR_T	unsigned char
 # define WINT_T		int
 #endif
@@ -265,16 +265,39 @@
   CHAR_T *wp = NULL;		/* Workspace.  */
   size_t wpmax = 0;		/* Maximal size of workspace.  */
   size_t wpsize;		/* Currently used bytes in workspace.  */
+  bool use_malloc = false;
 #define ADDW(Ch)							    \
   do									    \
     {									    \
-      if (wpsize == wpmax)						    \
+      if (__builtin_expect (wpsize == wpmax, 0))			    \
 	{								    \
 	  CHAR_T *old = wp;						    \
-	  wpmax = (UCHAR_MAX + 1 > 2 * wpmax ? UCHAR_MAX + 1 : 2 * wpmax);  \
-	  wp = (CHAR_T *) alloca (wpmax * sizeof (CHAR_T));		    \
-	  if (old != NULL)						    \
-	    MEMCPY (wp, old, wpsize);					    \
+	  size_t newsize = (UCHAR_MAX + 1 > 2 * wpmax			    \
+			    ? UCHAR_MAX + 1 : 2 * wpmax);		    \
+	  if (use_malloc || __libc_use_alloca (newsize))		    \
+	    {								    \
+	      wp = realloc (use_malloc ? wp : NULL, newsize);		    \
+	      if (wp == NULL)						    \
+		{							    \
+		  if (use_malloc)					    \
+		    free (old);						    \
+		  done = EOF;						    \
+		  goto errout;						    \
+		}							    \
+	      if (! use_malloc)						    \
+		MEMCPY (wp, old, wpsize);				    \
+	      wpmax = newsize;						    \
+	      use_malloc = true;					    \
+	    }								    \
+	  else								    \
+	    {								    \
+	      size_t s = wpmax * sizeof (CHAR_T);			    \
+	      wp = (CHAR_T *) extend_alloca (wp, s,			    \
+					     newsize * sizeof (CHAR_T));    \
+	      wpmax = s / sizeof (CHAR_T);				    \
+	      if (old != NULL)						    \
+		MEMCPY (wp, old, wpsize);				    \
+	    }								    \
 	}								    \
       wp[wpsize++] = (Ch);						    \
     }									    \
@@ -670,7 +693,10 @@
 		      if (Str != NULL)					      \
 			add_ptr_to_free (strptr);			      \
 		      else if (flags & POSIX_MALLOC)			      \
-			goto reteof;					      \
+			{						      \
+			  done = EOF;					      \
+			  goto errout;					      \
+			}						      \
 		    }							      \
 		  else							      \
 		    Str = ARG (Type *);					      \
@@ -711,8 +737,11 @@
 			  newstr = (char *) realloc (*strptr,
 						     strleng + MB_CUR_MAX);
 			  if (newstr == NULL)
-			    /* c can't have `a' flag, only `m'.  */
-			    goto reteof;
+			    {
+			      /* c can't have `a' flag, only `m'.  */
+			      done = EOF;
+			      goto errout;
+			    }
 			  else
 			    {
 			      *strptr = newstr;
@@ -758,8 +787,11 @@
 				 effort.  */
 			      str = (char *) realloc (*strptr, strsize + 1);
 			      if (str == NULL)
-				/* c can't have `a' flag, only `m'.  */
-				goto reteof;
+				{
+				  /* c can't have `a' flag, only `m'.  */
+				  done = EOF;
+				  goto errout;
+				}
 			      else
 				{
 				  *strptr = (char *) str;
@@ -828,8 +860,12 @@
 						      (strsize + 1)
 						      * sizeof (wchar_t));
 			  if (wstr == NULL)
-			    /* C or lc can't have `a' flag, only `m' flag.  */
-			    goto reteof;
+			    {
+			      /* C or lc can't have `a' flag, only `m'
+				 flag.  */
+			      done = EOF;
+			      goto errout;
+			    }
 			  else
 			    {
 			      *strptr = (char *) wstr;
@@ -879,8 +915,11 @@
 						    ((strsize + 1)
 						     * sizeof (wchar_t)));
 			if (wstr == NULL)
-			  /* C or lc can't have `a' flag, only `m' flag.  */
-			  goto reteof;
+			  {
+			    /* C or lc can't have `a' flag, only `m' flag.  */
+			    done = EOF;
+			    goto errout;
+			  }
 			else
 			  {
 			    *strptr = (char *) wstr;
@@ -992,7 +1031,10 @@
 			    if (newstr == NULL)
 			      {
 				if (flags & POSIX_MALLOC)
-				  goto reteof;
+				  {
+				    done = EOF;
+				    goto errout;
+				  }
 				/* We lose.  Oh well.  Terminate the
 				   string and stop converting,
 				   so at least we don't skip any input.  */
@@ -1042,7 +1084,10 @@
 			      if (str == NULL)
 				{
 				  if (flags & POSIX_MALLOC)
-				    goto reteof;
+				    {
+				      done = EOF;
+				      goto errout;
+				    }
 				  /* We lose.  Oh well.  Terminate the
 				     string and stop converting,
 				     so at least we don't skip any input.  */
@@ -1088,7 +1133,10 @@
 		      if (newstr == NULL)
 			{
 			  if (flags & POSIX_MALLOC)
-			    goto reteof;
+			    {
+			      done = EOF;
+			      goto errout;
+			    }
 			  /* We lose.  Oh well.  Terminate the string
 			     and stop converting, so at least we don't
 			     skip any input.  */
@@ -1170,7 +1218,10 @@
 			    if (wstr == NULL)
 			      {
 				if (flags & POSIX_MALLOC)
-				  goto reteof;
+				  {
+				    done = EOF;
+				    goto errout;
+				  }
 				/* We lose.  Oh well.  Terminate the string
 				   and stop converting, so at least we don't
 				   skip any input.  */
@@ -1242,7 +1293,10 @@
 			  if (wstr == NULL)
 			    {
 			      if (flags & POSIX_MALLOC)
-				goto reteof;
+				{
+				  done = EOF;
+				  goto errout;
+				}
 			      /* We lose.  Oh well.  Terminate the
 				 string and stop converting, so at
 				 least we don't skip any input.  */
@@ -2433,7 +2487,10 @@
 			      if (wstr == NULL)
 				{
 				  if (flags & POSIX_MALLOC)
-				    goto reteof;
+				    {
+				      done = EOF;
+				      goto errout;
+				    }
 				  /* We lose.  Oh well.  Terminate the string
 				     and stop converting, so at least we don't
 				     skip any input.  */
@@ -2515,7 +2572,10 @@
 			      if (wstr == NULL)
 				{
 				  if (flags & POSIX_MALLOC)
-				    goto reteof;
+				    {
+				      done = EOF;
+				      goto errout;
+				    }
 				  /* We lose.  Oh well.  Terminate the
 				     string and stop converting,
 				     so at least we don't skip any input.  */
@@ -2657,7 +2717,10 @@
 			      if (newstr == NULL)
 				{
 				  if (flags & POSIX_MALLOC)
-				    goto reteof;
+				    {
+				      done = EOF;
+				      goto errout;
+				    }
 				  /* We lose.  Oh well.  Terminate the string
 				     and stop converting, so at least we don't
 				     skip any input.  */
@@ -2722,7 +2785,10 @@
 				  goto allocagain;
 				}
 			      if (flags & POSIX_MALLOC)
-				goto reteof;
+				{
+				  done = EOF;
+				  goto errout;
+				}
 			      /* We lose.  Oh well.  Terminate the
 				 string and stop converting,
 				 so at least we don't skip any input.  */
@@ -2765,7 +2831,10 @@
 		      if (newstr == NULL)
 			{
 			  if (flags & POSIX_MALLOC)
-			    goto reteof;
+			    {
+			      done = EOF;
+			      goto errout;
+			    }
 			  /* We lose.  Oh well.  Terminate the string
 			     and stop converting, so at least we don't
 			     skip any input.  */
@@ -2828,12 +2897,14 @@
   /* Unlock stream.  */
   UNLOCK_STREAM (s);
 
+  if (use_malloc)
+    free (wp);
+
   if (errp != NULL)
     *errp |= errval;
 
-  if (done == EOF)
+  if (__builtin_expect (done == EOF, 0))
     {
-  reteof:
       if (__builtin_expect (ptrs_to_free != NULL, 0))
 	{
 	  struct ptrs_to_free *p = ptrs_to_free;
@@ -2848,7 +2919,6 @@
 	      ptrs_to_free = p;
 	    }
 	}
-      return EOF;
     }
   else if (__builtin_expect (strptr != NULL, 0))
     {

Modified: fsf/trunk/libc/string/strncat.c
==============================================================================
--- fsf/trunk/libc/string/strncat.c (original)
+++ fsf/trunk/libc/string/strncat.c Sat Sep 10 00:02:39 2011
@@ -25,6 +25,7 @@
 #endif
 
 #ifndef STRNCAT
+# undef strncat
 # define STRNCAT  strncat
 #endif
 

Modified: fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps Sat Sep 10 00:02:39 2011
@@ -640,6 +640,52 @@
 idouble: 1
 ildouble: 1
 ldouble: 1
+Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703":
+float: 1
+ifloat: 1
+double: 1
+idouble: 1
+ldouble: 82
+ildouble: 82
+Test "jn (3, 2.4048255576957729) == 0.19899990535769083404042146764530813":
+ldouble: 186
+ildouble: 186
+Test "jn (4, 2.4048255576957729) == 0.647466661641779720084932282551219891E-1":
+ldouble: 185
+ildouble: 185
+Test: "jn (5, 2.4048255576957729) == 0.163892432048058525099230549946147698E-1":
+float: 1
+ifloat: 1
+double: 1
+idouble: 1
+ldouble: 249
+ildouble: 249
+Test "jn (6, 2.4048255576957729) == 0.34048184720278336646673682895929161E-2":
+float: 2
+ifloat: 2
+double: 1
+idouble: 1
+ldouble: 511
+ildouble: 511
+Test "jn (7, 2.4048255576957729) == 0.60068836573295394221291569249883076E-3":
+float: 2
+ifloat: 2
+double: 1
+idouble: 1
+ldouble: 428
+ildouble: 428
+Test "jn (8, 2.4048255576957729) == 0.92165786705344923232879022467054148E-4":
+float: 3
+ifloat: 3
+double: 1
+idouble: 1
+ldouble: 609
+ildouble: 609
+Test "jn (9, 2.4048255576957729) == 0.12517270977961513005428966643852564E-4":
+float: 4
+ifloat: 4
+ldouble: 750
+ildouble: 750
 
 # lgamma
 Test "lgamma (-0.5) == log(2*sqrt(pi))":
@@ -1168,11 +1214,11 @@
 
 Function: "jn":
 double: 5
-float: 2
+float: 4
 idouble: 5
-ifloat: 2
-ildouble: 2
-ldouble: 2
+ifloat: 4
+ildouble: 750
+ldouble: 750
 
 Function: "lgamma":
 double: 1

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_jn.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_jn.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_jn.c Sat Sep 10 00:02:39 2011
@@ -215,7 +215,16 @@
 			}
 	     	    }
 		}
-	    	b = (t*__ieee754_j0(x)/b);
+		/* j0() and j1() suffer enormous loss of precision at and
+		 * near zero; however, we know that their zero points never
+		 * coincide, so just choose the one further away from zero.
+		 */
+		z = __ieee754_j0 (x);
+		w = __ieee754_j1 (x);
+		if (fabs (z) >= fabs (w))
+		  b = (t * z / b);
+		else
+		  b = (t * w / a);
 	    }
 	}
 	if(sgn==1) return -b; else return b;

Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/e_jnf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/e_jnf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/e_jnf.c Sat Sep 10 00:02:39 2011
@@ -165,7 +165,16 @@
 			}
 		    }
 		}
-		b = (t*__ieee754_j0f(x)/b);
+		/* j0() and j1() suffer enormous loss of precision at and
+		 * near zero; however, we know that their zero points never
+		 * coincide, so just choose the one further away from zero.
+		 */
+		z = __ieee754_j0f (x);
+		w = __ieee754_j1f (x);
+		if (fabsf (z) >= fabsf (w))
+		  b = (t * z / b);
+		else
+		  b = (t * w / a);
 	    }
 	}
 	if(sgn==1) return -b; else return b;

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128/e_jnl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128/e_jnl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128/e_jnl.c Sat Sep 10 00:02:39 2011
@@ -285,7 +285,16 @@
 		    }
 		}
 	    }
-	  b = (t * __ieee754_j0l (x) / b);
+	  /* j0() and j1() suffer enormous loss of precision at and
+	   * near zero; however, we know that their zero points never
+	   * coincide, so just choose the one further away from zero.
+	   */
+	  z = __ieee754_j0l (x);
+	  w = __ieee754_j1l (x);
+	  if (fabsl (z) >= fabsl (w))
+	    b = (t * z / b);
+	  else
+	    b = (t * w / a);
 	}
     }
   if (sgn == 1)

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c Sat Sep 10 00:02:39 2011
@@ -286,7 +286,16 @@
 		    }
 		}
 	    }
-	  b = (t * __ieee754_j0l (x) / b);
+	  /* j0() and j1() suffer enormous loss of precision at and
+	   * near zero; however, we know that their zero points never
+	   * coincide, so just choose the one further away from zero.
+	   */
+	  z = __ieee754_j0l (x);
+	  w = __ieee754_j1l (x);
+	  if (fabsl (z) >= fabsl (w))
+	    b = (t * z / b);
+	  else
+	    b = (t * w / a);
 	}
     }
   if (sgn == 1)

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-96/e_jnl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-96/e_jnl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-96/e_jnl.c Sat Sep 10 00:02:39 2011
@@ -281,7 +281,16 @@
 		    }
 		}
 	    }
-	  b = (t * __ieee754_j0l (x) / b);
+	  /* j0() and j1() suffer enormous loss of precision at and
+	   * near zero; however, we know that their zero points never
+	   * coincide, so just choose the one further away from zero.
+	   */
+	  z = __ieee754_j0l (x);
+	  w = __ieee754_j1l (x);
+	  if (fabsl (z) >= fabsl (w))
+	    b = (t * z / b);
+	  else
+	    b = (t * w / a);
 	}
     }
   if (sgn == 1)

Modified: fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h (original)
+++ fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h Sat Sep 10 00:02:39 2011
@@ -236,7 +236,7 @@
 {
   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
     /* The kernel header does this so there may be a reason.  */
-    return 0;
+    return NULL;
 
   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
 			       + CMSG_ALIGN (__cmsg->cmsg_len));
@@ -245,7 +245,7 @@
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
 	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
     /* No more entries.  */
-    return 0;
+    return NULL;
   return __cmsg;
 }
 #endif	/* Use `extern inline'.  */

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/socket.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/socket.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/socket.h Sat Sep 10 00:02:39 2011
@@ -318,7 +318,7 @@
 {
   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
     /* The kernel header does this so there may be a reason.  */
-    return 0;
+    return (void *) 0;
 
   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
 			       + CMSG_ALIGN (__cmsg->cmsg_len));
@@ -327,7 +327,7 @@
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
 	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
     /* No more entries.  */
-    return 0;
+    return (void *) 0;
   return __cmsg;
 }
 #endif	/* Use `extern inline'.  */

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h Sat Sep 10 00:02:39 2011
@@ -318,7 +318,7 @@
 {
   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
     /* The kernel header does this so there may be a reason.  */
-    return 0;
+    return (void *) 0;
 
   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
 			       + CMSG_ALIGN (__cmsg->cmsg_len));
@@ -327,7 +327,7 @@
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
 	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
     /* No more entries.  */
-    return 0;
+    return (void *) 0;
   return __cmsg;
 }
 #endif	/* Use `extern inline'.  */

Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/libm-test-ulps
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/libm-test-ulps (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/libm-test-ulps Sat Sep 10 00:02:39 2011
@@ -103,8 +103,8 @@
 float: 1
 idouble: 1
 ifloat: 1
-ldouble: 1
-ildouble: 1
+ildouble: 1
+ldouble: 1
 
 # catan
 Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
@@ -168,10 +168,10 @@
 ildouble: 1
 ldouble: 1
 Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
-ildouble: 1
-ldouble: 1
-float: 1
-ifloat: 1
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # ccosh
 Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
@@ -304,6 +304,9 @@
 ifloat: 1
 
 # cos
+Test "cos (0.80190127184058835) == 0.69534156199418473":
+double: 1
+idouble: 1
 Test "cos (M_PI_6l * 2.0) == 0.5":
 double: 1
 float: 1
@@ -323,16 +326,13 @@
 ifloat: 1
 ildouble: 1
 ldouble: 1
-Test "cos (0.80190127184058835) == 0.69534156199418473":
-double: 1
-idouble: 1
 
 # cpow
 Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
 float: 1
 ifloat: 1
-ldouble: 1
-ildouble: 1
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
 float: 1
 ifloat: 1
@@ -380,15 +380,15 @@
 ldouble: 1
 
 # csin
+Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
+double: 1
+idouble: 1
 Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
 ildouble: 1
 ldouble: 1
 Test "Imaginary part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
 float: 1
 ifloat: 1
-Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
-double: 1
-idouble: 1
 
 # csinh
 Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
@@ -440,12 +440,12 @@
 
 # ctanh
 Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
-float: 2
+double: 1
+float: 2
+idouble: 1
 ifloat: 2
 ildouble: 5
 ldouble: 5
-double: 1
-idouble: 1
 Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
 ildouble: 25
 ldouble: 25
@@ -456,10 +456,10 @@
 double: 1
 idouble: 1
 Test "Imaginary part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
-ildouble: 1
-ldouble: 1
-double: 1
-idouble: 1
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
 
 # erf
 Test "erf (1.25) == 0.922900128256458230136523481197281140":
@@ -481,26 +481,26 @@
 
 # exp10
 Test "exp10 (-1) == 0.1":
-ildouble: 1
-ldouble: 1
-float: 1
-ifloat: 1
-double: 2
-idouble: 2
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
-ildouble: 2
-ldouble: 2
-float: 1
-ifloat: 1
-double: 1
-idouble: 1
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
 Test "exp10 (3) == 1000":
+double: 6
+float: 2
+idouble: 6
+ifloat: 2
 ildouble: 8
 ldouble: 8
-float: 2
-ifloat: 2
-double: 6
-idouble: 6
 
 # expm1
 Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
@@ -660,10 +660,19 @@
 ildouble: 2
 ldouble: 2
 Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
+double: 1
 float: 4
+idouble: 1
 ifloat: 4
 ildouble: 1
 ldouble: 1
+Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 82
+ldouble: 82
 Test "jn (3, -1.0) == -0.0195633539826684059189053216217515083":
 ildouble: 1
 ldouble: 1
@@ -694,6 +703,51 @@
 ifloat: 2
 ildouble: 1
 ldouble: 1
+Test "jn (3, 2.4048255576957729) == 0.19899990535769083404042146764530813":
+double: 3
+idouble: 3
+ildouble: 186
+ldouble: 186
+Test "jn (4, 2.4048255576957729) == 0.647466661641779720084932282551219891E-1":
+double: 1
+idouble: 1
+ildouble: 185
+ldouble: 185
+Test "jn (5, 2.4048255576957729) == 0.163892432048058525099230549946147698E-1":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 249
+ldouble: 249
+Test "jn (6, 2.4048255576957729) == 0.34048184720278336646673682895929161E-2":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 511
+ldouble: 511
+Test "jn (7, 2.4048255576957729) == 0.60068836573295394221291569249883076E-3":
+double: 3
+float: 5
+idouble: 3
+ifloat: 5
+ildouble: 428
+ldouble: 428
+Test "jn (8, 2.4048255576957729) == 0.92165786705344923232879022467054148E-4":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 609
+ldouble: 609
+Test "jn (9, 2.4048255576957729) == 0.12517270977961513005428966643852564E-4":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 750
+ldouble: 750
 
 # lgamma
 Test "lgamma (-0.5) == log(2*sqrt(pi))":
@@ -714,12 +768,12 @@
 
 # log10
 Test "log10 (0.75) == -0.124938736608299953132449886193870744":
-ildouble: 1
-ldouble: 1
-float: 2
-ifloat: 2
-double: 1
-idouble: 1
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
 Test "log10 (e) == log10(e)":
 float: 1
 ifloat: 1
@@ -732,6 +786,9 @@
 ifloat: 1
 
 # sincos
+Test "sincos (0.80190127184058835, &sin_res, &cos_res) puts 0.69534156199418473 in cos_res":
+double: 1
+idouble: 1
 Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
 double: 1
 float: 1
@@ -754,9 +811,6 @@
 Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
 float: 1
 ifloat: 1
-Test "sincos (0.80190127184058835, &sin_res, &cos_res) puts 0.69534156199418473 in cos_res":
-double: 1
-idouble: 1
 
 # tan
 Test "tan (pi/4) == 1":
@@ -1178,12 +1232,12 @@
 ldouble: 5
 
 Function: Imaginary part of "ctanh":
-float: 1
+double: 1
+float: 1
+idouble: 1
 ifloat: 1
 ildouble: 25
 ldouble: 25
-double: 1
-idouble: 1
 
 Function: "erf":
 double: 1
@@ -1196,12 +1250,12 @@
 ldouble: 1
 
 Function: "exp10":
+double: 6
+float: 2
+idouble: 6
+ifloat: 2
 ildouble: 8
 ldouble: 8
-float: 2
-ifloat: 2
-double: 6
-idouble: 6
 
 Function: "expm1":
 double: 1
@@ -1235,11 +1289,11 @@
 
 Function: "jn":
 double: 4
-float: 4
+float: 5
 idouble: 4
-ifloat: 4
-ildouble: 2
-ldouble: 2
+ifloat: 5
+ildouble: 750
+ldouble: 750
 
 Function: "lgamma":
 double: 1
@@ -1250,12 +1304,12 @@
 ldouble: 1
 
 Function: "log10":
-float: 2
-ifloat: 2
-ildouble: 1
-ldouble: 1
-double: 1
-idouble: 1
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
 
 Function: "log1p":
 float: 1