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

r5908 - in glibc-package/branches/eglibc-2.18/debian: . patches patches/powerpc



Author: adconrad
Date: 2014-01-10 17:50:59 +0000 (Fri, 10 Jan 2014)
New Revision: 5908

Added:
   glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-32.diff
   glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-vdso.diff
Modified:
   glibc-package/branches/eglibc-2.18/debian/changelog
   glibc-package/branches/eglibc-2.18/debian/patches/series
Log:
* debian/patches/powerpc/submitted-gettimeofday-vdso.diff: New diff from
  Adhemerval Zanella at IBM to fix gettimeofday vDSO/IFUNC interactions.
* debian/patches/powerpc/submitted-gettimeofday-32.diff: Pull patch from
  Adhemerval Zanella at IBM to fix 32-bit gettimeofday VSYSCALL lookups.

Modified: glibc-package/branches/eglibc-2.18/debian/changelog
===================================================================
--- glibc-package/branches/eglibc-2.18/debian/changelog	2014-01-10 17:43:01 UTC (rev 5907)
+++ glibc-package/branches/eglibc-2.18/debian/changelog	2014-01-10 17:50:59 UTC (rev 5908)
@@ -12,6 +12,10 @@
     to ptrace_peeksiginfo_args struct to prevent namespace clash w/ linux.
   * debian/patches/powerpc/cvs-ppc64-vdso-ifunc.diff: Pull upstream fix to
     squash undefined behaviour in PowerPC64 vDSO IFUNC symbol resolutions.
+  * debian/patches/powerpc/submitted-gettimeofday-vdso.diff: New diff from
+    Adhemerval Zanella at IBM to fix gettimeofday vDSO/IFUNC interactions.
+  * debian/patches/powerpc/submitted-gettimeofday-32.diff: Pull patch from
+    Adhemerval Zanella at IBM to fix 32-bit gettimeofday VSYSCALL lookups.
 
   [ Aurelien Jarno ]
   * debian/patches/any/cvs-vfscanf-0e+0.diff: new patch from upstream to

Added: glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-32.diff
===================================================================
--- glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-32.diff	                        (rev 0)
+++ glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-32.diff	2014-01-10 17:50:59 UTC (rev 5908)
@@ -0,0 +1,41 @@
+From 2d3f338fde5f73f42fce8f2167b15f9f4bd7e3a2 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+Date: Fri, 10 Jan 2014 10:28:42 -0600
+Subject: [PATCH 2/2] PowerPC: Fix gettimeofday internal call
+
+This patch fixes GLIBC internal call of gettimeofday for PPC32. The
+ppc32 build does not generate PLT calls for internal symbols, so
+__gettimeofday calls end up being calling the IFUNC resolver instead
+of the resolved symbol. This patches its behaviour by setting internal
+call to internal function that correctly calls gettimeofday functions.
+---
+ sysdeps/unix/sysv/linux/powerpc/gettimeofday.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+index a90fd3e..802a43c 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
++++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+@@ -49,8 +49,18 @@ asm (".type __gettimeofday, %gnu_indirect_function");
+ /* This is doing "libc_hidden_def (__gettimeofday)" but the compiler won't
+    let us do it in C because it doesn't know we're defining __gettimeofday
+    here in this file.  */
+-asm (".globl __GI___gettimeofday\n"
+-     "__GI___gettimeofday = __gettimeofday");
++asm (".globl __GI___gettimeofday");
++
++#ifdef __powerpc64__
++asm ("__GI___gettimeofday = __gettimeofday");
++#else
++int
++__gettimeofday_vsyscall (struct timeval *tv, struct timezone *tz)
++{
++  return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
++}
++asm ("__GI___gettimeofday = __gettimeofday_vsyscall");
++#endif
+ 
+ #else
+ 
+-- 
+1.8.4

Added: glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-vdso.diff
===================================================================
--- glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-vdso.diff	                        (rev 0)
+++ glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-vdso.diff	2014-01-10 17:50:59 UTC (rev 5908)
@@ -0,0 +1,35 @@
+From de4acf65123639ced1d18bc1c40fb6968d2b9917 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+Date: Fri, 10 Jan 2014 07:28:38 -0600
+Subject: [PATCH 1/2] PowerPC: Fix gettimeofday ifunc selection
+
+The IFUNC selector for gettimeofday runs before _libc_vdso_platform_setup where
+__vdso_gettimeofday is set. The selector then sets __gettimeofday (the internal
+version used within GLIBC) to use the system call version instead of the vDSO one.
+This patch changes the check if vDSO is available to get its value directly
+instead of rely on __vdso_gettimeofday value.
+---
+ sysdeps/unix/sysv/linux/powerpc/gettimeofday.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+index 29a5e08..a90fd3e 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
++++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+@@ -35,8 +35,13 @@ __gettimeofday_syscall (struct timeval *tv, struct timezone *tz)
+ void *
+ gettimeofday_ifunc (void)
+ {
++  void *vdso_gettimeofday;
++
++  PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565);
++
+   /* If the vDSO is not available we fall back syscall.  */
+-  return (__vdso_gettimeofday ? VDSO_IFUNC_RET (__vdso_gettimeofday)
++  vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615);
++  return (vdso_gettimeofday ? VDSO_IFUNC_RET (vdso_gettimeofday)
+ 	  : __gettimeofday_syscall);
+ }
+ asm (".type __gettimeofday, %gnu_indirect_function");
+-- 
+1.8.4

Modified: glibc-package/branches/eglibc-2.18/debian/patches/series
===================================================================
--- glibc-package/branches/eglibc-2.18/debian/patches/series	2014-01-10 17:43:01 UTC (rev 5907)
+++ glibc-package/branches/eglibc-2.18/debian/patches/series	2014-01-10 17:50:59 UTC (rev 5908)
@@ -179,6 +179,8 @@
 
 powerpc/local-math-logb.diff
 powerpc/cvs-ppc64-vdso-ifunc.diff
+powerpc/submitted-gettimeofday-vdso.diff
+powerpc/submitted-gettimeofday-32.diff
 
 s390/submitted-nexttowardf.diff
 s390/cvs-s390-tls-got-pointer.diff


Reply to: