This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 07/12] elf: Move vDSO setup to rtld (BZ#24967)


* Adhemerval Zanella:

> diff --git a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
> index 07d38466e2..6475840117 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
> @@ -38,12 +38,9 @@ __gettimeofday_vsyscall (struct timeval *restrict tv, void *restrict tz)
>  }
>  
>  #ifdef SHARED
> -# include <dl-vdso.h>
> -# include <sysdep-vdso.h>
> -
>  # define INIT_ARCH()
>  libc_ifunc (__gettimeofday,
> -	    (get_vdso_symbol (HAVE_GETTIMEOFDAY_VSYSCALL)
> +	    (GLRO(dl_vdso_gettimeofday)
>  	    ?: __gettimeofday_vsyscall))

This IFUNC resolver is still not valid because _rtld_global_ro has a
relocation dependency.

What we should do instead is to patch the vDSO function pointers (and
pretty much all shared variables, including the page size) into
libc.so.6 right after loading it (before relocation).  I had hoped to
post a patch for this, but the prerequisite

  <https://sourceware.org/ml/libc-alpha/2019-11/msg00977.html>

has not been reviewed.  It provides _dl_lookup_direct, which we could
use to get access to this global variables structure very efficiently.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]