]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
linux: Use GLRO(dl_vdso_gettimeofday) on gettimeofday
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 4 Sep 2024 13:10:31 +0000 (10:10 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 8 Oct 2024 16:28:21 +0000 (13:28 -0300)
The BZ#24967 fix (1bdda52fe92fd01b424c) missed the gettimeofday for
architectures that define USE_IFUNC_GETTIMEOFDAY.  Although it is not
an issue, since there is no pointer mangling, there is also no need
to call dl_vdso_vsym since the vDSO setup was already done by the
loader.

Checked on x86_64-linux-gnu and i686-linux-gnu.

sysdeps/unix/sysv/linux/gettimeofday.c

index 7ab147c6143a63cd0f358c2058f4efaa9de13ca1..5ca89166110a1ef6bf80ce35a7764791f7591f01 100644 (file)
@@ -37,11 +37,11 @@ __gettimeofday_syscall (struct timeval *restrict tv, void *restrict tz)
 }
 
 # undef INIT_ARCH
-# define INIT_ARCH() \
-  void *vdso_gettimeofday = dl_vdso_vsym (HAVE_GETTIMEOFDAY_VSYSCALL)
+# define INIT_ARCH()
 libc_ifunc (__gettimeofday,
-           vdso_gettimeofday ? VDSO_IFUNC_RET (vdso_gettimeofday)
-                             : (void *) __gettimeofday_syscall)
+           GLRO(dl_vdso_gettimeofday) != NULL
+           ? VDSO_IFUNC_RET (GLRO(dl_vdso_gettimeofday))
+           : (void *) __gettimeofday_syscall)
 
 # else
 int