about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-27 21:03:22 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-27 21:03:22 +0000
commit62f29da7cbc527e8f8dda4f5101e6ac504c98505 (patch)
treed1f7d7ed70c131129214bc71441b1d8bbfc7268f
parente4e9446ba3c762d9bddd2718f889af545bf4e95c (diff)
downloadglibc-62f29da7cbc527e8f8dda4f5101e6ac504c98505.tar.gz
glibc-62f29da7cbc527e8f8dda4f5101e6ac504c98505.tar.xz
glibc-62f29da7cbc527e8f8dda4f5101e6ac504c98505.zip
Update.
2003-01-26  Andreas Schwab  <schwab@suse.de>

	* sysdeps/wordsize-32/divdi3.c: Export the functions only as
	compatibility symbols.  Remove INTDEF for __divdi3.
	* sysdeps/wordsize-32/lldiv.c: Don't use __divdi3_internal.
	* sysdeps/powerpc/powerpc32/divdi3.c: Remove.
	* sysdeps/powerpc/powerpc32/Makefile (CPPFLAGS-divdi3.c): Don't
	define.
	* sysdeps/powerpc/powerpc32/Dist: Remove divdi3.c.

2003-01-24  Jakub Jelinek  <jakub@redhat.com>

	* elf/tls-macros.h: Add SPARC 32-bit definitions.
	* sysdeps/sparc/sparc32/elf/configure.in: Add TLS check.
	* sysdeps/sparc/sparc32/dl-machine.h: Add dl_machine_h guards
	for the first half of the header.  Include tls.h.
	(elf_machine_type_class): Return ELF_RTYPE_CLASS_PLT for TLS
	relocs too.
	(elf_machine_rela): Handle TLS relocs.
	* sysdeps/sparc/dl-tls.h: New file.

	* sysdeps/unix/sysv/linux/sparc/sparc32/socket.S: Add cancellation
	support.

	* sysdeps/sparc/sparc32/sparcv9/hp-timing.h: Use %g6 instead of %g7.
	* sysdeps/sparc/sparc32/memchr.S: Likewise.
	* sysdeps/sparc/sparc32/memcpy.S: Likewise.
	* sysdeps/sparc/sparc32/strcat.S: Likewise.
	* sysdeps/sparc/sparc32/strchr.S: Likewise.
	* sysdeps/sparc/sparc32/strcmp.S: Likewise.
	* sysdeps/sparc/sparc32/strcpy.S: Likewise.
	* sysdeps/sparc/sparc64/sparcv9b/memcpy.S: Likewise.
	* sysdeps/sparc/sparc64/hp-timing.h: Likewise.
	* sysdeps/sparc/sparc64/memcpy.S: Likewise.
	* sysdeps/sparc/sparc64/stpcpy.S: Likewise.
	* sysdeps/sparc/sparc64/stpncpy.S: Likewise.
	* sysdeps/sparc/sparc64/strcat.S: Likewise.
	* sysdeps/sparc/sparc64/strchr.S: Likewise.
	* sysdeps/sparc/sparc64/strcmp.S: Likewise.
	* sysdeps/sparc/sparc64/strcpy.S: Likewise.
	* sysdeps/sparc/sparc64/strncmp.S: Likewise.
	* sysdeps/sparc/sparc64/strncpy.S: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.

2003-01-24  Andreas Schwab  <schwab@suse.de>

	* elf/dl-close.c (_dl_close): Don't relocate DT_FINI_ARRAY
	elements, and process them backwards.
	* elf/Makefile ($(objpfx)tst-array4): New target.
	($(objpfx)tst-array4.out): Likewise.
	(tests) [$(have-initfini-array) = yes]: Add tst-array4.
	* elf/tst-array4.c: New file.
	* elf/tst-array4.exp: Likewise.

2003-01-24  Steven Munroe  <sjmunroe@us.ibm.com>

	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c: New file.

2003-01-27  Guido Guenther  <agx@sigxcpu.org>

	* sysdeps/unix/sysv/linux/mips/sysdep.h (SYSCALL_ERROR_LABEL): Define.
	* sysdeps/unix/sysv/linux/mips/pread.c: Add support for
	cancellation handling and handle both __NR_pread64 and __NR_pread.
	* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pwrite.c: Add support for
	cancellation handling and handle both __NR_pwrite64 and __NR_pwrite.
	* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.
	* sysdeps/unix/mips/sysdep.S: Don't set errno in the _LIBC_REENTRANT
	case, use register names consistently.

2003-01-27  Wolfram Gloger  <wg@malloc.de>

	* malloc/hooks.c (mem2chunk_check): Check alignment of mem
	pointer, not of the computed chunk.  Bug report from Carlos
	O'Donell <carlos@baldric.uwo.ca>.
-rw-r--r--ChangeLog77
-rw-r--r--elf/Makefile8
-rw-r--r--elf/dl-close.c5
-rw-r--r--elf/tls-macros.h69
-rw-r--r--elf/tst-array4.c18
-rw-r--r--elf/tst-array4.exp19
-rw-r--r--linuxthreads/ChangeLog16
-rw-r--r--linuxthreads/sysdeps/sparc/sparc32/pt-machine.h8
-rw-r--r--linuxthreads/sysdeps/sparc/sparc64/pt-machine.h8
-rw-r--r--linuxthreads/sysdeps/sparc/tls.h53
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h6
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S2
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h6
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S2
-rw-r--r--sysdeps/powerpc/powerpc32/Dist1
-rw-r--r--sysdeps/powerpc/powerpc32/Makefile1
-rw-r--r--sysdeps/sparc/dl-tls.h (renamed from sysdeps/powerpc/powerpc32/divdi3.c)32
-rw-r--r--sysdeps/sparc/sparc32/dl-machine.h72
-rw-r--r--sysdeps/sparc/sparc32/elf/configure.in43
-rw-r--r--sysdeps/sparc/sparc32/memchr.S14
-rw-r--r--sysdeps/sparc/sparc32/memcpy.S138
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/hp-timing.h14
-rw-r--r--sysdeps/sparc/sparc32/strcat.S14
-rw-r--r--sysdeps/sparc/sparc32/strchr.S10
-rw-r--r--sysdeps/sparc/sparc32/strcmp.S8
-rw-r--r--sysdeps/sparc/sparc32/strcpy.S14
-rw-r--r--sysdeps/sparc/sparc64/hp-timing.h4
-rw-r--r--sysdeps/sparc/sparc64/memcpy.S120
-rw-r--r--sysdeps/sparc/sparc64/sparcv9b/memcpy.S26
-rw-r--r--sysdeps/sparc/sparc64/stpcpy.S40
-rw-r--r--sysdeps/sparc/sparc64/stpncpy.S64
-rw-r--r--sysdeps/sparc/sparc64/strcat.S22
-rw-r--r--sysdeps/sparc/sparc64/strchr.S16
-rw-r--r--sysdeps/sparc/sparc64/strcmp.S38
-rw-r--r--sysdeps/sparc/sparc64/strcpy.S22
-rw-r--r--sysdeps/sparc/sparc64/strncmp.S20
-rw-r--r--sysdeps/sparc/sparc64/strncpy.S16
-rw-r--r--sysdeps/unix/mips/sysdep.S19
-rw-r--r--sysdeps/unix/sysv/linux/mips/pread.c28
-rw-r--r--sysdeps/unix/sysv/linux/mips/pread64.c29
-rw-r--r--sysdeps/unix/sysv/linux/mips/pwrite.c30
-rw-r--r--sysdeps/unix/sysv/linux/mips/pwrite64.c28
-rw-r--r--sysdeps/unix/sysv/linux/mips/sysdep.h10
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c30
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/socket.S30
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h4
-rw-r--r--sysdeps/wordsize-32/divdi3.c13
-rw-r--r--sysdeps/wordsize-32/lldiv.c7
49 files changed, 893 insertions, 385 deletions
diff --git a/ChangeLog b/ChangeLog
index 20451a371f..37cebd01be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,80 @@
+2003-01-26  Andreas Schwab  <schwab@suse.de>
+
+	* sysdeps/wordsize-32/divdi3.c: Export the functions only as
+	compatibility symbols.  Remove INTDEF for __divdi3.
+	* sysdeps/wordsize-32/lldiv.c: Don't use __divdi3_internal.
+	* sysdeps/powerpc/powerpc32/divdi3.c: Remove.
+	* sysdeps/powerpc/powerpc32/Makefile (CPPFLAGS-divdi3.c): Don't
+	define.
+	* sysdeps/powerpc/powerpc32/Dist: Remove divdi3.c.
+
+2003-01-24  Jakub Jelinek  <jakub@redhat.com>
+
+	* elf/tls-macros.h: Add SPARC 32-bit definitions.
+	* sysdeps/sparc/sparc32/elf/configure.in: Add TLS check.
+	* sysdeps/sparc/sparc32/dl-machine.h: Add dl_machine_h guards
+	for the first half of the header.  Include tls.h.
+	(elf_machine_type_class): Return ELF_RTYPE_CLASS_PLT for TLS
+	relocs too.
+	(elf_machine_rela): Handle TLS relocs.
+	* sysdeps/sparc/dl-tls.h: New file.
+
+	* sysdeps/unix/sysv/linux/sparc/sparc32/socket.S: Add cancellation
+	support.
+
+	* sysdeps/sparc/sparc32/sparcv9/hp-timing.h: Use %g6 instead of %g7.
+	* sysdeps/sparc/sparc32/memchr.S: Likewise.
+	* sysdeps/sparc/sparc32/memcpy.S: Likewise.
+	* sysdeps/sparc/sparc32/strcat.S: Likewise.
+	* sysdeps/sparc/sparc32/strchr.S: Likewise.
+	* sysdeps/sparc/sparc32/strcmp.S: Likewise.
+	* sysdeps/sparc/sparc32/strcpy.S: Likewise.
+	* sysdeps/sparc/sparc64/sparcv9b/memcpy.S: Likewise.
+	* sysdeps/sparc/sparc64/hp-timing.h: Likewise.
+	* sysdeps/sparc/sparc64/memcpy.S: Likewise.
+	* sysdeps/sparc/sparc64/stpcpy.S: Likewise.
+	* sysdeps/sparc/sparc64/stpncpy.S: Likewise.
+	* sysdeps/sparc/sparc64/strcat.S: Likewise.
+	* sysdeps/sparc/sparc64/strchr.S: Likewise.
+	* sysdeps/sparc/sparc64/strcmp.S: Likewise.
+	* sysdeps/sparc/sparc64/strcpy.S: Likewise.
+	* sysdeps/sparc/sparc64/strncmp.S: Likewise.
+	* sysdeps/sparc/sparc64/strncpy.S: Likewise.
+	* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise.
+	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
+
+2003-01-24  Andreas Schwab  <schwab@suse.de>
+
+	* elf/dl-close.c (_dl_close): Don't relocate DT_FINI_ARRAY
+	elements, and process them backwards.
+	* elf/Makefile ($(objpfx)tst-array4): New target.
+	($(objpfx)tst-array4.out): Likewise.
+	(tests) [$(have-initfini-array) = yes]: Add tst-array4.
+	* elf/tst-array4.c: New file.
+	* elf/tst-array4.exp: Likewise.
+
+2003-01-24  Steven Munroe  <sjmunroe@us.ibm.com>
+
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c: New file.
+
+2003-01-27  Guido Guenther  <agx@sigxcpu.org>
+
+	* sysdeps/unix/sysv/linux/mips/sysdep.h (SYSCALL_ERROR_LABEL): Define.
+	* sysdeps/unix/sysv/linux/mips/pread.c: Add support for
+	cancellation handling and handle both __NR_pread64 and __NR_pread.
+	* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.
+	* sysdeps/unix/sysv/linux/mips/pwrite.c: Add support for
+	cancellation handling and handle both __NR_pwrite64 and __NR_pwrite.
+	* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.
+	* sysdeps/unix/mips/sysdep.S: Don't set errno in the _LIBC_REENTRANT
+	case, use register names consistently.
+
+2003-01-27  Wolfram Gloger  <wg@malloc.de>
+
+	* malloc/hooks.c (mem2chunk_check): Check alignment of mem
+	pointer, not of the computed chunk.  Bug report from Carlos
+	O'Donell <carlos@baldric.uwo.ca>.
+
 2003-01-25  Andreas Schwab  <schwab@suse.de>
 
 	* sysdeps/m68k/dl-machine.h (_dl_start_user): Use pc-relative
diff --git a/elf/Makefile b/elf/Makefile
index c6320d8867..09ea94800d 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -121,7 +121,7 @@ endif
 
 tests = tst-tls1 tst-tls2 tst-tls9
 ifeq (yes,$(have-initfini-array))
-tests += tst-array1 tst-array2 tst-array3
+tests += tst-array1 tst-array2 tst-array3 tst-array4
 endif
 ifeq (yes,$(build-static))
 tests-static = tst-tls1-static tst-tls2-static
@@ -594,6 +594,12 @@ $(objpfx)tst-array3.out: $(objpfx)tst-array3
 	  $(objpfx)tst-array3 > $@
 	cmp $@ tst-array1.exp > /dev/null
 
+$(objpfx)tst-array4: $(libdl)
+$(objpfx)tst-array4.out: $(objpfx)tst-array4 $(objpfx)tst-array2dep.so
+	$(elf-objpfx)$(rtld-installed-name) \
+	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
+	  $< > $@
+	cmp $@ tst-array4.exp > /dev/null
 
 check-textrel-CFLAGS = -O
 $(objpfx)check-textrel: check-textrel.c
diff --git a/elf/dl-close.c b/elf/dl-close.c
index cdebc739e8..1d4a8c3653 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -238,10 +238,9 @@ _dl_close (void *_map)
 				    + imap->l_info[DT_FINI_ARRAY]->d_un.d_ptr);
 		  unsigned int sz = (imap->l_info[DT_FINI_ARRAYSZ]->d_un.d_val
 				     / sizeof (ElfW(Addr)));
-		  unsigned int cnt;
 
-		  for (cnt = 0; cnt < sz; ++cnt)
-		    ((fini_t) (imap->l_addr + array[cnt])) ();
+		  while (sz-- > 0)
+		    ((fini_t) array[sz]) ();
 		}
 
 	      /* Next try the old-style destructor.  */
diff --git a/elf/tls-macros.h b/elf/tls-macros.h
index 046a7d4c92..2de4b1a1af 100644
--- a/elf/tls-macros.h
+++ b/elf/tls-macros.h
@@ -298,6 +298,75 @@ register void *__gp __asm__("$29");
           : "=r" (__l) : : "loc0", __TLS_CALL_CLOBBERS);		      \
      __l; })
 
+#elif defined __sparc__ && !defined __arch64__
+
+# define TLS_LE(x) \
+  ({ int *__l;								      \
+     asm ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l));		      \
+     asm ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l));	      \
+     asm ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l));			      \
+     __l; })
+
+# ifdef __PIC__ 
+#  define TLS_LOAD_PIC \
+  ({ register long pc __asm__ ("%o7");					      \
+     long got;								      \
+     asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t"			      \
+	  "call .+8\n\t"						      \
+	  "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t"		      \
+	  "add %1, %0, %1\n\t"						      \
+	  : "=r" (pc), "=r" (got));					      \
+     got; })
+# else
+#  define TLS_LOAD_PIC \
+   ({ long got;								      \
+      asm (".hidden _GLOBAL_OFFSET_TABLE_\n\t"				      \
+	   "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t"			      \
+	   "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0"			      \
+	   : "=r" (got));						      \
+      got; })
+# endif
+
+# define TLS_IE(x) \
+  ({ int *__l;								      \
+     asm ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l));			      \
+     asm ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l));	      \
+     asm ("ld [%1 + %2], %0, %%tie_ld(" #x ")"				      \
+	  : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l));		      \
+     asm ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l));    \
+     __l; })
+
+# define TLS_LD(x) \
+  ({ int *__l; register void *__o0 asm ("%o0");				      \
+     long __o;								      \
+     asm ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l));		      \
+     asm ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l));	      \
+     asm ("add %1, %2, %0, %%tldm_add(" #x ")"				      \
+	  : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l));		      \
+     asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t"			      \
+	  " nop"							      \
+	  : "=r" (__o0) : "0" (__o0)					      \
+	  : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4",	      \
+	    "o5", "o7");						      \
+     asm ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o));		      \
+     asm ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o));	      \
+     asm ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l)		      \
+	  : "r" (__o0), "r" (__o));					      \
+     __l; })
+
+# define TLS_GD(x) \
+  ({ int *__l; register void *__o0 asm ("%o0");				      \
+     asm ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l));			      \
+     asm ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l));	      \
+     asm ("add %1, %2, %0, %%tgd_add(" #x ")"				      \
+	  : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l));		      \
+     asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t"			      \
+	  " nop"							      \
+	  : "=r" (__o0) : "0" (__o0)					      \
+	  : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4",	      \
+	    "o5", "o7");						      \
+     __o0; })
+
 #else
 # error "No support for this architecture so far."
 #endif
diff --git a/elf/tst-array4.c b/elf/tst-array4.c
new file mode 100644
index 0000000000..ac3d4eb716
--- /dev/null
+++ b/elf/tst-array4.c
@@ -0,0 +1,18 @@
+#include <dlfcn.h>
+
+#define main array1_main
+#include "tst-array1.c"
+#undef main
+
+int
+main (void)
+{
+  void *handle = dlopen ("tst-array2dep.so", RTLD_LAZY);
+
+  array1_main ();
+
+  if (handle != NULL)
+    dlclose (handle);
+
+  return 0;
+}
diff --git a/elf/tst-array4.exp b/elf/tst-array4.exp
new file mode 100644
index 0000000000..560444d2e8
--- /dev/null
+++ b/elf/tst-array4.exp
@@ -0,0 +1,19 @@
+preinit array 0
+preinit array 1
+preinit array 2
+init
+init array 0
+init array 1
+init array 2
+DSO init
+DSO init array 0
+DSO init array 1
+DSO init array 2
+DSO fini array 2
+DSO fini array 1
+DSO fini array 0
+DSO fini
+fini array 2
+fini array 1
+fini array 0
+fini
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index d81864b977..2949321c65 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,3 +1,19 @@
+2003-01-24  Jakub Jelinek  <jakub@redhat.com>
+
+	* sysdeps/sparc/sparc32/pt-machine.h (__thread_self): Change to %g7,
+	as required by TLS ABI.
+	* sysdeps/sparc/sparc64/pt-machine.h (__thread_self): Likewise.
+	* sysdeps/sparc/tls.h [HAVE_TLS_SUPPORT] (USE_TLS, TLS_INIT_TCB_SIZE,
+	TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE, TLS_TCB_ALIGN, TLS_TCB_AT_TP,
+	INSTALL_DTV, INSTALL_NEW_DTV, GET_DTV, TLS_INIT_TP, THREAD_DTV):
+	Define.
+	[HAVE_TLS_SUPPORT]: Include descr.h and sysdep.h.
+	* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Use %g7
+	instead of %g6 for thread pointer.
+	* sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
+	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
+	* sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
+
 2003-01-25  Guido Guenther  <agx@sigxcpu.org>
 
 	* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
diff --git a/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h b/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
index 2e912332f5..cbfc872df2 100644
--- a/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
+++ b/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
@@ -1,6 +1,6 @@
 /* Machine-dependent pthreads configuration and inline functions.
    sparc version.
-   Copyright (C) 1996,1997,1998,2000,2001,2002 Free Software Foundation, Inc.
+   Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <rth@tamu.edu>.
 
@@ -53,10 +53,10 @@ testandset (int *spinlock)
 register char *stack_pointer __asm__("%sp");
 
 
-/* Registers %g6 and %g7 are reserved by the ABI for "system use".  It
-   happens that Solaris uses %g6 for the thread pointer -- we do the same.  */
+/* Registers %g6 and %g7 are reserved by the ABI for "system use".
+   %g7 is specified in the TLS ABI as thread pointer -- we do the same.  */
 struct _pthread_descr_struct;
-register struct _pthread_descr_struct *__thread_self __asm__("%g6");
+register struct _pthread_descr_struct *__thread_self __asm__("%g7");
 
 /* Return the thread descriptor for the current thread.  */
 #define THREAD_SELF  __thread_self
diff --git a/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h b/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
index f32b1feac8..3087020e1b 100644
--- a/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
+++ b/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
@@ -1,6 +1,6 @@
 /* Machine-dependent pthreads configuration and inline functions.
    Sparc v9 version.
-   Copyright (C) 1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc.
+   Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <rth@tamu.edu>.
 
@@ -59,10 +59,10 @@ testandset (int *spinlock)
 register char *stack_pointer __asm__ ("%sp");
 
 
-/* Registers %g6 and %g7 are reserved by the ABI for "system use".  It
-   happens that Solaris uses %g6 for the thread pointer -- we do the same.  */
+/* Registers %g6 and %g7 are reserved by the ABI for "system use".  The
+   TLS ABI specifies %g7 as the thread pointer.  */
 struct _pthread_descr_struct;
-register struct _pthread_descr_struct *__thread_self __asm__ ("%g6");
+register struct _pthread_descr_struct *__thread_self __asm__ ("%g7");
 
 /* Return the thread descriptor for the current thread.  */
 #define THREAD_SELF  __thread_self
diff --git a/linuxthreads/sysdeps/sparc/tls.h b/linuxthreads/sysdeps/sparc/tls.h
index 4571922f57..9a9719c48e 100644
--- a/linuxthreads/sysdeps/sparc/tls.h
+++ b/linuxthreads/sysdeps/sparc/tls.h
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/sparc version.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 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,9 +45,56 @@ typedef struct
 # include <tcb-offsets.h>
 #endif /* __ASSEMBLER__ */
 
-#undef USE_TLS
+#ifdef HAVE_TLS_SUPPORT
 
-#if USE_TLS
+/* Signal that TLS support is available.  */
+# define USE_TLS	1
+
+# ifndef __ASSEMBLER__
+/* Get system call information.  */
+#  include <sysdep.h>
+
+/* Get the thread descriptor definition.  */
+#  include <linuxthreads/descr.h>
+
+/* This is the size of the initial TCB.  */
+#  define TLS_INIT_TCB_SIZE sizeof (tcbhead_t)
+
+/* Alignment requirements for the initial TCB.  */
+#  define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t)
+
+/* This is the size of the TCB.  */
+#  define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct)
+
+/* Alignment requirements for the TCB.  */
+#  define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct)
+
+/* The TCB can have any size and the memory following the address the
+   thread pointer points to is unspecified.  Allocate the TCB there.  */
+#  define TLS_TCB_AT_TP	1
+
+/* Install the dtv pointer.  The pointer passed is to the element with
+   index -1 which contain the length.  */
+#  define INSTALL_DTV(descr, dtvp) \
+  ((tcbhead_t *) (descr))->dtv = (dtvp) + 1
+
+/* Install new dtv for current thread.  */
+#  define INSTALL_NEW_DTV(DTV) \
+  (((tcbhead_t *) __thread_self)->dtv = (DTV))
+
+/* Return dtv of given thread descriptor.  */
+#  define GET_DTV(descr) \
+  (((tcbhead_t *) (descr))->dtv)
+
+/* Code to initially initialize the thread pointer.  */
+# define TLS_INIT_TP(descr, secondcall) \
+  (__thread_self = (__typeof (__thread_self)) (descr), NULL)
+
+/* Return the address of the dtv for the current thread.  */
+#  define THREAD_DTV() \
+  (((tcbhead_t *) __thread_self)->dtv)
+
+# endif
 
 #else
 
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
index 66aaeabdde..545e1d367f 100644
--- a/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
+++ b/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
 
@@ -29,7 +29,7 @@
 # define PSEUDO(name, syscall_name, args)				      \
 	.text;								      \
 ENTRY(name)								      \
-	ld [%g6 + MULTIPLE_THREADS_OFFSET], %g1;			      \
+	ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;			      \
 	cmp %g1, 0;							      \
 	bne 1f;								      \
 	 mov SYS_ify(syscall_name), %g1;				      \
@@ -86,7 +86,7 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2)			      \
   __builtin_expect (THREAD_GETMEM (THREAD_SELF,				      \
 				   p_header.data.multiple_threads) == 0, 1)
 # else
-#  define SINGLE_THREAD_P ld [%g6 + MULTIPLE_THREADS_OFFSET], %g1
+#  define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
 # endif
 
 #elif !defined __ASSEMBLER__
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
index 9378bd8522..456fe74362 100644
--- a/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
+++ b/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
@@ -21,7 +21,7 @@
 
 	.text
 ENTRY(__vfork)
-	ld	[%g6 + MULTIPLE_THREADS_OFFSET], %o0
+	ld	[%g7 + MULTIPLE_THREADS_OFFSET], %o0
 	cmp	%o0, 0
 #ifdef SHARED
 	bne	HIDDEN_JUMPTARGET(__fork)
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
index 7d4f9b5ea8..dff728a81a 100644
--- a/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
+++ b/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
 
@@ -29,7 +29,7 @@
 # define PSEUDO(name, syscall_name, args)				      \
 	.text;								      \
 ENTRY(name)								      \
-	ld [%g6 + MULTIPLE_THREADS_OFFSET], %g1;			      \
+	ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;			      \
 	brz,pn %g1, 1f;							      \
 	 mov SYS_ify(syscall_name), %g1;				      \
 	ta 0x6d;							      \
@@ -85,7 +85,7 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2)			      \
   __builtin_expect (THREAD_GETMEM (THREAD_SELF,				      \
 				   p_header.data.multiple_threads) == 0, 1)
 # else
-#  define SINGLE_THREAD_P ld [%g6 + MULTIPLE_THREADS_OFFSET], %g1
+#  define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
 # endif
 
 #elif !defined __ASSEMBLER__
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
index bcfcedfc2d..98ad45795a 100644
--- a/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
+++ b/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
@@ -21,7 +21,7 @@
 
 	.text
 ENTRY(__vfork)
-	ld	[%g6 + MULTIPLE_THREADS_OFFSET], %o0
+	ld	[%g7 + MULTIPLE_THREADS_OFFSET], %o0
 #ifdef SHARED
 	cmp	%o0, 0
 	bne	HIDDEN_JUMPTARGET (__fork)
diff --git a/sysdeps/powerpc/powerpc32/Dist b/sysdeps/powerpc/powerpc32/Dist
index ef137361a4..ada834f7c3 100644
--- a/sysdeps/powerpc/powerpc32/Dist
+++ b/sysdeps/powerpc/powerpc32/Dist
@@ -1,4 +1,3 @@
-divdi3.c
 dl-machine.c
 dl-start.S
 libgcc-compat.S
diff --git a/sysdeps/powerpc/powerpc32/Makefile b/sysdeps/powerpc/powerpc32/Makefile
index 886a507c8f..9d7a1cd15c 100644
--- a/sysdeps/powerpc/powerpc32/Makefile
+++ b/sysdeps/powerpc/powerpc32/Makefile
@@ -34,7 +34,6 @@ endif
 ifeq (yes,$(build-shared))
 # Compatibility
 ifeq (yes,$(have-protected))
-CPPFLAGS-divdi3.c = -DHAVE_DOT_HIDDEN
 CPPFLAGS-libgcc-compat.S = -DHAVE_DOT_HIDDEN
 endif
 sysdep_routines += libgcc-compat
diff --git a/sysdeps/powerpc/powerpc32/divdi3.c b/sysdeps/sparc/dl-tls.h
index 647d1ad179..6edf8d5252 100644
--- a/sysdeps/powerpc/powerpc32/divdi3.c
+++ b/sysdeps/sparc/dl-tls.h
@@ -1,5 +1,5 @@
-/* 64-bit multiplication and division libgcc routines for 32-bit PowerPC
-   Copyright (C) 2002 Free Software Foundation, Inc.
+/* Thread-local storage handling in the ELF dynamic linker.  SPARC version.
+   Copyright (C) 2003 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
@@ -17,27 +17,13 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define _DIVDI3_C
-#include <sysdeps/wordsize-32/divdi3.c>
 
-INTDEF (__udivdi3);
-INTDEF (__moddi3);
-INTDEF (__umoddi3);
+/* Type used for the representation of TLS information in the GOT.  */
+typedef struct
+{
+  unsigned long int ti_module;
+  unsigned long int ti_offset;
+} tls_index;
 
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden __divdi3");
-asm (".hidden __udivdi3");
-asm (".hidden __moddi3");
-asm (".hidden __umoddi3");
-#endif
 
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
-
-symbol_version (INTUSE (__divdi3), __divdi3, GLIBC_2.0);
-symbol_version (INTUSE (__udivdi3), __udivdi3, GLIBC_2.0);
-symbol_version (INTUSE (__moddi3), __moddi3, GLIBC_2.0);
-symbol_version (INTUSE (__umoddi3), __umoddi3, GLIBC_2.0);
-
-#endif
+extern void *__tls_get_addr (tls_index *ti);
diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h
index 51060b652a..8c821b9cc2 100644
--- a/sysdeps/sparc/sparc32/dl-machine.h
+++ b/sysdeps/sparc/sparc32/dl-machine.h
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  SPARC version.
-   Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1996-2002, 2003 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
@@ -17,11 +17,15 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#ifndef dl_machine_h
+#define dl_machine_h
+
 #define ELF_MACHINE_NAME "sparc"
 
 #include <string.h>
 #include <sys/param.h>
 #include <ldsodefs.h>
+#include <tls.h>
 
 #ifndef VALIDX
 # define VALIDX(tag) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \
@@ -237,9 +241,17 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
    PLT entries should not be allowed to define the value.
    ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
    of the main executable's symbols, as for a COPY reloc.  */
-#define elf_machine_type_class(type) \
-  ((((type) == R_SPARC_JMP_SLOT) * ELF_RTYPE_CLASS_PLT)	\
+#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+# define elf_machine_type_class(type) \
+  ((((type) == R_SPARC_JMP_SLOT						      \
+     || ((type) >= R_SPARC_TLS_GD_HI22 && (type) <= R_SPARC_TLS_TPOFF64))     \
+    * ELF_RTYPE_CLASS_PLT)						      \
+   | (((type) == R_SPARC_COPY) * ELF_RTYPE_CLASS_COPY))
+#else
+# define elf_machine_type_class(type) \
+  ((((type) == R_SPARC_JMP_SLOT) * ELF_RTYPE_CLASS_PLT)			      \
    | (((type) == R_SPARC_COPY) * ELF_RTYPE_CLASS_COPY))
+#endif
 
 /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */
 #define ELF_MACHINE_JMP_SLOT	R_SPARC_JMP_SLOT
@@ -413,6 +425,8 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
   return value + reloc->r_addend;
 }
 
+#endif /* dl_machine_h */
+
 #ifdef RESOLVE
 
 /* Perform the relocation specified by RELOC and SYM (which is fully resolved).
@@ -448,16 +462,29 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 #if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP
       const Elf32_Sym *const refsym = sym;
 #endif
+#if defined USE_TLS && !defined RTLD_BOOTSTRAP
+      struct link_map *sym_map;
+#endif
       Elf32_Addr value;
 #ifndef RESOLVE_CONFLICT_FIND_MAP
       if (sym->st_shndx != SHN_UNDEF &&
 	  ELF32_ST_BIND (sym->st_info) == STB_LOCAL)
-	value = map->l_addr;
+	{
+	  value = map->l_addr;
+# if defined USE_TLS && !defined RTLD_BOOTSTRAP
+	  sym_map = map;
+# endif
+	}
       else
 	{
+# if defined USE_TLS && !defined RTLD_BOOTSTRAP
+	  sym_map = RESOLVE_MAP (&sym, version, r_type);
+	  value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+# else	  
 	  value = RESOLVE (&sym, version, r_type);
 	  if (sym)
 	    value += sym->st_value;
+# endif
 	}
 #else
       value = 0;
@@ -496,6 +523,43 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 	     so we can optimize the first instruction of .plt out.  */
 	  sparc_fixup_plt (reloc, reloc_addr, value, 0);
 	  break;
+#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) \
+    && !defined RESOLVE_CONFLICT_FIND_MAP
+	case R_SPARC_TLS_DTPMOD32:
+	  /* Get the information from the link map returned by the
+	     resolv function.  */
+	  if (sym_map != NULL)
+	    *reloc_addr = sym_map->l_tls_modid;
+	  break;
+	case R_SPARC_TLS_DTPOFF32:
+	  /* During relocation all TLS symbols are defined and used.
+	     Therefore the offset is already correct.  */
+	  *reloc_addr = (sym == NULL ? 0 : sym->st_value) + reloc->r_addend;
+	  break;
+	case R_SPARC_TLS_TPOFF32:
+	  /* The offset is negative, forward from the thread pointer.  */
+	  /* We know the offset of object the symbol is contained in.
+	     It is a negative value which will be added to the
+	     thread pointer.  */
+	  CHECK_STATIC_TLS (map, sym_map);
+	  *reloc_addr
+	    = (sym == NULL ? 0 : sym->st_value - sym_map->l_tls_offset)
+	      + reloc->r_addend;
+	  break;
+# ifndef RTLD_BOOTSTRAP
+	case R_SPARC_TLS_LE_HIX22:
+	case R_SPARC_TLS_LE_LOX10:
+	  CHECK_STATIC_TLS (map, sym_map);
+	  value = (sym == NULL ? 0 : sym->st_value - sym_map->l_tls_offset)
+		  + reloc->r_addend;
+	  if (r_type == R_SPARC_TLS_LE_HIX22)
+	    *reloc_addr = (*reloc_addr & 0xffc00000) | ((~value) >> 10);
+	  else
+	    *reloc_addr = (*reloc_addr & 0xffffe000) | (value & 0x3ff)
+			  | 0x1c00;
+	  break;
+# endif
+#endif
 #ifndef RTLD_BOOTSTRAP
 	case R_SPARC_8:
 	  *(char *) reloc_addr = value;
diff --git a/sysdeps/sparc/sparc32/elf/configure.in b/sysdeps/sparc/sparc32/elf/configure.in
new file mode 100644
index 0000000000..0c0b5121e5
--- /dev/null
+++ b/sysdeps/sparc/sparc32/elf/configure.in
@@ -0,0 +1,43 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/sparc/sparc32/elf.
+
+if test "$usetls" != no; then
+# Check for support of thread-local storage handling in assembler and linker.
+AC_CACHE_CHECK(for sparc32 TLS support, libc_cv_sparc32_tls, [dnl
+cat > conftest.s <<\EOF
+	.section ".tdata", "awT", @progbits
+	.globl foo
+foo:	.word	1
+	.section ".tbss", "awT", @nobits
+	.globl bar
+bar:	.skip	4
+	.text
+baz:	sethi	%tgd_hi22(foo), %l1
+	add	%l1, %tgd_lo10(foo), %l1
+	add	%l7, %l1, %o0, %tgd_add(foo)
+	call	__tls_get_addr, %tgd_call(foo)
+	sethi	%tldm_hi22(bar), %l1
+	add	%l1, %tldm_lo10(bar), %l1
+	add	%l7, %l1, %o0, %tldm_add(bar)
+	call	__tls_get_addr, %tldm_call(bar)
+	sethi	%tldo_hix22(bar), %l1
+	xor	%l1, %tldo_lox10(bar), %l1
+	add	%o0, %l1, %l1, %tldo_add(bar)
+	sethi	%tie_hi22(foo), %l1
+	add	%l1, %tie_lo10(foo), %l1
+	ld	[%l7 + %l1], %l1, %tie_ld(foo)
+	add	%g7, %l1, %l1, %tie_add(foo)
+	sethi	%tle_hix22(foo), %l1
+	xor	%l1, %tle_lox10(foo), %l1
+EOF
+dnl
+if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
+  libc_cv_sparc32_tls=yes
+else
+  libc_cv_sparc32_tls=no
+fi
+rm -f conftest*])
+if test $libc_cv_sparc32_tls = yes; then
+  AC_DEFINE(HAVE_TLS_SUPPORT)
+fi
+fi
diff --git a/sysdeps/sparc/sparc32/memchr.S b/sysdeps/sparc/sparc32/memchr.S
index d742a07bd7..490c431358 100644
--- a/sysdeps/sparc/sparc32/memchr.S
+++ b/sysdeps/sparc/sparc32/memchr.S
@@ -1,7 +1,7 @@
 /* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less
    than N.
    For SPARC v7.
-   Copyright (C) 1996,1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1999, 2000, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
 		  David S. Miller <davem@caip.rutgers.edu>.
@@ -67,23 +67,23 @@
 
 ENTRY(__memchr)
 	andcc		%o1, 0xff, %o1
-	sll		%o1, 8, %g7
+	sll		%o1, 8, %g6
 	andcc		%o0, 3, %g0
-	or		%o1, %g7, %g7
-	sll		%g7, 16, %o3
+	or		%o1, %g6, %g6
+	sll		%g6, 16, %o3
 	bne		0b
-	 or		%o3, %g7, %g2
+	 or		%o3, %g6, %g2
 	sethi		%hi(0x80808080), %o4
 	or		%o4, %lo(0x80808080), %o3
 4:	sethi		%hi(0x01010101), %o5
 5:	and		%o2, 3, %g1
 7:	andcc		%o2, 0xfffffffc, %o2
 	be		0f
-	 or		%o5, %lo(0x01010101), %g7
+	 or		%o5, %lo(0x01010101), %g6
 	ld		[%o0], %g4
 6:	xor		%g4, %g2, %g5
 	add		%o0, 4, %o0
-	sub		%g5, %g7, %g5
+	sub		%g5, %g6, %g5
 	andcc		%g5, %o3, %g0
 	bne		8f
 	 subcc		%o2, 4, %o2
diff --git a/sysdeps/sparc/sparc32/memcpy.S b/sysdeps/sparc/sparc32/memcpy.S
index f4252d0bf4..43e19b88b5 100644
--- a/sysdeps/sparc/sparc32/memcpy.S
+++ b/sysdeps/sparc/sparc32/memcpy.S
@@ -1,6 +1,6 @@
 /* Copy SIZE bytes from SRC to DEST.
    For SPARC v7.
-   Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1999, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David S. Miller <davem@caip.rutgers.edu>,
 		  Eddie C. Dost <ecd@skynet.be> and
@@ -196,7 +196,7 @@ ENTRY(memmove)
 	st		%o4, [%o0 - 4]
 	sub		%o1, 4, %o1
 	sub		%o0, 4, %o0
-2:	andcc		%g1, 0xffffff80, %g7
+2:	andcc		%g1, 0xffffff80, %g6
 	be		3f
 	 andcc		%o0, 4, %g0
 
@@ -205,23 +205,23 @@ ENTRY(memmove)
 	RMOVE_BIGCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5)
 	RMOVE_BIGCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5)
 	RMOVE_BIGCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5)
-	subcc		%g7, 128, %g7
+	subcc		%g6, 128, %g6
 	sub		%o1, 128, %o1
 	bne		5b
 	 sub		%o0, 128, %o0
 
-3:	andcc		%g1, 0x70, %g7
+3:	andcc		%g1, 0x70, %g6
 	be		72f
 	 andcc		%g1, 8, %g0
 
-	srl		%g7, 1, %o4
+	srl		%g6, 1, %o4
 	mov		%o7, %g2
-	add		%g7, %o4, %o4
+	add		%g6, %o4, %o4
 101:	call		100f
-	 sub		%o1, %g7, %o1
+	 sub		%o1, %g6, %o1
 	mov		%g2, %o7
 	jmpl		%o5 + (72f - 101b), %g0
-	 sub		%o0, %g7, %o0
+	 sub		%o0, %g6, %o0
 
 71:	RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g4, g5)
 	RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g4, g5)
@@ -264,23 +264,23 @@ ENTRY(memmove)
 	RMOVE_BIGALIGNCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5)
 	RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5)
 	RMOVE_BIGALIGNCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5)
-	subcc		%g7, 128, %g7
+	subcc		%g6, 128, %g6
 	sub		%o1, 128, %o1
 	bne		74b
 	 sub		%o0, 128, %o0
 
-	andcc		%g1, 0x70, %g7
+	andcc		%g1, 0x70, %g6
 	be		72b
 	 andcc		%g1, 8, %g0
 
-	srl		%g7, 1, %o4
+	srl		%g6, 1, %o4
 	mov		%o7, %g2
-	add		%g7, %o4, %o4
+	add		%g6, %o4, %o4
 102:	call		100f
-	 sub		%o1, %g7, %o1
+	 sub		%o1, %g6, %o1
 	mov		%g2, %o7
 	jmpl		%o5 + (72b - 102b), %g0
-	 sub		%o0, %g7, %o0
+	 sub		%o0, %g6, %o0
 
 75:	and		%o2, 0xe, %o3
 	mov		%o7, %g2
@@ -351,7 +351,7 @@ ENTRY(memmove)
 	sll		%g2, 3, %g4
 	mov		32, %g2
 	be		4f
-	 sub		%g2, %g4, %g7
+	 sub		%g2, %g4, %g6
 
 	blu		3f
 	 cmp		%g3, 8
@@ -386,22 +386,22 @@ ENTRY(memmove)
 
 	ld		[%o1 + 12], %o3
 5:	sll		%o5, %g4, %g2
-	srl		%g1, %g7, %g5
+	srl		%g1, %g6, %g5
 	or		%g2, %g5, %g2
 	st		%g2, [%o0 + 12]
 6:	ld		[%o1 + 8], %o4
 	sll		%o3, %g4, %g2
-	srl		%o5, %g7, %g5
+	srl		%o5, %g6, %g5
 	or		%g2, %g5, %g2
 	st		%g2, [%o0 + 8]
 7:	ld		[%o1 + 4], %g1
 	sll		%o4, %g4, %g2
-	srl		%o3, %g7, %g5
+	srl		%o3, %g6, %g5
 	or		%g2, %g5, %g2
 	st		%g2, [%o0 + 4]
 8:	ld		[%o1], %o5
 	sll		%g1, %g4, %g2
-	srl		%o4, %g7, %g5
+	srl		%o4, %g6, %g5
 	addcc		%g3, -4, %g3
 	or		%g2, %g5, %g2
 	add		%o1, -16, %o1
@@ -410,7 +410,7 @@ ENTRY(memmove)
 	bne,a		5b	
 	 ld		[%o1 + 12], %o3
 	sll		%o5, %g4, %g2
-	srl		%g1, %g7, %g5
+	srl		%g1, %g6, %g5
 	srl		%g4, 3, %g3
 	or		%g2, %g5, %g2
 	add		%o1, %g3, %o1
@@ -471,7 +471,7 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	st		%o4, [%o0]
 	add		%o1, 4, %o1
 	add		%o0, 4, %o0
-2:	andcc		%g1, 0xffffff80, %g7
+2:	andcc		%g1, 0xffffff80, %g6
 	be		3f
 	 andcc		%o0, 4, %g0
 
@@ -480,20 +480,20 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	MOVE_BIGCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5)
 	MOVE_BIGCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5)
 	MOVE_BIGCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5)
-	subcc		%g7, 128, %g7
+	subcc		%g6, 128, %g6
 	add		%o1, 128, %o1
 	bne		5b
 	 add		%o0, 128, %o0
-3:	andcc		%g1, 0x70, %g7
+3:	andcc		%g1, 0x70, %g6
 	be		80f
 	 andcc		%g1, 8, %g0
 
-	srl		%g7, 1, %o4
+	srl		%g6, 1, %o4
 	mov		%o7, %g2
-	add		%g7, %o4, %o4
-	add		%o1, %g7, %o1
+	add		%g6, %o4, %o4
+	add		%o1, %g6, %o1
 104:	call		100f
-	 add		%o0, %g7, %o0
+	 add		%o0, %g6, %o0
 	jmpl		%o5 + (80f - 104b), %g0
 	 mov		%g2, %o7
 
@@ -541,21 +541,21 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	MOVE_BIGALIGNCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5)
 	MOVE_BIGALIGNCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5)
 	MOVE_BIGALIGNCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5)
-	subcc		%g7, 128, %g7
+	subcc		%g6, 128, %g6
 	add		%o1, 128, %o1
 	bne		82b
 	 add		%o0, 128, %o0
 
-	andcc		%g1, 0x70, %g7
+	andcc		%g1, 0x70, %g6
 	be		84f
 	 andcc		%g1, 8, %g0
 
 	mov		%o7, %g2
 111:	call		110f
-	 add		%o1, %g7, %o1
+	 add		%o1, %g6, %o1
 	mov		%g2, %o7
 	jmpl		%o5 + (84f - 111b), %g0
-	 add		%o0, %g7, %o0
+	 add		%o0, %g6, %o0
 
 83:	MOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3, g4, g5)
 	MOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3, g4, g5)
@@ -626,7 +626,7 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	sll		%g2, 3, %g4
 	mov		32, %g2
 	be		4f
-	 sub		%g2, %g4, %g7
+	 sub		%g2, %g4, %g6
 	
 	blu		3f
 	 cmp		%g3, 0x8
@@ -661,22 +661,22 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	ld		[%o1], %o3
 	add		%g3, -1, %g3
 5:	sll		%o5, %g4, %g2
-	srl		%g1, %g7, %g5
+	srl		%g1, %g6, %g5
 	or		%g2, %g5, %g2
 	st		%g2, [%o0]
 7:	ld		[%o1 + 4], %o4
 	sll		%g1, %g4, %g2
-	srl		%o3, %g7, %g5
+	srl		%o3, %g6, %g5
 	or		%g2, %g5, %g2
 	st		%g2, [%o0 + 4]
 8:	ld		[%o1 + 8], %o5
 	sll		%o3, %g4, %g2
-	srl		%o4, %g7, %g5
+	srl		%o4, %g6, %g5
 	or		%g2, %g5, %g2
 	st		%g2, [%o0 + 8]
 9:	ld		[%o1 + 12], %g1
 	sll		%o4, %g4, %g2
-	srl		%o5, %g7, %g5
+	srl		%o5, %g6, %g5
 	addcc		%g3, -4, %g3
 	or		%g2, %g5, %g2
 	add		%o1, 16, %o1
@@ -685,8 +685,8 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	bne,a		5b
 	 ld		[%o1], %o3
 10:	sll		%o5, %g4, %g2
-	srl		%g1, %g7, %g5
-	srl		%g7, 3, %g3
+	srl		%g1, %g6, %g5
+	srl		%g6, 3, %g3
 	or		%g2, %g5, %g2
 	sub		%o1, %g3, %o1
 	andcc		%o2, 2, %g0
@@ -758,10 +758,10 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	be		41f
 	 and		%o2, 0xffffffc0, %o3
 	ld		[%o0 - 7], %o4
-4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 8, 24, -3)
-	SMOVE_CHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g7, g1, 8, 24, -3)
-	SMOVE_CHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g7, g1, 8, 24, -3)
-	SMOVE_CHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g7, g1, 8, 24, -3)
+4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
+	SMOVE_CHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
+	SMOVE_CHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
+	SMOVE_CHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
 	subcc		%o3, 64, %o3
 	add		%o1, 64, %o1
 	bne		4b
@@ -770,7 +770,7 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	andcc		%o2, 0x30, %o3
 	be,a		1f
 	 srl		%g1, 16, %g2
-4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 8, 24, -3)
+4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
 	subcc		%o3, 16, %o3
 	add		%o1, 16, %o1
 	bne		4b
@@ -793,10 +793,10 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	be		42f
 	 and		%o2, 0xffffffc0, %o3
 	ld		[%o0 - 6], %o4
-4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 16, 16, -2)
-	SMOVE_CHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g7, g1, 16, 16, -2)
-	SMOVE_CHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g7, g1, 16, 16, -2)
-	SMOVE_CHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g7, g1, 16, 16, -2)
+4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
+	SMOVE_CHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
+	SMOVE_CHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
+	SMOVE_CHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
 	subcc		%o3, 64, %o3
 	add		%o1, 64, %o1
 	bne		4b
@@ -805,7 +805,7 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	andcc		%o2, 0x30, %o3
 	be,a		1f
 	 srl		%g1, 16, %g2
-4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 16, 16, -2)
+4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
 	subcc		%o3, 16, %o3
 	add		%o1, 16, %o1
 	bne		4b
@@ -830,10 +830,10 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 
 	ld		[%o0 - 1], %o4
 	add		%o0, 4, %o0
-4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 24, 8, -1)
-	SMOVE_CHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g7, g1, 24, 8, -1)
-	SMOVE_CHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g7, g1, 24, 8, -1)
-	SMOVE_CHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g7, g1, 24, 8, -1)
+4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, -1)
+	SMOVE_CHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, -1)
+	SMOVE_CHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, -1)
+	SMOVE_CHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, -1)
 	subcc		%o3, 64, %o3
 	add		%o1, 64, %o1
 	bne		4b
@@ -842,7 +842,7 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	andcc		%o2, 0x30, %o3
 	be,a		1f
 	 srl		%g1, 24, %g2
-4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 24, 8, -1)
+4:	SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, -1)
 	subcc		%o3, 16, %o3
 	add		%o1, 16, %o1
 	bne		4b
@@ -852,10 +852,10 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 1:	st		%o4, [%o0 - 5]
 	b		88f
 	 stb		%g2, [%o0 - 1]
-41:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 8, 24, -3)
-	SMOVE_ALIGNCHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g7, g1, 8, 24, -3)
-	SMOVE_ALIGNCHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g7, g1, 8, 24, -3)
-	SMOVE_ALIGNCHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g7, g1, 8, 24, -3)
+41:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
+	SMOVE_ALIGNCHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
+	SMOVE_ALIGNCHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
+	SMOVE_ALIGNCHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
 	subcc		%o3, 64, %o3
 	add		%o1, 64, %o1
 	bne		41b
@@ -864,7 +864,7 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	andcc		%o2, 0x30, %o3
 	be,a		1f
 	 srl		%g1, 16, %g2
-4:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 8, 24, -3)
+4:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
 	subcc		%o3, 16, %o3
 	add		%o1, 16, %o1
 	bne		4b
@@ -875,10 +875,10 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	srl		%g1, 8, %g4
 	b		88f
 	 stb		%g4, [%o0 - 1]
-43:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 24, 8, 3)
-	SMOVE_ALIGNCHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g7, g1, 24, 8, 3)
-	SMOVE_ALIGNCHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g7, g1, 24, 8, 3)
-	SMOVE_ALIGNCHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g7, g1, 24, 8, 3)
+43:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, 3)
+	SMOVE_ALIGNCHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, 3)
+	SMOVE_ALIGNCHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, 3)
+	SMOVE_ALIGNCHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, 3)
 	subcc		%o3, 64, %o3
 	add		%o1, 64, %o1
 	bne		43b
@@ -887,7 +887,7 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	andcc		%o2, 0x30, %o3
 	be,a		1f
 	 srl		%g1, 24, %g2
-4:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 24, 8, 3)
+4:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, 3)
 	subcc		%o3, 16, %o3
 	add		%o1, 16, %o1
 	bne		4b
@@ -897,10 +897,10 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 1:	stb		%g2, [%o0 + 3]
 	b		88f
 	 add		%o0, 4, %o0
-42:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 16, 16, -2)
-	SMOVE_ALIGNCHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g7, g1, 16, 16, -2)
-	SMOVE_ALIGNCHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g7, g1, 16, 16, -2)
-	SMOVE_ALIGNCHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g7, g1, 16, 16, -2)
+42:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
+	SMOVE_ALIGNCHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
+	SMOVE_ALIGNCHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
+	SMOVE_ALIGNCHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
 	subcc		%o3, 64, %o3
 	add		%o1, 64, %o1
 	bne		42b
@@ -909,7 +909,7 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 	andcc		%o2, 0x30, %o3
 	be,a		1f
 	 srl		%g1, 16, %g2
-4:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g7, g1, 16, 16, -2)
+4:	SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
 	subcc		%o3, 16, %o3
 	add		%o1, 16, %o1
 	bne		4b
@@ -964,5 +964,5 @@ ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */
 100:	retl
 	 sub		%o7, %o4, %o5
 110:	retl
-	 sub		%o7, %g7, %o5
+	 sub		%o7, %g6, %o5
 END(memcpy)
diff --git a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
index 65b9d1fb2c..cc262882ab 100644
--- a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
+++ b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
@@ -1,5 +1,5 @@
 /* High precision, low overhead timing functions.  sparcv9 version.
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David S. Miller <davem@redhat.com>, 2001.
 
@@ -58,17 +58,17 @@ typedef unsigned long long int hp_timing_t;
 do {								\
   hp_timing_t __diff = (Diff) - GL(dl_hp_timing_overhead);	\
   __asm__ __volatile__("srl	%L0, 0, %%g1\n\t"		\
-		       "sllx	%H0, 32, %%g7\n\t"		\
-		       "or	%%g1, %%g7, %%g1\n\t"		\
+		       "sllx	%H0, 32, %%g6\n\t"		\
+		       "or	%%g1, %%g6, %%g1\n\t"		\
 		       "1: ldx	[%1], %%g5\n\t"			\
-		       "add	%%g5, %%g1, %%g7\n\t"		\
-		       "casx	[%1], %%g5,  %%g7\n\t"		\
-		       "cmp	%%g5, %%g7\n\t"			\
+		       "add	%%g5, %%g1, %%g6\n\t"		\
+		       "casx	[%1], %%g5,  %%g6\n\t"		\
+		       "cmp	%%g5, %%g6\n\t"			\
 		       "bne,pn	%%xcc, 1b\n\t"			\
 		       " nop"					\
 		       : /* no outputs */			\
 		       : "r" (__diff), "r" (&(Sum))		\
-		       : "memory", "g1", "g5", "g7");		\
+		       : "memory", "g1", "g5", "g6");		\
 } while(0)
 
 #define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
diff --git a/sysdeps/sparc/sparc32/strcat.S b/sysdeps/sparc/sparc32/strcat.S
index 888fb54090..434d8d03c7 100644
--- a/sysdeps/sparc/sparc32/strcat.S
+++ b/sysdeps/sparc/sparc32/strcat.S
@@ -1,6 +1,6 @@
 /* strcat (dest, src) -- Append SRC on the end of DEST.
    For SPARC v7.
-   Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1999, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jj@ultra.linux.cz>.
 
@@ -183,7 +183,7 @@ ENTRY(strcat)
 	srl		%o5, 8, %g5
 	sth		%g5, [%o0 + 2]
 1:	add		%o0, 4, %o0
-4:	sll		%o5, 24, %g7
+4:	sll		%o5, 24, %g6
 	ld		[%o1], %o5
 	add		%o1, 4, %o1
 	srl		%o5, 8, %g5
@@ -191,7 +191,7 @@ ENTRY(strcat)
 #ifdef EIGHTBIT_NOT_RARE
 	andn		%o4, %o5, %o4
 #endif
-	or		%g5, %g7, %g5
+	or		%g5, %g6, %g5
 	andcc		%o4, %o3, %g0
 	be,a		1b
 	 st		%g5, [%o0]
@@ -249,7 +249,7 @@ ENTRY(strcat)
 	sth		%g5, [%o0]
 	sub		%o0, 2, %o0
 1:	add		%o0, 4, %o0
-4:	sll		%o5, 16, %g7
+4:	sll		%o5, 16, %g6
 	ld		[%o1], %o5
 	add		%o1, 4, %o1
 	srl		%o5, 16, %g5
@@ -257,7 +257,7 @@ ENTRY(strcat)
 #ifdef EIGHTBIT_NOT_RARE
 	andn		%o4, %o5, %o4
 #endif
-	or		%g5, %g7, %g5
+	or		%g5, %g6, %g5
 	andcc		%o4, %o3, %g0
 	be,a		1b
 	 st		%g5, [%o0]
@@ -305,7 +305,7 @@ ENTRY(strcat)
 	stb		%g5, [%o0]
 	sub		%o0, 3, %o0
 1:	add		%o0, 4, %o0
-4:	sll		%o5, 8, %g7
+4:	sll		%o5, 8, %g6
 	ld		[%o1], %o5
 	add		%o1, 4, %o1
 	srl		%o5, 24, %g5
@@ -313,7 +313,7 @@ ENTRY(strcat)
 #ifdef EIGHTBIT_NOT_RARE
 	andn		%o4, %o5, %o4
 #endif
-	or		%g5, %g7, %g5
+	or		%g5, %g6, %g5
 	andcc		%o4, %o3, %g0
 	be		1b
 	 st		%g5, [%o0]
diff --git a/sysdeps/sparc/sparc32/strchr.S b/sysdeps/sparc/sparc32/strchr.S
index adfaa47371..931ea890cd 100644
--- a/sysdeps/sparc/sparc32/strchr.S
+++ b/sysdeps/sparc/sparc32/strchr.S
@@ -1,6 +1,6 @@
 /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
    For SPARC v7.
-   Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1999, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
 		  David S. Miller <davem@caip.rutgers.edu>.
@@ -86,9 +86,9 @@ ENTRY(strchr)
 6:	xor		%g4, %g2, %g5
 	sub		%g4, %o2, %o4
 #ifdef EIGHTBIT_NOT_RARE
-	sub		%g5, %o2, %g7
+	sub		%g5, %o2, %g6
 	andn		%o4, %g4, %o4
-	andn		%g7, %g5, %g5
+	andn		%g6, %g5, %g5
 #else
 	sub		%g5, %o2, %g5
 #endif
@@ -237,9 +237,9 @@ ENTRY(strrchr)
 7:	xor		%g4, %g2, %g5
 	sub		%g4, %o2, %o4
 #ifdef EIGHTBIT_NOT_RARE
-	sub		%g5, %o2, %g7
+	sub		%g5, %o2, %g6
 	andn		%o4, %g4, %o4
-	andn		%g7, %g5, %g5
+	andn		%g6, %g5, %g5
 #else
 	sub		%g5, %o2, %g5
 #endif
diff --git a/sysdeps/sparc/sparc32/strcmp.S b/sysdeps/sparc/sparc32/strcmp.S
index 265f18fb96..90e6f67085 100644
--- a/sysdeps/sparc/sparc32/strcmp.S
+++ b/sysdeps/sparc/sparc32/strcmp.S
@@ -1,6 +1,6 @@
 /* Compare two strings for differences.
    For SPARC v7.
-   Copyright (C) 1996, 97, 99 Free Software Foundation, Inc.
+   Copyright (C) 1996, 97, 99, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jj@ultra.linux.cz>.
 
@@ -144,13 +144,13 @@ ENTRY(strcmp)
 	andn		%i1, 3, %i1
 	mov		32, %l1
 	ld		[%i1], %l2
-	mov		-1, %g7
+	mov		-1, %g6
 	add		%i1, 4, %i1
 	sub		%l1, %g3, %l1
-	sll		%g7, %g3, %g7
+	sll		%g6, %g3, %g6
 
 1:	sll		%l2, %g3, %g5
-	and		%i4, %g7, %l3
+	and		%i4, %g6, %l3
 	sub		%i4, %i2, %g1
 #ifdef EIGHTBIT_NOT_RARE
 	andn		%g1, %i4, %g1
diff --git a/sysdeps/sparc/sparc32/strcpy.S b/sysdeps/sparc/sparc32/strcpy.S
index 8ae6455e1d..c0572d9b50 100644
--- a/sysdeps/sparc/sparc32/strcpy.S
+++ b/sysdeps/sparc/sparc32/strcpy.S
@@ -1,6 +1,6 @@
 /* Copy SRC to DEST returning DEST.
    For SPARC v7.
-   Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1999, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jj@ultra.linux.cz>.
 
@@ -125,12 +125,12 @@ ENTRY(strcpy)
 	srl		%o5, 8, %g5
 	sth		%g5, [%o0 + 2]
 1:	add		%o0, 4, %o0
-4:	sll		%o5, 24, %g7
+4:	sll		%o5, 24, %g6
 	ld		[%o1], %o5
 	add		%o1, 4, %o1
 	srl		%o5, 8, %g5
 	sub		%o5, %o2, %o4
-	or		%g5, %g7, %g5
+	or		%g5, %g6, %g5
 	andcc		%o4, %o3, %g0
 	be,a		1b
 	 st		%g5, [%o0]
@@ -184,12 +184,12 @@ ENTRY(strcpy)
 	sth		%g5, [%o0]
 	sub		%o0, 2, %o0
 1:	add		%o0, 4, %o0
-4:	sll		%o5, 16, %g7
+4:	sll		%o5, 16, %g6
 	ld		[%o1], %o5
 	add		%o1, 4, %o1
 	srl		%o5, 16, %g5
 	sub		%o5, %o2, %o4
-	or		%g5, %g7, %g5
+	or		%g5, %g6, %g5
 	andcc		%o4, %o3, %g0
 	be,a		1b
 	 st		%g5, [%o0]
@@ -234,12 +234,12 @@ ENTRY(strcpy)
 	stb		%g5, [%o0]
 	sub		%o0, 3, %o0
 1:	add		%o0, 4, %o0
-4:	sll		%o5, 8, %g7
+4:	sll		%o5, 8, %g6
 	ld		[%o1], %o5
 	add		%o1, 4, %o1
 	srl		%o5, 24, %g5
 	sub		%o5, %o2, %o4
-	or		%g5, %g7, %g5
+	or		%g5, %g6, %g5
 	andcc		%o4, %o3, %g0
 	be		1b
 	 st		%g5, [%o0]
diff --git a/sysdeps/sparc/sparc64/hp-timing.h b/sysdeps/sparc/sparc64/hp-timing.h
index f6cb89b603..1784dc1c91 100644
--- a/sysdeps/sparc/sparc64/hp-timing.h
+++ b/sysdeps/sparc/sparc64/hp-timing.h
@@ -1,5 +1,5 @@
 /* High precision, low overhead timing functions.  sparc64 version.
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David S. Miller <davem@redhat.com>, 2001.
 
@@ -63,7 +63,7 @@ do {								\
 		       " nop"					\
 		       : "=&r" (tmp1), "=&r" (tmp2)		\
 		       : "r" (__diff), "r" (&(Sum))		\
-		       : "memory", "g1", "g5", "g7");		\
+		       : "memory", "g1", "g5", "g6");		\
 } while(0)
 
 #define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
diff --git a/sysdeps/sparc/sparc64/memcpy.S b/sysdeps/sparc/sparc64/memcpy.S
index ede8dc4b2f..e9cc004633 100644
--- a/sysdeps/sparc/sparc64/memcpy.S
+++ b/sysdeps/sparc/sparc64/memcpy.S
@@ -1,6 +1,6 @@
 /* Copy SIZE bytes from SRC to DEST.
    For UltraSPARC.
-   Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc.
+   Copyright (C) 1996, 97, 98, 99, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David S. Miller (davem@caip.rutgers.edu) and
 		  Jakub Jelinek (jakub@redhat.com).
@@ -26,7 +26,7 @@
 #define USE_BPR
 	.register	%g2, #scratch
 	.register	%g3, #scratch
-	.register	%g7, #scratch
+	.register	%g6, #scratch
 #define XCC	xcc
 #endif
 #define FPRS_FEF	4
@@ -256,24 +256,24 @@ END(bcopy)
 	 add		%o0, 8, %o0			/* IEU0				*/
 202:	membar	  #LoadStore | #StoreStore | #StoreLoad	/* LSU		Group		*/
 	wr		%g0, ASI_BLK_P, %asi		/* LSU		Group		*/
-	subcc		%o2, 0x40, %g7			/* IEU1		Group		*/
+	subcc		%o2, 0x40, %g6			/* IEU1		Group		*/
 	mov		%o1, %g1			/* IEU0				*/
-	andncc		%g7, (0x40 - 1), %g7		/* IEU1		Group		*/
+	andncc		%g6, (0x40 - 1), %g6		/* IEU1		Group		*/
 	srl		%g1, 3, %g2			/* IEU0				*/
-	sub		%o2, %g7, %g3			/* IEU0		Group		*/
+	sub		%o2, %g6, %g3			/* IEU0		Group		*/
 	andn		%o1, (0x40 - 1), %o1		/* IEU1				*/
 	and		%g2, 7, %g2			/* IEU0		Group		*/
 	andncc		%g3, 0x7, %g3			/* IEU1				*/
 	fmovd		%f0, %f2			/* FPU				*/
 	sub		%g3, 0x10, %g3			/* IEU0		Group		*/
-	sub		%o2, %g7, %o2			/* IEU1				*/
+	sub		%o2, %g6, %o2			/* IEU1				*/
 	alignaddr	%g1, %g0, %g0			/* GRU		Group		*/
-	add		%g1, %g7, %g1			/* IEU0		Group		*/
+	add		%g1, %g6, %g1			/* IEU0		Group		*/
 	subcc		%o2, %g3, %o2			/* IEU1				*/
 	ldda		[%o1 + 0x00] %asi, %f0		/* LSU		Group		*/
 	add		%g1, %g3, %g1			/* IEU0				*/
 	ldda		[%o1 + 0x40] %asi, %f16		/* LSU		Group		*/
-	sub		%g7, 0x80, %g7			/* IEU0				*/
+	sub		%g6, 0x80, %g6			/* IEU0				*/
 	ldda		[%o1 + 0x80] %asi, %f32		/* LSU		Group		*/
 							/* Clk1		Group 8-(	*/
 							/* Clk2		Group 8-(	*/
@@ -286,9 +286,9 @@ END(bcopy)
 	 addcc		%o1, 0xc0, %o1			/* IEU1		Group		*/
 
 	.align		512		/* OK, here comes the fun part... */
-300:	FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16)	LOOP_CHUNK1(o1, o0, g7, 301f)
-	FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32)	LOOP_CHUNK2(o1, o0, g7, 302f)
-	FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0)	LOOP_CHUNK3(o1, o0, g7, 303f)
+300:	FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16)	LOOP_CHUNK1(o1, o0, g6, 301f)
+	FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32)	LOOP_CHUNK2(o1, o0, g6, 302f)
+	FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0)	LOOP_CHUNK3(o1, o0, g6, 303f)
 	b,pt		%xcc, 300b+4; faligndata %f0, %f2, %f48
 301:	FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0)	STORE_JUMP(o0, f48, 400f) membar #Sync
@@ -297,9 +297,9 @@ END(bcopy)
 303:	FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32)	STORE_JUMP(o0, f48, 432f) membar #Sync
 	VISLOOP_PAD
-310:	FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18)	LOOP_CHUNK1(o1, o0, g7, 311f)
-	FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34)	LOOP_CHUNK2(o1, o0, g7, 312f)
-	FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2)	LOOP_CHUNK3(o1, o0, g7, 313f)
+310:	FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18)	LOOP_CHUNK1(o1, o0, g6, 311f)
+	FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34)	LOOP_CHUNK2(o1, o0, g6, 312f)
+	FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2)	LOOP_CHUNK3(o1, o0, g6, 313f)
 	b,pt		%xcc, 310b+4; faligndata %f2, %f4, %f48
 311:	FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2)	STORE_JUMP(o0, f48, 402f) membar #Sync
@@ -308,9 +308,9 @@ END(bcopy)
 313:	FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34)	STORE_JUMP(o0, f48, 434f) membar #Sync
 	VISLOOP_PAD
-320:	FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20)	LOOP_CHUNK1(o1, o0, g7, 321f)
-	FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36)	LOOP_CHUNK2(o1, o0, g7, 322f)
-	FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4)	LOOP_CHUNK3(o1, o0, g7, 323f)
+320:	FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20)	LOOP_CHUNK1(o1, o0, g6, 321f)
+	FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36)	LOOP_CHUNK2(o1, o0, g6, 322f)
+	FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4)	LOOP_CHUNK3(o1, o0, g6, 323f)
 	b,pt		%xcc, 320b+4; faligndata %f4, %f6, %f48
 321:	FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4)	STORE_JUMP(o0, f48, 404f) membar #Sync
@@ -319,9 +319,9 @@ END(bcopy)
 323:	FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36)	STORE_JUMP(o0, f48, 436f) membar #Sync
 	VISLOOP_PAD
-330:	FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22)	LOOP_CHUNK1(o1, o0, g7, 331f)
-	FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38)	LOOP_CHUNK2(o1, o0, g7, 332f)
-	FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6)	LOOP_CHUNK3(o1, o0, g7, 333f)
+330:	FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22)	LOOP_CHUNK1(o1, o0, g6, 331f)
+	FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38)	LOOP_CHUNK2(o1, o0, g6, 332f)
+	FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6)	LOOP_CHUNK3(o1, o0, g6, 333f)
 	b,pt		%xcc, 330b+4; faligndata %f6, %f8, %f48
 331:	FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6)	STORE_JUMP(o0, f48, 406f) membar #Sync
@@ -330,9 +330,9 @@ END(bcopy)
 333:	FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38)	STORE_JUMP(o0, f48, 438f) membar #Sync
 	VISLOOP_PAD
-340:	FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24)	LOOP_CHUNK1(o1, o0, g7, 341f)
-	FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40)	LOOP_CHUNK2(o1, o0, g7, 342f)
-	FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8)	LOOP_CHUNK3(o1, o0, g7, 343f)
+340:	FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24)	LOOP_CHUNK1(o1, o0, g6, 341f)
+	FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40)	LOOP_CHUNK2(o1, o0, g6, 342f)
+	FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8)	LOOP_CHUNK3(o1, o0, g6, 343f)
 	b,pt		%xcc, 340b+4; faligndata %f8, %f10, %f48
 341:	FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8)	STORE_JUMP(o0, f48, 408f) membar #Sync
@@ -341,9 +341,9 @@ END(bcopy)
 343:	FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40)	STORE_JUMP(o0, f48, 440f) membar #Sync
 	VISLOOP_PAD
-350:	FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26)	LOOP_CHUNK1(o1, o0, g7, 351f)
-	FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42)	LOOP_CHUNK2(o1, o0, g7, 352f)
-	FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10)	LOOP_CHUNK3(o1, o0, g7, 353f)
+350:	FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26)	LOOP_CHUNK1(o1, o0, g6, 351f)
+	FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42)	LOOP_CHUNK2(o1, o0, g6, 352f)
+	FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10)	LOOP_CHUNK3(o1, o0, g6, 353f)
 	b,pt		%xcc, 350b+4; faligndata %f10, %f12, %f48
 351:	FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10)	STORE_JUMP(o0, f48, 410f) membar #Sync
@@ -352,9 +352,9 @@ END(bcopy)
 353:	FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42)	STORE_JUMP(o0, f48, 442f) membar #Sync
 	VISLOOP_PAD
-360:	FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28)	LOOP_CHUNK1(o1, o0, g7, 361f)
-	FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44)	LOOP_CHUNK2(o1, o0, g7, 362f)
-	FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12)	LOOP_CHUNK3(o1, o0, g7, 363f)
+360:	FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28)	LOOP_CHUNK1(o1, o0, g6, 361f)
+	FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44)	LOOP_CHUNK2(o1, o0, g6, 362f)
+	FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12)	LOOP_CHUNK3(o1, o0, g6, 363f)
 	b,pt		%xcc, 360b+4; faligndata %f12, %f14, %f48
 361:	FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12)	STORE_JUMP(o0, f48, 412f) membar #Sync
@@ -363,9 +363,9 @@ END(bcopy)
 363:	FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44)	STORE_JUMP(o0, f48, 444f) membar #Sync
 	VISLOOP_PAD
-370:	FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30)	LOOP_CHUNK1(o1, o0, g7, 371f)
-	FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46)	LOOP_CHUNK2(o1, o0, g7, 372f)
-	FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14)	LOOP_CHUNK3(o1, o0, g7, 373f)
+370:	FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30)	LOOP_CHUNK1(o1, o0, g6, 371f)
+	FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46)	LOOP_CHUNK2(o1, o0, g6, 372f)
+	FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14)	LOOP_CHUNK3(o1, o0, g6, 373f)
 	b,pt		%xcc, 370b+4; faligndata %f14, %f16, %f48
 371:	FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46)	STORE_SYNC(o0, f48) membar #Sync
 	FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14)	STORE_JUMP(o0, f48, 414f) membar #Sync
@@ -476,11 +476,11 @@ ENTRY(__align_cpy_8)
 	 cmp		%o2, (64 * 6)			/* IEU1		Group		*/
 	bgeu,pn		%xcc, 201b			/* CTI				*/
 	 andcc		%o0, 0x38, %g5			/* IEU1		Group		*/
-	andcc		%o2, -128, %g7			/* IEU1		Group		*/
+	andcc		%o2, -128, %g6			/* IEU1		Group		*/
 	bne,a,pt	%xcc, 82f + 4			/* CTI				*/
 	 ldx		[%o1], %g1			/* Load				*/
 	ba,pt		%xcc, 41f			/* CTI		Group		*/
-	 andcc		%o2, 0x70, %g7			/* IEU1				*/
+	 andcc		%o2, 0x70, %g6			/* IEU1				*/
 END(__align_cpy_8)
 
 	/* void *__align_cpy_16(void *dest, void *src, size_t n)
@@ -494,11 +494,11 @@ ENTRY(__align_cpy_16)
 	cmp		%o2, (64 * 6)			/* IEU1				*/
 	bgeu,pn		%xcc, 201b			/* CTI				*/
 	 andcc		%o0, 0x38, %g5			/* IEU1		Group		*/
-	andcc		%o2, -128, %g7			/* IEU1		Group		*/
+	andcc		%o2, -128, %g6			/* IEU1		Group		*/
 	bne,a,pt	%xcc, 82f + 4			/* CTI				*/
 	 ldx		[%o1], %g1			/* Load				*/
 	ba,pt		%xcc, 41f			/* CTI		Group		*/
-	 andcc		%o2, 0x70, %g7			/* IEU1				*/
+	 andcc		%o2, 0x70, %g6			/* IEU1				*/
 END(__align_cpy_16)
 
 #endif
@@ -538,13 +538,13 @@ ENTRY(memcpy)
 	sth		%g2, [%o0 - 2]			/* Store	Group + bubble	*/
 5:	andcc		%o1, 4, %g0			/* IEU1				*/
 216:	be,a,pn		%xcc, 2f			/* CTI				*/
-	 andcc		%o2, -128, %g7			/* IEU1		Group		*/
+	 andcc		%o2, -128, %g6			/* IEU1		Group		*/
 	lduw		[%o1], %g5			/* Load		Group		*/
 	add		%o1, 4, %o1			/* IEU0				*/
 	add		%o0, 4, %o0			/* IEU1				*/
 	sub		%o2, 4, %o2			/* IEU0		Group		*/
 	stw		%g5, [%o0 - 4]			/* Store			*/
-	andcc		%o2, -128, %g7			/* IEU1		Group		*/
+	andcc		%o2, -128, %g6			/* IEU1		Group		*/
 2:	be,pn		%xcc, 215f			/* CTI				*/
 	 andcc		%o0, 4, %g0			/* IEU1		Group		*/
 	be,pn		%xcc, 82f + 4			/* CTI		Group		*/
@@ -552,11 +552,11 @@ ENTRY(memcpy)
 	MOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
 	MOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
 	MOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
-35:	subcc		%g7, 128, %g7			/* IEU1		Group		*/
+35:	subcc		%g6, 128, %g6			/* IEU1		Group		*/
 	add		%o1, 128, %o1			/* IEU0				*/
 	bne,pt		%xcc, 5b			/* CTI				*/
 	 add		%o0, 128, %o0			/* IEU0		Group		*/
-215:	andcc		%o2, 0x70, %g7			/* IEU1		Group		*/
+215:	andcc		%o2, 0x70, %g6			/* IEU1		Group		*/
 41:	be,pn		%xcc, 80f			/* CTI				*/
 	 andcc		%o2, 8, %g0			/* IEU1		Group		*/
 							/* Clk1 8-(			*/
@@ -564,11 +564,11 @@ ENTRY(memcpy)
 							/* Clk3 8-(			*/
 							/* Clk4 8-(			*/
 79:	rd		%pc, %o5			/* PDU		Group		*/
-	sll		%g7, 1, %g5			/* IEU0		Group		*/
-	add		%o1, %g7, %o1			/* IEU1				*/
+	sll		%g6, 1, %g5			/* IEU0		Group		*/
+	add		%o1, %g6, %o1			/* IEU1				*/
 	sub		%o5, %g5, %o5			/* IEU0  	Group		*/
 	jmpl		%o5 + %lo(80f - 79b), %g0	/* CTI		Group brk forced*/
-	 add		%o0, %g7, %o0			/* IEU0		Group		*/
+	 add		%o0, %g6, %o0			/* IEU0		Group		*/
 36:	MOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
 	MOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
 	MOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
@@ -605,11 +605,11 @@ ENTRY(memcpy)
 
 82:	MOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
 	MOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
-37:	subcc		%g7, 128, %g7			/* IEU1		Group		*/
+37:	subcc		%g6, 128, %g6			/* IEU1		Group		*/
 	add		%o1, 128, %o1			/* IEU0				*/
 	bne,pt		%xcc, 82b			/* CTI				*/
 	 add		%o0, 128, %o0			/* IEU0		Group		*/
-	andcc		%o2, 0x70, %g7			/* IEU1				*/
+	andcc		%o2, 0x70, %g6			/* IEU1				*/
 	be,pn		%xcc, 84f			/* CTI				*/
 	 andcc		%o2, 8, %g0			/* IEU1		Group		*/
 							/* Clk1 8-(			*/
@@ -617,10 +617,10 @@ ENTRY(memcpy)
 							/* Clk3 8-(			*/
 							/* Clk4 8-(			*/
 83:	rd		%pc, %o5			/* PDU		Group		*/
-	add		%o1, %g7, %o1			/* IEU0		Group		*/
-	sub		%o5, %g7, %o5			/* IEU1				*/
+	add		%o1, %g6, %o1			/* IEU0		Group		*/
+	sub		%o5, %g6, %o5			/* IEU1				*/
 	jmpl		%o5 + %lo(84f - 83b), %g0	/* CTI		Group brk forced*/
-	 add		%o0, %g7, %o0			/* IEU0		Group		*/
+	 add		%o0, %g6, %o0			/* IEU0		Group		*/
 38:	MOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
 	MOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
 	MOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
@@ -756,13 +756,13 @@ ENTRY(memmove)
 	sth		%g2, [%o0]			/* Store	Group + bubble	*/
 5:	andcc		%o1, 4, %g0			/* IEU1				*/
 236:	be,a,pn		%xcc, 2f			/* CTI				*/
-	 andcc		%o2, -128, %g7			/* IEU1		Group		*/
+	 andcc		%o2, -128, %g6			/* IEU1		Group		*/
 	lduw		[%o1 - 4], %g5			/* Load		Group		*/
 	sub		%o1, 4, %o1			/* IEU0				*/
 	sub		%o0, 4, %o0			/* IEU1				*/
 	sub		%o2, 4, %o2			/* IEU0		Group		*/
 	stw		%g5, [%o0]			/* Store			*/
-	andcc		%o2, -128, %g7			/* IEU1		Group		*/
+	andcc		%o2, -128, %g6			/* IEU1		Group		*/
 2:	be,pn		%xcc, 235f			/* CTI				*/
 	 andcc		%o0, 4, %g0			/* IEU1		Group		*/
 	be,pn		%xcc, 282f + 4			/* CTI		Group		*/
@@ -770,11 +770,11 @@ ENTRY(memmove)
 	RMOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
 	RMOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
 	RMOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
-	subcc		%g7, 128, %g7			/* IEU1		Group		*/
+	subcc		%g6, 128, %g6			/* IEU1		Group		*/
 	sub		%o1, 128, %o1			/* IEU0				*/
 	bne,pt		%xcc, 5b			/* CTI				*/
 	 sub		%o0, 128, %o0			/* IEU0		Group		*/
-235:	andcc		%o2, 0x70, %g7			/* IEU1		Group		*/
+235:	andcc		%o2, 0x70, %g6			/* IEU1		Group		*/
 41:	be,pn		%xcc, 280f			/* CTI				*/
 	 andcc		%o2, 8, %g0			/* IEU1		Group		*/
 							/* Clk1 8-(			*/
@@ -782,11 +782,11 @@ ENTRY(memmove)
 							/* Clk3 8-(			*/
 							/* Clk4 8-(			*/
 279:	rd		%pc, %o5			/* PDU		Group		*/
-	sll		%g7, 1, %g5			/* IEU0		Group		*/
-	sub		%o1, %g7, %o1			/* IEU1				*/
+	sll		%g6, 1, %g5			/* IEU0		Group		*/
+	sub		%o1, %g6, %o1			/* IEU1				*/
 	sub		%o5, %g5, %o5			/* IEU0  	Group		*/
 	jmpl		%o5 + %lo(280f - 279b), %g0	/* CTI		Group brk forced*/
-	 sub		%o0, %g7, %o0			/* IEU0		Group		*/
+	 sub		%o0, %g6, %o0			/* IEU0		Group		*/
 	RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
 	RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
 	RMOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
@@ -823,11 +823,11 @@ ENTRY(memmove)
 
 282:	RMOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
 	RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
-	subcc		%g7, 128, %g7			/* IEU1		Group		*/
+	subcc		%g6, 128, %g6			/* IEU1		Group		*/
 	sub		%o1, 128, %o1			/* IEU0				*/
 	bne,pt		%xcc, 282b			/* CTI				*/
 	 sub		%o0, 128, %o0			/* IEU0		Group		*/
-	andcc		%o2, 0x70, %g7			/* IEU1				*/
+	andcc		%o2, 0x70, %g6			/* IEU1				*/
 	be,pn		%xcc, 284f			/* CTI				*/
 	 andcc		%o2, 8, %g0			/* IEU1		Group		*/
 							/* Clk1 8-(			*/
@@ -835,10 +835,10 @@ ENTRY(memmove)
 							/* Clk3 8-(			*/
 							/* Clk4 8-(			*/
 283:	rd		%pc, %o5			/* PDU		Group		*/
-	sub		%o1, %g7, %o1			/* IEU0		Group		*/
-	sub		%o5, %g7, %o5			/* IEU1				*/
+	sub		%o1, %g6, %o1			/* IEU0		Group		*/
+	sub		%o5, %g6, %o5			/* IEU1				*/
 	jmpl		%o5 + %lo(284f - 283b), %g0	/* CTI		Group brk forced*/
-	 sub		%o0, %g7, %o0			/* IEU0		Group		*/
+	 sub		%o0, %g6, %o0			/* IEU0		Group		*/
 	RMOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
 	RMOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
 	RMOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
diff --git a/sysdeps/sparc/sparc64/sparcv9b/memcpy.S b/sysdeps/sparc/sparc64/sparcv9b/memcpy.S
index 529e83aae9..704aee7306 100644
--- a/sysdeps/sparc/sparc64/sparcv9b/memcpy.S
+++ b/sysdeps/sparc/sparc64/sparcv9b/memcpy.S
@@ -1,6 +1,6 @@
 /* Copy SIZE bytes from SRC to DEST.
    For UltraSPARC-III.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David S. Miller (davem@redhat.com)
 
@@ -547,13 +547,13 @@ ENTRY(memmove)
 	sth		%g2, [%o0]			/* Store	Group + bubble	*/
 5:	andcc		%o1, 4, %g0			/* IEU1				*/
 236:	be,a,pn		%xcc, 2f			/* CTI				*/
-	 andcc		%o2, -128, %g7			/* IEU1		Group		*/
+	 andcc		%o2, -128, %g6			/* IEU1		Group		*/
 	lduw		[%o1 - 4], %g5			/* Load		Group		*/
 	sub		%o1, 4, %o1			/* IEU0				*/
 	sub		%o0, 4, %o0			/* IEU1				*/
 	sub		%o2, 4, %o2			/* IEU0		Group		*/
 	stw		%g5, [%o0]			/* Store			*/
-	andcc		%o2, -128, %g7			/* IEU1		Group		*/
+	andcc		%o2, -128, %g6			/* IEU1		Group		*/
 2:	be,pn		%xcc, 235f			/* CTI				*/
 	 andcc		%o0, 4, %g0			/* IEU1		Group		*/
 	be,pn		%xcc, 282f + 4			/* CTI		Group		*/
@@ -561,11 +561,11 @@ ENTRY(memmove)
 	RMOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
 	RMOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
 	RMOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
-	subcc		%g7, 128, %g7			/* IEU1		Group		*/
+	subcc		%g6, 128, %g6			/* IEU1		Group		*/
 	sub		%o1, 128, %o1			/* IEU0				*/
 	bne,pt		%xcc, 5b			/* CTI				*/
 	 sub		%o0, 128, %o0			/* IEU0		Group		*/
-235:	andcc		%o2, 0x70, %g7			/* IEU1		Group		*/
+235:	andcc		%o2, 0x70, %g6			/* IEU1		Group		*/
 41:	be,pn		%xcc, 280f			/* CTI				*/
 	 andcc		%o2, 8, %g0			/* IEU1		Group		*/
 							/* Clk1 8-(			*/
@@ -573,11 +573,11 @@ ENTRY(memmove)
 							/* Clk3 8-(			*/
 							/* Clk4 8-(			*/
 279:	rd		%pc, %o5			/* PDU		Group		*/
-	sll		%g7, 1, %g5			/* IEU0		Group		*/
-	sub		%o1, %g7, %o1			/* IEU1				*/
+	sll		%g6, 1, %g5			/* IEU0		Group		*/
+	sub		%o1, %g6, %o1			/* IEU1				*/
 	sub		%o5, %g5, %o5			/* IEU0  	Group		*/
 	jmpl		%o5 + %lo(280f - 279b), %g0	/* CTI		Group brk forced*/
-	 sub		%o0, %g7, %o0			/* IEU0		Group		*/
+	 sub		%o0, %g6, %o0			/* IEU0		Group		*/
 	RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
 	RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
 	RMOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
@@ -614,11 +614,11 @@ ENTRY(memmove)
 
 282:	RMOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
 	RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
-	subcc		%g7, 128, %g7			/* IEU1		Group		*/
+	subcc		%g6, 128, %g6			/* IEU1		Group		*/
 	sub		%o1, 128, %o1			/* IEU0				*/
 	bne,pt		%xcc, 282b			/* CTI				*/
 	 sub		%o0, 128, %o0			/* IEU0		Group		*/
-	andcc		%o2, 0x70, %g7			/* IEU1				*/
+	andcc		%o2, 0x70, %g6			/* IEU1				*/
 	be,pn		%xcc, 284f			/* CTI				*/
 	 andcc		%o2, 8, %g0			/* IEU1		Group		*/
 							/* Clk1 8-(			*/
@@ -626,10 +626,10 @@ ENTRY(memmove)
 							/* Clk3 8-(			*/
 							/* Clk4 8-(			*/
 283:	rd		%pc, %o5			/* PDU		Group		*/
-	sub		%o1, %g7, %o1			/* IEU0		Group		*/
-	sub		%o5, %g7, %o5			/* IEU1				*/
+	sub		%o1, %g6, %o1			/* IEU0		Group		*/
+	sub		%o5, %g6, %o5			/* IEU1				*/
 	jmpl		%o5 + %lo(284f - 283b), %g0	/* CTI		Group brk forced*/
-	 sub		%o0, %g7, %o0			/* IEU0		Group		*/
+	 sub		%o0, %g6, %o0			/* IEU0		Group		*/
 	RMOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
 	RMOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
 	RMOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
diff --git a/sysdeps/sparc/sparc64/stpcpy.S b/sysdeps/sparc/sparc64/stpcpy.S
index e9617f4d8b..bec0963ee0 100644
--- a/sysdeps/sparc/sparc64/stpcpy.S
+++ b/sysdeps/sparc/sparc64/stpcpy.S
@@ -1,6 +1,6 @@
 /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
    For SPARC v9.
-   Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
                   Jakub Jelinek <jj@ultra.linux.cz>.
@@ -25,7 +25,7 @@
 #ifndef XCC
 	.register	%g2, #scratch
 	.register	%g3, #scratch
-	.register	%g7, #scratch
+	.register	%g6, #scratch
 #endif
 
 	/* Normally, this uses
@@ -111,8 +111,8 @@ ENTRY(__stpcpy)
 
 	.align		16
 6:	ba,pt		%xcc, 23f			/* CTI		Group		*/
-	 sub		%o0, 3, %g7			/* IEU0				*/
-5:	sub		%o0, 2, %g7			/* IEU0		Group		*/
+	 sub		%o0, 3, %g6			/* IEU0				*/
+5:	sub		%o0, 2, %g6			/* IEU0		Group		*/
 	stb		%g5, [%o0 - 2]			/* Store			*/
 
 	srlx		%g3, 16, %g4			/* IEU0		Group		*/
@@ -121,27 +121,27 @@ ENTRY(__stpcpy)
 	stw		%g4, [%o0 - 8]			/* Store			*/
 
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 8:	ba,pt		%xcc, 24f			/* CTI		Group		*/
-	 sub		%o0, 5, %g7			/* IEU0				*/
+	 sub		%o0, 5, %g6			/* IEU0				*/
 
-7:	sub		%o0, 4, %g7			/* IEU0		Group		*/
+7:	sub		%o0, 4, %g6			/* IEU0		Group		*/
 	stb		%g5, [%o0 - 4]			/* Store			*/
 	srlx		%g3, 32, %g4			/* IEU0		Group		*/
 24:	stw		%g4, [%o0 - 8]			/* Store			*/
 
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0 			/* IEU0				*/
+	 mov		%g6, %o0 			/* IEU0				*/
 10:	ba,pt		%xcc, 25f			/* CTI		Group		*/
-	 sub		%o0, 7, %g7			/* IEU0				*/
+	 sub		%o0, 7, %g6			/* IEU0				*/
 
-9:	sub		%o0, 6, %g7			/* IEU0		Group		*/
+9:	sub		%o0, 6, %g6			/* IEU0		Group		*/
 	stb		%g5, [%o0 - 6]			/* Store			*/
 	srlx		%g3, 48, %g4			/* IEU0				*/
 25:	sth		%g4, [%o0 - 8]			/* Store	Group		*/
 
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 11:	stb		%g5, [%o0 - 8]			/* Store	Group		*/
 	retl						/* CTI+IEU1	Group		*/
 
@@ -230,13 +230,13 @@ ENTRY(__stpcpy)
 
 	.align		16
 17:	ba,pt		%xcc, 26f			/* CTI		Group		*/
-	 subcc		%o0, 3, %g7			/* IEU1				*/
+	 subcc		%o0, 3, %g6			/* IEU1				*/
 18:	ba,pt		%xcc, 27f			/* CTI		Group		*/
-	 subcc		%o0, 4, %g7			/* IEU1				*/
+	 subcc		%o0, 4, %g6			/* IEU1				*/
 
 19:	ba,pt		%xcc, 28f			/* CTI		Group		*/
-	 subcc		%o0, 5, %g7			/* IEU1				*/
-16:	subcc		%o0, 2, %g7			/* IEU1		Group		*/
+	 subcc		%o0, 5, %g6			/* IEU1				*/
+16:	subcc		%o0, 2, %g6			/* IEU1		Group		*/
 	srlx		%o3, 8, %o4			/* IEU0				*/
 
 	stb		%o4, [%o0 - 2]			/* Store			*/
@@ -249,15 +249,15 @@ ENTRY(__stpcpy)
 	stw		%o4, [%o0 - 8]			/* Store			*/
 	retl						/* CTI+IEU1	Group		*/
 
-	 mov		%g7, %o0 			/* IEU0				*/
+	 mov		%g6, %o0 			/* IEU0				*/
 
 	.align		16
 21:	ba,pt		%xcc, 29f			/* CTI		Group		*/
-	 subcc		%o0, 7, %g7			/* IEU1				*/
+	 subcc		%o0, 7, %g6			/* IEU1				*/
 22:	ba,pt		%xcc, 30f			/* CTI		Group		*/
-	 subcc		%o0, 8, %g7			/* IEU1				*/
+	 subcc		%o0, 8, %g6			/* IEU1				*/
 
-20:	subcc		%o0, 6, %g7			/* IEU1		Group		*/
+20:	subcc		%o0, 6, %g6			/* IEU1		Group		*/
 	srlx		%o3, 40, %o4			/* IEU0				*/
 	stb		%o4, [%o0 - 6]			/* Store			*/
 29:	srlx		%o3, 48, %o4			/* IEU0		Group		*/
@@ -267,7 +267,7 @@ ENTRY(__stpcpy)
 	stb		%o4, [%o0 - 8]			/* Store			*/
 	retl						/* CTI+IEU1	Group		*/
 
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 END(__stpcpy)
 
 weak_alias (__stpcpy, stpcpy)
diff --git a/sysdeps/sparc/sparc64/stpncpy.S b/sysdeps/sparc/sparc64/stpncpy.S
index ebd0025d5d..c1ea820a9b 100644
--- a/sysdeps/sparc/sparc64/stpncpy.S
+++ b/sysdeps/sparc/sparc64/stpncpy.S
@@ -2,7 +2,7 @@
    SRC to DEST, returning the address of the terminating '\0' in
    DEST, if any, or else DEST + N.
    For SPARC v9.
-   Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
 		  Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz>.
@@ -29,7 +29,7 @@
 #define USE_BPR
 	.register	%g2, #scratch
 	.register	%g3, #scratch
-	.register	%g7, #scratch
+	.register	%g6, #scratch
 #endif
 
 	/* Normally, this uses
@@ -112,7 +112,7 @@ ENTRY(__stpncpy)
 	 srlx		%g3, 8, %g5			/* IEU0				*/
 	andcc		%g5, 0xff, %g0			/* IEU1		Group		*/
 	be,pn		%icc, 10f			/* CTI				*/
-	 sub		%o0, 1, %g7			/* IEU0				*/
+	 sub		%o0, 1, %g6			/* IEU0				*/
 
 	andcc		%g3, 0xff, %g0			/* IEU1		Group		*/
 	bne,pt		%icc, 2b			/* CTI				*/
@@ -156,31 +156,31 @@ ENTRY(__stpncpy)
 
 	 stb		%g0, [%o0]			/* Store			*/
 9:	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
-10:	subcc		%o0, 2, %g7			/* IEU1		Group		*/
+	 mov		%g6, %o0			/* IEU0				*/
+10:	subcc		%o0, 2, %g6			/* IEU1		Group		*/
 
 	ba,pt		%xcc, 3b			/* CTI				*/
 	 sllx		%g5, 8, %g3			/* IEU0				*/
-11:	subcc		%o0, 3, %g7			/* IEU1		Group		*/
+11:	subcc		%o0, 3, %g6			/* IEU1		Group		*/
 	ba,pt		%xcc, 3b			/* CTI				*/
 
 	 sllx		%g4, 16, %g3			/* IEU0				*/
-12:	subcc		%o0, 4, %g7			/* IEU1		Group		*/
+12:	subcc		%o0, 4, %g6			/* IEU1		Group		*/
 	ba,pt		%xcc, 3b			/* CTI				*/
 	 sllx		%g5, 24, %g3			/* IEU0				*/
 
-13:	subcc		%o0, 5, %g7			/* IEU1		Group		*/
+13:	subcc		%o0, 5, %g6			/* IEU1		Group		*/
 	ba,pt		%xcc, 3b			/* CTI				*/
 	 sllx		%g4, 32, %g3			/* IEU0				*/
-14:	subcc		%o0, 6, %g7			/* IEU1		Group		*/
+14:	subcc		%o0, 6, %g6			/* IEU1		Group		*/
 
 	ba,pt		%xcc, 3b			/* CTI				*/
 	 sllx		%g5, 40, %g3			/* IEU0				*/
-15:	subcc		%o0, 7, %g7			/* IEU1		Group		*/
+15:	subcc		%o0, 7, %g6			/* IEU1		Group		*/
 	ba,pt		%xcc, 3b			/* CTI				*/
 
 	 sllx		%g4, 48, %g3			/* IEU0				*/
-16:	subcc		%o0, 8, %g7			/* IEU1		Group		*/
+16:	subcc		%o0, 8, %g6			/* IEU1		Group		*/
 	ba,pt		%xcc, 3b			/* CTI				*/
 	 clr		%g3				/* IEU0				*/
 
@@ -255,7 +255,7 @@ ENTRY(__stpncpy)
 19:	retl						/* CTI+IEU1	Group		*/
 	 nop						/* IEU0				*/
 
-20:	mov		%o0, %g7			/* IEU0		Group		*/
+20:	mov		%o0, %g6			/* IEU0		Group		*/
 	subcc		%o2, 1, %o2			/* IEU1				*/
 	be,pn		%XCC, 51f			/* CTI				*/
 	 add		%o0, 1, %o0			/* IEU0		Group		*/
@@ -266,7 +266,7 @@ ENTRY(__stpncpy)
 	 add		%o0, 1, %o0			/* IEU0				*/
 
 51:	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 
 	.align		16
 21:	andcc		%o2, 4, %g0			/* IEU1		Group		*/
@@ -295,7 +295,7 @@ ENTRY(__stpncpy)
 	 add		%o0, 1, %o0			/* IEU0				*/
 
 	.align		16
-55:	sub		%o0, 1, %g7			/* IEU0		Group		*/
+55:	sub		%o0, 1, %g6			/* IEU0		Group		*/
 25:	andcc		%o0, 7, %g0			/* IEU1				*/
 	be,a,pn		%icc, 4b			/* CTI				*/
 	 andncc		%o2, 31, %g3			/* IEU1		Group		*/
@@ -306,7 +306,7 @@ ENTRY(__stpncpy)
 	 add		%o0, 1, %o0			/* IEU0		Group		*/
 
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 
 	.align		16
 26:	ldub		[%o1], %o3			/* Load				*/
@@ -363,23 +363,23 @@ ENTRY(__stpncpy)
 	andcc		%o4, 0xff, %g0			/* IEU1		Group		*/
 
 	be,pn		%icc, 36f			/* CTI				*/
-	 srlx		%o3, 48, %g7			/* IEU0				*/
-	andcc		%g7, 0xff, %g0			/* IEU1		Group		*/
+	 srlx		%o3, 48, %g6			/* IEU0				*/
+	andcc		%g6, 0xff, %g0			/* IEU1		Group		*/
 	be,pn		%icc, 35f			/* CTI				*/
 
 	 srlx		%o3, 40, %o4			/* IEU0				*/
 	andcc		%o4, 0xff, %g0			/* IEU1		Group		*/
 	be,pn		%icc, 34f			/* CTI				*/
-	 srlx		%o3, 32, %g7			/* IEU0				*/
+	 srlx		%o3, 32, %g6			/* IEU0				*/
 
-	andcc		%g7, 0xff, %g0			/* IEU1		Group		*/
+	andcc		%g6, 0xff, %g0			/* IEU1		Group		*/
 	be,pn		%icc, 33f			/* CTI				*/
 	 srlx		%o3, 24, %o4			/* IEU0				*/
 	andcc		%o4, 0xff, %g0			/* IEU1		Group		*/
 
 	be,pn		%icc, 32f			/* CTI				*/
-	 srlx		%o3, 16, %g7			/* IEU0				*/
-	andcc		%g7, 0xff, %g0			/* IEU1		Group		*/
+	 srlx		%o3, 16, %g6			/* IEU0				*/
+	andcc		%g6, 0xff, %g0			/* IEU1		Group		*/
 	be,pn		%icc, 31f			/* CTI				*/
 
 	 srlx		%o3, 8, %o4			/* IEU0				*/
@@ -389,33 +389,33 @@ ENTRY(__stpncpy)
 
 	bne,pn		%icc, 29b			/* CTI				*/
 	 stx		%o3, [%o0-8]			/* Store			*/
-	sub		%o0, 1, %g7			/* IEU0		Group		*/
+	sub		%o0, 1, %g6			/* IEU0		Group		*/
 	ba,pt		%xcc, 4b			/* CTI				*/
 
 	 andncc		%o2, 31, %g3			/* IEU1				*/
-30:	subcc		%o0, 2, %g7			/* IEU0				*/
+30:	subcc		%o0, 2, %g6			/* IEU0				*/
 	ba,pt		%xcc, 3b			/* CTI				*/
 	 sllx		%o4, 8, %g3			/* IEU0		Group		*/
 
-31:	sllx		%g7, 16, %g3			/* IEU0		Group		*/
+31:	sllx		%g6, 16, %g3			/* IEU0		Group		*/
 	ba,pt		%xcc, 3b			/* CTI				*/
-	 sub		%o0, 3, %g7			/* IEU1				*/
-32:	subcc		%o0, 4, %g7			/* IEU1		Group		*/
+	 sub		%o0, 3, %g6			/* IEU1				*/
+32:	subcc		%o0, 4, %g6			/* IEU1		Group		*/
 
 	ba,pt		%xcc, 3b			/* CTI				*/
 	 sllx		%o4, 24, %g3			/* IEU0				*/
-33:	sllx		%g7, 32, %g3			/* IEU0		Group		*/
+33:	sllx		%g6, 32, %g3			/* IEU0		Group		*/
 	ba,pt		%xcc, 3b			/* CTI				*/
 
-	 sub		%o0, 5, %g7			/* IEU1				*/
-34:	subcc		%o0, 6, %g7			/* IEU1		Group		*/
+	 sub		%o0, 5, %g6			/* IEU1				*/
+34:	subcc		%o0, 6, %g6			/* IEU1		Group		*/
 	ba,pt		%xcc, 3b			/* CTI				*/
 	 sllx		%o4, 40, %g3			/* IEU0				*/
 
-35:	sllx		%g7, 48, %g3			/* IEU0		Group		*/
+35:	sllx		%g6, 48, %g3			/* IEU0		Group		*/
 	ba,pt		%xcc, 3b			/* CTI				*/
-	 sub		%o0, 7, %g7			/* IEU1				*/
-36:	subcc		%o0, 8, %g7			/* IEU1		Group		*/
+	 sub		%o0, 7, %g6			/* IEU1				*/
+36:	subcc		%o0, 8, %g6			/* IEU1		Group		*/
 
 	ba,pt		%xcc, 3b			/* CTI				*/
 	 sllx		%o4, 56, %g3			/* IEU0				*/
diff --git a/sysdeps/sparc/sparc64/strcat.S b/sysdeps/sparc/sparc64/strcat.S
index 3bb27a915f..85954a2103 100644
--- a/sysdeps/sparc/sparc64/strcat.S
+++ b/sysdeps/sparc/sparc64/strcat.S
@@ -1,6 +1,6 @@
 /* strcat (dest, src) -- Append SRC on the end of DEST.
    For SPARC v9.
-   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
 		  Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz>.
@@ -27,7 +27,7 @@
 #define USE_BPR
 	.register	%g2, #scratch
 	.register	%g3, #scratch
-	.register	%g7, #scratch
+	.register	%g6, #scratch
 #endif
 
 	/* Normally, this uses
@@ -52,7 +52,7 @@ ENTRY(strcat)
 	sethi		%hi(0x01010101), %g1		/* IEU0		Group		*/
 	ldub		[%o0], %o3			/* Load				*/
 	or		%g1, %lo(0x01010101), %g1	/* IEU0		Group		*/
-	mov		%o0, %g7			/* IEU1				*/
+	mov		%o0, %g6			/* IEU1				*/
 
 	sllx		%g1, 32, %g2			/* IEU0		Group		*/
 	andcc		%o0, 7, %g0			/* IEU1				*/
@@ -192,7 +192,7 @@ ENTRY(strcat)
 	bne,pt		%icc, 3b			/* CTI				*/
 	 mov		%o3, %g3			/* IEU0		Group		*/
 4:	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 
 	.align		16
 5:	stb		%g5, [%o0 - 2]			/* Store	Group		*/
@@ -202,23 +202,23 @@ ENTRY(strcat)
 
 	stw		%g4, [%o0 - 8]			/* Store	Group		*/
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 7:	stb		%g5, [%o0 - 4]			/* Store	Group		*/
 
 	srlx		%g3, 32, %g4			/* IEU0				*/
 8:	stw		%g4, [%o0 - 8]			/* Store	Group		*/
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0 			/* IEU0				*/
+	 mov		%g6, %o0 			/* IEU0				*/
 
 9:	stb		%g5, [%o0 - 6]			/* Store	Group		*/
 	srlx		%g3, 48, %g4			/* IEU0				*/
 10:	sth		%g4, [%o0 - 8]			/* Store	Group		*/
 	retl						/* CTI+IEU1	Group		*/
 
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 11:	stb		%g5, [%o0 - 8]			/* Store	Group		*/
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 
 	.align		16
 32:	andcc		%o0, 7, %g0			/* IEU1		Group		*/
@@ -309,7 +309,7 @@ ENTRY(strcat)
 	 stx		%o3, [%o0 - 8]			/* Store			*/
 	retl						/* CTI+IEU1	Group		*/
 
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 
 	.align		16
 16:	srlx		%o3, 8, %o4			/* IEU0		Group		*/
@@ -323,7 +323,7 @@ ENTRY(strcat)
 	stw		%o4, [%o0 - 8]			/* Store			*/
 
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0 			/* IEU0				*/
+	 mov		%g6, %o0 			/* IEU0				*/
 	nop
 	nop
 
@@ -335,5 +335,5 @@ ENTRY(strcat)
 22:	srlx		%o3, 56, %o4			/* IEU0		Group		*/
 	stb		%o4, [%o0 - 8]			/* Store			*/
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 END(strcat)
diff --git a/sysdeps/sparc/sparc64/strchr.S b/sysdeps/sparc/sparc64/strchr.S
index 8349148ec2..3c976eb38e 100644
--- a/sysdeps/sparc/sparc64/strchr.S
+++ b/sysdeps/sparc/sparc64/strchr.S
@@ -1,6 +1,6 @@
 /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
    For SPARC v9.
-   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
 		  Jakub Jelinek <jj@ultra.linux.cz>.
@@ -27,7 +27,7 @@
 #define USE_BPR
 	.register	%g2, #scratch
 	.register	%g3, #scratch
-	.register	%g7, #scratch
+	.register	%g6, #scratch
 #endif
 
 	/* Normally, this uses
@@ -86,10 +86,10 @@ ENTRY(strchr)
 
 	sub		%o4, %g1, %o5			/* IEU1				*/
 #ifdef EIGHTBIT_NOT_RARE
-	andn		%o2, %o3, %g7			/* IEU0		Group		*/
+	andn		%o2, %o3, %g6			/* IEU0		Group		*/
 	andn		%o5, %o4, %o5			/* IEU1				*/
 	ldxa		[%o0] ASI_PNF, %o3		/* Load				*/
-	or		%o5, %g7, %o5			/* IEU0		Group		*/
+	or		%o5, %g6, %o5			/* IEU0		Group		*/
 #else
 	ldxa		[%o0] ASI_PNF, %o3		/* Load				*/
 	or		%o5, %o2, %o5			/* IEU0		Group		*/
@@ -240,9 +240,9 @@ ENTRY(strchr)
 19:	sub		%o3, %g1, %o2			/* IEU0		Group		*/
 
 #ifdef EIGHTBIT_NOT_RARE
-	andn		%o2, %o3, %g7			/* IEU0		Group		*/
+	andn		%o2, %o3, %g6			/* IEU0		Group		*/
 	ldxa		[%o0] ASI_PNF, %o3		/* Load				*/
-	andcc		%g7, %g2, %g0			/* IEU1		Group		*/
+	andcc		%g6, %g2, %g0			/* IEU1		Group		*/
 #else
 	ldxa		[%o0] ASI_PNF, %o3		/* Load				*/
 	andcc		%o2, %g2, %g0			/* IEU1		Group		*/
@@ -364,11 +364,11 @@ ENTRY(strrchr)
 
 3:	sub		%o4, %g1, %o5			/* IEU1				*/
 #ifdef EIGHTBIT_NOT_RARE
-	andn		%o2, %o3, %g7			/* IEU0		Group		*/
+	andn		%o2, %o3, %g6			/* IEU0		Group		*/
 	andn		%o5, %o4, %o5			/* IEU1				*/
 	ldxa		[%o0] ASI_PNF, %o3		/* Load				*/
 
-	or		%o5, %g7, %o5			/* IEU0		Group		*/
+	or		%o5, %g6, %o5			/* IEU0		Group		*/
 #else
 	ldxa		[%o0] ASI_PNF, %o3		/* Load				*/
 
diff --git a/sysdeps/sparc/sparc64/strcmp.S b/sysdeps/sparc/sparc64/strcmp.S
index 54fd0e5e02..a69368ca07 100644
--- a/sysdeps/sparc/sparc64/strcmp.S
+++ b/sysdeps/sparc/sparc64/strcmp.S
@@ -1,6 +1,6 @@
 /* Compare two strings for differences.
    For SPARC v9.
-   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
                   Jakub Jelinek <jj@ultra.linux.cz>.
@@ -25,7 +25,7 @@
 #ifndef XCC
 	.register	%g2, #scratch
 	.register	%g3, #scratch
-	.register	%g7, #scratch
+	.register	%g6, #scratch
 #endif
 
 	/* Normally, this uses
@@ -117,7 +117,7 @@ ENTRY(strcmp)
 	 clr		%o0					/* IEU0				*/
 
 	.align		32
-13:	mov		0xff, %g7				/* IEU0		Group		*/
+13:	mov		0xff, %g6				/* IEU0		Group		*/
 #ifdef EIGHTBIT_NOT_RARE
 	andcc		%g4, %g2, %g0				/* IEU1				*/
 #else
@@ -129,34 +129,34 @@ ENTRY(strcmp)
 	srlx		%g3, 32, %g3				/* IEU0				*/
 	andcc		%g3, %g2, %g0				/* IEU1		Group		*/
 	be,pt		%xcc, 23f				/* CTI				*/
-	 sllx		%g7, 56, %o5				/* IEU0				*/
+	 sllx		%g6, 56, %o5				/* IEU0				*/
 
 	andcc		%o4, %o5, %g0				/* IEU1		Group		*/
 	be,pn		%xcc, 24f				/* CTI				*/
-	 sllx		%g7, 48, %o5				/* IEU0				*/
+	 sllx		%g6, 48, %o5				/* IEU0				*/
 	andcc		%o4, %o5, %g0				/* IEU1		Group		*/
 
 	be,pn		%xcc, 24f				/* CTI				*/
-	 sllx		%g7, 40, %o5				/* IEU0				*/
+	 sllx		%g6, 40, %o5				/* IEU0				*/
 	andcc		%o4, %o5, %g0				/* IEU1		Group		*/
 	be,pn		%xcc, 24f				/* CTI				*/
 
-	 sllx		%g7, 32, %o5				/* IEU0				*/
+	 sllx		%g6, 32, %o5				/* IEU0				*/
 	andcc		%o4, %o5, %g0				/* IEU1		Group		*/
 	be,pn		%xcc, 24f				/* CTI				*/
-23:	 sllx		%g7, 24, %o5				/* IEU0				*/
+23:	 sllx		%g6, 24, %o5				/* IEU0				*/
 
 	andcc		%o4, %o5, %g0				/* IEU1		Group		*/
 	be,pn		%icc, 24f				/* CTI				*/
-	 sllx		%g7, 16, %o5				/* IEU0				*/
+	 sllx		%g6, 16, %o5				/* IEU0				*/
 	andcc		%o4, %o5, %g0				/* IEU1		Group		*/
 
 	be,pn		%icc, 24f				/* CTI				*/
-	 sllx		%g7, 8, %o5				/* IEU0				*/
+	 sllx		%g6, 8, %o5				/* IEU0				*/
 	andcc		%o4, %o5, %g0				/* IEU1		Group		*/
 	be,pn		%icc, 24f				/* CTI				*/
 
-	 mov		%g7, %o5				/* IEU0				*/
+	 mov		%g6, %o5				/* IEU0				*/
 25:	cmp		%o4, %o3				/* IEU1		Group		*/
 5:	mov		-1, %o0					/* IEU0				*/
 	retl							/* CTI+IEU1	Group		*/
@@ -164,9 +164,9 @@ ENTRY(strcmp)
 	 movgu		%xcc, 1, %o0				/* Single	Group		*/
 
 	.align		16
-24:	sub		%o5, 1, %g7				/* IEU0		Group		*/
+24:	sub		%o5, 1, %g6				/* IEU0		Group		*/
 	clr		%o0					/* IEU1				*/
-	or		%o5, %g7, %o5				/* IEU0		Group		*/
+	or		%o5, %g6, %o5				/* IEU0		Group		*/
 	andn		%o4, %o5, %o4				/* IEU0		Group		*/
 
 	andn		%o3, %o5, %o3				/* IEU1				*/
@@ -205,7 +205,7 @@ ENTRY(strcmp)
 	sub		%o1, %g3, %o1				/* IEU0		Group		*/
 
 	sub		%o5, %g5, %o5				/* IEU1				*/
-	ldxa		[%o1] ASI_PNF, %g7			/* Load		Group		*/
+	ldxa		[%o1] ASI_PNF, %g6			/* Load		Group		*/
 	or		%g1, %g2, %g1				/* IEU0				*/
 	sub		%o1, %o0, %o1				/* IEU1				*/
 
@@ -215,10 +215,10 @@ ENTRY(strcmp)
 								 * %g2 = 8080808080800880
 								 * %g5 = number of bits to shift left
 								 * %o5 = number of bits to shift right */
-10:	sllx		%g7, %g5, %o3				/* IEU0		Group		*/
-	ldxa		[%o1 + %o0] ASI_PNF, %g7		/* Load				*/
+10:	sllx		%g6, %g5, %o3				/* IEU0		Group		*/
+	ldxa		[%o1 + %o0] ASI_PNF, %g6		/* Load				*/
 
-11:	srlx		%g7, %o5, %o4				/* IEU0		Group		*/
+11:	srlx		%g6, %o5, %o4				/* IEU0		Group		*/
 	ldxa		[%o0] ASI_PNF, %o2			/* Load				*/
 	or		%o3, %o4, %o3				/* IEU1				*/
 	add		%o0, 8, %o0				/* IEU0		Group		*/
@@ -272,8 +272,8 @@ ENTRY(strcmp)
 	be,pn		%icc, 4b				/* CTI				*/
 	 andcc		%o2, 0xff, %g0				/* IEU1		Group		*/
 	be,pn		%icc, 4b				/* CTI				*/
-	 sllx		%g7, %g5, %o3				/* IEU0				*/
+	 sllx		%g6, %g5, %o3				/* IEU0				*/
 
 	ba,pt		%xcc, 11b				/* CTI		Group		*/
-	 ldxa		[%o1 + %o0] ASI_PNF, %g7		/* Load				*/
+	 ldxa		[%o1 + %o0] ASI_PNF, %g6		/* Load				*/
 END(strcmp)
diff --git a/sysdeps/sparc/sparc64/strcpy.S b/sysdeps/sparc/sparc64/strcpy.S
index 170f04122b..f29fb2a405 100644
--- a/sysdeps/sparc/sparc64/strcpy.S
+++ b/sysdeps/sparc/sparc64/strcpy.S
@@ -1,6 +1,6 @@
 /* Copy SRC to DEST returning DEST.
    For SPARC v9.
-   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
                   Jakub Jelinek <jj@ultra.linux.cz>.
@@ -25,7 +25,7 @@
 #ifndef XCC
 	.register	%g2, #scratch
 	.register	%g3, #scratch
-	.register	%g7, #scratch
+	.register	%g6, #scratch
 #endif
 
 	/* Normally, this uses
@@ -48,7 +48,7 @@
 	.align		32
 ENTRY(strcpy)
 	sethi		%hi(0x01010101), %g1		/* IEU0		Group		*/
-	mov		%o0, %g7			/* IEU1				*/
+	mov		%o0, %g6			/* IEU1				*/
 	or		%g1, %lo(0x01010101), %g1	/* IEU0		Group		*/
 	andcc		%o0, 7, %g0			/* IEU1				*/
 
@@ -108,7 +108,7 @@ ENTRY(strcpy)
 	bne,pt		%icc, 3b			/* CTI				*/
 	 mov		%o3, %g3			/* IEU0		Group		*/
 4:	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 
 	.align		16
 5:	stb		%g5, [%o0 - 2]			/* Store	Group		*/
@@ -118,23 +118,23 @@ ENTRY(strcpy)
 
 	stw		%g4, [%o0 - 8]			/* Store	Group		*/
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 7:	stb		%g5, [%o0 - 4]			/* Store	Group		*/
 
 	srlx		%g3, 32, %g4			/* IEU0				*/
 8:	stw		%g4, [%o0 - 8]			/* Store	Group		*/
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0 			/* IEU0				*/
+	 mov		%g6, %o0 			/* IEU0				*/
 
 9:	stb		%g5, [%o0 - 6]			/* Store	Group		*/
 	srlx		%g3, 48, %g4			/* IEU0				*/
 10:	sth		%g4, [%o0 - 8]			/* Store	Group		*/
 	retl						/* CTI+IEU1	Group		*/
 
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 11:	stb		%g5, [%o0 - 8]			/* Store	Group		*/
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 
 12:	or		%g1, %g2, %g1			/* IEU0		Group		*/
 	ldub		[%o1], %o3			/* Load				*/
@@ -214,7 +214,7 @@ ENTRY(strcpy)
 	 stx		%o3, [%o0 - 8]			/* Store			*/
 	retl						/* CTI+IEU1	Group		*/
 
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 
 	.align		16
 16:	srlx		%o3, 8, %o4			/* IEU0		Group		*/
@@ -228,7 +228,7 @@ ENTRY(strcpy)
 	stw		%o4, [%o0 - 8]			/* Store			*/
 
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0 			/* IEU0				*/
+	 mov		%g6, %o0 			/* IEU0				*/
 	nop
 	nop
 
@@ -240,5 +240,5 @@ ENTRY(strcpy)
 22:	srlx		%o3, 56, %o4			/* IEU0		Group		*/
 	stb		%o4, [%o0 - 8]			/* Store			*/
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 END(strcpy)
diff --git a/sysdeps/sparc/sparc64/strncmp.S b/sysdeps/sparc/sparc64/strncmp.S
index 31fcfeee08..5a2c2880fc 100644
--- a/sysdeps/sparc/sparc64/strncmp.S
+++ b/sysdeps/sparc/sparc64/strncmp.S
@@ -2,7 +2,7 @@
    equal to or greater than zero if S1 is lexicographically less than, 
    equal to or greater than S2.
    For SPARC v9.
-   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
                   Jakub Jelinek <jj@ultra.linux.cz>.
@@ -29,7 +29,7 @@
 #define USE_BPR
 	.register	%g2, #scratch
 	.register	%g3, #scratch
-	.register	%g7, #scratch
+	.register	%g6, #scratch
 #endif
 
 	/* Normally, this uses
@@ -79,14 +79,14 @@ ENTRY(strncmp)
 	sub		%g4, %g1, %g3			/* IEU0		Group		*/
 	subcc		%g4, %o3, %o4			/* IEU1				*/
 #ifdef EIGHTBIT_NOT_RARE
-	andn		%g3, %g4, %g7			/* IEU0		Group		*/
+	andn		%g3, %g4, %g6			/* IEU0		Group		*/
 #endif
 	bne,pn		%xcc, 6f			/* CTI				*/
 	 ldxa		[%o0] ASI_PNF, %g4		/* Load		Group		*/
 
 	add		%o0, 8, %o0			/* IEU0				*/
 #ifdef EIGHTBIT_NOT_RARE
-	andcc		%g7, %g2, %g0			/* IEU1				*/
+	andcc		%g6, %g2, %g0			/* IEU1				*/
 #else
 	andcc		%g3, %g2, %g0			/* IEU1				*/
 #endif
@@ -95,8 +95,8 @@ ENTRY(strncmp)
 
 	addcc		%g3, %g1, %o4			/* IEU1				*/
 #ifdef EIGHTBIT_NOT_RARE
-	srlx		%g7, 32, %g7			/* IEU0				*/
-	andcc		%g7, %g2, %g0			/* IEU1		Group		*/
+	srlx		%g6, 32, %g6			/* IEU0				*/
+	andcc		%g6, %g2, %g0			/* IEU1		Group		*/
 #else
 	srlx		%g3, 32, %g3			/* IEU0				*/
 	andcc		%g3, %g2, %g0			/* IEU1		Group		*/
@@ -289,11 +289,11 @@ ENTRY(strncmp)
 
 	 ldxa		[%o0] ASI_PNF, %g4		/* Load				*/
 11:	sllx		%g3, 3, %g5			/* IEU0		Group		*/
-	mov		64, %g7				/* IEU1				*/
+	mov		64, %g6				/* IEU1				*/
 	or		%g1, %g2, %g1			/* IEU0		Group		*/
 	sub		%o1, %g3, %o1			/* IEU1				*/
 
-	sub		%g7, %g5, %g7			/* IEU0		Group		*/
+	sub		%g6, %g5, %g6			/* IEU0		Group		*/
 	ldxa		[%o1] ASI_PNF, %o4		/* Load				*/
 	sllx		%g1, 7, %g2			/* IEU1				*/
 	add		%o1, 8, %o1			/* IEU0		Group		*/
@@ -301,7 +301,7 @@ ENTRY(strncmp)
 							   %g2 = 8080808080808080
 							   %g3 = %o1 alignment
 							   %g5 = number of bits to shift left
-							   %g7 = number of bits to shift right */
+							   %g6 = number of bits to shift right */
 
 12:	sllx		%o4, %g5, %o3			/* IEU0		Group		*/
 	ldxa		[%o1] ASI_PNF, %o4		/* Load				*/
@@ -309,7 +309,7 @@ ENTRY(strncmp)
 13:	ldxa		[%o0] ASI_PNF, %g4		/* Load		Group		*/
 
 	addcc		%o0, 8, %o0			/* IEU1				*/
-	srlx		%o4, %g7, %o5			/* IEU0				*/
+	srlx		%o4, %g6, %o5			/* IEU0				*/
 	subcc		%o2, 8, %o2			/* IEU1		Group		*/
 	bl,pn		%XCC, 5b			/* CTI				*/
 
diff --git a/sysdeps/sparc/sparc64/strncpy.S b/sysdeps/sparc/sparc64/strncpy.S
index 1fec9b429a..43ab5f6575 100644
--- a/sysdeps/sparc/sparc64/strncpy.S
+++ b/sysdeps/sparc/sparc64/strncpy.S
@@ -2,7 +2,7 @@
    null-terminated string from SRC to DST.  If SRC does not cover all of
    COUNT, the balance is zeroed.
    For SPARC v9.
-   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
                   Jakub Jelinek <jj@ultra.linux.cz>.
@@ -29,7 +29,7 @@
 #define USE_BPR
 	.register	%g2, #scratch
 	.register	%g3, #scratch
-	.register	%g7, #scratch
+	.register	%g6, #scratch
 #endif
 
 	/* Normally, this uses
@@ -58,7 +58,7 @@ ENTRY(strncpy)
 	tst		%o2				/* IEU1				*/
 	be,pn		%XCC, 19f			/* CTI				*/
 #endif
-	 mov		%o0, %g7			/* IEU0		Group		*/
+	 mov		%o0, %g6			/* IEU0		Group		*/
 	or		%g1, %lo(0x01010101), %g1	/* IEU1				*/
 
 	andcc		%o0, 7, %g0			/* IEU1		Group		*/
@@ -156,7 +156,7 @@ ENTRY(strncpy)
 
 	 stb		%g0, [%o0]			/* Store			*/
 9:	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 
 	.align		16
 10:	ba,pt		%xcc, 3b			/* CTI				*/
@@ -240,14 +240,14 @@ ENTRY(strncpy)
 	stb		%g5, [%o0]			/* Store			*/ 
 
 19:	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 50:	stb		%g0, [%o0]			/* Store	Group		*/
 20:	subcc		%o2, 1, %o2			/* IEU1		Group		*/
 
 	bne,pt		%XCC, 50b			/* CTI				*/
 	 add		%o0, 1, %o0			/* IEU0				*/
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 
 21:	andcc		%o2, 4, %g0			/* IEU1		Group		*/
 	be,pn		%icc, 22f			/* CTI				*/
@@ -270,7 +270,7 @@ ENTRY(strncpy)
 	 stb		%g4, [%o0]			/* Store	Group		*/
 
 24:	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 25:	andcc		%o0, 7, %g0			/* IEU1		Group		*/
 	be,a,pn		%icc, 4b			/* CTI				*/
 
@@ -281,7 +281,7 @@ ENTRY(strncpy)
 
 	 add		%o0, 1, %o0			/* IEU0		Group		*/
 	retl						/* CTI+IEU1	Group		*/
-	 mov		%g7, %o0			/* IEU0				*/
+	 mov		%g6, %o0			/* IEU0				*/
 
 	.align		16
 26:	ldub		[%o1], %o3			/* Load				*/
diff --git a/sysdeps/unix/mips/sysdep.S b/sysdeps/unix/mips/sysdep.S
index fa1bfa1722..c710b0c274 100644
--- a/sysdeps/unix/mips/sysdep.S
+++ b/sysdeps/unix/mips/sysdep.S
@@ -27,11 +27,11 @@ ENTRY(__syscall_error)
 #ifdef __PIC__
 	.set noreorder
 	.set	noat
-	move	$1, $31
-	bltzal	$0, 0f
+	move	AT, ra
+	bltzal	zero, 0f
 	nop
-0:	.cpload	$31
-	move	$31, $1
+0:	.cpload	ra
+	move	ra, AT
 	.set	at
 	.set	reorder
 #endif
@@ -51,9 +51,6 @@ ENTRY(__syscall_error)
 	li	v0, EAGAIN
 skip:
 #endif
-	/* Store it in the "real" variable ... */
-	sw v0, errno
-
 	/* Find our per-thread errno address  */
 	jal	__errno_location
 
@@ -75,11 +72,11 @@ ENTRY(__syscall_error)
 #ifdef __PIC__
 	.set	noreorder
 	.set	noat
-	move	$1, $31
-	bltzal	$0, 0f
+	move	AT, ra
+	bltzal	zero, 0f
 	nop
-0:	.cpload	$31
-	move	$31, $1
+0:	.cpload	ra
+	move	ra, AT
 	.set	at
 	.set	reorder
 #endif
diff --git a/sysdeps/unix/sysv/linux/mips/pread.c b/sysdeps/unix/sysv/linux/mips/pread.c
index 45305d2ccc..e6cb21ff93 100644
--- a/sysdeps/unix/sysv/linux/mips/pread.c
+++ b/sysdeps/unix/sysv/linux/mips/pread.c
@@ -22,12 +22,19 @@
 #include <unistd.h>
 #include <endian.h>
 
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 #include <sys/syscall.h>
 #include <bp-checks.h>
 
 #include <kernel-features.h>
 
+#ifdef __NR_pread64             /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pread
+#  error "__NR_pread and __NR_pread64 both defined???"
+# endif
+# define __NR_pread __NR_pread64
+#endif
+
 #if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
 
 # if __ASSUME_PREAD_SYSCALL == 0
@@ -48,6 +55,22 @@ __libc_pread (fd, buf, count, offset)
 {
   ssize_t result;
 
+  if (SINGLE_THREAD_P)
+    {
+     /* First try the syscall.  */
+     assert (sizeof (offset) == 4);
+     result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+			      __LONG_LONG_PAIR (offset >> 31, offset));
+# if __ASSUME_PREAD_SYSCALL == 0
+     if (result == -1 && errno == ENOSYS)
+     /* No system call available.  Use the emulation.  */
+     result = __emulate_pread (fd, buf, count, offset);
+# endif
+     return result;
+    }
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
   /* First try the syscall.  */
   assert (sizeof (offset) == 4);
   result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
@@ -57,6 +80,9 @@ __libc_pread (fd, buf, count, offset)
     /* No system call available.  Use the emulation.  */
     result = __emulate_pread (fd, buf, count, offset);
 # endif
+
+  LIBC_CANCEL_RESET (oldtype);
+
   return result;
 }
 
diff --git a/sysdeps/unix/sysv/linux/mips/pread64.c b/sysdeps/unix/sysv/linux/mips/pread64.c
index d36d68967b..36ec100fb3 100644
--- a/sysdeps/unix/sysv/linux/mips/pread64.c
+++ b/sysdeps/unix/sysv/linux/mips/pread64.c
@@ -21,12 +21,19 @@
 #include <unistd.h>
 #include <endian.h>
 
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 #include <sys/syscall.h>
 #include <bp-checks.h>
 
 #include <kernel-features.h>
 
+#ifdef __NR_pread64             /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pread
+#  error "__NR_pread and __NR_pread64 both defined???"
+# endif
+# define __NR_pread __NR_pread64
+#endif
+
 #if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
 
 # if __ASSUME_PREAD_SYSCALL == 0
@@ -48,6 +55,23 @@ __libc_pread64 (fd, buf, count, offset)
 {
   ssize_t result;
 
+
+  if (SINGLE_THREAD_P)
+    {
+     /* First try the syscall.  */
+     result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+			      __LONG_LONG_PAIR ((off_t) (offset >> 32),
+			      (off_t) (offset & 0xffffffff)));
+# if __ASSUME_PREAD_SYSCALL == 0
+     if (result == -1 && errno == ENOSYS)
+     /* No system call available.  Use the emulation.  */
+     result = __emulate_pread64 (fd, buf, count, offset);
+# endif
+     return result;
+    }
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
   /* First try the syscall.  */
   result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
 			   __LONG_LONG_PAIR ((off_t) (offset >> 32),
@@ -57,6 +81,9 @@ __libc_pread64 (fd, buf, count, offset)
     /* No system call available.  Use the emulation.  */
     result = __emulate_pread64 (fd, buf, count, offset);
 # endif
+
+  LIBC_CANCEL_RESET (oldtype);
+
   return result;
 }
 
diff --git a/sysdeps/unix/sysv/linux/mips/pwrite.c b/sysdeps/unix/sysv/linux/mips/pwrite.c
index 44f9d30ebf..f25e327877 100644
--- a/sysdeps/unix/sysv/linux/mips/pwrite.c
+++ b/sysdeps/unix/sysv/linux/mips/pwrite.c
@@ -22,12 +22,19 @@
 #include <unistd.h>
 #include <endian.h>
 
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 #include <sys/syscall.h>
 #include <bp-checks.h>
 
 #include <kernel-features.h>
 
+#ifdef __NR_pwrite64            /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pwrite
+#  error "__NR_pwrite and __NR_pwrite64 both defined???"
+# endif
+# define __NR_pwrite __NR_pwrite64
+#endif
+
 #if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
 
 extern ssize_t __syscall_pwrite (int fd, const void *__unbounded buf, size_t count,
@@ -47,16 +54,35 @@ __libc_pwrite (fd, buf, count, offset)
 {
   ssize_t result;
 
+  if (SINGLE_THREAD_P)
+    {
+      /* First try the syscall.  */
+     assert (sizeof (offset) == 4);
+     result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+			   __LONG_LONG_PAIR (offset >> 31, offset));
+# if __ASSUME_PWRITE_SYSCALL == 0
+     if (result == -1 && errno == ENOSYS)
+       /* No system call available.  Use the emulation.  */
+       result = __emulate_pwrite (fd, buf, count, offset);
+# endif
+
+      return result;
+    }
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
   /* First try the syscall.  */
   assert (sizeof (offset) == 4);
   result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
-			   __LONG_LONG_PAIR (offset >> 31, offset));
+		   __LONG_LONG_PAIR (offset >> 31, offset));
 # if __ASSUME_PWRITE_SYSCALL == 0
   if (result == -1 && errno == ENOSYS)
     /* No system call available.  Use the emulation.  */
     result = __emulate_pwrite (fd, buf, count, offset);
 # endif
 
+  LIBC_CANCEL_RESET (oldtype);
+
   return result;
 }
 
diff --git a/sysdeps/unix/sysv/linux/mips/pwrite64.c b/sysdeps/unix/sysv/linux/mips/pwrite64.c
index 4f7299ed47..0accc1d37b 100644
--- a/sysdeps/unix/sysv/linux/mips/pwrite64.c
+++ b/sysdeps/unix/sysv/linux/mips/pwrite64.c
@@ -21,12 +21,19 @@
 #include <unistd.h>
 #include <endian.h>
 
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 #include <sys/syscall.h>
 #include <bp-checks.h>
 
 #include <kernel-features.h>
 
+#ifdef __NR_pwrite64            /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pwrite
+#  error "__NR_pwrite and __NR_pwrite64 both defined???"
+# endif
+# define __NR_pwrite __NR_pwrite64
+#endif
+
 #if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
 
 extern ssize_t __syscall_pwrite (int fd, const void *__unbounded buf, size_t count,
@@ -46,6 +53,23 @@ __libc_pwrite64 (fd, buf, count, offset)
 {
   ssize_t result;
 
+  if (SINGLE_THREAD_P)
+    {
+     /* First try the syscall.  */
+     result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+			      __LONG_LONG_PAIR ((off_t) (offset >> 32),
+			     (off_t) (offset & 0xffffffff)));
+# if __ASSUME_PWRITE_SYSCALL == 0
+     if (result == -1 && errno == ENOSYS)
+     /* No system call available.  Use the emulation.  */
+     result = __emulate_pwrite64 (fd, buf, count, offset);
+# endif
+
+     return result;
+    }
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
   /* First try the syscall.  */
   result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
 			   __LONG_LONG_PAIR ((off_t) (offset >> 32),
@@ -56,6 +80,8 @@ __libc_pwrite64 (fd, buf, count, offset)
     result = __emulate_pwrite64 (fd, buf, count, offset);
 # endif
 
+  LIBC_CANCEL_RESET (oldtype);
+
   return result;
 }
 
diff --git a/sysdeps/unix/sysv/linux/mips/sysdep.h b/sysdeps/unix/sysv/linux/mips/sysdep.h
index 1fd64e5bd5..710479ae18 100644
--- a/sysdeps/unix/sysv/linux/mips/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/sysdep.h
@@ -33,7 +33,15 @@
 # define SYS_ify(syscall_name)	__NR_/**/syscall_name
 #endif
 
-#ifndef __ASSEMBLER__
+#ifdef __ASSEMBLER__
+
+/* We don't want the label for the error handler to be visible in the symbol
+   table when we define it here.  */
+#ifdef __PIC__
+# define SYSCALL_ERROR_LABEL 99b
+#endif
+
+#else   /* ! __ASSEMBLER__ */
 
 /* Define a macro which expands into the inline wrapper code for a system
    call.  */
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c
new file mode 100644
index 0000000000..26950aa097
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c
@@ -0,0 +1,30 @@
+/* Procedure definition for FE_NOMASK_ENV for Linux/ppc64.
+   Copyright (C) 2003 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fenv.h>
+#include <errno.h>
+#include <sys/prctl.h>
+
+const fenv_t *
+__fe_nomask_env (void)
+{
+  prctl (PR_SET_FPEXC, PR_FP_EXC_PRECISE);
+
+  return FE_ENABLED_ENV;
+}
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
index 7bc734e38a..94b46e1849 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, 1997.
 
@@ -17,7 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 #include <socketcall.h>
 
 #define P(a, b) P2(a, b)
@@ -63,7 +63,12 @@ ENTRY (__socket)
 #endif
 #endif
 
-	mov P(SOCKOP_,socket), %o0	/* arg 1: socket subfunction */
+#if defined NEED_CANCELLATION && defined CENABLE
+	SINGLE_THREAD_P
+	cmp %g1, 0
+	bne .Lsocket_cancel
+#endif
+	 mov P(SOCKOP_,socket), %o0	/* arg 1: socket subfunction */
 	add %sp, 68, %o1		/* arg 2: parameter block */
 	LOADSYSCALL(socketcall)
 	t 0x10
@@ -72,6 +77,25 @@ ENTRY (__socket)
 	retl
 	 nop
 
+#if defined NEED_CANCELLATION && defined CENABLE
+.Lsocket_cancel:
+	save %sp, -96, %sp
+	CENABLE
+	 nop
+	mov %o0, %l0
+	add %sp, 68 + 96, %o1
+	mov P(SOCKOP_,socket), %o0
+	LOADSYSCALL(socketcall)
+	t 0x10
+	bcs __syscall_error_handler2
+	 mov %o0, %l1
+	CDISABLE
+	 mov %l0, %o0
+	jmpl %i7 + 8, %g0
+	 restore %g0, %l1, %o0
+	SYSCALL_ERROR_HANDLER2
+#endif
+
 	SYSCALL_ERROR_HANDLER
 
 END (__socket)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index e362894e17..7bf63b9c54 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 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2002, 2003 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.
 
@@ -131,7 +131,7 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler)			\
 	" sub	%%g0, %%o0, %%o0;"					\
 	"1:"
 
-#define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g7",		\
+#define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g6",		\
 	"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",			\
 	"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",		\
 	"f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",		\
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
index a64da1a223..e2bb8631a3 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 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2000, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
 
@@ -134,7 +134,7 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler)			\
 	" sub	%%g0, %%o0, %%o0;"					\
 	"1:"
 
-#define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g7",		\
+#define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g6",		\
 	"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",			\
 	"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",		\
 	"f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",		\
diff --git a/sysdeps/wordsize-32/divdi3.c b/sysdeps/wordsize-32/divdi3.c
index 8ca9fe4c0d..122ffcae8c 100644
--- a/sysdeps/wordsize-32/divdi3.c
+++ b/sysdeps/wordsize-32/divdi3.c
@@ -1,5 +1,5 @@
 /* 64-bit multiplication and division
-   Copyright (C) 1989, 1992-1999, 2000, 2001, 2002
+   Copyright (C) 1989, 1992-1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -294,7 +294,6 @@ __divdi3 (DWtype u, DWtype v)
     w = -w;
   return w;
 }
-INTDEF(__divdi3)
 
 DWtype
 __moddi3 (DWtype u, DWtype v)
@@ -329,3 +328,13 @@ __umoddi3 (UDWtype u, UDWtype v)
   __udivmoddi4 (u, v, &w);
   return w;
 }
+
+/* We declare these with compat_symbol so that they are not visible at
+   link time.  Programs must use the functions from libgcc.  */
+#if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING
+# include <shlib-compat.h>
+compat_symbol (libc, __divdi3, __divdi3, GLIBC_2_0);
+compat_symbol (libc, __moddi3, __moddi3, GLIBC_2_0);
+compat_symbol (libc, __udivdi3, __udivdi3, GLIBC_2_0);
+compat_symbol (libc, __umoddi3, __umoddi3, GLIBC_2_0);
+#endif
diff --git a/sysdeps/wordsize-32/lldiv.c b/sysdeps/wordsize-32/lldiv.c
index 2da982ca57..5cefd35c22 100644
--- a/sysdeps/wordsize-32/lldiv.c
+++ b/sysdeps/wordsize-32/lldiv.c
@@ -21,13 +21,6 @@
 
 #include <inttypes.h>
 
-#ifdef SHARED
-/* This is an ugly trick.  We cause the C code generated for the code
-   in lldiv.c to use __divdi3_internal instead of __divdi3 by defining
-   an alias on the assembler level.  */
-asm ("__divdi3 = __divdi3_internal");
-#endif
-
 #include <sysdeps/generic/lldiv.c>
 
 #undef imaxdiv