From f1c2bb8b9964ed31de988910f8b1cfb586d30091 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Mon, 25 Jul 2011 17:12:54 -0700 Subject: um: implement a x86_64 vDSO Until now UML had no x86_64 vDSO. So glibc always used the vsyscall page for gettimeday() and friends. Calls to gettimeday() returned falsely the host time and confused some programs. This patch adds a vDSO which turns all __vdso_* calls into a system call so that UML can trap them. As glibc still uses the vsyscall page for static binaries this patch improves the situation only for dynamic binaries. Signed-off-by: Richard Weinberger Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/sys-x86_64/vdso/vdso.lds.S | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 arch/um/sys-x86_64/vdso/vdso.lds.S (limited to 'arch/um/sys-x86_64/vdso/vdso.lds.S') diff --git a/arch/um/sys-x86_64/vdso/vdso.lds.S b/arch/um/sys-x86_64/vdso/vdso.lds.S new file mode 100644 index 000000000000..b96b2677cad8 --- /dev/null +++ b/arch/um/sys-x86_64/vdso/vdso.lds.S @@ -0,0 +1,32 @@ +/* + * Linker script for 64-bit vDSO. + * We #include the file to define the layout details. + * Here we only choose the prelinked virtual address. + * + * This file defines the version script giving the user-exported symbols in + * the DSO. We can define local symbols here called VDSO* to make their + * values visible using the asm-x86/vdso.h macros from the kernel proper. + */ + +#define VDSO_PRELINK 0xffffffffff700000 +#include "vdso-layout.lds.S" + +/* + * This controls what userland symbols we export from the vDSO. + */ +VERSION { + LINUX_2.6 { + global: + clock_gettime; + __vdso_clock_gettime; + gettimeofday; + __vdso_gettimeofday; + getcpu; + __vdso_getcpu; + time; + __vdso_time; + local: *; + }; +} + +VDSO64_PRELINK = VDSO_PRELINK; -- cgit v1.2.3