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

[commits] r10618 - in /fsf/glibc-2_12-branch/libc: ./ elf/ sunrpc/ sysdeps/unix/sysv/linux/ sysdeps/unix/sysv/linux/sh/sh4/ sysdeps/un...



Author: eglibc
Date: Wed Jun  2 00:06:36 2010
New Revision: 10618

Log:
Import glibc-2.12 for 2010-06-02

Added:
    fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/internal_recvmmsg.S
    fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/recvmmsg.c
Modified:
    fsf/glibc-2_12-branch/libc/ChangeLog
    fsf/glibc-2_12-branch/libc/elf/dl-runtime.c
    fsf/glibc-2_12-branch/libc/sunrpc/clnt_tcp.c
    fsf/glibc-2_12-branch/libc/sunrpc/clnt_udp.c
    fsf/glibc-2_12-branch/libc/sunrpc/clnt_unix.c
    fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/Makefile
    fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/kernel-features.h
    fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
    fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/socketcall.h
    fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/sys/timex.h
    fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/syscalls.list
    fsf/glibc-2_12-branch/libc/sysdeps/x86_64/multiarch/init-arch.c

Modified: fsf/glibc-2_12-branch/libc/ChangeLog
==============================================================================
--- fsf/glibc-2_12-branch/libc/ChangeLog (original)
+++ fsf/glibc-2_12-branch/libc/ChangeLog Wed Jun  2 00:06:36 2010
@@ -1,3 +1,42 @@
+2010-05-26  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	[BZ #11640]
+	* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):
+	Properly check family and model.
+
+2010-05-26  Takashi Yoshii  <takashi.yoshii.zj@xxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/sh/sh4/register-dump.h: Fix iov[] size.
+
+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.
+
+2010-05-21  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* 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-12  Andrew Stubbs  <ams@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/sh/sh4/fpu/feholdexcpt.c (feholdexcept): Really disable all

Modified: fsf/glibc-2_12-branch/libc/elf/dl-runtime.c
==============================================================================
--- fsf/glibc-2_12-branch/libc/elf/dl-runtime.c (original)
+++ fsf/glibc-2_12-branch/libc/elf/dl-runtime.c Wed Jun  2 00:06:36 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/glibc-2_12-branch/libc/sunrpc/clnt_tcp.c
==============================================================================
--- fsf/glibc-2_12-branch/libc/sunrpc/clnt_tcp.c (original)
+++ fsf/glibc-2_12-branch/libc/sunrpc/clnt_tcp.c Wed Jun  2 00:06:36 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/glibc-2_12-branch/libc/sunrpc/clnt_udp.c
==============================================================================
--- fsf/glibc-2_12-branch/libc/sunrpc/clnt_udp.c (original)
+++ fsf/glibc-2_12-branch/libc/sunrpc/clnt_udp.c Wed Jun  2 00:06:36 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/glibc-2_12-branch/libc/sunrpc/clnt_unix.c
==============================================================================
--- fsf/glibc-2_12-branch/libc/sunrpc/clnt_unix.c (original)
+++ fsf/glibc-2_12-branch/libc/sunrpc/clnt_unix.c Wed Jun  2 00:06:36 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/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/Makefile
==============================================================================
--- fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/Makefile (original)
+++ fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/Makefile Wed Jun  2 00:06:36 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/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/internal_recvmmsg.S
==============================================================================
--- fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/internal_recvmmsg.S (added)
+++ fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/internal_recvmmsg.S Wed Jun  2 00:06:36 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/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/kernel-features.h
==============================================================================
--- fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/kernel-features.h (original)
+++ fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/kernel-features.h Wed Jun  2 00:06:36 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/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/recvmmsg.c
==============================================================================
--- fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/recvmmsg.c (added)
+++ fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/recvmmsg.c Wed Jun  2 00:06:36 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/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
==============================================================================
--- fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h (original)
+++ fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h Wed Jun  2 00:06:36 2010
@@ -1,5 +1,5 @@
 /* Dump registers.
-   Copyright (C) 1999, 2000, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 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
@@ -58,7 +58,7 @@
 {
   char regs[22][8];
   char fpregs[34][8];
-  struct iovec iov[112];
+  struct iovec iov[22 * 2 + 34 * 2 + 2];
   size_t nr = 0;
 
 #define ADD_STRING(str) \

Modified: fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/socketcall.h
==============================================================================
--- fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/socketcall.h (original)
+++ fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/socketcall.h Wed Jun  2 00:06:36 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/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/sys/timex.h
==============================================================================
--- fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/sys/timex.h (original)
+++ fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/sys/timex.h Wed Jun  2 00:06:36 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/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/syscalls.list
==============================================================================
--- fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/syscalls.list (original)
+++ fsf/glibc-2_12-branch/libc/sysdeps/unix/sysv/linux/syscalls.list Wed Jun  2 00:06:36 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

Modified: fsf/glibc-2_12-branch/libc/sysdeps/x86_64/multiarch/init-arch.c
==============================================================================
--- fsf/glibc-2_12-branch/libc/sysdeps/x86_64/multiarch/init-arch.c (original)
+++ fsf/glibc-2_12-branch/libc/sysdeps/x86_64/multiarch/init-arch.c Wed Jun  2 00:06:36 2010
@@ -62,15 +62,15 @@
       unsigned int eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax;
       unsigned int extended_family = (eax >> 20) & 0xff;
       unsigned int extended_model = (eax >> 12) & 0xf0;
-      if (__cpu_features.family == 0x0f)
+      if (family == 0x0f)
 	{
 	  family += extended_family;
 	  model += extended_model;
 	}
-      else if (__cpu_features.family == 0x06)
+      else if (family == 0x06)
 	{
 	  model += extended_model;
-	  switch (__cpu_features.model)
+	  switch (model)
 	    {
 	    case 0x1a:
 	    case 0x1e: