From patchwork Wed Sep 5 02:04:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rafael Avila de Espindola X-Patchwork-Id: 29195 Received: (qmail 103208 invoked by alias); 5 Sep 2018 02:04:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 103179 invoked by uid 89); 5 Sep 2018 02:04:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail4.protonmail.ch Date: Wed, 05 Sep 2018 02:04:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=espindo.la; s=protonmail; t=1536113044; bh=uWwo5B3ZXKiVFjgn1CyfWNsdC97jwqb1MNycb3B7k6w=; h=Date:To:From:Reply-To:Subject:Feedback-ID:From; b=ODPKrnlvh6HOlDZCpan48/xhBwFwxrJshHtkPh1GWYDdj1aUhtTOMHCvXFxICDDkO WKVfVMSpSfO0lM3kuizSFVa2IFORxuY7Wx4+0hZLYm8KaZV5qbCXSp9Rvy0ADlCrXb DHzMOg+eHmBhBE8XlT2fKmbW3BWXeq1minvwTMcA= To: libc-alpha@sourceware.org From: Rafael Avila de Espindola Reply-To: Rafael Avila de Espindola Subject: [PATCH] Enable VDSO on statically linked programs. Message-ID: MIME-Version: 1.0 All the required code already existed, and some of it was already running. AT_SYSINFO_EHDR is processed if NEED_DL_SYSINFO_DSO is defined, but it looks like it always is. The call to setup_vdso is also unconditional, so all that was left to do was setup the function pointers and use them. This patch just deletes some #ifdef to enable that. --- Any ideas on how to test this would be appreciated. Locally I have used strace to check that the vdso is used, but it is not clear if I can use strace in an automated test. Is the copyright paperwork required when deleting code? :-) 2018-09-04 Rafael Ávila de Espíndola * sysdeps/unix/sysv/linux/sysdep-vdso.h: remove #ifdef SHARED. * sysdeps/unix/sysv/linux/x86/libc-vdso.h: remove #ifdef SHARED. * sysdeps/unix/sysv/linux/x86_64/init-first.c: remove #ifdef SHARED. sysdeps/unix/sysv/linux/sysdep-vdso.h | 11 ----------- sysdeps/unix/sysv/linux/x86/libc-vdso.h | 4 ---- sysdeps/unix/sysv/linux/x86_64/init-first.c | 2 -- 3 files changed, 17 deletions(-) diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h index 1912c1c156..6736752de6 100644 --- a/sysdeps/unix/sysv/linux/sysdep-vdso.h +++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h @@ -26,8 +26,6 @@ funcptr (args) #endif -#ifdef SHARED - # ifdef HAVE_VSYSCALL # include @@ -86,13 +84,4 @@ INTERNAL_SYSCALL (name, err, nr, ##args) # endif /* HAVE_VSYSCALL */ -# else /* SHARED */ - -# define INLINE_VSYSCALL(name, nr, args...) \ - INLINE_SYSCALL (name, nr, ##args) -# define INTERNAL_VSYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL (name, err, nr, ##args) - -#endif /* SHARED */ - #endif /* SYSDEP_VDSO_LINUX_H */ diff --git a/sysdeps/unix/sysv/linux/x86/libc-vdso.h b/sysdeps/unix/sysv/linux/x86/libc-vdso.h index 6f86073dae..669561166f 100644 --- a/sysdeps/unix/sysv/linux/x86/libc-vdso.h +++ b/sysdeps/unix/sysv/linux/x86/libc-vdso.h @@ -22,8 +22,6 @@ #include #include -#ifdef SHARED - # include extern long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *) @@ -32,6 +30,4 @@ extern long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *) extern long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *) attribute_hidden; -#endif - #endif /* _LIBC_VDSO_H */ diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c index 2320505804..57d4f9838e 100644 --- a/sysdeps/unix/sysv/linux/x86_64/init-first.c +++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see . */ -#ifdef SHARED # include # include # include @@ -47,6 +46,5 @@ __vdso_platform_setup (void) } # define VDSO_SETUP __vdso_platform_setup -#endif #include