]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
PowerPC: Fix gettimeofday ifunc selection
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Thu, 23 Jan 2014 17:07:47 +0000 (11:07 -0600)
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Thu, 23 Jan 2014 17:07:47 +0000 (11:07 -0600)
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.

This patch changes it by getting the vDSO value directly.

It fixes BZ#16431.

ChangeLog
NEWS
sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
sysdeps/unix/sysv/linux/powerpc/time.c

index 47607ed5dcc680c17ec0bd4ea879c7213b0bcc89..ac1a76a1e2b0e619a8952c21f321f6ccbec1c2fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-01-23  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+       [BZ#16431]
+       * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (__gettimeofday):
+       Adjust the vDSO correctly for internal calls.
+       * sysdeps/unix/sysv/linux/powerpc/time.c (time): Likewise.
+
 2014-01-23  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
        [BZ #16414]
diff --git a/NEWS b/NEWS
index 4190e85d7c645bf5f5b095f79cc78299b332d04d..5c2f07ac0672e45b64e9f69a2061c6a94d3714ba 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,7 +11,7 @@ Version 2.18.1
 
   14143, 14155, 14547, 14699, 15532, 15427, 15522, 15680, 15723, 15734,
   15735, 15797, 15892, 15895, 15909, 15917, 15996, 16072, 16150, 16414,
-  16430.
+  16430, 16431.
 
 * Support for powerpc64le has been added.
 
index 3ee063dba66b40e17c1259eb5ce963ec5e49394f..03138741f92221b84121a01ecd8acd2944252adb 100644 (file)
@@ -35,9 +35,12 @@ __gettimeofday_syscall (struct timeval *tv, struct timezone *tz)
 void *
 gettimeofday_ifunc (void)
 {
+  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)
-         : __gettimeofday_syscall);
+  void *vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615);
+  return (vdso_gettimeofday ? VDSO_IFUNC_RET (vdso_gettimeofday)
+         : (void*)__gettimeofday_syscall);
 }
 asm (".type __gettimeofday, %gnu_indirect_function");
 
index 85cc20e6e05277a476e1574c93d990c015b6a93e..cd40a29479c11917b75c09c87537e9aac89c55f3 100644 (file)
@@ -45,9 +45,12 @@ time_syscall (time_t *t)
 void *
 time_ifunc (void)
 {
+  PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565);
+
   /* If the vDSO is not available we fall back to the syscall.  */
-  return (__vdso_time ? VDSO_IFUNC_RET (__vdso_time)
-         : time_syscall);
+  void *vdso_time = _dl_vdso_vsym ("__kernel_time", &linux2615);
+  return (vdso_time ? VDSO_IFUNC_RET (vdso_time)
+         : (void*)time_syscall);
 }
 asm (".type time, %gnu_indirect_function");