1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

Enable VDSO on x86_64 statically linked programs [BZ #19767]

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.

	[BZ #19767]
	* nptl/Makefile (tests-static): Add tst-cond11-static.
	(tests): Likewise.
	* nptl/tst-cond11-static.c: New File.
	* sysdeps/unix/sysv/linux/Makefile (tests-static): Add
	tst-affinity-static.
	(tests): Likewise.
	* sysdeps/unix/sysv/linux/sysdep-vdso.h: Check USE_VSYSCALL
	instead of SHARED.
	* sysdeps/unix/sysv/linux/sysdep.h (ALWAYS_USE_VSYSCALL): New.
	(USE_VSYSCALL): Likewise.
	* sysdeps/unix/sysv/linux/tst-affinity-static.c: New file.
	* sysdeps/unix/sysv/linux/x86/libc-vdso.h: Check USE_VSYSCALL
	instead of SHARED.
	* sysdeps/unix/sysv/linux/x86_64/init-first.c: Don't check
	SHARED.
	* sysdeps/unix/sysv/linux/x86_64/sysdep.h (ALWAYS_USE_VSYSCALL):
	New.
This commit is contained in:
Rafael Ávila de Espíndola
2018-11-23 15:34:15 -08:00
committed by H.J. Lu
parent 1283c478aa
commit 1e8bdc3a2b
10 changed files with 47 additions and 12 deletions

View File

@ -18,6 +18,13 @@
#include <bits/wordsize.h>
#include <kernel-features.h>
/* By default only shared builds use vdso. */
#ifndef ALWAYS_USE_VSYSCALL
#define ALWAYS_USE_VSYSCALL 0
#endif
#define USE_VSYSCALL (defined (SHARED) || ALWAYS_USE_VSYSCALL)
/* Set error number and return -1. A target may choose to return the
internal function, __syscall_error, which sets errno and returns -1.
We use -1l, instead of -1, so that it can be casted to (void *). */