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

[commits] r8485 - in /fsf/trunk/libc: ./ sysdeps/ieee754/ldbl-128ibm/ sysdeps/powerpc/powerpc32/ sysdeps/powerpc/powerpc32/fpu/ sysdep...



Author: eglibc
Date: Fri May 22 13:25:36 2009
New Revision: 8485

Log:
Import glibc-mainline for 2009-05-22

Added:
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/____longjmp_chk.S
    fsf/trunk/libc/sysdeps/powerpc/powerpc64/____longjmp_chk.S
    fsf/trunk/libc/sysdeps/unix/sysv/linux/internal_accept4.S
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
    fsf/trunk/libc/sysdeps/powerpc/powerpc64/__longjmp-common.S
    fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile
    fsf/trunk/libc/sysdeps/unix/sysv/linux/accept4.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/accept4.S

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri May 22 13:25:36 2009
@@ -1,3 +1,30 @@
+2009-05-22  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
+
+	* sysdeps/ieee754/ldbl-128ibm/s_sinl.c: Set errno for ±Inf.
+	* sysdeps/ieee754/ldbl-128ibm/s_cosl.c: Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/s_tanl.c: Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/s_expm1l.c: Set errno for overflow.
+
+	* sysdeps/powerpc/powerpc32/____longjmp_chk.S: New file.
+	* sysdeps/powerpc/powerpc64/____longjmp_chk.S: New file.
+	* sysdeps/powerpc/powerpc32/__longjmp-common.S: Use CHECK_SP if
+	defined.
+	* sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S: Likewise.
+	* sysdeps/powerpc/powerpc64/__longjmp-common.S: Likewise.
+
+2009-05-22  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/accept4.c: Include kernel-features.h.
+	(accept4): If __NR_accept4 is not defined, but __NR_socketcall
+	is, either do nothing at all if __ASSUME_ACCEPT4, or
+	call __internal_accept4 and handle EINVAL -> ENOSYS translation.
+	* sysdeps/unix/sysv/linux/internal_accept4.S: New file.
+	* sysdeps/unix/sysv/linux/i386/accept4.S (SOCKOP_accept4): Don't
+	define.
+	* sysdeps/unix/sysv/linux/i386/internal_accept4.S: New file.
+	* sysdeps/unix/sysv/linux/Makefile (sysdep-routines): Add
+	internal_accept4 in socket directory.
+
 2009-05-20  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
 	* sysdeps/ia64/configure.in: New file.

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Fri May 22 13:25:36 2009
@@ -51,6 +51,13 @@
   Implemented by Ulrich Drepper.
 
 * Handling for group shadow files has been added.
+  Implemented by Ulrich Drepper.
+
+* DNS IPv4-IPv6 parallel lookup now deals better with broken DNS
+  servers (the case, e.g., for some people using the built-in DNS
+  server in ADSL modems/routers).  There is a once-per-process timeout
+  in case of a broken server.  To avoid it, users can run nscd or put
+  'options single-request' in /etc/resolv.conf.
   Implemented by Ulrich Drepper.
 
 

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_cosl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_cosl.c Fri May 22 13:25:36 2009
@@ -44,6 +44,7 @@
  *	TRIG(x) returns trig(x) nearly rounded
  */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 #include <math_ldbl_opt.h>
@@ -67,9 +68,11 @@
 	  return __kernel_cosl(x,z);
 
     /* cos(Inf or NaN) is NaN */
-	else if (ix>=0x7ff0000000000000LL)
+	else if (ix>=0x7ff0000000000000LL) {
+	    if (ix == 0x7ff0000000000000LL)
+		__set_errno (EDOM);
 	    return x-x;
-
+	}
     /* argument reduction needed */
 	else {
 	    n = __ieee754_rem_pio2l(x,y);

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c Fri May 22 13:25:36 2009
@@ -51,6 +51,7 @@
     License along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 #include <math_ldbl_opt.h>
@@ -120,7 +121,10 @@
 
   /* Overflow.  */
   if (x > maxlog)
-    return (big * big);
+    {
+      __set_errno (ERANGE);
+      return (big * big);
+    }
 
   /* Minimum value.  */
   if (x < minarg)

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_sinl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_sinl.c Fri May 22 13:25:36 2009
@@ -44,6 +44,7 @@
  *	TRIG(x) returns trig(x) nearly rounded
  */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 #include <math_ldbl_opt.h>
@@ -67,8 +68,11 @@
 	  return __kernel_sinl(x,z,0);
 
     /* sin(Inf or NaN) is NaN */
-	else if (ix>=0x7ff0000000000000LL) return x-x;
-
+	else if (ix>=0x7ff0000000000000LL) {
+	    if (ix == 0x7ff0000000000000LL)
+		__set_errno (EDOM);
+	    return x-x;
+	}
     /* argument reduction needed */
 	else {
 	    n = __ieee754_rem_pio2l(x,y);

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_tanl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_tanl.c Fri May 22 13:25:36 2009
@@ -44,6 +44,7 @@
  *	TRIG(x) returns trig(x) nearly rounded
  */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 #include <math_ldbl_opt.h>
@@ -66,8 +67,11 @@
 	if(ix <= 0x3fe921fb54442d10LL) return __kernel_tanl(x,z,1);
 
     /* tanl(Inf or NaN) is NaN */
-	else if (ix>=0x7ff0000000000000LL) return x-x;		/* NaN */
-
+	else if (ix>=0x7ff0000000000000LL) {
+	    if (ix == 0x7ff0000000000000LL)
+		__set_errno (EDOM);
+	    return x-x;		/* NaN */
+	}
     /* argument reduction needed */
 	else {
 	    n = __ieee754_rem_pio2l(x,y);

Added: fsf/trunk/libc/sysdeps/powerpc/powerpc32/____longjmp_chk.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/____longjmp_chk.S (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/____longjmp_chk.S Fri May 22 13:25:36 2009
@@ -1,0 +1,37 @@
+/* Copyright (C) 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+#include <rtld-global-offsets.h>
+
+	.section .rodata.str1.1,"aMS",@progbits,1
+.LC0:
+	.string "longjmp causes uninitialized stack frame"
+	.text
+
+#define __longjmp ____longjmp_chk
+
+#define CHECK_SP(reg) \
+	cmplw	reg, r1;				\
+	bge+	.Lok;					\
+	lis	r3,.LC0@ha;				\
+	la	r3,.LC0@l(r3);				\
+	bl	HIDDEN_JUMPTARGET (__fortify_fail);	\
+.Lok:
+
+#include <__longjmp-common.S>

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S Fri May 22 13:25:36 2009
@@ -1,5 +1,5 @@
 /* longjmp for PowerPC.
-   Copyright (C) 1995-1997, 1999-2001, 2003, 2004, 2005, 2006
+   Copyright (C) 1995-1997, 1999-2001, 2003, 2004, 2005, 2006, 2009
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -31,7 +31,7 @@
 ENTRY (BP_SYM (__longjmp))
 	CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
 
-#ifdef PTR_DEMANGLE
+#if defined PTR_DEMANGLE || defined CHECK_SP
 	lwz r24,(JB_GPR1*4)(r3)
 #else
 	lwz r1,(JB_GPR1*4)(r3)
@@ -45,8 +45,16 @@
 	lwz r19,((JB_GPRS+5)*4)(r3)
 	lwz r20,((JB_GPRS+6)*4)(r3)
 #ifdef PTR_DEMANGLE
+# ifdef CHECK_SP
+	PTR_DEMANGLE3 (r24, r24, r25)
+# else
 	PTR_DEMANGLE3 (r1, r24, r25)
+# endif
 	PTR_DEMANGLE2 (r0, r25)
+#endif
+#ifdef CHECK_SP
+	CHECK_SP (r24)
+	mr r1,r24
 #endif
 	mtlr r0
 	lwz r21,((JB_GPRS+7)*4)(r3)

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S Fri May 22 13:25:36 2009
@@ -114,7 +114,7 @@
 	lvx	v31,0,r6
 L(no_vmx):
 #endif
-#ifdef PTR_DEMANGLE
+#if defined PTR_DEMANGLE || defined CHECK_SP
 	lwz r24,(JB_GPR1*4)(r3)
 #else
 	lwz r1,(JB_GPR1*4)(r3)
@@ -135,8 +135,16 @@
 	lwz r20,((JB_GPRS+6)*4)(r3)
 	lfd fp20,((JB_FPRS+6*2)*4)(r3)
 #ifdef PTR_DEMANGLE
+# ifdef CHECK_SP
+	PTR_DEMANGLE3 (r24, r24, r25)
+# else
 	PTR_DEMANGLE3 (r1, r24, r25)
+# endif
 	PTR_DEMANGLE2 (r0, r25)
+#endif
+#ifdef CHECK_SP
+	CHECK_SP (r24)
+	mr r1,r24
 #endif
 	mtlr r0
 	lwz r21,((JB_GPRS+7)*4)(r3)

Added: fsf/trunk/libc/sysdeps/powerpc/powerpc64/____longjmp_chk.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/____longjmp_chk.S (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/____longjmp_chk.S Fri May 22 13:25:36 2009
@@ -1,0 +1,39 @@
+/* Copyright (C) 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+#include <rtld-global-offsets.h>
+
+	.section .rodata.str1.1,"aMS",@progbits,1
+.LC0:
+	.string "longjmp causes uninitialized stack frame"
+	.section .toc,"aw"
+.LC1:
+	.tc .LC0[TC],.LC0
+	.text
+
+#define __longjmp ____longjmp_chk
+
+#define CHECK_SP(reg) \
+	cmpld	reg, r1;				\
+	bge+	.Lok;					\
+	ld	r3,.LC1@toc(2);				\
+	bl	HIDDEN_JUMPTARGET (__fortify_fail);	\
+.Lok:
+
+#include <__longjmp-common.S>

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc64/__longjmp-common.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/__longjmp-common.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/__longjmp-common.S Fri May 22 13:25:36 2009
@@ -107,11 +107,21 @@
 	lvx	v31,0,r6
 L(no_vmx):
 #endif
-#ifdef PTR_DEMANGLE
+#if defined PTR_DEMANGLE || defined CHECK_SP
 	ld r22,(JB_GPR1*8)(r3)
-	PTR_DEMANGLE3 (r1, r22, r25)
 #else
 	ld r1,(JB_GPR1*8)(r3)
+#endif
+#ifdef PTR_DEMANGLE
+# ifdef CHECK_SP
+	PTR_DEMANGLE3 (r22, r22, r25)
+# else
+	PTR_DEMANGLE3 (r1, r22, r25)
+# endif
+#endif
+#ifdef CHECK_SP
+	CHECK_SP (r22)
+	mr r1,r22
 #endif
 	ld r2,(JB_GPR2*8)(r3)
 	ld r0,(JB_LR*8)(r3)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile Fri May 22 13:25:36 2009
@@ -9,6 +9,10 @@
 
 ifeq ($(subdir),malloc)
 CFLAGS-malloc.c += -DMORECORE_CLEARS=2
+endif
+
+ifeq ($(subdir),socket)
+sysdep_routines += internal_accept4
 endif
 
 ifeq ($(subdir),misc)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/accept4.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/accept4.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/accept4.c Fri May 22 13:25:36 2009
@@ -23,6 +23,7 @@
 
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
+#include <kernel-features.h>
 
 
 #ifdef __NR_accept4
@@ -41,6 +42,50 @@
 
   return result;
 }
+#elif defined __NR_socketcall
+# ifndef __ASSUME_ACCEPT4
+extern int __internal_accept4 (int fd, __SOCKADDR_ARG addr,
+			       socklen_t *addr_len, int flags)
+     attribute_hidden;
+
+static int have_accept4;
+
+int
+accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
+{
+  if (__builtin_expect (have_accept4 >= 0, 1))
+    {
+      int ret = __internal_accept4 (fd, addr, addr_len, flags);
+      /* The kernel returns -EINVAL for unknown socket operations.
+	 We need to convert that error to an ENOSYS error.  */
+      if (__builtin_expect (ret < 0, 0)
+	  && have_accept4 == 0
+	  && errno == EINVAL)
+	{
+	  /* Try another call, this time with the FLAGS parameter
+	     cleared and an invalid file descriptor.  This call will not
+	     cause any harm and it will return immediately.  */
+	  ret = __internal_accept4 (-1, addr, addr_len, 0);
+	  if (errno == EINVAL)
+	    {
+	      have_accept4 = -1;
+	      __set_errno (ENOSYS);
+	    }
+	  else
+	    {
+	      have_accept4 = 1;
+	      __set_errno (EINVAL);
+	    }
+	  return -1;
+	}
+      return ret;
+    }
+  __set_errno (ENOSYS);
+  return -1;
+}
+# else
+/* When __ASSUME_ACCEPT4 accept4 is defined in internal_accept4.S.  */
+# endif
 #else
 int
 accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/accept4.S
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/accept4.S (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/accept4.S Fri May 22 13:25:36 2009
@@ -23,10 +23,6 @@
 
 #define EINVAL	22
 #define ENOSYS	38
-
-#ifndef SOCKOP_accept4
-# define SOCKOP_accept4 18
-#endif
 
 #ifdef __ASSUME_ACCEPT4
 # define errlabel SYSCALL_ERROR_LABEL

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/internal_accept4.S
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/internal_accept4.S (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/internal_accept4.S Fri May 22 13:25:36 2009
@@ -1,0 +1,14 @@
+#include <kernel-features.h>
+#include <sys/syscall.h>
+#if !defined __NR_accept4 && defined __NR_socketcall
+# define socket	accept4
+# ifdef __ASSUME_ACCEPT4
+#  define __socket accept4
+# else
+#  define __socket __internal_accept4
+# endif
+# define NARGS 4
+# define NEED_CANCELLATION
+# define NO_WEAK_ALIAS
+# include <socket.S>
+#endif