about summary refs log tree commit diff
path: root/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/i386/sysdep.S43
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.h50
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sysdep.S36
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S76
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h37
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S61
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h25
-rw-r--r--sysdeps/unix/sysv/linux/sh/sysdep.h60
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h31
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h31
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.h30
-rw-r--r--sysdeps/unix/x86_64/sysdep.S38
12 files changed, 91 insertions, 427 deletions
diff --git a/sysdeps/unix/i386/sysdep.S b/sysdeps/unix/i386/sysdep.S
index 3bc872add8..9f279e15b1 100644
--- a/sysdeps/unix/i386/sysdep.S
+++ b/sysdeps/unix/i386/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1994,1995,1996,1997,2000,2002,2004,2005
+/* Copyright (C) 1991-1997,2000,2002,2004,2005,2011
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -46,57 +46,24 @@ syscall_error:
 notb:
 #endif
 #ifndef	PIC
-# if USE___THREAD
-#  ifndef NO_TLS_DIRECT_SEG_REFS
+# ifndef NO_TLS_DIRECT_SEG_REFS
 	movl %eax, %gs:C_SYMBOL_NAME(errno@NTPOFF)
-#  else
+# else
 	movl %gs:0, %ecx
 	movl %eax, C_SYMBOL_NAME(errno@NTPOFF)(%ecx)
-#  endif
-# elif !defined _LIBC_REENTRANT
-	movl %eax, C_SYMBOL_NAME(errno)
-# else
-	pushl %eax
-	PUSH_ERRNO_LOCATION_RETURN
-	call BP_SYM (__errno_location)
-	POP_ERRNO_LOCATION_RETURN
-	popl %ecx
-	movl %ecx, (%eax)
 # endif
 #else
 	/* The caller has pushed %ebx and then set it up to
 	   point to the GOT before calling us through the PLT.  */
-# if USE___THREAD
 	movl C_SYMBOL_NAME(errno@GOTNTPOFF)(%ebx), %ecx
 
 	/* Pop %ebx value saved before jumping here.  */
 	popl %ebx
-#  ifndef NO_TLS_DIRECT_SEG_REFS
+# ifndef NO_TLS_DIRECT_SEG_REFS
 	addl %gs:0, %ecx
 	movl %eax, (%ecx)
-#  else
-	movl %eax, %gs:0(%ecx)
-#  endif
-# elif RTLD_PRIVATE_ERRNO
-	movl %eax, C_SYMBOL_NAME(rtld_errno@GOTOFF)(%ebx)
-
-	/* Pop %ebx value saved before jumping here.  */
-	popl %ebx
-# elif !defined _LIBC_REENTRANT
-	movl C_SYMBOL_NAME(errno@GOT)(%ebx), %ecx
-
-	/* Pop %ebx value saved before jumping here.  */
-	popl %ebx
-	movl %eax, (%ecx)
 # else
-	pushl %eax
-	PUSH_ERRNO_LOCATION_RETURN
-	call C_SYMBOL_NAME (BP_SYM (__errno_location)@PLT)
-	POP_ERRNO_LOCATION_RETURN
-	popl %ecx
-	/* Pop %ebx value saved before jumping here.  */
-	popl %ebx
-	movl %ecx, (%eax)
+	movl %eax, %gs:0(%ecx)
 # endif
 #endif
 	movl $-1, %eax
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index 77e6bad105..64ef4008bc 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 1992,1993,1995-2000,2002-2006,2007
-   	Free Software Foundation, Inc.
+/* Copyright (C) 1992,1993,1995-2000,2002-2006,2007,2011
+	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
 
@@ -121,13 +121,12 @@
 
 # elif defined _LIBC_REENTRANT
 
-#  if USE___THREAD
-#   ifndef NOT_IN_libc
-#    define SYSCALL_ERROR_ERRNO __libc_errno
-#   else
-#    define SYSCALL_ERROR_ERRNO errno
-#   endif
-#   define SYSCALL_ERROR_HANDLER					      \
+#  ifndef NOT_IN_libc
+#   define SYSCALL_ERROR_ERRNO __libc_errno
+#  else
+#   define SYSCALL_ERROR_ERRNO errno
+#  endif
+#  define SYSCALL_ERROR_HANDLER					      \
 0:SETUP_PIC_REG (cx);							      \
   addl $_GLOBAL_OFFSET_TABLE_, %ecx;					      \
   movl SYSCALL_ERROR_ERRNO@GOTNTPOFF(%ecx), %ecx;			      \
@@ -136,38 +135,13 @@
   SYSCALL_ERROR_HANDLER_TLS_STORE (%edx, %ecx);				      \
   orl $-1, %eax;							      \
   jmp L(pseudo_end);
-#   ifndef NO_TLS_DIRECT_SEG_REFS
-#    define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff)		      \
+#  ifndef NO_TLS_DIRECT_SEG_REFS
+#   define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff)		      \
   movl src, %gs:(destoff)
-#   else
-#    define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff)		      \
+#  else
+#   define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff)		      \
   addl %gs:0, destoff;							      \
   movl src, (destoff)
-#   endif
-#  else
-#   define SYSCALL_ERROR_HANDLER					      \
-0:pushl %ebx;								      \
-  cfi_adjust_cfa_offset (4);						      \
-  cfi_rel_offset (ebx, 0);						      \
-  SETUP_PIC_REG (bx);							      \
-  addl $_GLOBAL_OFFSET_TABLE_, %ebx;					      \
-  xorl %edx, %edx;							      \
-  subl %eax, %edx;							      \
-  pushl %edx;								      \
-  cfi_adjust_cfa_offset (4);						      \
-  PUSH_ERRNO_LOCATION_RETURN;						      \
-  call BP_SYM (__errno_location)@PLT;					      \
-  POP_ERRNO_LOCATION_RETURN;						      \
-  popl %ecx;								      \
-  cfi_adjust_cfa_offset (-4);						      \
-  popl %ebx;								      \
-  cfi_adjust_cfa_offset (-4);						      \
-  cfi_restore (ebx);							      \
-  movl %ecx, (%eax);							      \
-  orl $-1, %eax;							      \
-  jmp L(pseudo_end);
-/* A quick note: it is assumed that the call to `__errno_location' does
-   not modify the stack!  */
 #  endif
 # else
 /* Store (- %eax) into errno through the GOT.  */
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.S b/sysdeps/unix/sysv/linux/ia64/sysdep.S
index 3633dd4b78..3271857d61 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep.S
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2001, 2003, 2004, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
 
@@ -34,7 +34,7 @@ ENTRY(__syscall_error)
 	;;
 	st4	[r2]=r8
 	mov	r8=-1
-#elif USE___THREAD
+#else
 # ifndef NOT_IN_libc
 #  define SYSCALL_ERROR_ERRNO __libc_errno
 # else
@@ -46,37 +46,7 @@ ENTRY(__syscall_error)
 	mov	r8=-1
 	add	r2=r2,r13;;
 	st4	[r2]=r3
-#elif defined _LIBC_REENTRANT
-	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(0)
-	alloc	r33=ar.pfs, 0, 4, 0, 0
-	mov	r32=rp
-	.body
-	mov	r35=r8
-	mov	r34=r1
-	;;
-	br.call.sptk.many b0 = __errno_location
-.Lret0:		/* force new bundle */
-	st4	[r8]=r35
-	mov	r1=r34
-	mov	rp=r32
-	mov	r8=-1
-	mov	ar.pfs=r33
-#else /* _LIBC_REENTRANT */
-	/*
-	 * Note that the gp has to be set properly for this to work.
-	 * As long as all syscalls are in the same load unit
-	 * (executable or shared library) as this routine, we should
-	 * be fine.  Otherwise, we would have to first load the global
-	 * pointer register from __gp.
-	 */
-	addl	r2=@ltoff(errno),gp
-	;;
-	ld8	r2=[r2]
-	mov	r3=r8
-	mov	r8=-1
-	;;
-	st4	[r2]=r3
-#endif /* _LIBC_REENTRANT */
+#endif
 	ret			// ret is #define'd in syscall.h!
 END(__syscall_error)
 
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
index 2a1dad0695..5a24fdc2e7 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2011 Free Software Foundation, Inc.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
    This file is part of the GNU C Library.
 
@@ -32,12 +32,11 @@
 	.text
 ENTRY(__syscall_error)
 #ifndef PIC
-# if USE___THREAD
-#  ifndef NOT_IN_libc
-#   define SYSCALL_ERROR_ERRNO __libc_errno
-#  else
-#   define SYSCALL_ERROR_ERRNO errno
-#  endif
+# ifndef NOT_IN_libc
+#  define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+#  define SYSCALL_ERROR_ERRNO errno
+# endif
 	basr	%r1,0
 0:	l	%r1,1f-0b(%r1)
 	ear	%r3,%a0
@@ -46,34 +45,6 @@ ENTRY(__syscall_error)
 	lhi	%r2,-1
 	br	%r14
 1:	.long	SYSCALL_ERROR_ERRNO@ntpoff
-# elif !defined _LIBC_REENTRANT
-	basr	%r1,0
-0:	l	%r1,1f-0b(%r1)
-	lcr	%r2,%r2
-	st	%r2,0(%r1)
-	lhi	%r2,-1
-	br	%r14
-1:	.long  errno
-# else
-	stm	%r13,%r15,52(%r15)
-	cfi_offset (%r15, -36)
-	cfi_offset (%r14, -40)
-	cfi_offset (%r13, -44)
-	lr	%r0,%r15
-	ahi	%r15,-96
-	cfi_adjust_cfa_offset (96)
-	lcr	%r13,%r2
-	st	%r0,0(%r15)
-	basr	%r1,0
-0:	l	%r1,1f-0b(%r1)
-	basr	%r14,%r1
-	st	%r13,0(%r2)
-	lm	%r13,%r15,148(%r15)
-	cfi_adjust_cfa_offset (-96)
-	lhi	%r2,-1
-	br	%r14
-1:	.long  __errno_location
-#endif
 #else
 # if RTLD_PRIVATE_ERRNO
 	basr	%r1,0
@@ -83,7 +54,7 @@ ENTRY(__syscall_error)
 	lhi	%r2,-1
 	br	%r14
 1:	.long	rtld_errno - 0b
-# elif USE___THREAD
+# else
 #  ifndef NOT_IN_libc
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
@@ -98,39 +69,6 @@ ENTRY(__syscall_error)
 	lhi	%r2,-1
 	br	%r14
 1:	.long	_GLOBAL_OFFSET_TABLE_-0b
-# elif !defined _LIBC_REENTRANT
-	basr	%r1,0
-0:	al	%r1,1f-0b(%r1)
-	l	%r1,errno@GOT(%r1)
-	lcr	%r2,%r2
-	st	%r2,0(0,%r1)
-	lhi	%r2,-1
-	br	%r14
-1:	.long	_GLOBAL_OFFSET_TABLE_-0b
-# else
-	stm	%r11,%r15,44(%r15)
-	cfi_offset (%r15, -36)
-	cfi_offset (%r14, -40)
-	cfi_offset (%r13, -44)
-	cfi_offset (%r12, -48)
-	cfi_offset (%r11, -52)
-	lr	%r0,%r15
-	ahi	%r15,-96
-	cfi_adjust_cfa_offset (96)
-	lcr	%r11,%r2
-	st	%r0,0(%r15)
-	basr	%r13,0
-0:	l	%r12,1f-0b(%r13)
-	l	%r1,2f-0b(%r13)
-	la	%r12,0(%r12,%r13)
-	bas	%r14,0(%r1,%r13)
-	st	%r11,0(%r2)
-	lm	%r11,%r15,140(%r15)
-	cfi_adjust_cfa_offset (-96)
-	lhi	%r2,-1
-	br	%r14
-1:	.long _GLOBAL_OFFSET_TABLE_-0b
-2:	.long __errno_location@PLT-0b
 # endif
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
index 13ce9ab748..435eaabb17 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2011
    Free Software Foundation, Inc.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
    This file is part of the GNU C Library.
@@ -56,10 +56,10 @@
 #undef PSEUDO
 #define	PSEUDO(name, syscall_name, args)				      \
   .text;                                                                      \
-  ENTRY (name)							              \
+  ENTRY (name)								      \
     DO_CALL (syscall_name, args);                                             \
     lhi  %r4,-4095 ;                                                          \
-    clr  %r2,%r4 ;		                                              \
+    clr  %r2,%r4 ;							      \
     jnl  SYSCALL_ERROR_LABEL
 
 #undef PSEUDO_END
@@ -70,7 +70,7 @@
 #undef PSEUDO_NOERRNO
 #define	PSEUDO_NOERRNO(name, syscall_name, args)			      \
   .text;                                                                      \
-  ENTRY (name)							              \
+  ENTRY (name)								      \
     DO_CALL (syscall_name, args)
 
 #undef PSEUDO_END_NOERRNO
@@ -80,7 +80,7 @@
 #undef PSEUDO_ERRVAL
 #define	PSEUDO_ERRVAL(name, syscall_name, args)				      \
   .text;                                                                      \
-  ENTRY (name)							              \
+  ENTRY (name)								      \
     DO_CALL (syscall_name, args);					      \
     lcr %r2,%r2
 
@@ -107,14 +107,13 @@
     br    %r14;								      \
 2:  .long rtld_errno-1b
 # elif defined _LIBC_REENTRANT
-#  if USE___THREAD
-#   ifndef NOT_IN_libc
-#    define SYSCALL_ERROR_ERRNO __libc_errno
-#   else
-#    define SYSCALL_ERROR_ERRNO errno
-#   endif
-#   define SYSCALL_ERROR_LABEL 0f
-#   define SYSCALL_ERROR_HANDLER \
+#  ifndef NOT_IN_libc
+#   define SYSCALL_ERROR_ERRNO __libc_errno
+#  else
+#   define SYSCALL_ERROR_ERRNO errno
+#  endif
+#  define SYSCALL_ERROR_LABEL 0f
+#  define SYSCALL_ERROR_HANDLER \
 0:  lcr   %r0,%r2;							      \
     basr  %r1,0;							      \
 1:  al    %r1,2f-1b(%r1);						      \
@@ -124,14 +123,6 @@
     lhi   %r2,-1;							      \
     br    %r14;								      \
 2:  .long _GLOBAL_OFFSET_TABLE_-1b
-#  else
-#   define SYSCALL_ERROR_LABEL 0f
-#   define SYSCALL_ERROR_HANDLER \
-0:  basr  %r1,0;							      \
-1:  al    %r1,2f-1b(%r1);						      \
-    br    %r1;								      \
-2:  .long syscall_error@plt-1b
-#  endif
 # else
 #  define SYSCALL_ERROR_LABEL 0f
 #  define SYSCALL_ERROR_HANDLER \
@@ -317,8 +308,8 @@
     if (INTERNAL_SYSCALL_ERROR_P (_ret, ))				      \
       {									      \
       iserr:								      \
-        __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, ));			      \
-        _ret = -1L;							      \
+	__set_errno (INTERNAL_SYSCALL_ERRNO (_ret, ));			      \
+	_ret = -1L;							      \
       }									      \
   out:									      \
     (int) _ret;								      \
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
index bb61e894f1..41d8143896 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004, 2011 Free Software Foundation, Inc.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
    This file is part of the GNU C Library.
 
@@ -33,12 +33,11 @@
 .text
 ENTRY(__syscall_error)
 #ifndef PIC
-# if USE___THREAD
-#  ifndef NOT_IN_libc
-#   define SYSCALL_ERROR_ERRNO __libc_errno
-#  else
-#   define SYSCALL_ERROR_ERRNO errno
-#  endif
+# ifndef NOT_IN_libc
+#  define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+#  define SYSCALL_ERROR_ERRNO errno
+# endif
 	basr	%r1,0
 0:	lg	%r1,1f-0b(%r1)
 	ear	%r3,%a0
@@ -49,29 +48,6 @@ ENTRY(__syscall_error)
 	lghi	%r2,-1
 	br	%r14
 1:	.quad	SYSCALL_ERROR_ERRNO@ntpoff
-# elif !defined _LIBC_REENTRANT
-	larl	%r1,errno
-	lcr	%r2,%r2
-	st	%r2,0(%r1)
-	lghi	%r2,-1
-	br	%r14
-# else
-	stmg	%r13,%r15,104(%r15)
-	cfi_offset (%r15,-40)
-	cfi_offset (%r14,-48)
-	cfi_offset (%r13,-56)
-	lgr	%r0,%r15
-	aghi	%r15,-160
-	cfi_adjust_cfa_offset (160)
-	lcr	%r13,%r2
-	stg	%r0,0(%r15)
-	brasl	%r14,__errno_location
-	st	%r13,0(%r2)
-	lmg	%r13,%r15,264(%r15)
-	cfi_adjust_cfa_offset (-160)
-	lghi	%r2,-1
-	br	%r14
-#endif
 #else
 # if RTLD_PRIVATE_ERRNO
 	larl	%r1,rtld_errno
@@ -79,7 +55,7 @@ ENTRY(__syscall_error)
 	st	%r2,0(%r1)
 	lghi	%r2,-1
 	br	%r14
-# elif USE___THREAD
+# else
 #  ifndef NOT_IN_libc
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
@@ -94,29 +70,6 @@ ENTRY(__syscall_error)
 	st	%r2,0(%r1,%r3)
 	lghi	%r2,-1
 	br	%r14
-# elif !defined _LIBC_REENTRANT
-	larl	%r1,_GLOBAL_OFFSET_TABLE_
-	lg	%r1,errno@GOT(%r1)
-	lcr	%r2,%r2
-	st	%r2,0(%r1)
-	lghi	%r2,-1
-	br	%r14
-# else
-	stmg	%r13,%r15,104(%r15)
-	cfi_offset (%r15,-40)
-	cfi_offset (%r14,-48)
-	cfi_offset (%r13,-56)
-	lgr	%r0,%r15
-	aghi	%r15,-160
-	cfi_adjust_cfa_offset (160)
-	lcr	%r13,%r2
-	stg	%r0,0(%r15)
-	brasl	%r14,__errno_location@PLT
-	st	%r13,0(%r2)
-	lmg	%r13,%r15,264(%r15)
-	cfi_adjust_cfa_offset (-160)
-	lghi	%r2,-1
-	br	%r14
 # endif
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
index 4d45417639..598fb86529 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
@@ -1,5 +1,5 @@
 /* Assembler macros for 64 bit S/390.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2011
    Free Software Foundation, Inc.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
    This file is part of the GNU C Library.
@@ -115,14 +115,13 @@
     lghi  %r2,-1;							      \
     br    %r14
 # elif defined _LIBC_REENTRANT
-#  if USE___THREAD
-#   ifndef NOT_IN_libc
-#    define SYSCALL_ERROR_ERRNO __libc_errno
-#   else
-#    define SYSCALL_ERROR_ERRNO errno
-#   endif
-#   define SYSCALL_ERROR_LABEL 0f
-#   define SYSCALL_ERROR_HANDLER \
+#  ifndef NOT_IN_libc
+#   define SYSCALL_ERROR_ERRNO __libc_errno
+#  else
+#   define SYSCALL_ERROR_ERRNO errno
+#  endif
+#  define SYSCALL_ERROR_LABEL 0f
+#  define SYSCALL_ERROR_HANDLER \
 0:  lcr   %r0,%r2;							      \
     larl  %r1,SYSCALL_ERROR_ERRNO@indntpoff;				      \
     lg    %r1,0(%r1);							      \
@@ -132,10 +131,6 @@
     st    %r0,0(%r1,%r2);						      \
     lghi   %r2,-1;							      \
     br    %r14
-#  else
-#   define SYSCALL_ERROR_LABEL syscall_error@plt
-#   define SYSCALL_ERROR_HANDLER
-#  endif
 # else
 #  define SYSCALL_ERROR_LABEL 0f
 #  define SYSCALL_ERROR_HANDLER \
@@ -319,8 +314,8 @@
     if (INTERNAL_SYSCALL_ERROR_P (_ret, ))				      \
       {									      \
       iserr:								      \
-        __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, ));			      \
-        _ret = -1L;							      \
+	__set_errno (INTERNAL_SYSCALL_ERRNO (_ret, ));			      \
+	_ret = -1L;							      \
       }									      \
   out:									      \
     (int) _ret;								      \
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.h b/sysdeps/unix/sysv/linux/sh/sysdep.h
index 0fc2c4f1ee..4ba0def0ed 100644
--- a/sysdeps/unix/sysv/linux/sh/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sh/sysdep.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 1992,1993,1995,1996,1997,1998,1999,2000,2002,2003,2004,
-   2005,2006,2009	Free Software Foundation, Inc.
+/* Copyright (C) 1992,1993,1995-2000,2002-2006,2009,2011
+	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
    Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
@@ -114,13 +114,12 @@
 
 # elif defined _LIBC_REENTRANT
 
-#  if USE___THREAD
-#   ifndef NOT_IN_libc
-#    define SYSCALL_ERROR_ERRNO __libc_errno
-#   else
-#    define SYSCALL_ERROR_ERRNO errno
-#   endif
-#   define SYSCALL_ERROR_HANDLER \
+#  ifndef NOT_IN_libc
+#   define SYSCALL_ERROR_ERRNO __libc_errno
+#  else
+#   define SYSCALL_ERROR_ERRNO errno
+#  endif
+#  define SYSCALL_ERROR_HANDLER \
 	neg r0,r1; \
 	mov r12,r2; \
 	mov.l 0f,r12; \
@@ -137,43 +136,6 @@
 	.align 2; \
      0: .long _GLOBAL_OFFSET_TABLE_; \
      1: .long SYSCALL_ERROR_ERRNO@GOTTPOFF
-#  else
-#   define SYSCALL_ERROR_HANDLER \
-	neg r0,r1; \
-	mov.l r14,@-r15; \
-	cfi_adjust_cfa_offset (4); \
-	cfi_rel_offset (r14, 0); \
-	mov.l r12,@-r15; \
-	cfi_adjust_cfa_offset (4); \
-	cfi_rel_offset (r12, 0); \
-	mov.l r1,@-r15; \
-	cfi_adjust_cfa_offset (4); \
-	cfi_rel_offset (r1, 0); \
-	mov.l 0f,r12; \
-	mova 0f,r0; \
-	add r0,r12; \
-	sts.l pr,@-r15; \
-	cfi_adjust_cfa_offset (4); \
-	cfi_rel_offset (pr, 0); \
-	mov r15,r14; \
-	cfi_def_cfa_register (r14); \
-	mov.l 1f,r1; \
-	bsrf r1; \
-         nop; \
-     2: mov r14,r15; \
-	lds.l @r15+,pr; \
-	mov.l @r15+,r1; \
-	mov.l r1,@r0; \
-	mov.l @r15+,r12; \
-	mov.l @r15+,r14; \
-	bra .Lpseudo_end; \
-	 mov _IMM1,r0; \
-	.align 2; \
-     0: .long _GLOBAL_OFFSET_TABLE_; \
-     1: .long PLTJMP(C_SYMBOL_NAME(__errno_location))-(2b-.)
-/* A quick note: it is assumed that the call to `__errno_location' does
-   not modify the stack!  */
-#  endif
 # else
 /* Store (-r0) into errno through the GOT.  */
 #  define SYSCALL_ERROR_HANDLER						      \
@@ -324,8 +286,8 @@
     unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args);             \
     if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0))         \
       {                                                                       \
-        __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));                   \
-        resultvar = 0xffffffff;                                               \
+	__set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));                   \
+	resultvar = 0xffffffff;                                               \
       }                                                                       \
     (int) resultvar; })
 
@@ -347,7 +309,7 @@
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
   ({									      \
     unsigned long int resultvar;					      \
-    register long int r3 asm ("%r3") = (name);			 	      \
+    register long int r3 asm ("%r3") = (name);				      \
     SUBSTITUTE_ARGS_##nr(args);						      \
 									      \
     asm volatile (SYSCALL_INST_STR##nr SYSCALL_INST_PAD			      \
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index 8af045dc2b..161f431078 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2002, 2003, 2004, 2006, 2008
+/* Copyright (C) 1997, 2002, 2003, 2004, 2006, 2008, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997.
@@ -99,32 +99,19 @@ ENTRY(name);					\
 	 mov	-1, %o0;
 # elif defined _LIBC_REENTRANT
 
-#  if USE___THREAD
-#   ifndef NOT_IN_libc
-#    define SYSCALL_ERROR_ERRNO __libc_errno
-#   else
-#    define SYSCALL_ERROR_ERRNO errno
-#   endif
-#   define SYSCALL_ERROR_HANDLER				\
+#  ifndef NOT_IN_libc
+#   define SYSCALL_ERROR_ERRNO __libc_errno
+#  else
+#   define SYSCALL_ERROR_ERRNO errno
+#  endif
+#  define SYSCALL_ERROR_HANDLER				\
 0:	SETUP_PIC_REG(o2,g1)					\
 	sethi	%tie_hi22(SYSCALL_ERROR_ERRNO), %g1;		\
 	add	%g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1;	\
 	ld	[%o2 + %g1], %g1, %tie_ld(SYSCALL_ERROR_ERRNO);	\
-	st	%o0, [%g7 + %g1]; 				\
-	jmp	%o7 + 8;    					\
+	st	%o0, [%g7 + %g1];				\
+	jmp	%o7 + 8;					\
 	 mov	-1, %o0;
-#  else
-#  define SYSCALL_ERROR_HANDLER		\
-0:	save	%sp, -96, %sp;		\
-	cfi_def_cfa_register(%fp);	\
-	cfi_window_save;		\
-	cfi_register (%o7, %i7);	\
-	call	__errno_location;	\
-	 nop;				\
-	st	%i0, [%o0];		\
-	jmp	%i7 + 8;		\
-	 restore %g0, -1, %o0;
-#  endif
 # else
 #  define SYSCALL_ERROR_HANDLER		\
 0:	SETUP_PIC_REG(o2,g1)		\
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
index bdd1d45bd7..bc8a0b0e3a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2000, 2002, 2003, 2004, 2006, 2008
+/* Copyright (C) 1997, 2000, 2002, 2003, 2004, 2006, 2008, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
@@ -106,32 +106,19 @@ ENTRY(name);					\
 	 mov	-1, %o0;
 # elif defined _LIBC_REENTRANT
 
-#  if USE___THREAD
-#   ifndef NOT_IN_libc
-#    define SYSCALL_ERROR_ERRNO __libc_errno
-#   else
-#    define SYSCALL_ERROR_ERRNO errno
-#   endif
-#   define SYSCALL_ERROR_HANDLER				\
+#  ifndef NOT_IN_libc
+#   define SYSCALL_ERROR_ERRNO __libc_errno
+#  else
+#   define SYSCALL_ERROR_ERRNO errno
+#  endif
+#  define SYSCALL_ERROR_HANDLER				\
 0:	SETUP_PIC_REG(o2,g1)					\
 	sethi	%tie_hi22(SYSCALL_ERROR_ERRNO), %g1;		\
 	add	%g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1;	\
 	ldx	[%o2 + %g1], %g1, %tie_ldx(SYSCALL_ERROR_ERRNO);\
-	st	%o0, [%g7 + %g1]; 				\
-	jmp	%o7 + 8;    					\
+	st	%o0, [%g7 + %g1];				\
+	jmp	%o7 + 8;					\
 	 mov	-1, %o0;
-#  else
-#  define SYSCALL_ERROR_HANDLER		\
-0:	save	%sp, -176, %sp;		\
-	cfi_def_cfa_register(%fp);	\
-	cfi_window_save;		\
-	cfi_register (%o7, %i7);	\
-	call	__errno_location;	\
-	 nop;				\
-	st	%i0, [%o0];		\
-	jmp	%i7 + 8;		\
-	 restore %g0, -1, %o0;
-#  endif
 # else
 #  define SYSCALL_ERROR_HANDLER		\
 0:	SETUP_PIC_REG(o2,g1)		\
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index a9821dc0a8..64362300ae 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -124,7 +124,7 @@
   movl %edx, (%rcx);				\
   orq $-1, %rax;				\
   jmp L(pseudo_end);
-# elif USE___THREAD
+# else
 #  ifndef NOT_IN_libc
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
@@ -138,34 +138,6 @@
   movl %edx, %fs:(%rcx);			\
   orq $-1, %rax;				\
   jmp L(pseudo_end);
-# elif defined _LIBC_REENTRANT
-/* Store (- %rax) into errno through the GOT.
-   Note that errno occupies only 4 bytes.  */
-#  define SYSCALL_ERROR_HANDLER			\
-0:						\
-  xorl %edx, %edx;				\
-  subq %rax, %rdx;				\
-  pushq %rdx;					\
-  cfi_adjust_cfa_offset(8);			\
-  PUSH_ERRNO_LOCATION_RETURN;			\
-  call BP_SYM (__errno_location)@PLT;		\
-  POP_ERRNO_LOCATION_RETURN;			\
-  popq %rdx;					\
-  cfi_adjust_cfa_offset(-8);			\
-  movl %edx, (%rax);				\
-  orq $-1, %rax;				\
-  jmp L(pseudo_end);
-
-/* A quick note: it is assumed that the call to `__errno_location' does
-   not modify the stack!  */
-# else /* Not _LIBC_REENTRANT.  */
-#  define SYSCALL_ERROR_HANDLER			\
-0:movq errno@GOTPCREL(%RIP), %rcx;		\
-  xorl %edx, %edx;				\
-  subq %rax, %rdx;				\
-  movl %edx, (%rcx);				\
-  orq $-1, %rax;				\
-  jmp L(pseudo_end);
 # endif	/* PIC */
 
 /* The Linux/x86-64 kernel expects the system call parameters in
diff --git a/sysdeps/unix/x86_64/sysdep.S b/sysdeps/unix/x86_64/sysdep.S
index aca81fef2f..908da3c3d5 100644
--- a/sysdeps/unix/x86_64/sysdep.S
+++ b/sysdeps/unix/x86_64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2004, 2005, 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
@@ -45,43 +45,11 @@ syscall_error:
 	movl $EAGAIN, %eax	/* Yes; translate it to EAGAIN.  */
 notb:
 #endif
-#if USE___THREAD
-# ifdef PIC
+#ifdef PIC
 	movq C_SYMBOL_NAME(errno@GOTTPOFF)(%rip), %rcx
 	movl %eax, %fs:0(%rcx)
-# else
-	movl %eax, %fs:C_SYMBOL_NAME(errno@TPOFF)
-# endif
-#elif !defined PIC
-# ifndef _LIBC_REENTRANT
-	movl %eax, C_SYMBOL_NAME(errno)
-# else
-	pushq %rax
-	cfi_adjust_cfa_offset(8)
-	PUSH_ERRNO_LOCATION_RETURN
-	call BP_SYM (__errno_location)
-	POP_ERRNO_LOCATION_RETURN
-	popq %rcx
-	cfi_adjust_cfa_offset(-8)
-	movl %ecx, (%rax)
-# endif
 #else
-# if RTLD_PRIVATE_ERRNO
-	leaq rtld_errno(%rip), %rcx
-	movl %eax, (%rcx)
-# elif !defined _LIBC_REENTRANT
-	movq C_SYMBOL_NAME(errno)@GOTPCREL(%rip), %rcx
-	movl %eax, (%rcx)
-# else
-	pushq %rax
-	cfi_adjust_cfa_offset(8)
-	PUSH_ERRNO_LOCATION_RETURN
-	call C_SYMBOL_NAME (BP_SYM (__errno_location)@PLT)
-	POP_ERRNO_LOCATION_RETURN
-	popq %rcx
-	cfi_adjust_cfa_offset(-8)
-	movl %ecx, (%rax)
-# endif
+	movl %eax, %fs:C_SYMBOL_NAME(errno@TPOFF)
 #endif
 	movq $-1, %rax
 	ret