diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2019-06-21 10:36:52 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-06-21 10:43:22 -0300 |
commit | 85c748f9ff3db4a7796472f90d4d80e9987b7922 (patch) | |
tree | 72c9e135c9667ca02fa73e96d59c66731cd8e906 | |
parent | ce5b73a7c3d8caefc72ac3b95490861e3ee13520 (diff) | |
download | glibc-85c748f9ff3db4a7796472f90d4d80e9987b7922.zip glibc-85c748f9ff3db4a7796472f90d4d80e9987b7922.tar.gz glibc-85c748f9ff3db4a7796472f90d4d80e9987b7922.tar.bz2 |
Add missing VDSO_{NAME,HASH}_* macros and use them for PREPARE_VERSION_KNOWN
Define all currently used Linux versions used for
PREPARE_VERSION{,_KNOWN} in sysdeps/unix/sysv/linux/dl-vdso.h and use
them instead of duplicating the versions and precomputed hashes across
architecture specific files.
* sysdeps/unix/sysv/linux/aarch64/gettimeofday.c (INIT_ARCH): Use
PREPARE_VERSION_KNOWN.
* sysdeps/unix/sysv/linux/aarch64/init-first.c: Likewise.
* sysdeps/unix/sysv/linux/dl-vdso.h (VDSO_NAME_LINUX_2_6_39): New
define.
(VDSO_HASH_LINUX_2_6_39): Likewise.
(VDSO_NAME_LINUX_4_9): Likewise.
(VDSO_HASH_LINUX_4_9): Likewise.
* sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (INIT_ARCH): Likewise.
* sysdeps/unix/sysv/linux/powerpc/init-first.c
(_libc_vdso_platform_setup): Likewise.
* sysdeps/unix/sysv/linux/powerpc/time.c (INIT_ARCH): Likewise.
* sysdeps/unix/sysv/linux/s390/init-first.c (_libc_vdso_platform_setup):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/init-first.c (__vdso_platform_setup):
Likewise.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/gettimeofday.c | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/init-first.c | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/dl-vdso.h | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/gettimeofday.c | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/init-first.c | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/time.c | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/init-first.c | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/init-first.c | 2 |
9 files changed, 34 insertions, 11 deletions
@@ -1,3 +1,22 @@ +2019-06-21 Tobias Klauser <tklauser@distanz.ch> + + * sysdeps/unix/sysv/linux/aarch64/gettimeofday.c (INIT_ARCH): Use + PREPARE_VERSION_KNOWN. + * sysdeps/unix/sysv/linux/aarch64/init-first.c: Likewise. + * sysdeps/unix/sysv/linux/dl-vdso.h (VDSO_NAME_LINUX_2_6_39): New + define. + (VDSO_HASH_LINUX_2_6_39): Likewise. + (VDSO_NAME_LINUX_4_9): Likewise. + (VDSO_HASH_LINUX_4_9): Likewise. + * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (INIT_ARCH): Likewise. + * sysdeps/unix/sysv/linux/powerpc/init-first.c + (_libc_vdso_platform_setup): Likewise. + * sysdeps/unix/sysv/linux/powerpc/time.c (INIT_ARCH): Likewise. + * sysdeps/unix/sysv/linux/s390/init-first.c (_libc_vdso_platform_setup): + Likewise. + * sysdeps/unix/sysv/linux/x86_64/init-first.c (__vdso_platform_setup): + Likewise. + 2019-06-20 Mike Crowe <mac@mcrowe.com> * nptl/eintr.c: Use libsupport. diff --git a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c index 6c008ed..9180b50 100644 --- a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c +++ b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c @@ -38,13 +38,13 @@ __gettimeofday_vsyscall (struct timeval *tv, struct timezone *tz) return INLINE_VSYSCALL (gettimeofday, 2, tv, tz); } -/* PREPARE_VERSION will need an __LP64__ ifdef when ILP32 support +/* PREPARE_VERSION_KNOWN will need an __LP64__ ifdef when ILP32 support goes in. See _libc_vdso_platform_setup in sysdeps/unix/sysv/linux/aarch64/init-first.c. */ # undef INIT_ARCH # define INIT_ARCH() \ - PREPARE_VERSION (linux_version, "LINUX_2.6.39", 123718537); \ + PREPARE_VERSION_KNOWN (linux_version, LINUX_2_6_39); \ void *vdso_gettimeofday = \ _dl_vdso_vsym ("__kernel_gettimeofday", &linux_version); diff --git a/sysdeps/unix/sysv/linux/aarch64/init-first.c b/sysdeps/unix/sysv/linux/aarch64/init-first.c index ce7319f..80f7ed9 100644 --- a/sysdeps/unix/sysv/linux/aarch64/init-first.c +++ b/sysdeps/unix/sysv/linux/aarch64/init-first.c @@ -27,9 +27,9 @@ static inline void _libc_vdso_platform_setup (void) { #ifdef __LP64__ - PREPARE_VERSION (linux_version, "LINUX_2.6.39", 123718537); + PREPARE_VERSION_KNOWN (linux_version, LINUX_2_6_39); #else - PREPARE_VERSION (linux_version, "LINUX_4.9", 61765625); + PREPARE_VERSION_KNOWN (linux_version, LINUX_4_9); #endif void *p = _dl_vdso_vsym ("__kernel_gettimeofday", &linux_version); diff --git a/sysdeps/unix/sysv/linux/dl-vdso.h b/sysdeps/unix/sysv/linux/dl-vdso.h index 50ee290..9e61ca7 100644 --- a/sysdeps/unix/sysv/linux/dl-vdso.h +++ b/sysdeps/unix/sysv/linux/dl-vdso.h @@ -44,6 +44,10 @@ #define VDSO_HASH_LINUX_2_6_15 123718565 #define VDSO_NAME_LINUX_2_6_29 "LINUX_2.6.29" #define VDSO_HASH_LINUX_2_6_29 123718585 +#define VDSO_NAME_LINUX_2_6_39 "LINUX_2.6.39" +#define VDSO_HASH_LINUX_2_6_39 123718537 +#define VDSO_NAME_LINUX_4_9 "LINUX_4.9" +#define VDSO_HASH_LINUX_4_9 61765625 #define VDSO_NAME_LINUX_4_15 "LINUX_4.15" #define VDSO_HASH_LINUX_4_15 182943605 diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c index c8d7790..463b678 100644 --- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c +++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c @@ -57,8 +57,8 @@ __gettimeofday_syscall (struct timeval *tv, struct timezone *tz) return INLINE_SYSCALL (gettimeofday, 2, tv, tz); } -# define INIT_ARCH() \ - PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565); \ +# define INIT_ARCH() \ + PREPARE_VERSION_KNOWN (linux2615, LINUX_2_6_15); \ void *vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615); /* If the vDSO is not available we fall back syscall. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/init-first.c b/sysdeps/unix/sysv/linux/powerpc/init-first.c index 237b5ab..831f910 100644 --- a/sysdeps/unix/sysv/linux/powerpc/init-first.c +++ b/sysdeps/unix/sysv/linux/powerpc/init-first.c @@ -37,7 +37,7 @@ void *VDSO_SYMBOL(sigtramp_rt32); static inline void _libc_vdso_platform_setup (void) { - PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565); + PREPARE_VERSION_KNOWN (linux2615, LINUX_2_6_15); void *p = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615); PTR_MANGLE (p); diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c index c2f171b..cb3e8b9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/time.c +++ b/sysdeps/unix/sysv/linux/powerpc/time.c @@ -66,8 +66,8 @@ time_syscall (time_t *t) return result; } -# define INIT_ARCH() \ - PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565); \ +# define INIT_ARCH() \ + PREPARE_VERSION_KNOWN (linux2615, LINUX_2_6_15); \ void *vdso_time = _dl_vdso_vsym ("__kernel_time", &linux2615); /* If the vDSO is not available we fall back to the syscall. */ diff --git a/sysdeps/unix/sysv/linux/s390/init-first.c b/sysdeps/unix/sysv/linux/s390/init-first.c index 71dd43f..1f46e80 100644 --- a/sysdeps/unix/sysv/linux/s390/init-first.c +++ b/sysdeps/unix/sysv/linux/s390/init-first.c @@ -35,7 +35,7 @@ long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *) static inline void _libc_vdso_platform_setup (void) { - PREPARE_VERSION (linux2629, "LINUX_2.6.29", 123718585); + PREPARE_VERSION_KNOWN (linux2629, LINUX_2_6_29); void *p = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2629); PTR_MANGLE (p); diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c index 6a347be..85333e5 100644 --- a/sysdeps/unix/sysv/linux/x86_64/init-first.c +++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c @@ -32,7 +32,7 @@ extern __typeof (clock_gettime) __syscall_clock_gettime attribute_hidden; static inline void __vdso_platform_setup (void) { - PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); + PREPARE_VERSION_KNOWN (linux26, LINUX_2_6); void *p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux26); if (p == NULL) |