The PowerPC gettimeofday implementation (sysdeps/unix/sysv/linux/powerpc/gettimeofday.c) relies on IFUNC selection to use the vDSO implementation (if it is provided by kernel) or a fallback symbol that uses a system call. 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. Although this does not lead to wrong behavior, a possible performance leverage would be to change the way IFUNC resolver get the vDSO to call _dl_vdso_vsym directly instead of relying in __vdso_gettimeofday value (much like as x86_64 does).
An fix for this issue: 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");
*** Bug 16257 has been marked as a duplicate of this bug. ***
In fact I think Bug 16257 is a duplicate of Bug 16430 instead. And I'm currently working with Alan Modra to determine if this is a binutils bug or an expected behavior.
Fixed by d98720e07f67fbeec00f9e1347840404240d3c48.