This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

glibc git repo branch, master, updated. 38ae768d88c47dd06030104eb3376212b0d8d164


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "glibc git repo".

The branch, master has been updated
       via  38ae768d88c47dd06030104eb3376212b0d8d164 (commit)
       via  0323b051be1bee42592e6813064031aacfd6063d (commit)
       via  1e1dc4e82dd4f31b87440388614c3e4bccdd5f3c (commit)
      from  be6b2e5cf302f984d8f405c0d40e7a3979c47bc3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=38ae768d88c47dd06030104eb3376212b0d8d164

commit 38ae768d88c47dd06030104eb3376212b0d8d164
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Fri May 22 08:35:15 2009 -0700

    Fix errno for IBM long double.
    
    After the last addition to the math test suite PPC routines haven't
    been adjusted so far.

diff --git a/ChangeLog b/ChangeLog
index 2c1d66c..45be576 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-05-22  Andreas Schwab  <schwab@linux-m68k.org>
 
+	* 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
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_cosl.c b/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
index 59a8196..8470850 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
@@ -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);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
index 7350065..f631edd 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
@@ -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 @@ __expm1l (long double x)
 
   /* Overflow.  */
   if (x > maxlog)
-    return (big * big);
+    {
+      __set_errno (ERANGE);
+      return (big * big);
+    }
 
   /* Minimum value.  */
   if (x < minarg)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_sinl.c b/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
index 8cc592c..bd72225 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
@@ -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);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_tanl.c b/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
index ea5a7f0..913f38f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
@@ -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);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0323b051be1bee42592e6813064031aacfd6063d

commit 0323b051be1bee42592e6813064031aacfd6063d
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Fri May 22 08:28:20 2009 -0700

    Add ___longjmp_chk support for powerpc{32,64}.

diff --git a/ChangeLog b/ChangeLog
index b5cc481..2c1d66c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-05-22  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* 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@redhat.com>
 
 	* sysdeps/unix/sysv/linux/accept4.c: Include kernel-features.h.
diff --git a/sysdeps/powerpc/powerpc32/____longjmp_chk.S b/sysdeps/powerpc/powerpc32/____longjmp_chk.S
new file mode 100644
index 0000000..5c1f648
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/____longjmp_chk.S
@@ -0,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>
diff --git a/sysdeps/powerpc/powerpc32/__longjmp-common.S b/sysdeps/powerpc/powerpc32/__longjmp-common.S
index 2093b7e..7b1c017 100644
--- a/sysdeps/powerpc/powerpc32/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/__longjmp-common.S
@@ -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,9 +45,17 @@ ENTRY (BP_SYM (__longjmp))
 	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)
 	lwz r22,((JB_GPRS+8)*4)(r3)
diff --git a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
index f9f010f..f105815 100644
--- a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
@@ -114,7 +114,7 @@ L(aligned_restore_vmx):
 	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,9 +135,17 @@ L(no_vmx):
 	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)
 	lfd fp21,((JB_FPRS+7*2)*4)(r3)
diff --git a/sysdeps/powerpc/powerpc64/____longjmp_chk.S b/sysdeps/powerpc/powerpc64/____longjmp_chk.S
new file mode 100644
index 0000000..5654902
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/____longjmp_chk.S
@@ -0,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>
diff --git a/sysdeps/powerpc/powerpc64/__longjmp-common.S b/sysdeps/powerpc/powerpc64/__longjmp-common.S
index 19b2849..1be1f8f 100644
--- a/sysdeps/powerpc/powerpc64/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc64/__longjmp-common.S
@@ -107,12 +107,22 @@ L(aligned_restore_vmx):
 	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)
 	ld r14,((JB_GPRS+0)*8)(r3)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1e1dc4e82dd4f31b87440388614c3e4bccdd5f3c

commit 1e1dc4e82dd4f31b87440388614c3e4bccdd5f3c
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri May 22 08:25:34 2009 -0700

    Implement accept4 for more archs using socketcall.
    
    So far accept4 was only supported on archs using socketcall for x86.
    This patch adds support for the remaining archs.

diff --git a/ChangeLog b/ChangeLog
index 5ff23ea..b5cc481 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2009-05-22  Jakub Jelinek  <jakub@redhat.com>
+
+	* 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@intel.com>
 
 	* sysdeps/ia64/configure.in: New file.
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 170c042..cee5d29 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -11,6 +11,10 @@ ifeq ($(subdir),malloc)
 CFLAGS-malloc.c += -DMORECORE_CLEARS=2
 endif
 
+ifeq ($(subdir),socket)
+sysdep_routines += internal_accept4
+endif
+
 ifeq ($(subdir),misc)
 sysdep_routines += sysctl clone llseek umount umount2 readahead \
 		   setfsuid setfsgid makedev epoll_pwait signalfd \
diff --git a/sysdeps/unix/sysv/linux/accept4.c b/sysdeps/unix/sysv/linux/accept4.c
index 4be710f..9ef9f47 100644
--- a/sysdeps/unix/sysv/linux/accept4.c
+++ b/sysdeps/unix/sysv/linux/accept4.c
@@ -23,6 +23,7 @@
 
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
+#include <kernel-features.h>
 
 
 #ifdef __NR_accept4
@@ -41,6 +42,50 @@ accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
 
   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)
diff --git a/sysdeps/unix/sysv/linux/i386/accept4.S b/sysdeps/unix/sysv/linux/i386/accept4.S
index 087ccc4..1d05eff 100644
--- a/sysdeps/unix/sysv/linux/i386/accept4.S
+++ b/sysdeps/unix/sysv/linux/i386/accept4.S
@@ -24,10 +24,6 @@
 #define EINVAL	22
 #define ENOSYS	38
 
-#ifndef SOCKOP_accept4
-# define SOCKOP_accept4 18
-#endif
-
 #ifdef __ASSUME_ACCEPT4
 # define errlabel SYSCALL_ERROR_LABEL
 #else
diff --git a/sysdeps/unix/sysv/linux/internal_accept4.S b/sysdeps/unix/sysv/linux/internal_accept4.S
new file mode 100644
index 0000000..ffc5536
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/internal_accept4.S
@@ -0,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

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                        |   27 +++++++++++++
 sysdeps/ieee754/ldbl-128ibm/s_cosl.c             |    7 ++-
 sysdeps/ieee754/ldbl-128ibm/s_expm1l.c           |    6 ++-
 sysdeps/ieee754/ldbl-128ibm/s_sinl.c             |    8 +++-
 sysdeps/ieee754/ldbl-128ibm/s_tanl.c             |    8 +++-
 sysdeps/powerpc/powerpc32/____longjmp_chk.S      |   37 ++++++++++++++++++
 sysdeps/powerpc/powerpc32/__longjmp-common.S     |   12 +++++-
 sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S |   10 ++++-
 sysdeps/powerpc/powerpc64/____longjmp_chk.S      |   39 +++++++++++++++++++
 sysdeps/powerpc/powerpc64/__longjmp-common.S     |   14 ++++++-
 sysdeps/unix/sysv/linux/Makefile                 |    4 ++
 sysdeps/unix/sysv/linux/accept4.c                |   45 ++++++++++++++++++++++
 sysdeps/unix/sysv/linux/i386/accept4.S           |    4 --
 sysdeps/unix/sysv/linux/internal_accept4.S       |   14 +++++++
 14 files changed, 219 insertions(+), 16 deletions(-)
 create mode 100644 sysdeps/powerpc/powerpc32/____longjmp_chk.S
 create mode 100644 sysdeps/powerpc/powerpc64/____longjmp_chk.S
 create mode 100644 sysdeps/unix/sysv/linux/internal_accept4.S


hooks/post-receive
-- 
glibc git repo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]