]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
s390: Enable VDSO for static linking
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 30 May 2019 11:04:06 +0000 (08:04 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 5 Aug 2019 19:38:22 +0000 (16:38 -0300)
Although s390 only enables vDSO for dynamically linked elf binaries
(arch/s390/kernel/vdso.c:217), there is no indication in the code or
associated commit message for why not enable it for statically linked
binaries as well.  To double check, I rebuilt a kernel with the
check removed and the vDSO does work for static build for supplied
symbols.

Checked on s390x-linux-gnu and s390-linux-gnu.

[BZ #19767]
* sysdeps/unix/sysv/linux/s390/init-first.c: Remove #ifdef SHARED.
* sysdeps/unix/sysv/linux/s390/libc-vdso.h: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
(ALWAYS_USE_VSYSCALL): Define.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
(ALWAYS_USE_VSYSCALL): Likewise.

ChangeLog
sysdeps/unix/sysv/linux/s390/init-first.c
sysdeps/unix/sysv/linux/s390/libc-vdso.h
sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h

index bd12f2d60a1fdc54ae320e3dc96c06f7baa1a56a..c9d7631962eb69617d21259f3f1a8aa89b3530e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2019-08-05  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+       [BZ #19767]
+       * sysdeps/unix/sysv/linux/s390/init-first.c: Remove #ifdef SHARED.
+       * sysdeps/unix/sysv/linux/s390/libc-vdso.h: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
+       (ALWAYS_USE_VSYSCALL): Define.
+       * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
+       (ALWAYS_USE_VSYSCALL): Likewise.
+
        [BZ #19767]
        * sysdeps/unix/sysv/linux/riscv/init-first.c: Remove #ifdef SHARED.
        * sysdeps/unix/sysv/linux/riscv/libc-vdso.h: Likewise.
index 1f46e8052a37421c84afca0d6a81dc05ac85aa40..8c54d13935e54b5d0360ad5e943390df8626d01a 100644 (file)
@@ -16,9 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifdef SHARED
-# include <dl-vdso.h>
-# include <libc-vdso.h>
+#include <dl-vdso.h>
+#include <libc-vdso.h>
 
 long int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
    attribute_hidden;
@@ -54,7 +53,4 @@ _libc_vdso_platform_setup (void)
   VDSO_SYMBOL (getcpu) = p;
 }
 
-# define VDSO_SETUP _libc_vdso_platform_setup
-#endif
-
 #include <csu/init-first.c>
index 5e2d1e4b3f20efa06f09992b078711cf4f65a4e8..cc97601383175624a7198561684b46f4d7499869 100644 (file)
@@ -20,8 +20,6 @@
 #ifndef _LIBC_VDSO_H
 #define _LIBC_VDSO_H
 
-#ifdef SHARED
-
 #include <sysdep-vdso.h>
 
 extern long int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
@@ -33,6 +31,5 @@ extern long int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);
 
 extern long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
    attribute_hidden;
-#endif
 
 #endif /* _LIBC_VDSO_H */
index 640fb52de19aef133399057f558a88bb8850726f..47d1c5cdb2e615c8bf7db5b56d9dc127b226ce67 100644 (file)
@@ -19,6 +19,9 @@
 #ifndef _LINUX_S390_SYSDEP_H
 #define _LINUX_S390_SYSDEP_H
 
+/* Always enable vsyscalls on s390-32.  */
+#define ALWAYS_USE_VSYSCALL 1
+
 #include <sysdeps/s390/s390-32/sysdep.h>
 #include <sysdeps/unix/sysdep.h>
 #include <sysdeps/unix/sysv/linux/sysdep.h>
index 9a9834c750f3bd8c3b761cd7918e15c1f1ae6901..2552aaa7111cac05bfaa13b3418bb25d5e7b5b73 100644 (file)
@@ -20,6 +20,9 @@
 #ifndef _LINUX_S390_SYSDEP_H
 #define _LINUX_S390_SYSDEP_H
 
+/* Always enable vsyscalls on s390-64.  */
+#define ALWAYS_USE_VSYSCALL 1
+
 #include <sysdeps/s390/s390-64/sysdep.h>
 #include <sysdeps/unix/sysdep.h>
 #include <sysdeps/unix/sysv/linux/sysdep.h>