aarch64: Use an ifunc/VDSO to implement gettimeofday in shared glibc.
commit3c7b9f1fc37c8a639df7406af100a2d389ff843a
authorSteve Ellcey <sellcey@caviumnetworks.com>
Thu, 14 Jun 2018 07:18:42 +0000 (14 08:18 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 14 Jun 2018 12:56:57 +0000 (14 13:56 +0100)
tree035e75bf0b4bc3e0e871959e731df2a5628dfc1d
parentc59ee916a66299f23d81568c77d7af3be17d4b6c
aarch64: Use an ifunc/VDSO to implement gettimeofday in shared glibc.

This patch uses an ifunc to implement gettimeofday in the shared libc.
This is faster compared to the vsyscall mechanism that has to check a
global pointer, demangle it and call it indirectly when the VDSO is
present. Resolving the gettimeofday symbol directly to the VDSO code
is safe because there are no failures that the libc has to handle by
setting errno like in a generic vsyscall (the only failure when the
VDSO code falls back to a syscall is EFAULT, but passing an invalid
pointer is undefined behaviour so returning -EFAULT is fine).

If the kernel supports the VDSO interface we use it for extern calls,
otherwise the old vsyscall method is used which falls back to a syscall.
The static version of gettimeofday continues to use a syscall, libc.so
internal calls use the old vsyscall method.

* sysdeps/unix/sysv/linux/aarch64/gettimeofday.c: New file.
ChangeLog
sysdeps/unix/sysv/linux/aarch64/gettimeofday.c [new file with mode: 0644]