summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc/time.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-01-20 12:29:51 -0600
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-01-20 12:29:51 -0600
commitd98720e07f67fbeec00f9e1347840404240d3c48 (patch)
tree91a4f5a45e3144043e4ef0954084a0f1d6810d8b /sysdeps/unix/sysv/linux/powerpc/time.c
parent2bc52556b71ac068774366e08085e30c960d3c93 (diff)
downloadglibc-d98720e07f67fbeec00f9e1347840404240d3c48.tar.gz
glibc-d98720e07f67fbeec00f9e1347840404240d3c48.tar.xz
glibc-d98720e07f67fbeec00f9e1347840404240d3c48.zip
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.

This patch changes it by getting the vDSO value directly.

It fixes BZ#16431.
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/time.c')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/time.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c
index 023bc026be..9f54d97246 100644
--- a/sysdeps/unix/sysv/linux/powerpc/time.c
+++ b/sysdeps/unix/sysv/linux/powerpc/time.c
@@ -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");