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

[commits] r10527 - in /fsf/trunk/libc: ./ elf/ sunrpc/ sysdeps/unix/sysv/linux/ sysdeps/unix/sysv/linux/sys/



Author: eglibc
Date: Sat May 22 00:04:12 2010
New Revision: 10527

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

Added:
    fsf/trunk/libc/sysdeps/unix/sysv/linux/internal_recvmmsg.S
    fsf/trunk/libc/sysdeps/unix/sysv/linux/recvmmsg.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/elf/dl-runtime.c
    fsf/trunk/libc/sunrpc/clnt_tcp.c
    fsf/trunk/libc/sunrpc/clnt_udp.c
    fsf/trunk/libc/sunrpc/clnt_unix.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile
    fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/socketcall.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sys/timex.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/syscalls.list

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat May 22 00:04:12 2010
@@ -1,3 +1,30 @@
+2010-05-21  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* elf/dl-runtime.c (_dl_profile_fixup): Don't crash on unresolved weak
+	symbol reference.
+
+2010-05-19  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* elf/dl-runtime.c (_dl_fixup): Don't crash on unresolved weak
+	symbol reference.
+
+2010-05-21  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add recvmmsg
+	and internal_recvmmsg.
+	* sysdeps/unix/sysv/linux/recvmmsg.c: New file.
+	* sysdeps/unix/sysv/linux/internal_recvmmsg.S: New file.
+	* sysdeps/unix/sysv/linux/socketcall.h (SOCKOP_recvmmsg): Define.
+	* sysdeps/unix/sysv/linux/syscalls.list (recvmmsg): Remove.
+
+	* sunrpc/clnt_tcp.c (clnttcp_control): Add missing break.
+	* sunrpc/clnt_udp.c (clntudp_control): Likewise.
+	* sunrpc/clnt_unix.c (clntunix_control): Likewise.
+
+2010-05-20  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/sys/timex.h: Use __REDIRECT_NTH.
+
 2010-05-17  Luis Machado  <luisgpm@xxxxxxxxxx>
 
 	POWER7 optimizations.

Modified: fsf/trunk/libc/elf/dl-runtime.c
==============================================================================
--- fsf/trunk/libc/elf/dl-runtime.c (original)
+++ fsf/trunk/libc/elf/dl-runtime.c Sat May 22 00:04:12 2010
@@ -1,5 +1,5 @@
 /* On-demand PLT fixup for shared objects.
-   Copyright (C) 1995-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1995-2009, 2010 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
@@ -144,7 +144,8 @@
   /* And now perhaps the relocation addend.  */
   value = elf_machine_plt_value (l, reloc, value);
 
-  if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0))
+  if (sym != NULL
+      && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0))
     value = ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) ();
 
   /* Finally, fix up the plt itself.  */
@@ -231,8 +232,9 @@
 				       ? LOOKUP_VALUE_ADDRESS (result)
 					 + defsym->st_value : 0);
 
-	  if (__builtin_expect (ELFW(ST_TYPE) (defsym->st_info)
-				== STT_GNU_IFUNC, 0))
+	  if (defsym != NULL
+	      && __builtin_expect (ELFW(ST_TYPE) (defsym->st_info)
+				   == STT_GNU_IFUNC, 0))
 	    value = ((DL_FIXUP_VALUE_TYPE (*) (void))
 		     DL_FIXUP_VALUE_ADDR (value)) ();
 	}
@@ -369,7 +371,7 @@
       struct audit_ifaces *afct = GLRO(dl_audit);
       for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
 	{
- 	  if (afct->ARCH_LA_PLTENTER != NULL
+	  if (afct->ARCH_LA_PLTENTER != NULL
 	      && (reloc_result->enterexit
 		  & (LA_SYMB_NOPLTENTER << (2 * (cnt + 1)))) == 0)
 	    {

Modified: fsf/trunk/libc/sunrpc/clnt_tcp.c
==============================================================================
--- fsf/trunk/libc/sunrpc/clnt_tcp.c (original)
+++ fsf/trunk/libc/sunrpc/clnt_tcp.c Sat May 22 00:04:12 2010
@@ -399,6 +399,7 @@
       /* This will set the xid of the NEXT call */
       *(u_long *)ct->ct_mcall =  htonl (*(u_long *)info - 1);
       /* decrement by 1 as clnttcp_call() increments once */
+      break;
     case CLGET_VERS:
       /*
        * This RELIES on the information that, in the call body,

Modified: fsf/trunk/libc/sunrpc/clnt_udp.c
==============================================================================
--- fsf/trunk/libc/sunrpc/clnt_udp.c (original)
+++ fsf/trunk/libc/sunrpc/clnt_udp.c Sat May 22 00:04:12 2010
@@ -582,6 +582,7 @@
       /* This will set the xid of the NEXT call */
       *(u_long *)cu->cu_outbuf =  htonl(*(u_long *)info - 1);
       /* decrement by 1 as clntudp_call() increments once */
+      break;
     case CLGET_VERS:
       /*
        * This RELIES on the information that, in the call body,

Modified: fsf/trunk/libc/sunrpc/clnt_unix.c
==============================================================================
--- fsf/trunk/libc/sunrpc/clnt_unix.c (original)
+++ fsf/trunk/libc/sunrpc/clnt_unix.c Sat May 22 00:04:12 2010
@@ -376,6 +376,7 @@
       /* This will set the xid of the NEXT call */
       *(u_long *) ct->ct_mcall =  htonl (*(u_long *)info - 1);
       /* decrement by 1 as clntunix_call() increments once */
+      break;
     case CLGET_VERS:
       /*
        * This RELIES on the information that, in the call body,

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 Sat May 22 00:04:12 2010
@@ -12,7 +12,7 @@
 endif
 
 ifeq ($(subdir),socket)
-sysdep_routines += internal_accept4
+sysdep_routines += internal_accept4 recvmmsg internal_recvmmsg
 endif
 
 ifeq ($(subdir),misc)

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/internal_recvmmsg.S
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/internal_recvmmsg.S (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/internal_recvmmsg.S Sat May 22 00:04:12 2010
@@ -1,0 +1,14 @@
+#include <kernel-features.h>
+#include <sys/syscall.h>
+#if !defined __NR_recvmmsg && defined __NR_socketcall
+# define socket	recvmmsg
+# ifdef __ASSUME_RECVMMSG
+#  define __socket recvmmsg
+# else
+#  define __socket __internal_recvmmsg
+# endif
+# define NARGS 5
+# define NEED_CANCELLATION
+# define NO_WEAK_ALIAS
+# include <socket.S>
+#endif

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h Sat May 22 00:04:12 2010
@@ -525,3 +525,8 @@
 #if __LINUX_KERNEL_VERSION >= 0x020620
 # define __ASSUME_F_GETOWN_EX	1
 #endif
+
+/* Support for the recvmmsg syscall was added in 2.6.33.  */
+#if __LINUX_KERNEL_VERSION >= 0x020621
+# define __ASSUME_RECVMMSG	1
+#endif

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/recvmmsg.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/recvmmsg.c (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/recvmmsg.c Sat May 22 00:04:12 2010
@@ -1,0 +1,100 @@
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Schwab <schwab@xxxxxxxxxx>, 2010.
+
+   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 <errno.h>
+#include <sys/socket.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <kernel-features.h>
+
+
+#ifdef __NR_recvmmsg
+int
+recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
+	  const struct timespec *tmo)
+{
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (recvmmsg, 5, fd, vmessages, vlen, flags, tmo);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  int result = INLINE_SYSCALL (recvmmsg, 5, fd, vmessages, vlen, flags, tmo);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+#elif defined __NR_socketcall
+# ifndef __ASSUME_RECVMMSG
+extern int __internal_recvmmsg (int fd, struct mmsghdr *vmessages,
+				unsigned int vlen, int flags,
+				const struct timespec *tmo)
+     attribute_hidden;
+
+static int have_recvmmsg;
+
+int
+recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
+	  const struct timespec *tmo)
+{
+  if (__builtin_expect (have_recvmmsg >= 0, 1))
+    {
+      int ret = __internal_recvmmsg (fd, vmessages, vlen, flags, tmo);
+      /* 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_recvmmsg == 0
+	  && errno == EINVAL)
+	{
+	  /* Try another call, this time with an invalid file
+	     descriptor and all other parameters cleared.  This call
+	     will not cause any harm and it will return
+	     immediately.  */
+	  ret = __internal_recvmmsg (-1, 0, 0, 0, 0);
+	  if (errno == EINVAL)
+	    {
+	      have_recvmmsg = -1;
+	      __set_errno (ENOSYS);
+	    }
+	  else
+	    {
+	      have_recvmmsg = 1;
+	      __set_errno (EINVAL);
+	    }
+	  return -1;
+	}
+      return ret;
+    }
+  __set_errno (ENOSYS);
+  return -1;
+}
+# else
+/* When __ASSUME_RECVMMSG recvmmsg is defined in internal_recvmmsg.S.  */
+# endif
+#else
+int
+recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
+	  const struct timespec *tmo)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+stub_warning (recvmmsg)
+#endif

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/socketcall.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/socketcall.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/socketcall.h Sat May 22 00:04:12 2010
@@ -44,5 +44,6 @@
 #define SOCKOP_sendmsg		16
 #define SOCKOP_recvmsg		17
 #define SOCKOP_accept4		18
+#define SOCKOP_recvmmsg		19
 
 #endif /* sys/socketcall.h */

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sys/timex.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sys/timex.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sys/timex.h Sat May 22 00:04:12 2010
@@ -140,9 +140,9 @@
 extern int __adjtimex (struct timex *__ntx) __THROW;
 extern int adjtimex (struct timex *__ntx) __THROW;
 
-#if defined __GNUC__ && __GNUC__ >= 2
-extern int ntp_gettime (struct ntptimeval *__ntv)
-     __asm__ ("ntp_gettimex") __THROW;
+#ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
+			   ntp_gettimex);
 #else
 extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
 # define ntp_gettime ntp_gettimex

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/syscalls.list
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/syscalls.list (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/syscalls.list Sat May 22 00:04:12 2010
@@ -53,7 +53,6 @@
 putpmsg		-	putpmsg		i:ippii	putpmsg
 query_module	EXTRA	query_module	i:sipip	query_module
 quotactl	EXTRA	quotactl	i:isip	quotactl
-recvmmsg	EXTRA	recvmmsg	Ci:ipiip	recvmmsg
 remap_file_pages -	remap_file_pages i:piiii	__remap_file_pages remap_file_pages
 sched_getp	-	sched_getparam	i:ip	__sched_getparam	sched_getparam
 sched_gets	-	sched_getscheduler	i:i	__sched_getscheduler	sched_getscheduler