aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-08-13 18:47:42 +0000
committerUlrich Drepper <drepper@redhat.com>2007-08-13 18:47:42 +0000
commit9c6f6953fda96b49c8510a879304ea4222ea1781 (patch)
treec169827926668d35139d9d1bbe26db86c17f8e6d /sysdeps/unix
parentf8de5057b9ded1d4ff41d8614530a83ba338c9e8 (diff)
downloadglibc-9c6f6953fda96b49c8510a879304ea4222ea1781.zip
glibc-9c6f6953fda96b49c8510a879304ea4222ea1781.tar.gz
glibc-9c6f6953fda96b49c8510a879304ea4222ea1781.tar.bz2
* sysdeps/unix/sysv/linux/x86_64/libc-start.c
(_libc_vdso_platform_setup): If vDSO is not available point __vdso_gettimeofday to the vsyscall. * sysdeps/unix/sysv/linux/x86_64/gettimeofday.S [SHARED]: Use __vdso_gettimeofday instead of vsyscall.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/gettimeofday.S7
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/libc-start.c4
2 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S
index 84a99b0..f618e73 100644
--- a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S
+++ b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,7 +28,12 @@ ENTRY (__gettimeofday)
/* Align stack. */
sub $0x8, %rsp
cfi_adjust_cfa_offset(8)
+#ifdef SHARED
+ movq __vdso_gettimeofday(%rip), %rax
+ PTR_DEMANGLE (%rax)
+#else
movq $VSYSCALL_ADDR_vgettimeofday, %rax
+#endif
callq *%rax
/* Check error return. */
cmpl $-4095, %eax
diff --git a/sysdeps/unix/sysv/linux/x86_64/libc-start.c b/sysdeps/unix/sysv/linux/x86_64/libc-start.c
index 0ce4795..dea2e8a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/libc-start.c
+++ b/sysdeps/unix/sysv/linux/x86_64/libc-start.c
@@ -31,6 +31,10 @@ _libc_vdso_platform_setup (void)
PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
void *p = _dl_vdso_vsym ("gettimeofday", &linux26);
+ /* If the vDSO is not available we fall back on the old vsyscall. */
+#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000ul
+ if (p == NULL)
+ p = (void *) VSYSCALL_ADDR_vgettimeofday;
PTR_MANGLE (p);
__vdso_gettimeofday = p;