[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r15229 - in /fsf/trunk/libc: ./ nptl/ nptl/sysdeps/unix/sysv/linux/x86_64/ sysdeps/i386/ sysdeps/i386/i686/multiarch/ sysdep...



Author: eglibc
Date: Wed Sep  7 00:02:29 2011
New Revision: 15229

Log:
Import glibc-mainline for 2011-09-07

Added:
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
    fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S
    fsf/trunk/libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S
    fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S
    fsf/trunk/libc/sysdeps/i386/sysdep.h
    fsf/trunk/libc/sysdeps/unix/clock_gettime.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/clock_gettime.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/getsysstats.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
    fsf/trunk/libc/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
    fsf/trunk/libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S
    fsf/trunk/libc/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S
    fsf/trunk/libc/sysdeps/x86_64/sysdep.h
    fsf/trunk/libc/sysdeps/x86_64/wcscmp.S

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Sep  7 00:02:29 2011
@@ -1,3 +1,40 @@
+2011-09-07  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/init-first.c
+	(_libc_vdso_platform_setup): If vDSO is not present store pointer to
+	syscall wrapper around clock_gettime in __vdso_clock_gettime.
+	* sysdeps/unix/sysv/linux/x86_64/syscalls.list: Add entry for
+	clock_gettime.
+
+2011-09-06  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/clock_gettime.c (INTERNAL_GETTIME):
+	Forgot to demangle the pointer.
+
+	* sysdeps/i386/sysdep.h: Define atom_text_section.
+	* sysdeps/x86_64/sysdep.h: Likewise.
+	* sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S: Place function in
+	section with atom_text_section.
+	* sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S: Likewise.
+	* sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S: Likewise.
+	* sysdeps/x86_64/multiarch/strlen-no-bsf.S: Likewise.
+	* sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S: Likewise.
+
+	* sysdeps/unix/sysv/linux/x86_64/clock_gettime.c: New file.
+	* sysdeps/unix/sysv/linux/clock_gettime.c (SYSCALL_GETTIME): Allow
+	already be defined.  Change to take two parameters and don't assign
+	result to variable.  Adjust all users.
+	Define INTERNAL_GETTIME if not already defined.
+	Use INTERNAL_GETTIME instead of INTERNAL_VSYSCALL got clock_gettime
+	call.
+	* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Don't define
+	HAVE_CLOCK_GETTIME_VSYSCALL.
+	* sysdeps/unix/clock_gettime.c: Adjust use of SYSDEP_GETTIME_CPU.
+
+	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Don't use
+	gettimeofday vsyscall, just use time.
+
 2011-09-06  Andreas Schwab  <schwab@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/x86_64/gettimeofday.c [!SHARED]: Include

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Wed Sep  7 00:02:29 2011
@@ -1,3 +1,16 @@
+2011-09-06  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait): Don't
+	use gettimeofday vsyscall, just call gettimeofday.
+	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
+	Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
+	Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
+	Simplify __vdso_clock_gettime use.
+
 2011-09-05  David S. Miller  <davem@xxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/sem_timedwait.c (do_futex_timed_wait):

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S Wed Sep  7 00:02:29 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -68,10 +68,6 @@
 #endif
 
 
-/* For the calculation see asm/vsyscall.h.  */
-#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000
-
-
 	.globl	__lll_lock_wait_private
 	.type	__lll_lock_wait_private,@function
 	.hidden	__lll_lock_wait_private
@@ -250,10 +246,9 @@
 	/* Get current time.  */
 	movq	%rsp, %rdi
 	xorl	%esi, %esi
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-	/* This is a regular function call, all caller-save registers
-	   might be clobbered.  */
-	callq	*%rax
+	/* This call works because we directly jump to a system call entry
+	   which preserves all the registers.  */
+	call	JUMPTARGET(__gettimeofday)
 
 	/* Compute relative timeout.  */
 	movq	8(%rsp), %rax
@@ -402,8 +397,9 @@
 	/* Get current time.  */
 2:	movq	%rsp, %rdi
 	xorl	%esi, %esi
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-	callq	*%rax
+	/* This call works because we directly jump to a system call entry
+	   which preserves all the registers.  */
+	call	JUMPTARGET(__gettimeofday)
 
 	/* Compute relative timeout.  */
 	movq	8(%rsp), %rax

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S Wed Sep  7 00:02:29 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002=2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2011=2007, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -50,9 +50,6 @@
 	orl	$FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, reg
 #endif
 
-/* For the calculation see asm/vsyscall.h.  */
-#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000
-
 
 	.globl	__lll_robust_lock_wait
 	.type	__lll_robust_lock_wait,@function
@@ -219,10 +216,9 @@
 	/* Get current time.  */
 	movq	%rsp, %rdi
 	xorl	%esi, %esi
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-	/* This is a regular function call, all caller-save registers
-	   might be clobbered.  */
-	callq	*%rax
+	/* This call works because we directly jump to a system call entry
+	   which preserves all the registers.  */
+	call	JUMPTARGET(__gettimeofday)
 
 	/* Compute relative timeout.  */
 	movq	8(%rsp), %rax

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S Wed Sep  7 00:02:29 2011
@@ -25,9 +25,6 @@
 #include <pthread-errnos.h>
 
 #include <kernel-features.h>
-
-/* For the calculation see asm/vsyscall.h.  */
-#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000
 
 
 	.text
@@ -453,13 +450,11 @@
 	movq	__vdso_clock_gettime@GOTPCREL(%rip), %rax
 	movq	(%rax), %rax
 	PTR_DEMANGLE (%rax)
-	jz	26f
 	call	*%rax
-	jmp	27f
+#  else
+	movl	$__NR_clock_gettime, %eax
+	syscall
 #  endif
-26:	movl	$__NR_clock_gettime, %eax
-	syscall
-27:
 #  ifndef __ASSUME_POSIX_TIMERS
 	cmpq	$-ENOSYS, %rax
 	je	19f
@@ -473,8 +468,9 @@
 # else
 	leaq	24(%rsp), %rdi
 	xorl	%esi, %esi
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-	callq	*%rax
+	/* This call works because we directly jump to a system call entry
+	   which preserves all the registers.  */
+	call	JUMPTARGET(__gettimeofday)
 
 	/* Compute relative timeout.  */
 	movq	40(%rsp), %rax
@@ -611,8 +607,9 @@
 	/* clock_gettime not available.  */
 19:	leaq	32(%rsp), %rdi
 	xorl	%esi, %esi
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-	callq	*%rax
+	/* This call works because we directly jump to a system call entry
+	   which preserves all the registers.  */
+	call	JUMPTARGET(__gettimeofday)
 
 	/* Compute relative timeout.  */
 	movq	40(%rsp), %rax

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S Wed Sep  7 00:02:29 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2005,2007,2009,2010,2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -22,10 +22,6 @@
 #include <lowlevelrwlock.h>
 #include <pthread-errnos.h>
 #include <kernel-features.h>
-
-
-/* For the calculation see asm/vsyscall.h.  */
-#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000
 
 	.text
 
@@ -123,8 +119,9 @@
 	/* Get current time.  */
 	movq	%rsp, %rdi
 	xorl	%esi, %esi
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-	callq	*%rax
+	/* This call works because we directly jump to a system call entry
+	   which preserves all the registers.  */
+	call	JUMPTARGET(__gettimeofday)
 
 	/* Compute relative timeout.  */
 	movq	8(%rsp), %rax

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S Wed Sep  7 00:02:29 2011
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010, 2011
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -22,10 +23,6 @@
 #include <lowlevelrwlock.h>
 #include <pthread-errnos.h>
 #include <kernel-features.h>
-
-
-/* For the calculation see asm/vsyscall.h.  */
-#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000
 
 	.text
 
@@ -120,8 +117,9 @@
 	/* Get current time.  */
 	movq	%rsp, %rdi
 	xorl	%esi, %esi
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-	callq	*%rax
+	/* This call works because we directly jump to a system call entry
+	   which preserves all the registers.  */
+	call	JUMPTARGET(__gettimeofday)
 
 	/* Compute relative timeout.  */
 	movq	8(%rsp), %rax

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S Wed Sep  7 00:02:29 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2005,2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2005,2007,2009,2010,2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -23,10 +23,6 @@
 #include <shlib-compat.h>
 #include <pthread-errnos.h>
 #include <structsem.h>
-
-
-/* For the calculation see asm/vsyscall.h.  */
-#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000
 
 	.text
 
@@ -212,9 +208,10 @@
 	addq	$1, NWAITERS(%r12)
 
 7:	xorl	%esi, %esi
-	movq	%rsp, %rdi
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-	callq	*%rax
+	movq	%rsp,%rdi
+	/* This call works because we directly jump to a system call entry
+	   which preserves all the registers.  */
+	call	JUMPTARGET(__gettimeofday)
 
 	/* Compute relative timeout.  */
 	movq	8(%rsp), %rax

Modified: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S (original)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S Wed Sep  7 00:02:29 2011
@@ -40,7 +40,7 @@
 # define STR1  PARMS
 # define STR2  STR1+4
 
-	.text
+	atom_text_section
 ENTRY (__strchr_sse2_bsf)
 
 	ENTRANCE

Modified: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S (original)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S Wed Sep  7 00:02:29 2011
@@ -1,5 +1,5 @@
 /* strlen with SSE2 and BSF
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -39,7 +39,7 @@
 #define RETURN		POP (%edi); POP (%esi); ret; \
 			cfi_restore_state; cfi_remember_state
 
-	.text
+	atom_text_section
 ENTRY ( __strlen_sse2_bsf)
 	ENTRANCE
 	mov	STR(%esp), %edi

Modified: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S (original)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S Wed Sep  7 00:02:29 2011
@@ -37,7 +37,7 @@
 # define STR1  PARMS
 # define STR2  STR1+4
 
-	.text
+	atom_text_section
 ENTRY (__strrchr_sse2_bsf)
 
 	mov	STR1(%esp), %ecx

Modified: fsf/trunk/libc/sysdeps/i386/sysdep.h
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/sysdep.h (original)
+++ fsf/trunk/libc/sysdeps/i386/sysdep.h Wed Sep  7 00:02:29 2011
@@ -1,5 +1,5 @@
 /* Assembler macros for i386.
-   Copyright (C) 1991-93,95,96,98,2002,2003,2005,2006
+   Copyright (C) 1991-93,95,96,98,2002,2003,2005,2006,2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -167,4 +167,6 @@
 #endif
 #endif
 
+#define atom_text_section .section ".text.atom", "ax"
+
 #endif	/* __ASSEMBLER__ */

Modified: fsf/trunk/libc/sysdeps/unix/clock_gettime.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/clock_gettime.c (original)
+++ fsf/trunk/libc/sysdeps/unix/clock_gettime.c Wed Sep  7 00:02:29 2011
@@ -1,5 +1,5 @@
 /* clock_gettime -- Get the current time from a POSIX clockid_t.  Unix version.
-   Copyright (C) 1999-2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1999-2004, 2005, 2007, 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
@@ -113,7 +113,7 @@
 
     default:
 #ifdef SYSDEP_GETTIME_CPU
-      SYSDEP_GETTIME_CPU;
+      retval = SYSDEP_GETTIME_CPU (clock_id, tp);
 #endif
 #if HP_TIMING_AVAIL
       if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1))

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/clock_gettime.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/clock_gettime.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/clock_gettime.c Wed Sep  7 00:02:29 2011
@@ -1,5 +1,5 @@
 /* clock_gettime -- Get current time from a POSIX clockid_t.  Linux version.
-   Copyright (C) 2003,2004,2005,2006,2007,2010 Free Software Foundation, Inc.
+   Copyright (C) 2003,2004,2005,2006,2007,2010,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,9 +32,14 @@
 # include <bits/libc-vdso.h>
 #endif
 
-#define SYSCALL_GETTIME \
-  retval = INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp); \
-  break
+#ifndef SYSCALL_GETTIME
+# define SYSCALL_GETTIME(id, tp) \
+  INLINE_VSYSCALL (clock_gettime, 2, id, tp)
+#endif
+#ifndef INTERNAL_GETTIME
+# define INTERNAL_GETTIME(id, tp) \
+  INTERNAL_VSYSCALL (clock_gettime, err, 2, id, tp)
+#endif
 
 #ifdef __ASSUME_POSIX_TIMERS
 
@@ -44,7 +49,8 @@
   SYSDEP_GETTIME_CPUTIME						      \
   case CLOCK_REALTIME:							      \
   case CLOCK_MONOTONIC:							      \
-    SYSCALL_GETTIME
+    retval = SYSCALL_GETTIME (clock_id, tp);				      \
+    break
 
 # define __libc_missing_posix_timers 0
 #elif defined __NR_clock_gettime
@@ -59,7 +65,7 @@
   if (!__libc_missing_posix_timers)
     {
       INTERNAL_SYSCALL_DECL (err);
-      int r = INTERNAL_VSYSCALL (clock_gettime, err, 2, clock_id, tp);
+      int r = INTERNAL_GETTIME (clock_id, tp);
       if (!INTERNAL_SYSCALL_ERROR_P (r, err))
 	return 0;
 
@@ -89,7 +95,7 @@
     /* Fallback code.  */						      \
     if (retval == EINVAL && clock_id == CLOCK_REALTIME)			      \
       retval = realtime_gettime (tp);					      \
-    else 								      \
+    else								      \
       {									      \
 	__set_errno (retval);						      \
 	retval = -1;							      \
@@ -119,7 +125,7 @@
   if (!__libc_missing_posix_cpu_timers)
     {
       INTERNAL_SYSCALL_DECL (err);
-      int r = INTERNAL_VSYSCALL (clock_gettime, err, 2, clock_id, tp);
+      int r = INTERNAL_GETTIME (clock_id, tp);
       if (!INTERNAL_SYSCALL_ERROR_P (r, err))
 	return 0;
 

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/getsysstats.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/getsysstats.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/getsysstats.c Wed Sep  7 00:02:29 2011
@@ -36,15 +36,6 @@
 #include <atomic.h>
 #include <not-cancel.h>
 #include <kernel-features.h>
-
-#ifndef HAVE_CLOCK_GETTIME_VSYSCALL
-# undef INTERNAL_VSYSCALL
-# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
-# undef INLINE_VSYSCALL
-# define INLINE_VSYSCALL INLINE_SYSCALL
-#else
-# include <bits/libc-vdso.h>
-#endif
 
 
 /* How we can determine the number of available processors depends on
@@ -141,17 +132,10 @@
   static int cached_result;
   static time_t timestamp;
 
-#ifdef __ASSUME_POSIX_TIMERS
-  struct timespec ts;
-  INTERNAL_SYSCALL_DECL (err);
-  INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts);
-#else
-  struct timeval ts;
-  __gettimeofday (&ts, NULL);
-#endif
+  time_t now = time (NULL);
   time_t prev = timestamp;
   atomic_read_barrier ();
-  if (ts.tv_sec == prev)
+  if (now == prev)
     return cached_result;
 
   /* XXX Here will come a test for the new system call.  */
@@ -243,7 +227,7 @@
  out:
   cached_result = result;
   atomic_write_barrier ();
-  timestamp = ts.tv_sec;
+  timestamp = now;
 
   return result;
 }

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c Wed Sep  7 00:02:29 2011
@@ -1,0 +1,14 @@
+#include "bits/libc-vdso.h"
+
+#ifdef SHARED
+# define SYSCALL_GETTIME(id, tp) \
+  ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
+  PTR_DEMANGLE (f);							  \
+  f (id, tp); })
+# define INTERNAL_GETTIME(id, tp) \
+  ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
+  PTR_DEMANGLE (f);							  \
+  f (id, tp); })
+#endif
+
+#include "../clock_gettime.c"

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c Wed Sep  7 00:02:29 2011
@@ -17,6 +17,8 @@
    02111-1307 USA.  */
 
 #ifdef SHARED
+# include <time.h>
+# include <sysdep.h>
 # include <dl-vdso.h>
 # include <bits/libc-vdso.h>
 
@@ -27,12 +29,17 @@
 long int (*__vdso_getcpu) (unsigned *, unsigned *, void *) attribute_hidden;
 
 
+extern long int __syscall_clock_gettime (clockid_t, struct timespec *);
+
+
 static inline void
 _libc_vdso_platform_setup (void)
 {
   PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
 
   void *p = _dl_vdso_vsym ("clock_gettime", &linux26);
+  if (p == NULL)
+    p = __syscall_clock_gettime;
   PTR_MANGLE (p);
   __GI___vdso_clock_gettime = p;
 

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list Wed Sep  7 00:02:29 2011
@@ -14,6 +14,7 @@
 semtimedop	-	semtimedop	i:ipip	semtimedop
 semget		-	semget		i:iii	__semget	semget
 semctl		-	semctl		i:iiii	__semctl	semctl
+syscall_clock_gettime	EXTRA	clock_gettime	Ei:ip		__syscall_clock_gettime
 
 
 # proper socket implementations:

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h Wed Sep  7 00:02:29 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2005, 2007, 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
@@ -279,8 +279,8 @@
     if (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err))			      \
       {									      \
       iserr:								      \
-        __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err));		      \
-        sc_ret = -1L;							      \
+	__set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err));		      \
+	sc_ret = -1L;							      \
       }									      \
   out:									      \
     sc_ret;								      \
@@ -303,9 +303,6 @@
   out:									      \
     v_ret;								      \
   })
-
-/* List of system calls which are supported as vsyscalls.  */
-#  define HAVE_CLOCK_GETTIME_VSYSCALL	1
 
 # else
 #  define INLINE_VSYSCALL(name, nr, args...) \

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S Wed Sep  7 00:02:29 2011
@@ -23,7 +23,7 @@
 # include <sysdep.h>
 # include "asm-syntax.h"
 
-	.text
+	atom_text_section
 ENTRY (__strchr_sse2_no_bsf)
 	movd	%esi, %xmm1
 	movq	%rdi, %rcx

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S Wed Sep  7 00:02:29 2011
@@ -26,7 +26,7 @@
 
 #  define RETURN ret
 
-	.section .text.sse2,"ax",@progbits
+	atom_text_section
 ENTRY (__strlen_no_bsf)
 # endif
 	xor	%eax, %eax

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S Wed Sep  7 00:02:29 2011
@@ -23,7 +23,7 @@
 # include <sysdep.h>
 # include "asm-syntax.h"
 
-	.text
+	atom_text_section
 ENTRY (__strrchr_sse2_no_bsf)
 
 	movd	%rsi, %xmm1

Modified: fsf/trunk/libc/sysdeps/x86_64/sysdep.h
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/sysdep.h (original)
+++ fsf/trunk/libc/sysdeps/x86_64/sysdep.h Wed Sep  7 00:02:29 2011
@@ -1,5 +1,5 @@
 /* Assembler macros for x86-64.
-   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 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
@@ -114,4 +114,6 @@
 # endif
 #endif
 
+#define atom_text_section .section ".text.atom", "ax"
+
 #endif	/* __ASSEMBLER__ */

Modified: fsf/trunk/libc/sysdeps/x86_64/wcscmp.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/wcscmp.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/wcscmp.S Wed Sep  7 00:02:29 2011
@@ -19,11 +19,6 @@
    02111-1307 USA.  */
 
 #include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc and for
-   the DSO.  In static binaries we need wcscmp before the initialization
-   happened.  */
 
 	.text
 ENTRY (wcscmp)