Re: [PATCH 1/7] x86/vdso: Respect COMPAT_32BIT_TIME

H. Peter Anvin
2026-03-05T23:58:49Z

On 2026-03-05 01:24, Thomas Weißschuh wrote:
>
>> Weak references would be a way to work around the link failures.
>
> I am still not sure where "the link failures" should be coming from.
> The only sense I can make out of it, is if somebody manually and directly links
> to vdso.so. Like in the following example:
>
> $ cat test.c
> #include <stdio.h>
>
> #include <linux/time.h>
>
> int __vdso_clock_gettime(__kernel_clockid_t clock, struct __kernel_timespec *ts);
>
> int main(void)
> {
> struct __kernel_timespec ts;
> int ret;
>
> printf("__vdso_clock_gettime=%p\n", __vdso_clock_gettime);
>
> ret = __vdso_clock_gettime(CLOCK_REALTIME, &ts);
> printf("ret=%d\n", ret);
> }
> $ gcc test.c /lib/modules/$(uname -r)/vdso/vdso64.so
> $ ./a.out
> __vdso_clock_gettime=0x7ff6ba2eeb80
> ret=0
>
> This actually works on glibc (not on musl). But it is highly non-standard and
> relies on multiple implementation details. Furthermore it can fail to run on
> systems without a vDSO, as mentioned before.
>
> Is this the usage pattern you have in mind?
> Do you know of anybody doing things this way?
>

Yes, and yes, I do.

-hpa