This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.13-229-gc738465
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 28 May 2011 05:53:51 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.13-229-gc738465
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via c738465a4c13370f58b797a82cdf1c67e1121867 (commit)
from f1f929d74a08d6f973cec20e311401586f408d35 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c738465a4c13370f58b797a82cdf1c67e1121867
commit c738465a4c13370f58b797a82cdf1c67e1121867
Author: Ulrich Drepper <drepper@gmail.com>
Date: Sat May 28 01:53:26 2011 -0400
Add support for time syscall in vDSO
diff --git a/ChangeLog b/ChangeLog
index 1f474df..188fc90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2011-05-28 Ulrich Drepper <drepper@gmail.com>
+ [BZ #12813]
+ * sysdeps/unix/sysv/linux/x86_64/init-first.c (__vdso_time): Retrieve
+ time symbol from vDSO. Substitute with vsyscall if not available.
+ * sysdeps/unix/sysv/linux/x86_64/time.S [SHARED]: Use
+ __vdso_time.
+
* sysdeps/unix/sysv/linux/internal_sendmmsg.S: New file.
* sysdeps/unix/sysv/linux/sendmmsg.c: New file.
* sysdeps/unix/sysv/linux/Makefile [subdir=socket] (sysdep_routines):
diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
index 23934fc..e676f62 100644
--- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -28,6 +28,8 @@ strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden)
long int (*__vdso_getcpu) (unsigned *, unsigned *, void *);
+long int (*__vdso_time) (time_t *) attribute_hidden;
+
static inline void
_libc_vdso_platform_setup (void)
@@ -53,6 +55,14 @@ _libc_vdso_platform_setup (void)
p = (void *) VSYSCALL_ADDR_vgetcpu;
PTR_MANGLE (p);
__vdso_getcpu = p;
+
+ p = _dl_vdso_vsym ("time", &linux26);
+ /* If the vDSO is not available we fall back on the old vsyscall. */
+#define VSYSCALL_ADDR_vtime 0xffffffffff600400
+ if (p == NULL)
+ p = (void *) VSYSCALL_ADDR_vtime;
+ PTR_MANGLE (p);
+ __vdso_time = p;
}
# define VDSO_SETUP _libc_vdso_platform_setup
diff --git a/sysdeps/unix/sysv/linux/x86_64/time.S b/sysdeps/unix/sysv/linux/x86_64/time.S
index e3f3268..66d7498 100644
--- a/sysdeps/unix/sysv/linux/x86_64/time.S
+++ b/sysdeps/unix/sysv/linux/x86_64/time.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,02, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2001,02, 2003, 2011 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
@@ -32,7 +32,12 @@ ENTRY (time)
sub $0x8, %rsp
cfi_adjust_cfa_offset(8)
+#ifdef SHARED
+ movq __vdso_time(%rip), %rax
+ PTR_DEMANGLE (%rax)
+#else
movq $VSYSCALL_ADDR_vtime, %rax
+#endif
callq *%rax
add $0x8, %rsp
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
sysdeps/unix/sysv/linux/x86_64/init-first.c | 10 ++++++++++
sysdeps/unix/sysv/linux/x86_64/time.S | 7 ++++++-
3 files changed, 22 insertions(+), 1 deletions(-)
hooks/post-receive
--
GNU C Library master sources