diff mbox series

[v2] linux: Use GLRO(dl_vdso_time) on time

Message ID 20240905134922.2463750-1-adhemerval.zanella@linaro.org
State Accepted
Commit 55d33108c72c9b3e231b83a55e16a9ba1190c768
Headers show
Series [v2] linux: Use GLRO(dl_vdso_time) on time | expand

Commit Message

Adhemerval Zanella Sept. 5, 2024, 1:49 p.m. UTC
The BZ#24967 fix (1bdda52fe92fd01b424c) missed the time for
architectures that define 1bdda52fe92fd01b424c.  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.
--
Change from v1:
* Fixed build on some architectures due a missing INIT_ARCH.
---
 sysdeps/unix/sysv/linux/time.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Florian Weimer Sept. 5, 2024, 2:27 p.m. UTC | #1
* Adhemerval Zanella:

> The BZ#24967 fix (1bdda52fe92fd01b424c) missed the time for
> architectures that define 1bdda52fe92fd01b424c.  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.

Typo is still there.

Thanks,
Florian
Adhemerval Zanella Oct. 2, 2024, 11:39 a.m. UTC | #2
On 05/09/24 11:27, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> The BZ#24967 fix (1bdda52fe92fd01b424c) missed the time for
>> architectures that define 1bdda52fe92fd01b424c.  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.
> 
> Typo is still there.

Are you ok with the typo fixed?
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/time.c b/sysdeps/unix/sysv/linux/time.c
index f8b0cee41c..50854e05e2 100644
--- a/sysdeps/unix/sysv/linux/time.c
+++ b/sysdeps/unix/sysv/linux/time.c
@@ -32,12 +32,10 @@  time_syscall (time_t *t)
   return INLINE_SYSCALL_CALL (time, t);
 }
 
-# undef INIT_ARCH
-# define INIT_ARCH() \
-  void *vdso_time = dl_vdso_vsym (HAVE_TIME_VSYSCALL);
+# define INIT_ARCH()
 libc_ifunc (time,
-	    vdso_time ? VDSO_IFUNC_RET (vdso_time)
-		      : (void *) time_syscall);
+	    GLRO(dl_vdso_time) != NULL ? VDSO_IFUNC_RET (GLRO(dl_vdso_time))
+				       : (void *) time_syscall);
 
 # else
 time_t