1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

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.
This commit is contained in:
Adhemerval Zanella
2014-01-20 12:29:51 -06:00
parent 2bc52556b7
commit d98720e07f
4 changed files with 18 additions and 5 deletions

View 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");