Blame SOURCES/glibc-rh1077389-p2.patch

147e83
#
147e83
# commit d98720e07f67fbeec00f9e1347840404240d3c48
147e83
# Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
147e83
# Date:   Mon Jan 20 12:29:51 2014 -0600
147e83
# 
147e83
#     PowerPC: Fix gettimeofday ifunc selection
147e83
#     
147e83
#     The IFUNC selector for gettimeofday runs before _libc_vdso_platform_setup where
147e83
#     __vdso_gettimeofday is set. The selector then sets __gettimeofday (the internal
147e83
#     version used within GLIBC) to use the system call version instead of the vDSO one.
147e83
#     This patch changes the check if vDSO is available to get its value directly
147e83
#     instead of rely on __vdso_gettimeofday.
147e83
#     
147e83
#     This patch changes it by getting the vDSO value directly.
147e83
#     
147e83
#     It fixes BZ#16431.
147e83
# 
147e83
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
147e83
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c	2015-01-15 16:07:59.167420456 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c	2015-01-15 16:07:41.408969001 -0500
147e83
@@ -34,9 +34,12 @@
147e83
 void *
147e83
 gettimeofday_ifunc (void)
147e83
 {
147e83
+  PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565);
147e83
+
147e83
   /* If the vDSO is not available we fall back syscall.  */
147e83
-  return (__vdso_gettimeofday ? VDSO_IFUNC_RET (__vdso_gettimeofday)
147e83
-	  : __gettimeofday_syscall);
147e83
+  void *vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615);
147e83
+  return (vdso_gettimeofday ? VDSO_IFUNC_RET (vdso_gettimeofday)
147e83
+	  : (void*)__gettimeofday_syscall);
147e83
 }
147e83
 asm (".type __gettimeofday, %gnu_indirect_function");
147e83
 
147e83
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c
147e83
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c	2015-01-15 16:07:59.168420425 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c	2015-01-15 16:07:41.408969001 -0500
147e83
@@ -45,9 +45,12 @@
147e83
 void *
147e83
 time_ifunc (void)
147e83
 {
147e83
+  PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565);
147e83
+
147e83
   /* If the vDSO is not available we fall back to the syscall.  */
147e83
-  return (__vdso_time ? VDSO_IFUNC_RET (__vdso_time)
147e83
-	  : time_syscall);
147e83
+  void *vdso_time = _dl_vdso_vsym ("__kernel_time", &linux2615);
147e83
+  return (vdso_time ? VDSO_IFUNC_RET (vdso_time)
147e83
+	  : (void*)time_syscall);
147e83
 }
147e83
 asm (".type time, %gnu_indirect_function");
147e83