about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-08-14 01:54:13 +0000
committerUlrich Drepper <drepper@redhat.com>1997-08-14 01:54:13 +0000
commitca34d7a7c77fa8dc823fd05439870e5a96610c5a (patch)
tree4b4057b8b919007f42caa4e1558bb9c5487976ae /sysdeps
parent0413b54c02d31cae62e8d13b3ee7ac109ceeff0e (diff)
downloadglibc-ca34d7a7c77fa8dc823fd05439870e5a96610c5a.tar.gz
glibc-ca34d7a7c77fa8dc823fd05439870e5a96610c5a.tar.xz
glibc-ca34d7a7c77fa8dc823fd05439870e5a96610c5a.zip
1997-08-14 03:14  Ulrich Drepper  <drepper@cygnus.com>

	* elf/dl-minimal.c: Don't use relative #include paths.
	(malloc): Don't try to initialize _dl_pagesize, it already is.
	(__sigjmp_save, longjmp): Reformat.

	* sysdeps/generic/dl-sysdep.c: Implement _dl_show_auxv function to
	show content of auxiliary array.
	(_dl_sysdep_start): Remember start of auxiliary vector.
	* sysdeps/mach/hurd/dl-sysdep.c: (_dl_show_auxv): New dummy function.
	* elf/link.h: Add prototype for _dl_show_auxv.
	* elf/rtld.c (dl_main): Call _dl_show_auxv if LD_SHOW_AUXV envvar
	is present.

	* libio/iofdopen.c: Better prepare for use in libstdc++.
	* libio/iofflush.c: Likewise.
	* libio/iofgetpos.c: Likewise.
	* libio/iofgets.c: Likewise.
	* libio/iofopen.c: Likewise.
	* libio/iofputs.c: Likewise.
	* libio/iofread.c: Likewise.
	* libio/iofsetpos.c: Likewise.
	* libio/ioftell.c: Likewise.
	* libio/iofwrite.c: Likewise.
	* libio/iogetdelim.c: Likewise.
	* libio/iogets.c: Likewise.
	* libio/iopopen.c: Likewise.
	* libio/ioputs.c: Likewise.
	* libio/iosetbuffer.c: Likewise.
	* libio/iosetvbuf.c: Likewise.
	* libio/ioungetc.c: Likewise.
	* libio/iovsprintf.c: Likewise.
	* libio/iovsscanf.c: Likewise.

	* manual/creature.texi: Mention _XOPEN_SOURCE_EXTENDED in correct
	place.

	* manual/math.texi: Add comment to sincos decsription to say it's a
	GNU extension.
	Fix description of random function.

	* posix/fnmatch.h: Recognize Windog by _WINDOWS32 not WIN32.
	* posix/glob.c: Likewise.  Handle stupid system headers on SunOS.
	Add casts for all __alloca calls.
	* posix/glob.h: Recognize Windog by _WINDOWS32 not WIN32.
	Declare additional GLOB_* constants also if _GNU_SOURCE is defined.
	Patches by Paul D. Smith <psmith@BayNetworks.COM>.

	* stdio-common/_itoa.c: Don't use relateive #include paths.

	* sysdeps/i386/fpu/bits/mathinline.h: Enable optimizations even for
	gcc 2.7.
	(atan): Loading 1.0 from memory does not pay off.
	(asinh): Fix typo.

1997-08-13 09:44  Philip Blundell  <Philip.Blundell@pobox.com>

	* sysdeps/stub/accept.c: Use socklen_t where necessary.
	* sysdeps/stub/bind.c: Likewise.
	* sysdeps/stub/connect.c: Likewise.
	* sysdeps/stub/getsockname.c: Likewise.
	* sysdeps/stub/getsockopt.c: Likewise.
	* sysdeps/stub/recvfrom.c: Likewise.
	* sysdeps/stub/sendto.c: Likewise.
	* sysdeps/stub/setsockopt.c: Likewise.

1997-08-11  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* io/ftw.c (object_compare): Avoid memcmp when comparing scalar
	types.

1997-08-12  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* math/libm-test.c (cbrt_test): Add epsilon for long double to
	`cbrt (-0.001)'.

1997-08-11  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/stub/bits/string.h: Fix comment.

1997-08-01  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* elf/Makefile (routines): Remove dl-version.
	(dl-routines): Add it here instead.  This removes dead code from
	libc.so.

1997-08-12 17:17  Wolfram Gloger  <wmglo@dent.med.uni-muenchen.de>

	* malloc/thread-m.h (thread_atfork, thread_atfork_static): New
	macros to encapsulate pthread_atfork's functionality.
	* malloc/malloc.c (ptmalloc_lock_all, ptmalloc_unlock_all): New
	functions, registered via thread_atfork in the initialization
	routine or via thread_atfork_static in global scope.  This
	ensures a consistent state of all locks across fork().

1997-08-11 23:00:32 1997  Mark Kettenis  <kettenis@phys.uva.nl>

	* login/programs/xtmp.c (compare_entry):
	Partially undo patch made by Klaus Espenlaub.  There
	was no xtmp/utmp typo.  Added comment to cclarify this.
	* login/programs/xtmp.h: Likewise.

	* posix/getopt.c: Recognize Windog by _WINDOWS32 not WIN32.
	Patch by Paul D. Smith <psmith@BayNetworks.COM>.

1997-08-12 13:51  Ulrich Drepper  <drepper@cygnus.com>

	* login/getutid.c: Rename to __getutid and make getutid and getutxid
	weak aliases.
	Patch by ir. Mark M._Kettenis <kettenis@phys.uva.nl>.

1997-08-11 23:55  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/Makefile [subdir=misc] (sysdep_headers):
	Add bits/mman.h.

1997-08-11 08:51:21 1997  H.J. Lu  <hjl@gnu.ai.mit.edu>

	* stdlib/fmtmsg.c (fmtmsg): Add static to
	__libc_once_define macro.

	* libc.map (__progname_full, __progname): Added.

1997-08-04 08:31  H.J. Lu  <hjl@gnu.ai.mit.edu>

	* sysdeps/unix/sysv/linux/if_index.c (if_nametoindex): Return 0
	if SIOGIFINDEX is not defined.
	(if_indextoname): Initialize "result" to NULL.
	(if_nametoindex, if_nameindex): Fix ENOSYS setting.

1997-08-11 11:58  Richard Henderson  <rth@cygnus.com>

	Sparc ISO C 9x exception handling:
	* sysdeps/sparc/fpu/bits/mathdef.h: New file.
	* sysdeps/sparc/fpu/fclrexcpt.c: New file.
	* sysdeps/sparc/fpu/fegetenv.c: New file.
	* sysdeps/sparc/fpu/fegetround.c: New file.
	* sysdeps/sparc/fpu/feholdexcpt.c: New file.
	* sysdeps/sparc/fpu/fesetenv.c: New file.
	* sysdeps/sparc/fpu/fesetround.c: New file.
	* sysdeps/sparc/fpu/feupdateenv.c: New file.
	* sysdeps/sparc/fpu/fgetexcptflg.c: New file.
	* sysdeps/sparc/fpu/fraiseexcpt.c: New file.
	* sysdeps/sparc/fpu/fsetexcptflg.c: New file.
	* sysdeps/sparc/fpu/ftestexcept.c: New file.
	* sysdeps/sparc/sparc32/fpu/bits/fenv.h: New file.
	* sysdeps/sparc/sparc64/fpu/bits/fenv.h: New file.

1997-08-11 11:58  Richard Henderson  <rth@cygnus.com>

	Sparc64 merge:
	* configure.in: Change up subdirectories, rename sparc8->sparcv8.

	* csu/Makefile: Nuke need-nopic-initfini bits.  The problem was
	that sparc64 ld did not recognize pic relocs at all.

	* elf/dl-deps.c: Include <string.h>.
	* elf/do-rel.h (elf_dynamic_do_rel): Take reloc address and size
	directly instead of the DT names to get them from.
	* elf/dynamic-link.h (_ELF_DYNAMIC_DO_RELOC): New macro distilled
	from ELF_DYNAMIC_DO_REL{,A}.  Define a second version that accounts
	for the possibility that DT_RELA and DT_JMPPLT overlap, as such is
	the case on the Sparc.

	* elf/elf.h: Stub out Elf64_Ver*, and make them the same as the
	Elf32_Ver* bits.  The linker does not even know to differentiate
	between the word sizes.  Someone should examine this and figure
	out what the proper sizes of things should be for 64-bit hosts
	before the sparc64 libraries are distributed.

	* shlib-versions: Rename sparc64 ld.so to not conflict with sparc32
	on the same machine.

	Move old sysdeps/sparc contents to sysdeps/sparc/sparc32,
	rename sparc8 subdir to sparcv8, move sysdeps/sparc64 content to
	sysdeps/sparc/sparc64.  Same for sysdeps/unix/sysv/linux/sparc.

	* sysdeps/sparc/Implies: Do ieee754 here.
	* sysdeps/sparc/configure.in: Move from sparc32/.
	* sysdeps/sparc/sparc32/Implies: Do wordsize here.
	* sysdeps/sparc/sparc64/Implies: Likewise.

	* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_load_address):
	Use uninitialized .got to find load address instead of AT_BASE, as
	the later does not exist when running ld.so directly.

	* sysdeps/sparc/sparc32/fpu/fpu_control.h: Move from ../.
	* sysdeps/sparc/sparc64/fpu/fpu_control.h: Likewise.

	* sysdeps/sparc/sparc32/udiv_qrnnd.S: Clean up PIC support.

	* sysdeps/sparc/sparc64/Makefile (sysdep_routines): Add s_finitel
	and s_signbitl for stdio.
	* sysdeps/sparc/sparc64/configure.in: Remove, we no longer need
	nopic_initfini.

	* sysdeps/sparc/sparc64/bsd-_setjmp.S: Remove.
	* sysdeps/sparc/sparc64/bsd-setjmp.S: Remove.
	* sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S: New empty file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S: New empty file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Add __longjmp alias.
	* sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S: Add weak _setjmp
	and setjmp entry points.

	* sysdeps/sparc/sparc64/dl-machine.h: Finish real implementation.

	* sysdeps/sparc/sparc64/elf/crtbegin.S: Add copyright, fix PIC.
	* sysdeps/sparc/sparc64/elf/crtend.S: Likewise.

	* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h (struct sigaction):
	Fix sa_flags size for sparc64; add sa_restorer for kernel.

	* sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Fix PIC.
	* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.

	* sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S: New file.

1997-08-10 18:29:08 1997  Mark Kettenis  <kettenis@phys.uva.nl>

	* login/login.c (login): Check for correct return value of
	utmpname.

1997-08-11 16:49  Ulrich Drepper  <drepper@cygnus.com>

	* time/tzset.c (__tzset_internal): Correctly handle TZ strings
	following incorrect old POSIX specs.
	Patch by Paul Eggert <eggert@twinsun.com>.

	* sysdeps/generic/bits/sigaction.h: Correct comment for SA_RESTART.
	* sysdeps/unix/bsd/osf/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/minix/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/sysv4/bits/sigaction.h: Likewise.
	Reported by NIIBE Yutaka <gniibe@mri.co.jp>.

1997-08-09  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* manual/math.texi: Define the macros @mul and @infinity and use
	them to format the multiplication and infinity signs.
	(FP Comparison Functions): Use @code, not @math, for C code
	examples.

	* elf/dl-profile.c: Add descriptions and implement reading of
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/bits/sigaction.h6
-rw-r--r--sysdeps/generic/dl-sysdep.c77
-rw-r--r--sysdeps/i386/fpu/bits/mathinline.h13
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.c7
-rw-r--r--sysdeps/sparc/Implies1
-rw-r--r--sysdeps/sparc/fpu/bits/mathdef.h64
-rw-r--r--sysdeps/sparc/fpu/fclrexcpt.c (renamed from sysdeps/sparc64/bsd-setjmp.S)29
-rw-r--r--sysdeps/sparc/fpu/fegetenv.c26
-rw-r--r--sysdeps/sparc/fpu/fegetround.c30
-rw-r--r--sysdeps/sparc/fpu/feholdexcpt.c (renamed from sysdeps/sparc64/bsd-_setjmp.S)32
-rw-r--r--sysdeps/sparc/fpu/fesetenv.c43
-rw-r--r--sysdeps/sparc/fpu/fesetround.c37
-rw-r--r--sysdeps/sparc/fpu/feupdateenv.c38
-rw-r--r--sysdeps/sparc/fpu/fgetexcptflg.c31
-rw-r--r--sysdeps/sparc/fpu/fraiseexcpt.c66
-rw-r--r--sysdeps/sparc/fpu/fsetexcptflg.c34
-rw-r--r--sysdeps/sparc/fpu/ftestexcept.c30
-rw-r--r--sysdeps/sparc/sparc32/Dist (renamed from sysdeps/sparc/Dist)0
-rw-r--r--sysdeps/sparc/sparc32/Implies1
-rw-r--r--sysdeps/sparc/sparc32/Makefile (renamed from sysdeps/sparc/Makefile)0
-rw-r--r--sysdeps/sparc/sparc32/__longjmp.S (renamed from sysdeps/sparc/__longjmp.S)0
-rw-r--r--sysdeps/sparc/sparc32/add_n.S (renamed from sysdeps/sparc/add_n.S)0
-rw-r--r--sysdeps/sparc/sparc32/addmul_1.S (renamed from sysdeps/sparc/addmul_1.S)0
-rw-r--r--sysdeps/sparc/sparc32/alloca.S (renamed from sysdeps/sparc/alloca.S)0
-rw-r--r--sysdeps/sparc/sparc32/bits/endian.h (renamed from sysdeps/sparc/bits/endian.h)0
-rw-r--r--sysdeps/sparc/sparc32/bits/setjmp.h (renamed from sysdeps/sparc/bits/setjmp.h)0
-rw-r--r--sysdeps/sparc/sparc32/bsd-_setjmp.S (renamed from sysdeps/sparc/bsd-_setjmp.S)0
-rw-r--r--sysdeps/sparc/sparc32/bsd-setjmp.S (renamed from sysdeps/sparc/bsd-setjmp.S)0
-rw-r--r--sysdeps/sparc/sparc32/divrem.m4 (renamed from sysdeps/sparc/divrem.m4)0
-rw-r--r--sysdeps/sparc/sparc32/dl-machine.h (renamed from sysdeps/sparc/dl-machine.h)18
-rw-r--r--sysdeps/sparc/sparc32/dotmul.S (renamed from sysdeps/sparc/dotmul.S)0
-rw-r--r--sysdeps/sparc/sparc32/e_sqrt.c (renamed from sysdeps/sparc/e_sqrt.c)0
-rw-r--r--sysdeps/sparc/sparc32/elf/Makefile (renamed from sysdeps/sparc/elf/Makefile)0
-rw-r--r--sysdeps/sparc/sparc32/elf/start.c (renamed from sysdeps/sparc/elf/start.c)0
-rw-r--r--sysdeps/sparc/sparc32/fpu/bits/fenv.h76
-rw-r--r--sysdeps/sparc/sparc32/fpu/fpu_control.h (renamed from sysdeps/sparc/fpu_control.h)0
-rw-r--r--sysdeps/sparc/sparc32/lshift.S (renamed from sysdeps/sparc/lshift.S)0
-rw-r--r--sysdeps/sparc/sparc32/memcopy.h (renamed from sysdeps/sparc/memcopy.h)0
-rw-r--r--sysdeps/sparc/sparc32/mul_1.S (renamed from sysdeps/sparc/mul_1.S)0
-rw-r--r--sysdeps/sparc/sparc32/rem.S (renamed from sysdeps/sparc/rem.S)0
-rw-r--r--sysdeps/sparc/sparc32/rshift.S (renamed from sysdeps/sparc/rshift.S)0
-rw-r--r--sysdeps/sparc/sparc32/sdiv.S (renamed from sysdeps/sparc/sdiv.S)0
-rw-r--r--sysdeps/sparc/sparc32/setjmp.S (renamed from sysdeps/sparc/setjmp.S)0
-rw-r--r--sysdeps/sparc/sparc32/sparcv8/addmul_1.S (renamed from sysdeps/sparc/sparc8/addmul_1.S)0
-rw-r--r--sysdeps/sparc/sparc32/sparcv8/mul_1.S (renamed from sysdeps/sparc/sparc8/mul_1.S)0
-rw-r--r--sysdeps/sparc/sparc32/sparcv8/submul_1.S (renamed from sysdeps/sparc/sparc8/submul_1.S)0
-rw-r--r--sysdeps/sparc/sparc32/sparcv8/udiv_qrnnd.S (renamed from sysdeps/sparc/sparc8/udiv_qrnnd.S)0
-rw-r--r--sysdeps/sparc/sparc32/sub_n.S (renamed from sysdeps/sparc/sub_n.S)0
-rw-r--r--sysdeps/sparc/sparc32/submul_1.S (renamed from sysdeps/sparc/submul_1.S)0
-rw-r--r--sysdeps/sparc/sparc32/udiv.S (renamed from sysdeps/sparc/udiv.S)0
-rw-r--r--sysdeps/sparc/sparc32/udiv_qrnnd.S (renamed from sysdeps/sparc/udiv_qrnnd.S)51
-rw-r--r--sysdeps/sparc/sparc32/umul.S (renamed from sysdeps/sparc/umul.S)0
-rw-r--r--sysdeps/sparc/sparc32/urem.S (renamed from sysdeps/sparc/urem.S)0
-rw-r--r--sysdeps/sparc/sparc64/Implies1
-rw-r--r--sysdeps/sparc/sparc64/Makefile (renamed from sysdeps/sparc64/Makefile)2
-rw-r--r--sysdeps/sparc/sparc64/add_n.S (renamed from sysdeps/sparc64/add_n.S)0
-rw-r--r--sysdeps/sparc/sparc64/addmul_1.S (renamed from sysdeps/sparc64/addmul_1.S)0
-rw-r--r--sysdeps/sparc/sparc64/bits/endian.h (renamed from sysdeps/sparc64/bits/endian.h)0
-rw-r--r--sysdeps/sparc/sparc64/dl-machine.h (renamed from sysdeps/sparc64/dl-machine.h)119
-rw-r--r--sysdeps/sparc/sparc64/elf/Dist (renamed from sysdeps/sparc64/elf/Dist)0
-rw-r--r--sysdeps/sparc/sparc64/elf/Makefile (renamed from sysdeps/sparc64/elf/Makefile)0
-rw-r--r--sysdeps/sparc/sparc64/elf/crtbegin.S69
-rw-r--r--sysdeps/sparc/sparc64/elf/crtbeginS.S (renamed from sysdeps/sparc64/elf/crtbeginS.S)0
-rw-r--r--sysdeps/sparc/sparc64/elf/crtend.S70
-rw-r--r--sysdeps/sparc/sparc64/elf/crtendS.S (renamed from sysdeps/sparc64/elf/crtendS.S)0
-rw-r--r--sysdeps/sparc/sparc64/elf/start.S (renamed from sysdeps/sparc64/elf/start.S)0
-rw-r--r--sysdeps/sparc/sparc64/fpu/bits/fenv.h76
-rw-r--r--sysdeps/sparc/sparc64/fpu/fpu_control.h (renamed from sysdeps/sparc64/fpu_control.h)0
-rw-r--r--sysdeps/sparc/sparc64/gmp-mparam.h (renamed from sysdeps/sparc64/gmp-mparam.h)0
-rw-r--r--sysdeps/sparc/sparc64/lshift.S (renamed from sysdeps/sparc64/lshift.S)0
-rw-r--r--sysdeps/sparc/sparc64/mul_1.S (renamed from sysdeps/sparc64/mul_1.S)0
-rw-r--r--sysdeps/sparc/sparc64/rshift.S (renamed from sysdeps/sparc64/rshift.S)0
-rw-r--r--sysdeps/sparc/sparc64/sub_n.S (renamed from sysdeps/sparc64/sub_n.S)0
-rw-r--r--sysdeps/sparc/sparc64/submul_1.S (renamed from sysdeps/sparc64/submul_1.S)0
-rw-r--r--sysdeps/sparc64/Implies3
-rwxr-xr-xsysdeps/sparc64/configure3
-rw-r--r--sysdeps/sparc64/configure.in7
-rw-r--r--sysdeps/sparc64/elf/crtbegin.S49
-rw-r--r--sysdeps/sparc64/elf/crtend.S50
-rw-r--r--sysdeps/stub/accept.c2
-rw-r--r--sysdeps/stub/bind.c2
-rw-r--r--sysdeps/stub/bits/string.h2
-rw-r--r--sysdeps/stub/connect.c3
-rw-r--r--sysdeps/stub/getsockname.c2
-rw-r--r--sysdeps/stub/getsockopt.c3
-rw-r--r--sysdeps/stub/recvfrom.c3
-rw-r--r--sysdeps/stub/sendto.c3
-rw-r--r--sysdeps/stub/setsockopt.c3
-rw-r--r--sysdeps/unix/bsd/osf/bits/sigaction.h8
-rw-r--r--sysdeps/unix/sysv/linux/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/sigaction.h24
-rw-r--r--sysdeps/unix/sysv/linux/bits/sigaction.h26
-rw-r--r--sysdeps/unix/sysv/linux/if_index.c17
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/mman.h75
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sigaction.h28
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/sigaction.h29
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/Dist (renamed from sysdeps/unix/sysv/linux/sparc/Dist)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/Makefile (renamed from sysdeps/unix/sysv/linux/sparc/Makefile)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/__sigtrampoline.S (renamed from sysdeps/unix/sysv/linux/sparc/__sigtrampoline.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h (renamed from sysdeps/unix/sysv/linux/sparc/bits/mman.h)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/brk.c (renamed from sysdeps/unix/sysv/linux/sparc/brk.c)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (renamed from sysdeps/unix/sysv/linux/sparc/clone.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/fork.S (renamed from sysdeps/unix/sysv/linux/sparc/fork.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h (renamed from sysdeps/unix/sysv/linux/sparc/init-first.h)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h (renamed from sysdeps/unix/sysv/linux/sparc/kernel_stat.h)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S (renamed from sysdeps/unix/sysv/linux/sparc/pipe.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h (renamed from sysdeps/unix/sysv/linux/sparc/profil-counter.h)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c (renamed from sysdeps/unix/sysv/linux/sparc/sigaction.c)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/socket.S (renamed from sysdeps/unix/sysv/linux/sparc/socket.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S (renamed from sysdeps/unix/sysv/linux/sparc/syscall.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list (renamed from sysdeps/unix/sysv/linux/sparc/syscalls.list)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.S (renamed from sysdeps/unix/sysv/linux/sparc/sysdep.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (renamed from sysdeps/unix/sysv/linux/sparc/sysdep.h)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/Dist (renamed from sysdeps/unix/sysv/linux/sparc64/Dist)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/Makefile (renamed from sysdeps/unix/sysv/linux/sparc64/Makefile)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/__longjmp.S (renamed from sysdeps/unix/sysv/linux/sparc64/__longjmp.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h (renamed from sysdeps/unix/sysv/linux/sparc64/bits/mman.h)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h (renamed from sysdeps/unix/sysv/linux/sparc64/bits/setjmp.h)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h (renamed from sysdeps/unix/sysv/linux/sparc64/bits/types.h)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/brk.S (renamed from sysdeps/unix/sysv/linux/sparc64/brk.S)6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (renamed from sysdeps/unix/sysv/linux/sparc64/clone.S)10
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/fork.S (renamed from sysdeps/unix/sysv/linux/sparc64/fork.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S (renamed from sysdeps/unix/sysv/linux/sparc64/getcontext.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h (renamed from sysdeps/unix/sysv/linux/sparc64/init-first.h)50
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h (renamed from sysdeps/unix/sysv/linux/sparc64/kernel_stat.h)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S (renamed from sysdeps/unix/sysv/linux/sparc64/longjmp.S)2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S (renamed from sysdeps/unix/sysv/linux/sparc64/pipe.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h (renamed from sysdeps/unix/sysv/linux/sparc64/profil-counter.h)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S (renamed from sysdeps/unix/sysv/linux/sparc64/setcontext.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S (renamed from sysdeps/unix/sysv/linux/sparc64/setjmp.S)19
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sigjmp.S (renamed from sysdeps/unix/sysv/linux/sparc64/sigjmp.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S39
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (renamed from sysdeps/unix/sysv/linux/sparc64/syscalls.list)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.S (renamed from sysdeps/unix/sysv/linux/sparc64/sysdep.S)0
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (renamed from sysdeps/unix/sysv/linux/sparc64/sysdep.h)68
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/ucontext.h (renamed from sysdeps/unix/sysv/linux/sparc64/ucontext.h)0
-rw-r--r--sysdeps/unix/sysv/minix/bits/sigaction.h16
-rw-r--r--sysdeps/unix/sysv/sysv4/bits/sigaction.h12
140 files changed, 1236 insertions, 379 deletions
diff --git a/sysdeps/generic/bits/sigaction.h b/sysdeps/generic/bits/sigaction.h
index e5f661db80..e89479bd1c 100644
--- a/sysdeps/generic/bits/sigaction.h
+++ b/sysdeps/generic/bits/sigaction.h
@@ -37,9 +37,9 @@ struct sigaction
 
 /* Bits in `sa_flags'.  */
 #ifdef	__USE_BSD
-#define	SA_ONSTACK	0x1	/* Take signal on signal stack.  */
-#define	SA_RESTART	0x2	/* Don't restart syscall on signal return.  */
-#define	SA_DISABLE	0x4	/* Disable alternate signal stack.  */
+# define SA_ONSTACK	0x1	/* Take signal on signal stack.  */
+# define SA_RESTART	0x2	/* Restart syscall on signal return.  */
+# define SA_DISABLE	0x4	/* Disable alternate signal stack.  */
 #endif
 #define	SA_NOCLDSTOP	0x8	/* Don't send SIGCHLD when children stop.  */
 
diff --git a/sysdeps/generic/dl-sysdep.c b/sysdeps/generic/dl-sysdep.c
index 4f97f8547b..fd79bc4b81 100644
--- a/sysdeps/generic/dl-sysdep.c
+++ b/sysdeps/generic/dl-sysdep.c
@@ -25,6 +25,7 @@
 #include <fcntl.h>
 #include <link.h>
 #include <unistd.h>
+#include <stdio-common/_itoa.h>
 
 #include <dl-machine.h>
 
@@ -40,6 +41,7 @@ extern void ENTRY_POINT (void);
 int __libc_enable_secure;
 int __libc_multiple_libcs;	/* Defining this here avoids the inclusion
 				   of init-first.  */
+static ElfW(auxv_t) *_dl_auxv;
 
 ElfW(Addr)
 _dl_sysdep_start (void **start_argptr,
@@ -68,7 +70,7 @@ _dl_sysdep_start (void **start_argptr,
   seen = 0;
 #define M(type) (1 << (type))
 
-  for (av = (void *) ++start_argptr;
+  for (av = _dl_auxv = (void *) ++start_argptr;
        av->a_type != AT_NULL;
        seen |= M ((++av)->a_type))
     switch (av->a_type)
@@ -148,3 +150,76 @@ void
 _dl_sysdep_start_cleanup (void)
 {
 }
+
+void
+_dl_show_auxv (void)
+{
+  char buf[64];
+  ElfW(auxv_t) *av;
+
+  /* Terminate string.  */
+  buf[63] = '\0';
+
+  for (av = _dl_auxv; av->a_type != AT_NULL; ++av)
+    switch (av->a_type)
+      {
+      case AT_PHDR:
+	_dl_sysdep_message ("AT_PHDR:     0x",
+			    _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+					16, 0),
+			    "\n", NULL);
+	break;
+      case AT_PHNUM:
+	_dl_sysdep_message ("AT_PHNUM:    ",
+			    _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+					10, 0),
+			    "\n", NULL);
+	break;
+      case AT_PAGESZ:
+	_dl_sysdep_message ("AT_PAGESZ:   ",
+			    _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+					10, 0),
+			    "\n", NULL);
+	break;
+      case AT_ENTRY:
+	_dl_sysdep_message ("AT_ENTRY:    0x",
+			    _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+					16, 0),
+			    "\n", NULL);
+	break;
+      case AT_UID:
+	_dl_sysdep_message ("AT_UID:      ",
+			    _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+					10, 0),
+			    "\n", NULL);
+	break;
+      case AT_GID:
+	_dl_sysdep_message ("AT_GID:      ",
+			    _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+					10, 0),
+			    "\n", NULL);
+	break;
+      case AT_EUID:
+	_dl_sysdep_message ("AT_EUID:     ",
+			    _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+					10, 0),
+			    "\n", NULL);
+	break;
+      case AT_EGID:
+	_dl_sysdep_message ("AT_EGID:     ",
+			    _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+					10, 0),
+			    "\n", NULL);
+	break;
+      case AT_PLATFORM:
+	_dl_sysdep_message ("AT_PLATFORM: ", av->a_un.a_ptr, NULL);
+	break;
+      case AT_HWCAP:
+	/* Well, what shall we use?  A string or an integer with bits?  */
+	_dl_sysdep_message ("AT_HWCAP:    ",
+			    _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+					10, 0),
+			    "\n", NULL);
+	break;
+      }
+}
diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h
index b3736f8417..c6b9331f9a 100644
--- a/sysdeps/i386/fpu/bits/mathinline.h
+++ b/sysdeps/i386/fpu/bits/mathinline.h
@@ -70,15 +70,6 @@
 #endif
 
 
-#if defined __GNUC__ && \
-    (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ <= 7))
-/* gcc 2.7.2 and 2.7.2.1 have problems with inlining `long double'
-   functions so we disable this now.  */
-# undef __NO_MATH_INLINES
-# define __NO_MATH_INLINES
-#endif
-
-
 #ifdef	__GNUC__
 #if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
 
@@ -301,7 +292,7 @@ __inline_mathop (sin, "fsin")
 /* The argument range of this inline version is reduced.  */
 __inline_mathop (cos, "fcos")
 
-__inline_mathop_decl (atan, "fpatan", "u" (__x), "0" (1.0) : "st(1)")
+__inline_mathop (atan, "fld1; fpatan")
 __inline_mathop (log, "fldln2; fxch; fyl2x")
 __inline_mathop (log10, "fldlg2; fxch; fyl2x")
 
@@ -390,7 +381,7 @@ __inline_mathcode (log1p, __x, \
 __inline_mathcode (asinh, __x, \
   register long double  __y = __fabsl (__x);				      \
   return (log1pl (__y * __y / (__sqrtl (__y * __y + 1.0) + 1.0) + __y)	      \
-	  * __sgn1l (__x))
+	  * __sgn1l (__x)))
 
 __inline_mathcode (acosh, __x, \
   return logl (__x + __sqrtl (__x - 1.0) * __sqrtl (__x + 1.0)))
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 69dd55ad39..88918c517f 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -713,3 +713,10 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
   return __mach_msg (msg, option, send_size, rcv_size, rcv_name,
 		     timeout, notify);
 }
+
+
+void
+_dl_show_auxv (void)
+{
+  /* There is nothing to print.  Hurd has no auxiliary vector.  */
+}
diff --git a/sysdeps/sparc/Implies b/sysdeps/sparc/Implies
index 8a2007c5ce..da719e1707 100644
--- a/sysdeps/sparc/Implies
+++ b/sysdeps/sparc/Implies
@@ -1,3 +1,2 @@
-wordsize-32
 # SPARC uses IEEE 754 floating point.
 ieee754
diff --git a/sysdeps/sparc/fpu/bits/mathdef.h b/sysdeps/sparc/fpu/bits/mathdef.h
new file mode 100644
index 0000000000..0bc9c94ecc
--- /dev/null
+++ b/sysdeps/sparc/fpu/bits/mathdef.h
@@ -0,0 +1,64 @@
+/* Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _MATH_H
+#error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#endif
+
+/* FIXME! This file describes properties of the compiler, not the machine;
+   it should not be part of libc!  */
+
+#ifdef __GNUC__
+#if __STDC__ == 1
+
+/* In GNU or ANSI mode, gcc leaves `float' expressions as-is.  */
+typedef float float_t;
+typedef double double_t;
+
+/* Signal that types stay as they were declared.  */
+#define FLT_EVAL_METHOD	0
+
+/* Define `INFINITY' as value of type `float_t'.  */
+#define INFINITY	HUGE_VALF
+
+#else 
+
+/* For `gcc -traditional', `float' expressions are evaluated as `double'. */
+typedef double float_t;
+typedef double double_t;
+
+/* Signal that both types are `double'.  */
+#define FLT_EVAL_METHOD	1
+
+/* Define `INFINITY' as value of type `float_t'.  */
+#define INFINITY	HUGE_VAL
+
+#endif
+#else
+
+/* Wild guess at types for float_t and double_t. */
+typedef double float_t;
+typedef double double_t;
+
+/* Strange compiler, we don't know how it works.  */
+#define FLT_EVAL_METHOD	-1
+
+/* Define `INFINITY' as value of type `float_t'.  */
+#define INFINITY	HUGE_VAL
+
+#endif
diff --git a/sysdeps/sparc64/bsd-setjmp.S b/sysdeps/sparc/fpu/fclrexcpt.c
index c42123fc42..8dc68e84e9 100644
--- a/sysdeps/sparc64/bsd-setjmp.S
+++ b/sysdeps/sparc/fpu/fclrexcpt.c
@@ -1,4 +1,4 @@
-/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'.  Sparc64 version.
+/* Clear given exceptions in current floating-point environment.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -17,25 +17,16 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <sysdep.h>
+#include <fenv.h>
 
-ENTRY(setjmp)
+void
+feclearexcept (int excepts)
+{
+  fenv_t tmp;
 
-#ifdef PIC
-1:	rd	%pc,%g1
-	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2
-	or	%g2,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2
-	add	%g1,%g2,%g1
-	sethi	%hi(C_SYMBOL_NAME(__sigsetjmp)),%g2
-	or	%g2,%lo(C_SYMBOL_NAME(__sigsetjmp)),%g2
-	ld	[%g1+%g2], %g1
-#else
-	sethi	%hi(C_SYMBOL_NAME(__sigsetjmp)), %g1
-	or	%lo(C_SYMBOL_NAME(__sigsetjmp)), %g1, %g1
-	add	%g1, %g4, %g1
-#endif
+  __fenv_stfsr (tmp);
 
-	jmp %g1
-	 mov 1, %o1		/* Pass second argument of one.  */
+  tmp &= ~(excepts & FE_ALL_EXCEPT);
 
-END(setjmp)
+  __fenv_ldfsr (tmp);
+}
diff --git a/sysdeps/sparc/fpu/fegetenv.c b/sysdeps/sparc/fpu/fegetenv.c
new file mode 100644
index 0000000000..a796ccb731
--- /dev/null
+++ b/sysdeps/sparc/fpu/fegetenv.c
@@ -0,0 +1,26 @@
+/* Store current floating-point environment.
+   Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+void
+fegetenv (fenv_t *envp)
+{
+  __fenv_stfsr (*envp);
+}
diff --git a/sysdeps/sparc/fpu/fegetround.c b/sysdeps/sparc/fpu/fegetround.c
new file mode 100644
index 0000000000..ea1df2b6d8
--- /dev/null
+++ b/sysdeps/sparc/fpu/fegetround.c
@@ -0,0 +1,30 @@
+/* Return current rounding direction.
+   Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+int
+fegetround (void)
+{
+  fenv_t tmp;
+
+  __fenv_stfsr (tmp);
+
+  return tmp & __FE_ROUND_MASK;
+}
diff --git a/sysdeps/sparc64/bsd-_setjmp.S b/sysdeps/sparc/fpu/feholdexcpt.c
index 1388c4c238..9b4c2134f7 100644
--- a/sysdeps/sparc64/bsd-_setjmp.S
+++ b/sysdeps/sparc/fpu/feholdexcpt.c
@@ -1,4 +1,4 @@
-/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'.  Sparc64 version.
+/* Store current floating-point environment and clear exceptions.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -17,27 +17,19 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <sysdep.h>
+#include <fenv.h>
 
-ENTRY(_setjmp)
+int
+feholdexcept (fenv_t *envp)
+{
+  fenv_t tmp;
 
-#ifdef PIC
-1:	rd	%pc,%g1
-	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2
-	or	%g2,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2
-	add	%g1,%g2,%g1
-	sethi	%hi(C_SYMBOL_NAME(__sigsetjmp)),%g2
-	or	%g2,%lo(C_SYMBOL_NAME(__sigsetjmp)),%g2
-	ld	[%g1+%g2], %g1
-#else
-	sethi	%hi(C_SYMBOL_NAME(__sigsetjmp)), %g1
-	or	%lo(C_SYMBOL_NAME(__sigsetjmp)), %g1, %g1
-	add	%g1, %g4, %g1
-#endif
+  __fenv_stfsr (*envp);
 
-	jmp %g1
-	 mov %g0, %o1		/* Pass second argument of zero.  */
+  /* Set all exceptions to non-stop.  */
+  tmp = *envp | (0x1f << 23);
 
-END(_setjmp)
+  __fenv_ldfsr (tmp);
 
-strong_alias(_setjmp, __setjmp)
+  return 1;
+}
diff --git a/sysdeps/sparc/fpu/fesetenv.c b/sysdeps/sparc/fpu/fesetenv.c
new file mode 100644
index 0000000000..44c5b2629c
--- /dev/null
+++ b/sysdeps/sparc/fpu/fesetenv.c
@@ -0,0 +1,43 @@
+/* Install given floating-point environment.
+   Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+void
+fesetenv (const fenv_t *envp)
+{
+  fenv_t dummy;
+
+  /* Put these constants in memory explicitly, so as to cope with a
+     -fPIC bug as of gcc 970624.  Making them automatic is quicker
+     than loading up the pic register in this instance.  */
+
+  if (envp == FE_DFL_ENV)
+    {
+      dummy = 0;
+      envp = &dummy;
+    }
+  else if (envp == FE_NOMASK_ENV)
+    {
+      dummy = 0x1f << 23;
+      envp = &dummy;
+    }
+
+  __fenv_ldfsr (*envp);
+}
diff --git a/sysdeps/sparc/fpu/fesetround.c b/sysdeps/sparc/fpu/fesetround.c
new file mode 100644
index 0000000000..74963d7573
--- /dev/null
+++ b/sysdeps/sparc/fpu/fesetround.c
@@ -0,0 +1,37 @@
+/* Set current rounding direction.
+   Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+int
+fesetround (int round)
+{
+  fenv_t tmp;
+
+  if ((round & ~__FE_ROUND_MASK) != 0)
+    /* ROUND is no valid rounding mode.  */
+    return 0;
+
+  __fenv_stfsr (tmp);
+  tmp &= ~__FE_ROUND_MASK;
+  tmp |= round;
+  __fenv_ldfsr (tmp);
+
+  return 1;
+}
diff --git a/sysdeps/sparc/fpu/feupdateenv.c b/sysdeps/sparc/fpu/feupdateenv.c
new file mode 100644
index 0000000000..0fba9975f8
--- /dev/null
+++ b/sysdeps/sparc/fpu/feupdateenv.c
@@ -0,0 +1,38 @@
+/* Install given floating-point environment and raise exceptions.
+   Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+void
+feupdateenv (const fenv_t *envp)
+{
+  fexcept_t tmp;
+
+  /* Save current exceptions.  */
+  __fenv_stfsr (tmp);
+  tmp &= FE_ALL_EXCEPT;
+
+  /* Install new environment.  */
+  fesetenv (envp);
+
+  /* Raise the safed exception.  Incidently for us the implementation
+     defined format of the values in objects of type fexcept_t is the
+     same as the ones specified using the FE_* constants.  */
+  feraiseexcept ((int) tmp);
+}
diff --git a/sysdeps/sparc/fpu/fgetexcptflg.c b/sysdeps/sparc/fpu/fgetexcptflg.c
new file mode 100644
index 0000000000..977c93e2ca
--- /dev/null
+++ b/sysdeps/sparc/fpu/fgetexcptflg.c
@@ -0,0 +1,31 @@
+/* Store current representation for exceptions.
+   Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+void
+fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+  fexcept_t tmp;
+
+  /* Get the current exceptions.  */
+  __fenv_stfsr (tmp);
+
+  *flagp = tmp & excepts & FE_ALL_EXCEPT;
+}
diff --git a/sysdeps/sparc/fpu/fraiseexcpt.c b/sysdeps/sparc/fpu/fraiseexcpt.c
new file mode 100644
index 0000000000..308c9b2e7f
--- /dev/null
+++ b/sysdeps/sparc/fpu/fraiseexcpt.c
@@ -0,0 +1,66 @@
+/* Raise given exceptions.
+   Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+#include <math.h>
+
+static void
+ignore_me(double foo)
+{
+}
+
+void
+feraiseexcept (int excepts)
+{
+  /* Raise exceptions represented by EXPECTS.  But we must raise only
+     one signal at a time.  It is important the if the overflow/underflow
+     exception and the inexact exception are given at the same time,
+     the overflow/underflow exception follows the inexact exception.  */
+
+  /* First: invalid exception.  */
+  if ((FE_INVALID & excepts) != 0)
+    {
+      /* One example of a invalid operation is 0/0.  */
+      ignore_me (0.0 / 0.0);
+    }
+
+  /* Next: division by zero.  */
+  if ((FE_DIVBYZERO & excepts) != 0)
+    {
+      ignore_me (1.0 / 0.0);
+    }
+
+  /* Next: overflow.  */
+  if ((FE_OVERFLOW & excepts) != 0)
+    {
+      ignore_me (LDBL_MAX * LDBL_MAX);
+    }
+
+  /* Next: underflow.  */
+  if ((FE_UNDERFLOW & excepts) != 0)
+    {
+      ignore_me (LDBL_MIN / 16.0);
+    }
+
+  /* Last: inexact.  */
+  if ((FE_INEXACT & excepts) != 0)
+    {
+      ignore_me (1.0 / M_PI);
+    }
+}
diff --git a/sysdeps/sparc/fpu/fsetexcptflg.c b/sysdeps/sparc/fpu/fsetexcptflg.c
new file mode 100644
index 0000000000..1029cde03d
--- /dev/null
+++ b/sysdeps/sparc/fpu/fsetexcptflg.c
@@ -0,0 +1,34 @@
+/* Set floating-point environment exception handling.
+   Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+#include <math.h>
+
+void
+fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+  fenv_t tmp;
+
+  __fenv_stfsr (tmp);
+
+  tmp &= ~(excepts & FE_ALL_EXCEPT);
+  tmp |= *flagp & excepts & FE_ALL_EXCEPT;
+
+  __fenv_ldfsr (tmp);
+}
diff --git a/sysdeps/sparc/fpu/ftestexcept.c b/sysdeps/sparc/fpu/ftestexcept.c
new file mode 100644
index 0000000000..3efe9e896b
--- /dev/null
+++ b/sysdeps/sparc/fpu/ftestexcept.c
@@ -0,0 +1,30 @@
+/* Test exception in current environment.
+   Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+int
+fetestexcept (int excepts)
+{
+  int tmp;
+
+  __fenv_stfsr (tmp);
+
+  return tmp & excepts & FE_ALL_EXCEPT;
+}
diff --git a/sysdeps/sparc/Dist b/sysdeps/sparc/sparc32/Dist
index 6c3b23baa5..6c3b23baa5 100644
--- a/sysdeps/sparc/Dist
+++ b/sysdeps/sparc/sparc32/Dist
diff --git a/sysdeps/sparc/sparc32/Implies b/sysdeps/sparc/sparc32/Implies
new file mode 100644
index 0000000000..39a34c5f57
--- /dev/null
+++ b/sysdeps/sparc/sparc32/Implies
@@ -0,0 +1 @@
+wordsize-32
diff --git a/sysdeps/sparc/Makefile b/sysdeps/sparc/sparc32/Makefile
index deec2f8145..deec2f8145 100644
--- a/sysdeps/sparc/Makefile
+++ b/sysdeps/sparc/sparc32/Makefile
diff --git a/sysdeps/sparc/__longjmp.S b/sysdeps/sparc/sparc32/__longjmp.S
index 36e1c170dd..36e1c170dd 100644
--- a/sysdeps/sparc/__longjmp.S
+++ b/sysdeps/sparc/sparc32/__longjmp.S
diff --git a/sysdeps/sparc/add_n.S b/sysdeps/sparc/sparc32/add_n.S
index 9852c256aa..9852c256aa 100644
--- a/sysdeps/sparc/add_n.S
+++ b/sysdeps/sparc/sparc32/add_n.S
diff --git a/sysdeps/sparc/addmul_1.S b/sysdeps/sparc/sparc32/addmul_1.S
index 375d25db6b..375d25db6b 100644
--- a/sysdeps/sparc/addmul_1.S
+++ b/sysdeps/sparc/sparc32/addmul_1.S
diff --git a/sysdeps/sparc/alloca.S b/sysdeps/sparc/sparc32/alloca.S
index dcbd171163..dcbd171163 100644
--- a/sysdeps/sparc/alloca.S
+++ b/sysdeps/sparc/sparc32/alloca.S
diff --git a/sysdeps/sparc/bits/endian.h b/sysdeps/sparc/sparc32/bits/endian.h
index f1a75c0652..f1a75c0652 100644
--- a/sysdeps/sparc/bits/endian.h
+++ b/sysdeps/sparc/sparc32/bits/endian.h
diff --git a/sysdeps/sparc/bits/setjmp.h b/sysdeps/sparc/sparc32/bits/setjmp.h
index 43bae1a496..43bae1a496 100644
--- a/sysdeps/sparc/bits/setjmp.h
+++ b/sysdeps/sparc/sparc32/bits/setjmp.h
diff --git a/sysdeps/sparc/bsd-_setjmp.S b/sysdeps/sparc/sparc32/bsd-_setjmp.S
index bf49765f4d..bf49765f4d 100644
--- a/sysdeps/sparc/bsd-_setjmp.S
+++ b/sysdeps/sparc/sparc32/bsd-_setjmp.S
diff --git a/sysdeps/sparc/bsd-setjmp.S b/sysdeps/sparc/sparc32/bsd-setjmp.S
index 16dc260765..16dc260765 100644
--- a/sysdeps/sparc/bsd-setjmp.S
+++ b/sysdeps/sparc/sparc32/bsd-setjmp.S
diff --git a/sysdeps/sparc/divrem.m4 b/sysdeps/sparc/sparc32/divrem.m4
index 665abf11ae..665abf11ae 100644
--- a/sysdeps/sparc/divrem.m4
+++ b/sysdeps/sparc/sparc32/divrem.m4
diff --git a/sysdeps/sparc/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h
index dc38e17292..f7bcba0c2f 100644
--- a/sysdeps/sparc/dl-machine.h
+++ b/sysdeps/sparc/sparc32/dl-machine.h
@@ -51,11 +51,25 @@ elf_machine_dynamic (void)
   return *got;
 }
 
-
 /* Return the run-time load address of the shared object.  */
 static inline Elf32_Addr
 elf_machine_load_address (void)
 {
+  register Elf32_Addr pc __asm("%o7"), got;
+
+  /* Utilize the fact that a local .got entry will be partially
+     initialized at startup awaiting its RELATIVE fixup.  */
+
+  __asm("sethi %%hi(.Load_address),%1\n"
+        ".Load_address:\n\t"
+        "call 1f\n\t"
+        "or %1,%%lo(.Load_address),%1\n"
+        "1:\tld [%%l7+%1],%1"
+        : "=r"(pc), "=r"(got));
+
+  return pc - got;
+}
+
   Elf32_Addr addr;
 
   asm (
@@ -219,6 +233,8 @@ elf_machine_lazy_rel (struct link_map *map, const Elf32_Rela *reloc)
 /* The SPARC never uses Elf32_Rel relocations.  */
 #define ELF_MACHINE_NO_REL 1
 
+/* The SPARC overlaps DT_RELA and DT_PLTREL.  */
+#define ELF_MACHINE_PLTREL_OVERLAP 1
 
 /* Set up the loaded object described by L so its unrelocated PLT
    entries will jump to the on-demand fixup code in dl-runtime.c.  */
diff --git a/sysdeps/sparc/dotmul.S b/sysdeps/sparc/sparc32/dotmul.S
index 7ce695cb7a..7ce695cb7a 100644
--- a/sysdeps/sparc/dotmul.S
+++ b/sysdeps/sparc/sparc32/dotmul.S
diff --git a/sysdeps/sparc/e_sqrt.c b/sysdeps/sparc/sparc32/e_sqrt.c
index a98ae21ace..a98ae21ace 100644
--- a/sysdeps/sparc/e_sqrt.c
+++ b/sysdeps/sparc/sparc32/e_sqrt.c
diff --git a/sysdeps/sparc/elf/Makefile b/sysdeps/sparc/sparc32/elf/Makefile
index 319fbdef10..319fbdef10 100644
--- a/sysdeps/sparc/elf/Makefile
+++ b/sysdeps/sparc/sparc32/elf/Makefile
diff --git a/sysdeps/sparc/elf/start.c b/sysdeps/sparc/sparc32/elf/start.c
index f1e80195ca..f1e80195ca 100644
--- a/sysdeps/sparc/elf/start.c
+++ b/sysdeps/sparc/sparc32/elf/start.c
diff --git a/sysdeps/sparc/sparc32/fpu/bits/fenv.h b/sysdeps/sparc/sparc32/fpu/bits/fenv.h
new file mode 100644
index 0000000000..0560dd99b8
--- /dev/null
+++ b/sysdeps/sparc/sparc32/fpu/bits/fenv.h
@@ -0,0 +1,76 @@
+/* Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _FENV_H
+#error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Define bits representing the exception.  We use the bit positions
+   of the appropriate accrued exception bits from the FSR.  */
+enum
+  {
+    FE_INVALID = 	(1 << 9),
+#define FE_INVALID	FE_INVALID
+    FE_OVERFLOW = 	(1 << 8),
+#define FE_OVERFLOW	FE_OVERFLOW
+    FE_UNDERFLOW = 	(1 << 7),
+#define FE_UNDERFLOW	FE_UNDERFLOW
+    FE_DIVBYZERO = 	(1 << 6),
+#define FE_DIVBYZERO	FE_DIVBYZERO
+    FE_INEXACT = 	(1 << 5)
+#define FE_INEXACT	FE_INEXACT
+  };
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The Sparc FPU supports all of the four defined rounding modes.  We
+   use again the bit positions in the FPU control word as the values
+   for the appropriate macros.  */
+enum
+  {
+    FE_TONEAREST = 	(0U << 30),
+#define FE_TONEAREST	FE_TONEAREST
+    FE_TOWARDSZERO = 	(1U << 30),
+#define FE_TOWARDSZERO	FE_TOWARDSZERO
+    FE_UPWARD = 	(2U << 30),
+#define FE_UPWARD	FE_UPWARD
+    FE_DOWNWARD = 	(3U << 30)
+#define FE_DOWNWARD	FE_DOWNWARD
+  };
+
+#define __FE_ROUND_MASK	(3U << 30)
+
+/* Type representing exception flags.  */
+typedef unsigned int fexcept_t;
+
+/* Type representing floating-point environment.  */
+typedef unsigned int fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exception is masked.  */
+# define FE_NOMASK_ENV	((fenv_t *) -2)
+#endif
+
+/* For internal use only: access the fp state register.  */
+#define __fenv_stfsr(X)   __asm__("stfsr %0" : "=m"(X))
+#define __fenv_ldfsr(X)   __asm__ __volatile__("ldfsr %0" : : "m"(X))
diff --git a/sysdeps/sparc/fpu_control.h b/sysdeps/sparc/sparc32/fpu/fpu_control.h
index 5ef3824702..5ef3824702 100644
--- a/sysdeps/sparc/fpu_control.h
+++ b/sysdeps/sparc/sparc32/fpu/fpu_control.h
diff --git a/sysdeps/sparc/lshift.S b/sysdeps/sparc/sparc32/lshift.S
index 4f0595f2fb..4f0595f2fb 100644
--- a/sysdeps/sparc/lshift.S
+++ b/sysdeps/sparc/sparc32/lshift.S
diff --git a/sysdeps/sparc/memcopy.h b/sysdeps/sparc/sparc32/memcopy.h
index ff73f453da..ff73f453da 100644
--- a/sysdeps/sparc/memcopy.h
+++ b/sysdeps/sparc/sparc32/memcopy.h
diff --git a/sysdeps/sparc/mul_1.S b/sysdeps/sparc/sparc32/mul_1.S
index 142fd8ba2a..142fd8ba2a 100644
--- a/sysdeps/sparc/mul_1.S
+++ b/sysdeps/sparc/sparc32/mul_1.S
diff --git a/sysdeps/sparc/rem.S b/sysdeps/sparc/sparc32/rem.S
index d50f1af630..d50f1af630 100644
--- a/sysdeps/sparc/rem.S
+++ b/sysdeps/sparc/sparc32/rem.S
diff --git a/sysdeps/sparc/rshift.S b/sysdeps/sparc/sparc32/rshift.S
index fea4f3b926..fea4f3b926 100644
--- a/sysdeps/sparc/rshift.S
+++ b/sysdeps/sparc/sparc32/rshift.S
diff --git a/sysdeps/sparc/sdiv.S b/sysdeps/sparc/sparc32/sdiv.S
index 02ed2e973c..02ed2e973c 100644
--- a/sysdeps/sparc/sdiv.S
+++ b/sysdeps/sparc/sparc32/sdiv.S
diff --git a/sysdeps/sparc/setjmp.S b/sysdeps/sparc/sparc32/setjmp.S
index 772ec723a3..772ec723a3 100644
--- a/sysdeps/sparc/setjmp.S
+++ b/sysdeps/sparc/sparc32/setjmp.S
diff --git a/sysdeps/sparc/sparc8/addmul_1.S b/sysdeps/sparc/sparc32/sparcv8/addmul_1.S
index fb9ea7cf0e..fb9ea7cf0e 100644
--- a/sysdeps/sparc/sparc8/addmul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv8/addmul_1.S
diff --git a/sysdeps/sparc/sparc8/mul_1.S b/sysdeps/sparc/sparc32/sparcv8/mul_1.S
index b641feb453..b641feb453 100644
--- a/sysdeps/sparc/sparc8/mul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv8/mul_1.S
diff --git a/sysdeps/sparc/sparc8/submul_1.S b/sysdeps/sparc/sparc32/sparcv8/submul_1.S
index e40119d011..e40119d011 100644
--- a/sysdeps/sparc/sparc8/submul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv8/submul_1.S
diff --git a/sysdeps/sparc/sparc8/udiv_qrnnd.S b/sysdeps/sparc/sparc32/sparcv8/udiv_qrnnd.S
index 49c2398806..49c2398806 100644
--- a/sysdeps/sparc/sparc8/udiv_qrnnd.S
+++ b/sysdeps/sparc/sparc32/sparcv8/udiv_qrnnd.S
diff --git a/sysdeps/sparc/sub_n.S b/sysdeps/sparc/sparc32/sub_n.S
index b7a11958e2..b7a11958e2 100644
--- a/sysdeps/sparc/sub_n.S
+++ b/sysdeps/sparc/sparc32/sub_n.S
diff --git a/sysdeps/sparc/submul_1.S b/sysdeps/sparc/sparc32/submul_1.S
index a8ebd501a7..a8ebd501a7 100644
--- a/sysdeps/sparc/submul_1.S
+++ b/sysdeps/sparc/sparc32/submul_1.S
diff --git a/sysdeps/sparc/udiv.S b/sysdeps/sparc/sparc32/udiv.S
index 4a7d1526b0..4a7d1526b0 100644
--- a/sysdeps/sparc/udiv.S
+++ b/sysdeps/sparc/sparc32/udiv.S
diff --git a/sysdeps/sparc/udiv_qrnnd.S b/sysdeps/sparc/sparc32/udiv_qrnnd.S
index 437d66e9ea..5b67f874c3 100644
--- a/sysdeps/sparc/udiv_qrnnd.S
+++ b/sysdeps/sparc/sparc32/udiv_qrnnd.S
@@ -18,7 +18,6 @@
 ! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
 ! the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-!
 ! Added PIC support - May/96, Miguel de Icaza
 
 ! INPUT PARAMETERS
@@ -32,8 +31,16 @@
 
 	.text
 	.align	8
-LC0:	.double	0r4294967296
-LC1:	.double	0r2147483648
+
+	.type two_to_32,@object
+two_to_32:
+	.double	0r4294967296
+	.size two_to_32,8
+
+	.type two_to_31,@object
+two_to_31:
+	.double	0r2147483648
+	.size two_to_31,8
 
 	.align	4
 	.global	__udiv_qrnnd
@@ -45,22 +52,19 @@ ENTRY(__udiv_qrnnd)
 	st	%i1,[%fp-8]
 	ld	[%fp-8],%f10
 #ifdef PIC
-._XL11:
-	call	._XL1
+.Lbase:	call	1f
 	fitod	%f10,%f4
-._XL1:
-	sub	%o7,(._XL11-LC0),%o7
-	ldd	[%o7],%f8
+1:	ldd	[%o7-(.Lbase-two_to_32)],%f8
 #else
-	sethi	%hi(LC0),%o7
+	sethi	%hi(two_to_32),%o7
 	fitod	%f10,%f4
-	ldd	[%o7+%lo(LC0)],%f8
+	ldd	[%o7+%lo(two_to_32)],%f8
 #endif
 	cmp	%i1,0
 	bge	L248
 	mov	%i0,%i5
 	faddd	%f4,%f8,%f4
-L248:
+.L248:
 	st	%i2,[%fp-8]
 	ld	[%fp-8],%f10
 	fmuld	%f4,%f8,%f6
@@ -68,7 +72,7 @@ L248:
 	bge	L249
 	fitod	%f10,%f2
 	faddd	%f2,%f8,%f2
-L249:
+.L249:
 	st	%i3,[%fp-8]
 	faddd	%f6,%f2,%f2
 	ld	[%fp-8],%f10
@@ -76,18 +80,13 @@ L249:
 	bge	L250
 	fitod	%f10,%f4
 	faddd	%f4,%f8,%f4
-L250:
+.L250:
 	fdivd	%f2,%f4,%f2
 #ifdef PIC
-._XL22:
-	call	._XL2
-	nop
-._XL2:
-	sub	%o7,(._XL22-LC1),%o7
-	ldd	[%o7],%f4
+	ldd	[%o7-(.Lbase-two_to_31)],%f4
 #else
-	sethi	%hi(LC1),%o7
-	ldd	[%o7+%lo(LC1)],%f4
+	sethi	%hi(two_to_31),%o7
+	ldd	[%o7+%lo(two_to_31)],%f4
 #endif
 	fcmped	%f2,%f4
 	nop
@@ -97,13 +96,13 @@ L250:
 	st	%f2,[%fp-8]
 	b	L252
 	ld	[%fp-8],%i4
-L251:
+.L251:
 	fdtoi	%f2,%f2
 	st	%f2,[%fp-8]
 	ld	[%fp-8],%i4
 	sethi	%hi(-2147483648),%g2
 	xor	%i4,%g2,%i4
-L252:
+.L252:
 	wr	%g0,%i4,%y
 	sra	%i3,31,%g2
 	and	%i4,%g2,%g2
@@ -153,12 +152,14 @@ L252:
 	st	%o7,[%i5]
 	ret
 	restore
-L253:
+.L253:
 	blu	L246
 	mov	%i4,%i0
 	add	%i4,1,%i0
 	sub	%o7,%i3,%o7
-L246:
+.L246:
 	st	%o7,[%i5]
 	ret
 	restore
+
+	.size	__udiv_qrnnd, .-__udiv_qrnnd
diff --git a/sysdeps/sparc/umul.S b/sysdeps/sparc/sparc32/umul.S
index 7a26c295cb..7a26c295cb 100644
--- a/sysdeps/sparc/umul.S
+++ b/sysdeps/sparc/sparc32/umul.S
diff --git a/sysdeps/sparc/urem.S b/sysdeps/sparc/sparc32/urem.S
index e72c33dd63..e72c33dd63 100644
--- a/sysdeps/sparc/urem.S
+++ b/sysdeps/sparc/sparc32/urem.S
diff --git a/sysdeps/sparc/sparc64/Implies b/sysdeps/sparc/sparc64/Implies
new file mode 100644
index 0000000000..a8cae95f9d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/Implies
@@ -0,0 +1 @@
+wordsize-64
diff --git a/sysdeps/sparc64/Makefile b/sysdeps/sparc/sparc64/Makefile
index 48a86c6acb..656274d75c 100644
--- a/sysdeps/sparc64/Makefile
+++ b/sysdeps/sparc/sparc64/Makefile
@@ -7,5 +7,5 @@ omit-long-double-fcts = yes
 
 # But we do need these few functions to even link stdio proggies
 ifeq ($(subdir),math)
-sysdep_routines += s_isinfl s_isnanl
+sysdep_routines += s_isinfl s_isnanl s_finitel s_signbitl
 endif
diff --git a/sysdeps/sparc64/add_n.S b/sysdeps/sparc/sparc64/add_n.S
index 68bb008a7d..68bb008a7d 100644
--- a/sysdeps/sparc64/add_n.S
+++ b/sysdeps/sparc/sparc64/add_n.S
diff --git a/sysdeps/sparc64/addmul_1.S b/sysdeps/sparc/sparc64/addmul_1.S
index 260481230f..260481230f 100644
--- a/sysdeps/sparc64/addmul_1.S
+++ b/sysdeps/sparc/sparc64/addmul_1.S
diff --git a/sysdeps/sparc64/bits/endian.h b/sysdeps/sparc/sparc64/bits/endian.h
index a2ab07249a..a2ab07249a 100644
--- a/sysdeps/sparc64/bits/endian.h
+++ b/sysdeps/sparc/sparc64/bits/endian.h
diff --git a/sysdeps/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h
index df09c8fc85..eb46ba92be 100644
--- a/sysdeps/sparc64/dl-machine.h
+++ b/sysdeps/sparc/sparc64/dl-machine.h
@@ -26,6 +26,9 @@
 #include <sysdep.h>
 
 
+/* Translate a processor-specific dynamic tag to the index into l_info.  */
+#define DT_SPARC(x)	(DT_SPARC_##x - DT_LOPROC + DT_NUM)
+
 /* Return nonzero iff E_MACHINE is compatible with the running host.  */
 static inline int
 elf_machine_matches_host (Elf64_Half e_machine)
@@ -33,15 +36,15 @@ elf_machine_matches_host (Elf64_Half e_machine)
   return e_machine == EM_SPARC64;
 }
 
-
 /* Return the link-time address of _DYNAMIC.  Conveniently, this is the
    first element of the GOT.  This must be inlined in a function which
    uses global data.  */
 static inline Elf64_Addr
 elf_machine_dynamic (void)
 {
-  register Elf64_Addr *got asm ("%l7");
-  return *got;
+  register Elf64_Addr elf_pic_register __asm__("%l7");
+
+  return *(Elf64_Addr *)elf_pic_register;
 }
 
 
@@ -49,17 +52,19 @@ elf_machine_dynamic (void)
 static inline Elf64_Addr
 elf_machine_load_address (void)
 {
-  Elf64_Addr here;
+  register Elf64_Addr elf_pic_register __asm__("%l7");
+  Elf64_Addr pc, la;
+
+  /* Utilize the fact that a local .got entry will be partially
+     initialized at startup awaiting its RELATIVE fixup.  */
 
-  __asm("rd %pc,%0\n\t"
-	"ba 1f\n\t"
-	" add %0,12,%0\n\t"
-	".weak __load_address_undefined\n\t"
-	"call __load_address_undefined\n"
-	"1:"
-	: "=r"(here));
+  __asm("sethi %%hi(.Load_address), %1\n"
+	".Load_address:\n\t"
+	"rd %%pc, %0\n\t"
+	"or %1, %%lo(.Load_address), %1\n\t"
+	: "=r"(pc), "=r"(la));
 
-  return here + (*(int *)here << 2);
+  return pc - *(Elf64_Addr *)(elf_pic_register + la);
 }
 
 #ifdef RESOLVE
@@ -71,8 +76,6 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
 		  const Elf64_Sym *sym, const struct r_found_version *version,
 		  Elf64_Addr *const reloc_addr)
 {
-  Elf64_Addr loadbase;
-
 #ifndef RTLD_BOOTSTRAP
   /* This is defined in rtld.c, but nowhere in the static libc.a; make the
      reference weak so static programs can still link.  This declaration
@@ -87,7 +90,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
 #ifndef RTLD_BOOTSTRAP
       if (map != &_dl_rtld_map) /* Already done in rtld itself. */
 #endif
-	*reloc_addr += map->l_addr + reloc->r_addend;
+	*reloc_addr = map->l_addr + reloc->r_addend;
     }
   else
     {
@@ -123,9 +126,9 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
 	  memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
 						   refsym->st_size));
 	  break;
+
+	case R_SPARC_64:
 	case R_SPARC_GLOB_DAT:
-	/* case R_SPARC_64: */
-	case R_SPARC_JMP_SLOT:
 	  *reloc_addr = value;
 	  break;
 	case R_SPARC_8:
@@ -155,6 +158,25 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
 	  *(unsigned *)reloc_addr = (*(unsigned *)reloc_addr & 0xffc00000)
 				     | (value >> 10);
 	  break;
+
+	case R_SPARC_JMP_SLOT:
+	  {
+	    Elf64_Dyn *pltfmt = map->l_info[DT_SPARC(PLTFMT)];
+	    switch (pltfmt ? pltfmt->d_un.d_val : 0)
+	      {
+	      case 1: /* .got.plt with absolute addresses */
+		*reloc_addr = value;
+	        break;
+	      case 2: /* .got.plt with got-relative addresses */
+		*reloc_addr = value - (map->l_info[DT_PLTGOT]->d_un.d_ptr
+				       + map->l_addr);
+		break;
+	      default:
+		assert (! "unexpected .plt format type");
+	      }
+	  }
+	  break;
+
 	case R_SPARC_NONE:		/* Alright, Wilbur.  */
 	  break;
 	default:
@@ -195,6 +217,8 @@ elf_machine_lazy_rel (struct link_map *map, const Elf64_Rela *reloc)
 /* The SPARC never uses Elf64_Rel relocations.  */
 #define ELF_MACHINE_NO_REL 1
 
+/* The SPARC overlaps DT_RELA and DT_PLTREL.  */
+#define ELF_MACHINE_PLTREL_OVERLAP 1
 
 /* Set up the loaded object described by L so its unrelocated PLT
    entries will jump to the on-demand fixup code in dl-runtime.c.  */
@@ -203,7 +227,7 @@ static inline int
 elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 {
   Elf64_Addr *got;
-  extern void _dl_runtime_resolve (Elf64_Word);
+  extern void _dl_runtime_resolve (void);
 
   if (l->l_info[DT_JMPREL] && lazy)
     {
@@ -224,9 +248,9 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 	.type _dl_runtime_resolve, @function
 _dl_runtime_resolve:
 	save %sp, -160, %sp
-	mov %g1, %o1
+	mov %g5, %o0
 	call fixup
-	 mov %g2, %o0
+	 mov %g6, %o1
 	jmp %o0
 	 restore
 	.size _dl_runtime_resolve, .-_dl_runtime_resolve
@@ -236,10 +260,6 @@ _dl_runtime_resolve:
 #define elf_machine_relplt elf_machine_rela
 
 
-/* Mask identifying addresses reserved for the user program,
-   where the dynamic linker should not map anything.  */
-#define ELF_MACHINE_USER_ADDRESS_MASK	???
-
 /* Initial entry point code for the dynamic linker.
    The C function `_dl_start' is the real entry point;
    its return value is the user program's entry point.  */
@@ -257,33 +277,59 @@ _start:
 	call	_dl_start
 	 add	 %sp," __S(STACK_BIAS) "+22*8,%o0
 	/* FALLTHRU */
+	.size _start, .-_start
 
 	.global _dl_start_user
 	.type _dl_start_user, @function
 _dl_start_user:
    /* Load the GOT register.  */
-1:	rd	%pc,%g1
+1:	call	11f
 	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
-	or	%l2,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
-	add	%l7,%g1,%l7
+11:	or	%l7,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
+	add	%l7,%o7,%l7
    /* Save the user entry point address in %l0.  */
 	mov	%o0,%l0
    /* See if we were run as a command with the executable file name as an
-      extra leading argument.  If so, adjust the stack pointer.  */
+      extra leading argument.  If so, we must shift things around since we
+      must keep the stack doubleword aligned.  */
 	sethi	%hi(_dl_skip_args), %g2
 	or	%g2, %lo(_dl_skip_args), %g2
-	ld	[%l7+%g2], %i0
+	ldx	[%l7+%g2], %i0
+	ld	[%i0], %i0
 	brz,pt	%i0, 2f
-	 ldx	[%sp+" __S(STACK_BIAS) "+22*8], %i1
+	 nop
+	/* Find out how far to shift.  */
+	ldx	[%sp+" __S(STACK_BIAS) "+22*8], %i1
 	sub	%i1, %i0, %i1
 	sllx	%i0, 3, %i2
-	add	%sp, %i2, %sp
 	stx	%i1, [%sp+" __S(STACK_BIAS) "+22*8]
+	add	%sp, " __S(STACK_BIAS) "+23*8, %i1
+	add	%i1, %i2, %i2
+	/* Copy down argv.  */
+12:	ldx	[%i2], %i3
+	add	%i2, 8, %i2
+	stx	%i3, [%i1]
+	brnz,pt	%i3, 12b
+	 add	%i1, 8, %i1
+	/* Copy down envp.  */
+13:	ldx	[%i2], %i3
+	add	%i2, 8, %i2
+	stx	%i3, [%i1]
+	brnz,pt	%i3, 13b
+	 add	%i1, 8, %i1
+	/* Copy down auxiliary table.  */
+14:	ldx	[%i2], %i3
+	ldx	[%i2+8], %i4
+	add	%i2, 16, %i2
+	stx	%i3, [%i1]
+	stx	%i4, [%i1+8]
+	brnz,pt	%i3, 13b
+	 add	%i1, 16, %i1
    /* Load _dl_default_scope[2] to pass to _dl_init_next.  */
 2:	sethi	%hi(_dl_default_scope), %g2
-	or	%g2, %lo(_dl_defalt_scope), %g2
-	add	%g2, 2*8, %g2
-	ldx	[%l7+%g2], %l1
+	or	%g2, %lo(_dl_default_scope), %g2
+	ldx	[%l7+%g2], %g2
+	ldx	[%g2+2*8], %l1
    /* Call _dl_init_next to return the address of an initializer to run.  */
 3:	call	_dl_init_next
 	 mov	%l1, %o0
@@ -295,8 +341,9 @@ _dl_start_user:
    /* Clear the startup flag.  */
 4:	sethi	%hi(_dl_starting_up), %g2
 	or	%g2, %lo(_dl_starting_up), %g2
-	st	%g0, [%l7+%g2]
-   /* Pass our finalizer function to the user in %g1
+	ldx	[%l7+%g2], %g2
+	st	%g0, [%g2]
+   /* Pass our finalizer function to the user in %g1.  */
 	sethi	%hi(_dl_fini), %g1
 	or	%g1, %lo(_dl_fini), %g1
 	ldx	[%l7+%g1], %g1
diff --git a/sysdeps/sparc64/elf/Dist b/sysdeps/sparc/sparc64/elf/Dist
index d9338c8fd6..d9338c8fd6 100644
--- a/sysdeps/sparc64/elf/Dist
+++ b/sysdeps/sparc/sparc64/elf/Dist
diff --git a/sysdeps/sparc64/elf/Makefile b/sysdeps/sparc/sparc64/elf/Makefile
index 1b38355b38..1b38355b38 100644
--- a/sysdeps/sparc64/elf/Makefile
+++ b/sysdeps/sparc/sparc64/elf/Makefile
diff --git a/sysdeps/sparc/sparc64/elf/crtbegin.S b/sysdeps/sparc/sparc64/elf/crtbegin.S
new file mode 100644
index 0000000000..318e7a6a3f
--- /dev/null
+++ b/sysdeps/sparc/sparc64/elf/crtbegin.S
@@ -0,0 +1,69 @@
+/* Destructor cleanup code for elf64-sparc
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
+ 
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+ 
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+
+.section ".ctors",#alloc,#write
+
+	.align 8
+__CTOR_LIST__:
+	.xword	-1
+
+.section ".dtors",#alloc,#write
+
+	.align 8
+__DTOR_LIST__:
+	.xword	-1
+
+.section ".fini",#alloc,#execinstr
+
+	call	__do_global_dtors_aux
+	 nop
+
+.text
+
+	.align 4
+	.type __do_global_dtors_aux,#function
+__do_global_dtors_aux:
+	save	%sp,-160,%sp
+
+#ifdef PIC
+1:	call	11f
+	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+11:	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+	add	%l7, %o7, %l7
+	sethi	%hi(__DTOR_LIST__), %l0
+	or	%l0, %lo(__DTOR_LIST__), %l0
+	ldx	[%l7+%l0], %l0
+#else
+	sethi	%hi(__DTOR_LIST__), %l0
+	or	%l0, %lo(__DTOR_LIST__), %l0
+	add	%l0, %g4, %l0
+#endif
+
+	ba	3f
+	 ldx	[%l0+8], %l1
+2:	jmpl	%l1, %o7
+	 ldx	[%l0+8], %l1
+3:	brnz,pt	%l1, 2b
+	 add	%l0, 8, %l0
+
+	ret
+	 restore
+
+	.size __do_global_dtors_aux,.-__do_global_dtors_aux
diff --git a/sysdeps/sparc64/elf/crtbeginS.S b/sysdeps/sparc/sparc64/elf/crtbeginS.S
index 7db4bc590e..7db4bc590e 100644
--- a/sysdeps/sparc64/elf/crtbeginS.S
+++ b/sysdeps/sparc/sparc64/elf/crtbeginS.S
diff --git a/sysdeps/sparc/sparc64/elf/crtend.S b/sysdeps/sparc/sparc64/elf/crtend.S
new file mode 100644
index 0000000000..7a5c067b07
--- /dev/null
+++ b/sysdeps/sparc/sparc64/elf/crtend.S
@@ -0,0 +1,70 @@
+/* Constructor startup code for elf64-sparc
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
+ 
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+ 
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+ 
+ 
+.section ".ctors",#alloc,#write
+
+	.align 8
+__CTOR_END__:
+	.xword	0
+
+.section ".dtors",#alloc,#write
+
+	.align 8
+__DTOR_END__:
+	.xword	0
+
+.section ".init",#alloc,#execinstr
+
+	call	__do_global_ctors_aux
+	 nop
+
+.text
+
+	.align 4
+	.type __do_global_ctors_aux,#function
+__do_global_ctors_aux:
+	save	%sp,-160,%sp
+
+#ifdef PIC
+1:	call	11f
+	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+11:	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+	add	%l7, %o7, %l7
+	sethi	%hi(__CTOR_END__), %l0
+	or	%l0, %lo(__CTOR_END__), %l0
+	ldx	[%l7+%l0], %l0
+#else
+	sethi	%hi(__CTOR_END__), %l0
+	or	%l0, %lo(__CTOR_END__), %l0
+	add	%l0, %g4, %l0
+#endif
+
+	ba	3f
+	 ldx	[%l0+8], %l1
+2:	jmpl	%l1, %o7
+	 ldx	[%l0+8], %l1
+3:	addcc	%l1, 1, %g0
+	bnz,pt	%xcc, 2b
+	 add	%l0, 8, %l0
+
+	ret
+	 restore
+
+	.size __do_global_ctors_aux,.-__do_global_ctors_aux
diff --git a/sysdeps/sparc64/elf/crtendS.S b/sysdeps/sparc/sparc64/elf/crtendS.S
index 56532f567d..56532f567d 100644
--- a/sysdeps/sparc64/elf/crtendS.S
+++ b/sysdeps/sparc/sparc64/elf/crtendS.S
diff --git a/sysdeps/sparc64/elf/start.S b/sysdeps/sparc/sparc64/elf/start.S
index 73f42367ee..73f42367ee 100644
--- a/sysdeps/sparc64/elf/start.S
+++ b/sysdeps/sparc/sparc64/elf/start.S
diff --git a/sysdeps/sparc/sparc64/fpu/bits/fenv.h b/sysdeps/sparc/sparc64/fpu/bits/fenv.h
new file mode 100644
index 0000000000..802c58bdce
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/bits/fenv.h
@@ -0,0 +1,76 @@
+/* Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _FENV_H
+#error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Define bits representing the exception.  We use the bit positions
+   of the appropriate accrued exception bits from the FSR.  */
+enum
+  {
+    FE_INVALID = 	(1 << 9),
+#define FE_INVALID	FE_INVALID
+    FE_OVERFLOW = 	(1 << 8),
+#define FE_OVERFLOW	FE_OVERFLOW
+    FE_UNDERFLOW = 	(1 << 7),
+#define FE_UNDERFLOW	FE_UNDERFLOW
+    FE_DIVBYZERO = 	(1 << 6),
+#define FE_DIVBYZERO	FE_DIVBYZERO
+    FE_INEXACT = 	(1 << 5)
+#define FE_INEXACT	FE_INEXACT
+  };
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The Sparc FPU supports all of the four defined rounding modes.  We
+   use again the bit positions in the FPU control word as the values
+   for the appropriate macros.  */
+enum
+  {
+    FE_TONEAREST = 	(0U << 30),
+#define FE_TONEAREST	FE_TONEAREST
+    FE_TOWARDSZERO = 	(1U << 30),
+#define FE_TOWARDSZERO	FE_TOWARDSZERO
+    FE_UPWARD = 	(2U << 30),
+#define FE_UPWARD	FE_UPWARD
+    FE_DOWNWARD = 	(3U << 30)
+#define FE_DOWNWARD	FE_DOWNWARD
+  };
+
+#define __FE_ROUND_MASK	(3U << 30)
+
+/* Type representing exception flags.  */
+typedef unsigned long fexcept_t;
+
+/* Type representing floating-point environment.  */
+typedef unsigned long fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exception is masked.  */
+# define FE_NOMASK_ENV	((fenv_t *) -2)
+#endif
+
+/* For internal use only: access the fp state register.  */
+#define __fenv_stfsr(X)   __asm__("stx %%fsr,%0" : "=m"(X))
+#define __fenv_ldfsr(X)   __asm__ __volatile__("ldx %0,%%fsr" : : "m"(X))
diff --git a/sysdeps/sparc64/fpu_control.h b/sysdeps/sparc/sparc64/fpu/fpu_control.h
index fd8abb19f1..fd8abb19f1 100644
--- a/sysdeps/sparc64/fpu_control.h
+++ b/sysdeps/sparc/sparc64/fpu/fpu_control.h
diff --git a/sysdeps/sparc64/gmp-mparam.h b/sysdeps/sparc/sparc64/gmp-mparam.h
index a3c66974de..a3c66974de 100644
--- a/sysdeps/sparc64/gmp-mparam.h
+++ b/sysdeps/sparc/sparc64/gmp-mparam.h
diff --git a/sysdeps/sparc64/lshift.S b/sysdeps/sparc/sparc64/lshift.S
index 1678991529..1678991529 100644
--- a/sysdeps/sparc64/lshift.S
+++ b/sysdeps/sparc/sparc64/lshift.S
diff --git a/sysdeps/sparc64/mul_1.S b/sysdeps/sparc/sparc64/mul_1.S
index 87e441d7eb..87e441d7eb 100644
--- a/sysdeps/sparc64/mul_1.S
+++ b/sysdeps/sparc/sparc64/mul_1.S
diff --git a/sysdeps/sparc64/rshift.S b/sysdeps/sparc/sparc64/rshift.S
index e1b3aca112..e1b3aca112 100644
--- a/sysdeps/sparc64/rshift.S
+++ b/sysdeps/sparc/sparc64/rshift.S
diff --git a/sysdeps/sparc64/sub_n.S b/sysdeps/sparc/sparc64/sub_n.S
index 93f8a8235d..93f8a8235d 100644
--- a/sysdeps/sparc64/sub_n.S
+++ b/sysdeps/sparc/sparc64/sub_n.S
diff --git a/sysdeps/sparc64/submul_1.S b/sysdeps/sparc/sparc64/submul_1.S
index 3cc0e3bb08..3cc0e3bb08 100644
--- a/sysdeps/sparc64/submul_1.S
+++ b/sysdeps/sparc/sparc64/submul_1.S
diff --git a/sysdeps/sparc64/Implies b/sysdeps/sparc64/Implies
deleted file mode 100644
index 1d793f9fb1..0000000000
--- a/sysdeps/sparc64/Implies
+++ /dev/null
@@ -1,3 +0,0 @@
-wordsize-64
-# SPARC uses IEEE 754 floating point.
-ieee754
diff --git a/sysdeps/sparc64/configure b/sysdeps/sparc64/configure
deleted file mode 100755
index 099f5b0470..0000000000
--- a/sysdeps/sparc64/configure
+++ /dev/null
@@ -1,3 +0,0 @@
- # Local configure fragment for sysdeps/sparc64
-
-nopic_initfini=yes
diff --git a/sysdeps/sparc64/configure.in b/sysdeps/sparc64/configure.in
deleted file mode 100644
index 5f74b82de3..0000000000
--- a/sysdeps/sparc64/configure.in
+++ /dev/null
@@ -1,7 +0,0 @@
-sinclude(./aclocal.m4)dnl Autoconf lossage
-GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
-# Local configure fragment for sysdeps/sparc64
-
-dnl We need to have separate crt? files for static linking which does
-dnl not use PIC.
-nopic_initfini=yes
diff --git a/sysdeps/sparc64/elf/crtbegin.S b/sysdeps/sparc64/elf/crtbegin.S
deleted file mode 100644
index fbd731cad0..0000000000
--- a/sysdeps/sparc64/elf/crtbegin.S
+++ /dev/null
@@ -1,49 +0,0 @@
-.section ".ctors",#alloc,#write
-
-	.align 8
-__CTOR_LIST__:
-	.xword	-1
-
-.section ".dtors",#alloc,#write
-
-	.align 8
-__DTOR_LIST__:
-	.xword	-1
-
-.section ".fini",#alloc,#execinstr
-
-	call	__do_global_dtors_aux
-	 nop
-
-.text
-
-	.align 4
-	.type __do_global_dtors_aux,#function
-__do_global_dtors_aux:
-	save	%sp,-160,%sp
-
-#ifdef PIC
-1:	rd	%pc, %g1
-	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
-	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
-	add	%l7, %g1, %l7
-	sethi	%hi(__DTOR_LIST__), %l0
-	or	%l0, %lo(__DTOR_LIST__), %l0
-	ldx	[%l7+%l0], %l0
-#else
-	sethi	%hi(__DTOR_LIST__), %l0
-	or	%l0, %lo(__DTOR_LIST__), %l0
-	add	%l0, %g4, %l0
-#endif
-
-	ba	3f
-	 ldx	[%l0+8], %l1
-2:	jmpl	%l1, %o7
-	 ldx	[%l0+8], %l1
-3:	brnz,pt	%l1, 2b
-	 add	%l0, 8, %l0
-
-	ret
-	 restore
-
-	.size __do_global_dtors_aux,.-__do_global_dtors_aux
diff --git a/sysdeps/sparc64/elf/crtend.S b/sysdeps/sparc64/elf/crtend.S
deleted file mode 100644
index ea69083d69..0000000000
--- a/sysdeps/sparc64/elf/crtend.S
+++ /dev/null
@@ -1,50 +0,0 @@
-.section ".ctors",#alloc,#write
-
-	.align 8
-__CTOR_END__:
-	.xword	0
-
-.section ".dtors",#alloc,#write
-
-	.align 8
-__DTOR_END__:
-	.xword	0
-
-.section ".init",#alloc,#execinstr
-
-	call	__do_global_ctors_aux
-	 nop
-
-.text
-
-	.align 4
-	.type __do_global_ctors_aux,#function
-__do_global_ctors_aux:
-	save	%sp,-160,%sp
-
-#ifdef PIC
-1:	rd	%pc, %g1
-	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
-	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
-	add	%l7, %g1, %l7
-	sethi	%hi(__CTOR_END__), %l0
-	or	%l0, %lo(__CTOR_END__), %l0
-	ldx	[%l7+%l0], %l0
-#else
-	sethi	%hi(__CTOR_END__), %l0
-	or	%l0, %lo(__CTOR_END__), %l0
-	add	%l0, %g4, %l0
-#endif
-
-	ba	3f
-	 ldx	[%l0+8], %l1
-2:	jmpl	%l1, %o7
-	 ldx	[%l0+8], %l1
-3:	addcc	%l1, 1, %g0
-	bnz,pt	%xcc, 2b
-	 add	%l0, 8, %l0
-
-	ret
-	 restore
-
-	.size __do_global_ctors_aux,.-__do_global_ctors_aux
diff --git a/sysdeps/stub/accept.c b/sysdeps/stub/accept.c
index 8f65f5fe7b..c27070c0b1 100644
--- a/sysdeps/stub/accept.c
+++ b/sysdeps/stub/accept.c
@@ -28,7 +28,7 @@ int
 accept (fd, addr, addr_len)
      int fd;
      __SOCKADDR_ARG addr;
-     size_t *addr_len;
+     socklen_t *addr_len;
 {
   __set_errno (ENOSYS);
   return -1;
diff --git a/sysdeps/stub/bind.c b/sysdeps/stub/bind.c
index bfd2888138..7e7f0d70b7 100644
--- a/sysdeps/stub/bind.c
+++ b/sysdeps/stub/bind.c
@@ -24,7 +24,7 @@ int
 bind (fd, addr, len)
      int fd;
      __CONST_SOCKADDR_ARG addr;
-     size_t len;
+     socklen_t len;
 {
   __set_errno (ENOSYS);
   return -1;
diff --git a/sysdeps/stub/bits/string.h b/sysdeps/stub/bits/string.h
index bd1b77409d..ad68b038b6 100644
--- a/sysdeps/stub/bits/string.h
+++ b/sysdeps/stub/bits/string.h
@@ -1,4 +1,4 @@
-/* This file should provide inline versions of math functions.
+/* This file should provide inline versions of string functions.
 
    Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
 
diff --git a/sysdeps/stub/connect.c b/sysdeps/stub/connect.c
index 9152a9449c..fb8b50341a 100644
--- a/sysdeps/stub/connect.c
+++ b/sysdeps/stub/connect.c
@@ -27,12 +27,11 @@ int
 __connect (fd, addr, len)
      int fd;
      __CONST_SOCKADDR_ARG addr;
-     size_t len;
+     socklen_t len;
 {
   __set_errno (ENOSYS);
   return -1;
 }
 weak_alias (__connect, connect)
 
-
 stub_warning (connect)
diff --git a/sysdeps/stub/getsockname.c b/sysdeps/stub/getsockname.c
index 0706e59b8f..f0d46dbc3c 100644
--- a/sysdeps/stub/getsockname.c
+++ b/sysdeps/stub/getsockname.c
@@ -24,7 +24,7 @@ int
 getsockname (fd, addr, len)
      int fd;
      __SOCKADDR_ARG addr;
-     size_t *len;
+     socklen_t *len;
 {
   __set_errno (ENOSYS);
   return -1;
diff --git a/sysdeps/stub/getsockopt.c b/sysdeps/stub/getsockopt.c
index d06b3e66e3..6f3c866b46 100644
--- a/sysdeps/stub/getsockopt.c
+++ b/sysdeps/stub/getsockopt.c
@@ -28,11 +28,10 @@ getsockopt (fd, level, optname, optval, optlen)
      int level;
      int optname;
      void *optval;
-     size_t *optlen;
+     socklen_t *optlen;
 {
   __set_errno (ENOSYS);
   return -1;
 }
 
-
 stub_warning (getsockopt)
diff --git a/sysdeps/stub/recvfrom.c b/sysdeps/stub/recvfrom.c
index d759c3d0a1..931bdbb1b5 100644
--- a/sysdeps/stub/recvfrom.c
+++ b/sysdeps/stub/recvfrom.c
@@ -29,11 +29,10 @@ recvfrom (fd, buf, n, flags, addr, addr_len)
      size_t n;
      int flags;
      __SOCKADDR_ARG addr;
-     size_t *addr_len;
+     socklen_t *addr_len;
 {
   __set_errno (ENOSYS);
   return -1;
 }
 
-
 stub_warning (recvfrom)
diff --git a/sysdeps/stub/sendto.c b/sysdeps/stub/sendto.c
index d09efba513..47dad95dbd 100644
--- a/sysdeps/stub/sendto.c
+++ b/sysdeps/stub/sendto.c
@@ -28,11 +28,10 @@ sendto (fd, buf, n, flags, addr, addr_len)
      size_t n;
      int flags;
      __CONST_SOCKADDR_ARG addr;
-     size_t addr_len;
+     socklen_t addr_len;
 {
   __set_errno (ENOSYS);
   return -1;
 }
 
-
 stub_warning (sendto)
diff --git a/sysdeps/stub/setsockopt.c b/sysdeps/stub/setsockopt.c
index b1c02a154b..5fad292a57 100644
--- a/sysdeps/stub/setsockopt.c
+++ b/sysdeps/stub/setsockopt.c
@@ -28,11 +28,10 @@ setsockopt (fd, level, optname, optval, optlen)
      int level;
      int optname;
      void *optval;
-     size_t optlen;
+     socklen_t optlen;
 {
   __set_errno (ENOSYS);
   return -1;
 }
 
-
 stub_warning (setsockopt)
diff --git a/sysdeps/unix/bsd/osf/bits/sigaction.h b/sysdeps/unix/bsd/osf/bits/sigaction.h
index df400d4aaa..56e28a04fb 100644
--- a/sysdeps/unix/bsd/osf/bits/sigaction.h
+++ b/sysdeps/unix/bsd/osf/bits/sigaction.h
@@ -1,5 +1,5 @@
 /* Structure and constant definitions for sigaction et al.  OSF/1 version.
-   Copyright (C) 1993, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Brendan Kehoe (brendan@zen.org).
 
@@ -33,9 +33,9 @@ struct sigaction
 
 /* Bits in `sa_flags'.  */
 #ifdef	__USE_BSD
-#define	SA_ONSTACK	0x1	/* Take signal on signal stack.  */
-#define	SA_RESTART	0x2	/* Don't restart syscall on signal return.  */
-#define	SA_DISABLE	0x4	/* Disable alternate signal stack.  */
+# define SA_ONSTACK	0x1	/* Take signal on signal stack.  */
+# define SA_RESTART	0x2	/* Restart syscall on signal return.  */
+# define SA_DISABLE	0x4	/* Disable alternate signal stack.  */
 #endif
 #define	SA_NOCLDSTOP	0x4	/* Don't send SIGCHLD when children stop.  */
 
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index ed9ae873fd..ea1ab49fd4 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -11,7 +11,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h sys/mtio.h \
 		  sys/module.h sys/io.h sys/klog.h sys/kdaemon.h \
 		  sys/user.h sys/sysmacros.h sys/procfs.h \
 		  sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h \
-		  sys/quota.h sys/fsuid.h
+		  sys/quota.h sys/fsuid.h bits/mman.h
 
 install-others += $(inst_includedir)/bits/syscall.h
 
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h b/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
index e2e97bd70c..f28b6f256c 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
@@ -31,21 +31,21 @@ struct sigaction
   };
 
 /* Bits in `sa_flags'.  */
-#define	SA_NOCLDSTOP 0x00000004	/* Don't send SIGCHLD when children stop.  */
+#define	SA_NOCLDSTOP  0x00000004 /* Don't send SIGCHLD when children stop.  */
 #ifdef __USE_MISC
-#define SA_STACK     0x00000001	/* Use signal stack by using `sa_restorer'.  */
-#define SA_RESTART   0x00000002	/* Don't restart syscall on signal return.  */
-#define SA_INTERRUPT 0x20000000	/* Historical no-op.  */
-#define SA_NOMASK    0x00000008	/* Don't automatically block the signal when
-				   its handler is being executed.  */
-#define SA_ONESHOT   0x00000010	/* Reset to SIG_DFL on entry to handler.  */
+# define SA_STACK     0x00000001 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART   0x00000002 /* Restart syscall on signal return.  */
+# define SA_INTERRUPT 0x20000000 /* Historical no-op.  */
+# define SA_NOMASK    0x00000008 /* Don't automatically block the signal
+				    when its handler is being executed.  */
+# define SA_ONESHOT   0x00000010 /* Reset to SIG_DFL on entry to handler.  */
 
 /* Some aliases for the SA_ constants.  */
-#define SA_NODEFER	SA_NOMASK
-#define SA_RESETHAND	SA_ONESHOT
+# define SA_NODEFER   SA_NOMASK
+# define SA_RESETHAND SA_ONESHOT
 #endif
 
 /* Values for the HOW argument to `sigprocmask'.  */
-#define	SIG_BLOCK	1	/* Block signals.  */
-#define	SIG_UNBLOCK	2	/* Unblock signals.  */
-#define	SIG_SETMASK	3	/* Set the set of blocked signals.  */
+#define	SIG_BLOCK     1		 /* Block signals.  */
+#define	SIG_UNBLOCK   2		 /* Unblock signals.  */
+#define	SIG_SETMASK   3		 /* Set the set of blocked signals.  */
diff --git a/sysdeps/unix/sysv/linux/bits/sigaction.h b/sysdeps/unix/sysv/linux/bits/sigaction.h
index 13a6a03248..247b53499e 100644
--- a/sysdeps/unix/sysv/linux/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/bits/sigaction.h
@@ -1,5 +1,5 @@
 /* The proper definitions for Linux's sigaction.
-   Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 1995, 1996, 1997 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
@@ -34,21 +34,21 @@ struct sigaction
   };
 
 /* Bits in `sa_flags'.  */
-#define	SA_NOCLDSTOP 1		/* Don't send SIGCHLD when children stop.  */
+#define	SA_NOCLDSTOP  1		 /* Don't send SIGCHLD when children stop.  */
 #ifdef __USE_MISC
-#define SA_STACK     0x08000000	/* Use signal stack by using `sa_restorer'.  */
-#define SA_RESTART   0x10000000	/* Don't restart syscall on signal return.  */
-#define SA_INTERRUPT 0x20000000	/* Historical no-op.  */
-#define SA_NODEFER   0x40000000	/* Don't automatically block the signal when
-				   its handler is being executed.  */
-#define SA_RESETHAND 0x80000000	/* Reset to SIG_DFL on entry to handler.  */
+# define SA_STACK     0x08000000 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
+# define SA_INTERRUPT 0x20000000 /* Historical no-op.  */
+# define SA_NODEFER   0x40000000 /* Don't automatically block the signal when
+				    its handler is being executed.  */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler.  */
 
 /* Some aliases for the SA_ constants.  */
-#define SA_NOMASK	SA_NODEFER
-#define SA_ONESHOT	SA_RESETHAND
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
 #endif
 
 /* Values for the HOW argument to `sigprocmask'.  */
-#define	SIG_BLOCK	0	/* Block signals.  */
-#define	SIG_UNBLOCK	1	/* Unblock signals.  */
-#define	SIG_SETMASK	2	/* Set the set of blocked signals.  */
+#define	SIG_BLOCK     0		 /* Block signals.  */
+#define	SIG_UNBLOCK   1		 /* Unblock signals.  */
+#define	SIG_SETMASK   2		 /* Set the set of blocked signals.  */
diff --git a/sysdeps/unix/sysv/linux/if_index.c b/sysdeps/unix/sysv/linux/if_index.c
index f64fe1e1ca..615a81d14a 100644
--- a/sysdeps/unix/sysv/linux/if_index.c
+++ b/sysdeps/unix/sysv/linux/if_index.c
@@ -68,20 +68,21 @@ if_nametoindex (const char *ifname)
 {
 #ifndef SIOGIFINDEX
   __set_errno (ENOSYS);
+  return 0;
 #else
   struct ifreq ifr;
-  int rc;
   int fd = opensock ();
 
   if (fd < 0)
     return 0;
 
   strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
-  rc = ioctl (fd, SIOGIFINDEX, &ifr);
-  if (rc < 0)
+  if (ioctl (fd, SIOGIFINDEX, &ifr) < 0)
     {
+      int saved_errno = errno;
       close (fd);
-      __set_errno (rc == -EINVAL ? ENOSYS : -rc);
+      if (saved_errno == EINVAL)
+	__set_errno (ENOSYS);
       return 0;
     }
   close (fd);
@@ -109,7 +110,6 @@ if_nameindex (void)
   __set_errno (ENOSYS);
   return NULL;
 #else
-  int rc;
   int fd = opensock ();
   struct ifconf ifc;
   unsigned int rq_ifs = 4, nifs, i;
@@ -153,12 +153,13 @@ if_nameindex (void)
 	  goto jump;
 	}
       strcpy (idx[i].if_name, ifr->ifr_name);
-      rc = ioctl (fd, SIOGIFINDEX, ifr);
-      if (rc < 0)
+      if (ioctl (fd, SIOGIFINDEX, ifr) < 0)
 	{
+	  int saved_errno = errno;
 	  free (idx);
 	  idx = NULL;
-	  __set_errno (rc == -EINVAL ? ENOSYS : -rc);
+	  if (saved_errno == EINVAL)
+	    __set_errno (ENOSYS);
 	  goto jump;
 	}
       idx[i].if_index = ifr->ifr_ifindex;
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/mman.h b/sysdeps/unix/sysv/linux/m68k/bits/mman.h
new file mode 100644
index 0000000000..d6c29d2176
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/bits/mman.h
@@ -0,0 +1,75 @@
+/* Definitions for POSIX memory map inerface.  Linux/m68k version.
+   Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never include this file directly.  Use <sys/mman.h> instead"
+#endif
+
+/* The following definitions basically come from the kernel headers.
+   But the kernel header is not namespace clean.  */
+
+
+/* Protections are chosen from these bits, OR'd together.  The
+   implementation does not necessarily support PROT_EXEC or PROT_WRITE
+   without PROT_READ.  The only guarantees are that no writing will be
+   allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ	0x1		/* Page can be read.  */
+#define PROT_WRITE	0x2		/* Page can be written.  */
+#define PROT_EXEC	0x4		/* Page can be executed.  */
+#define PROT_NONE	0x0		/* Page can not be accessed.  */
+
+/* Sharing types (must choose one and only one of these).  */
+#define MAP_SHARED	0x01		/* Share changes.  */
+#define MAP_PRIVATE	0x02		/* Changes are private.  */
+#ifdef __USE_MISC
+# define MAP_TYPE	0x0f		/* Mask for type of mapping.  */
+#endif
+
+/* Other flags.  */
+#define MAP_FIXED	0x10		/* Interpret addr exactly.  */
+#ifdef __USE_MISC
+# define MAP_FILE	0
+# define MAP_ANONYMOUS	0x20		/* Don't use a file.  */
+# define MAP_ANON	MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific.  */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN	0x0100		/* Stack-like segment.  */
+# define MAP_DENYWRITE	0x0800		/* ETXTBSY */
+# define MAP_EXECUTABLE	0x1000		/* Mark it as an executable.  */
+# define MAP_LOCKED	0x2000		/* Lock the mapping.  */
+# define MAP_NORESERVE	0x4000		/* Don't check for reservations.  */
+#endif
+
+/* Flags to `msync'.  */
+#define MS_ASYNC	1		/* Sync memory asynchronously.  */
+#define MS_SYNC		4		/* Synchronous memory sync.  */
+#define MS_INVALIDATE	2		/* Invalidate the caches.  */
+
+/* Flags for `mlockall'.  */
+#define MCL_CURRENT	1		/* Lock all currently mapped pages.  */
+#define MCL_FUTURE	2		/* Lock all additions to address
+					   space.  */
+
+/* Flags for `mremap'.  */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE	1
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
index 66c58cc540..d6f70f2a2e 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
@@ -39,24 +39,24 @@ struct sigaction
   };
 
 /* Bits in `sa_flags'.  */
-#define	SA_NOCLDSTOP 1		/* Don't send SIGCHLD when children stop.  */
+#define	SA_NOCLDSTOP  1		 /* Don't send SIGCHLD when children stop.  */
 #ifdef __USE_MISC
-#define SA_STACK     0x08000000	/* Use signal stack by using `sa_restorer'.  */
-#define SA_RESTART   0x10000000	/* Don't restart syscall on signal return.  */
-#define SA_INTERRUPT 0x20000000	/* Historical no-op.  */
-#define SA_NODEFER   0x40000000	/* Don't automatically block the signal when
-				   its handler is being executed.  */
-#define SA_RESETHAND 0x80000000	/* Reset to SIG_DFL on entry to handler.  */
+# define SA_STACK     0x08000000 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
+# define SA_INTERRUPT 0x20000000 /* Historical no-op.  */
+# define SA_NODEFER   0x40000000 /* Don't automatically block the signal when
+				    its handler is being executed.  */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler.  */
 
 /* Some aliases for the SA_ constants.  */
-#define SA_NOMASK	SA_NODEFER
-#define SA_ONESHOT	SA_RESETHAND
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
 #endif
 
 /* Values for the HOW argument to `sigprocmask'.  */
-#define SIG_NOP		0	/* 0 is unused to catch errors */
-#define	SIG_BLOCK	1	/* Block signals.  */
-#define	SIG_UNBLOCK	2	/* Unblock signals.  */
-#define	SIG_SETMASK	3	/* Set the set of blocked signals.  */
-#define SIG_SETMASK32	256	/* Goodie from SGI for BSD compatibility:
+#define SIG_NOP	      0		/* 0 is unused to catch errors */
+#define	SIG_BLOCK     1		/* Block signals.  */
+#define	SIG_UNBLOCK   2		/* Unblock signals.  */
+#define	SIG_SETMASK   3		/* Set the set of blocked signals.  */
+#define SIG_SETMASK32 256	/* Goodie from SGI for BSD compatibility:
 				   set only the low 32 bit of the sigset.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
index 19aa7e39cb..13471995b9 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
@@ -27,26 +27,29 @@ struct sigaction
     __sigset_t sa_mask;
 
     /* Special flags.  */
-    unsigned int sa_flags;
+    unsigned long sa_flags;
+
+    /* Not used by Linux/Sparc yet.  */
+    void (*sa_restorer)(void);
   };
 
 
 /* Bits in `sa_flags'.  */
-#define	SA_NOCLDSTOP 0x00000008	/* Don't send SIGCHLD when children stop.  */
+#define	SA_NOCLDSTOP 0x00000008  /* Don't send SIGCHLD when children stop.  */
 #ifdef __USE_MISC
-#define SA_STACK     0x00000001	/* Use signal stack by using `sa_restorer'.  */
-#define SA_RESTART   0x00000002	/* Don't restart syscall on signal return.  */
-#define SA_INTERRUPT 0x00000010	/* Historical no-op.  */
-#define SA_NOMASK    0x00000020	/* Don't automatically block the signal when
-				   its handler is being executed.  */
-#define SA_ONESHOT   0x00000004	/* Reset to SIG_DFL on entry to handler.  */
+# define SA_STACK     0x00000001 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART   0x00000002 /* Restart syscall on signal return.  */
+# define SA_INTERRUPT 0x00000010 /* Historical no-op.  */
+# define SA_NOMASK    0x00000020 /* Don't automatically block the signal when
+				    its handler is being executed.  */
+# define SA_ONESHOT   0x00000004 /* Reset to SIG_DFL on entry to handler.  */
 
 /* Some aliases for the SA_ constants.  */
-#define SA_NODEFER	SA_NOMASK
-#define SA_RESETHAND	SA_ONESHOT
+# define SA_NODEFER   SA_NOMASK
+# define SA_RESETHAND SA_ONESHOT
 #endif
 
 /* Values for the HOW argument to `sigprocmask'.  */
-#define	SIG_BLOCK	1	/* Block signals.  */
-#define	SIG_UNBLOCK	2	/* Unblock signals.  */
-#define	SIG_SETMASK	4	/* Set the set of blocked signals.  */
+#define	SIG_BLOCK     1		 /* Block signals.  */
+#define	SIG_UNBLOCK   2		 /* Unblock signals.  */
+#define	SIG_SETMASK   4		 /* Set the set of blocked signals.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/Dist b/sysdeps/unix/sysv/linux/sparc/sparc32/Dist
index 9729f0709b..9729f0709b 100644
--- a/sysdeps/unix/sysv/linux/sparc/Dist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Dist
diff --git a/sysdeps/unix/sysv/linux/sparc/Makefile b/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile
index 4cbd3bd004..4cbd3bd004 100644
--- a/sysdeps/unix/sysv/linux/sparc/Makefile
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile
diff --git a/sysdeps/unix/sysv/linux/sparc/__sigtrampoline.S b/sysdeps/unix/sysv/linux/sparc/sparc32/__sigtrampoline.S
index a639511f3e..a639511f3e 100644
--- a/sysdeps/unix/sysv/linux/sparc/__sigtrampoline.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/__sigtrampoline.S
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h
index 3e7f2900fa..3e7f2900fa 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h
diff --git a/sysdeps/unix/sysv/linux/sparc/brk.c b/sysdeps/unix/sysv/linux/sparc/sparc32/brk.c
index 8f079bf444..8f079bf444 100644
--- a/sysdeps/unix/sysv/linux/sparc/brk.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/brk.c
diff --git a/sysdeps/unix/sysv/linux/sparc/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
index 64735e9dbc..64735e9dbc 100644
--- a/sysdeps/unix/sysv/linux/sparc/clone.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
diff --git a/sysdeps/unix/sysv/linux/sparc/fork.S b/sysdeps/unix/sysv/linux/sparc/sparc32/fork.S
index 951ab4981b..951ab4981b 100644
--- a/sysdeps/unix/sysv/linux/sparc/fork.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/fork.S
diff --git a/sysdeps/unix/sysv/linux/sparc/init-first.h b/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h
index 39822fc595..39822fc595 100644
--- a/sysdeps/unix/sysv/linux/sparc/init-first.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
index 91f02f4e20..91f02f4e20 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
diff --git a/sysdeps/unix/sysv/linux/sparc/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S
index 4c50656d6c..4c50656d6c 100644
--- a/sysdeps/unix/sysv/linux/sparc/pipe.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S
diff --git a/sysdeps/unix/sysv/linux/sparc/profil-counter.h b/sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h
index 1bd06482c9..1bd06482c9 100644
--- a/sysdeps/unix/sysv/linux/sparc/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h
diff --git a/sysdeps/unix/sysv/linux/sparc/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
index d39eb7cc76..d39eb7cc76 100644
--- a/sysdeps/unix/sysv/linux/sparc/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
diff --git a/sysdeps/unix/sysv/linux/sparc/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
index bdfc2fcc6d..bdfc2fcc6d 100644
--- a/sysdeps/unix/sysv/linux/sparc/socket.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
diff --git a/sysdeps/unix/sysv/linux/sparc/syscall.S b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
index 3921ca52dc..3921ca52dc 100644
--- a/sysdeps/unix/sysv/linux/sparc/syscall.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
diff --git a/sysdeps/unix/sysv/linux/sparc/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
index 7883d70719..7883d70719 100644
--- a/sysdeps/unix/sysv/linux/sparc/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.S b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.S
index 7e9023901b..7e9023901b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sysdep.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.S
diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index 0e5a8cd218..0e5a8cd218 100644
--- a/sysdeps/unix/sysv/linux/sparc/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
diff --git a/sysdeps/unix/sysv/linux/sparc64/Dist b/sysdeps/unix/sysv/linux/sparc/sparc64/Dist
index e770e20eb9..e770e20eb9 100644
--- a/sysdeps/unix/sysv/linux/sparc64/Dist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/Dist
diff --git a/sysdeps/unix/sysv/linux/sparc64/Makefile b/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile
index c4d83226a2..c4d83226a2 100644
--- a/sysdeps/unix/sysv/linux/sparc64/Makefile
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile
diff --git a/sysdeps/unix/sysv/linux/sparc64/__longjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/__longjmp.S
index 3107179fdc..3107179fdc 100644
--- a/sysdeps/unix/sysv/linux/sparc64/__longjmp.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/__longjmp.S
diff --git a/sysdeps/unix/sysv/linux/sparc64/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h
index 3e7f2900fa..3e7f2900fa 100644
--- a/sysdeps/unix/sysv/linux/sparc64/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h
diff --git a/sysdeps/unix/sysv/linux/sparc64/bits/setjmp.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h
index ab850e5301..ab850e5301 100644
--- a/sysdeps/unix/sysv/linux/sparc64/bits/setjmp.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h
diff --git a/sysdeps/unix/sysv/linux/sparc64/bits/types.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h
index 222967881f..222967881f 100644
--- a/sysdeps/unix/sysv/linux/sparc64/bits/types.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h
diff --git a/sysdeps/unix/sysv/linux/sparc64/brk.S b/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
index 87412e095a..abdd7e6604 100644
--- a/sysdeps/unix/sysv/linux/sparc64/brk.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
@@ -40,10 +40,10 @@ __curbrk: .skip 8
 ENTRY(__brk)
 	save	%sp, -160, %sp
 #ifdef PIC
-1:	rd	%pc, %g1
+1:	call	2f
 	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
-	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
-	add	%l7, %g1, %l7
+2:	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+	add	%l7, %o7, %l7
 #endif
 
 	LOADSYSCALL(brk)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S
new file mode 100644
index 0000000000..4e6a2da560
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S
@@ -0,0 +1 @@
+/* _setjmp is in setjmp.S  */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S
new file mode 100644
index 0000000000..1da848d2f1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S
@@ -0,0 +1 @@
+/* setjmp is in setjmp.S  */
diff --git a/sysdeps/unix/sysv/linux/sparc64/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
index fe38bf4ab7..a5cb1a4c4a 100644
--- a/sysdeps/unix/sysv/linux/sparc64/clone.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
@@ -54,10 +54,10 @@ __libc_clone:
 	 restore
 99:
 #ifdef PIC
-	rd	%pc, %g1
+	call	1f
 	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7
-	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7
-	add	%l7, %g1, %l7
+1:	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7
+	add	%l7, %o7, %l7
 	set	EINVAL, %i0
 	sethi	%hi(errno), %g2
 	or	%g2, %lo(errno), %g2
@@ -76,7 +76,7 @@ __libc_clone:
 	mov	-1,%i0
 	ret
 	 restore
-	.size __libc_clone,.-__libc_clone
+	.size __libc_clone, .-__libc_clone
 
 	.type __thread_start,@function
 __thread_start:
@@ -86,4 +86,4 @@ __thread_start:
 	 mov	%l3,%o0
 	call	_exit,0
 	 nop
-	.size __thread_start,.-__thread_start
+	.size __thread_start, .-__thread_start
diff --git a/sysdeps/unix/sysv/linux/sparc64/fork.S b/sysdeps/unix/sysv/linux/sparc/sparc64/fork.S
index c735da5a44..c735da5a44 100644
--- a/sysdeps/unix/sysv/linux/sparc64/fork.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/fork.S
diff --git a/sysdeps/unix/sysv/linux/sparc64/getcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S
index 05b06269e4..05b06269e4 100644
--- a/sysdeps/unix/sysv/linux/sparc64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S
diff --git a/sysdeps/unix/sysv/linux/sparc64/init-first.h b/sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h
index f7fad7f87f..3e27c6dcf7 100644
--- a/sysdeps/unix/sysv/linux/sparc64/init-first.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h
@@ -33,33 +33,33 @@
 	.global " #NAME "
 	.type " #NAME ",@function
 " #NAME ":
-	save	%sp, -64, %sp
-1:	rd	%pc, %g1
+	save	%sp, -128, %sp
+1:	call	11f
 	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
-	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+11:	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
 	add	%l7, %o7, %l7
 	/* Are we a dynamic libc being loaded into a static program?  */
-	sethi	%hi(_dl_starting_up), %g2
-	or	%g2, %lo(_dl_starting_up), %g2
-	ld	[%l7+%g2], %g2
-	brz,pn	%g2, 3f
-	 sethi	%hi(__libc_multiple_libcs), %g3
-	ld	[%g2], %g2
-	subcc	%g0, %g2, %g0
-	subc	%g0, -1, %g2
-3:	or	%g3, %lo(__libc_multiple_libcs), %g3
-	ld	[%l7+%g3], %g3
-	st	%g2, [%g3]
+	sethi	%hi(_dl_starting_up), %l2
+	or	%l2, %lo(_dl_starting_up), %l2
+	ldx	[%l7+%l2], %l2
+	brz,pn	%l2, 3f
+	 sethi	%hi(__libc_multiple_libcs), %l3
+	ld	[%l2], %l4
+	mov	%g0, %l2
+	movrz	%l4, 1, %l2
+3:	or	%l3, %lo(__libc_multiple_libcs), %l3
+	ldx	[%l7+%l3], %l3
+	st	%l2, [%l3]
 	/* If so, argc et al are in %o0-%o2 already.  Otherwise, load them.  */
-	brnz,pn	%g2, " #INIT "
+	brnz,pn	%l2, " #INIT "
 	 restore
-	ld	[%sp+" __S(STACK_BIAS) "+22*8], %o0
+	ldx	[%sp+" __S(STACK_BIAS) "+22*8], %o0
 	add	%sp, " __S(STACK_BIAS) "+23*8, %o1
 	sll	%o0, 3, %o2
 	add	%o2, %o1, %o2
-	add	%o2, 8, %o2
-	ba,a	" #INIT "
-	.size "#NAME " .-" #NAME);
+	ba	" #INIT "
+	 add	%o2, 8, %o2
+	.size "#NAME ", .-" #NAME);
 
 #else
 
@@ -73,15 +73,15 @@
 	or	%g2, %lo(_dl_starting_up), %g2
 	brz,pt	%g2, 3f
 	 sethi	%hi(__libc_multiple_libcs), %g3
-	ld	[%g4+%g2], %g2
-	subcc	%g0, %g2, %g0
-	subc	%g0, -1, %g2
-3:	add	%g3, %g4, %g3
-	st	%g2, [%g3+%lo(__libc_multiple_libcs)]
+	ld	[%g4+%g2], %g1
+	mov	%g0, %g2
+	movrz	%g1, 1, %g2
+3:	or	%g3, %lo(__libc_multiple_libcs), %g3
+	st	%g2, [%g3+%g4]
 	/* If so, argc et al are in %o0-%o2 already.  Otherwise, load them.  */
 	brnz,pn	%g2, " #INIT "
 	 nop
-	ld	[%sp+" __S(STACK_BIAS) "+22*8], %o0
+	ldx	[%sp+" __S(STACK_BIAS) "+22*8], %o0
 	add	%sp, " __S(STACK_BIAS) "+23*8, %o1
 	sll	%o0, 3, %o2
 	add	%o2, %o1, %o2
diff --git a/sysdeps/unix/sysv/linux/sparc64/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
index fcb752e3ec..fcb752e3ec 100644
--- a/sysdeps/unix/sysv/linux/sparc64/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
diff --git a/sysdeps/unix/sysv/linux/sparc64/longjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S
index c81b10495e..c4563776b6 100644
--- a/sysdeps/unix/sysv/linux/sparc64/longjmp.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S
@@ -42,3 +42,5 @@ ENTRY(longjmp)
 	ta	0x6f
 
 END(longjmp)
+
+strong_alias(longjmp, __longjmp)
diff --git a/sysdeps/unix/sysv/linux/sparc64/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S
index 82ff4eae3c..82ff4eae3c 100644
--- a/sysdeps/unix/sysv/linux/sparc64/pipe.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S
diff --git a/sysdeps/unix/sysv/linux/sparc64/profil-counter.h b/sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h
index 6a3f0a291a..6a3f0a291a 100644
--- a/sysdeps/unix/sysv/linux/sparc64/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h
diff --git a/sysdeps/unix/sysv/linux/sparc64/setcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
index 2968b65633..2968b65633 100644
--- a/sysdeps/unix/sysv/linux/sparc64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
diff --git a/sysdeps/unix/sysv/linux/sparc64/setjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S
index 8b88b49ac4..fcc5cb5a48 100644
--- a/sysdeps/unix/sysv/linux/sparc64/setjmp.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S
@@ -27,10 +27,29 @@
 #define O_gregs			32
 #define O_g1			(O_gregs + 4*8)
 
+/* int _setjmp(jmp_buf) */
+
+.weak _setjmp
+ENTRY(_setjmp)
+
+	ba	__sigsetjmp_local
+	 set	0, %o1
+
+END(setjmp)
+
+/* int setjmp(jmp_buf) */
+
+.weak setjmp
+ENTRY(setjmp)
+
+	set	1, %o1
+
+END(setjmp)
 
 /* int __sigsetjmp(jmp_buf, savemask)  */
 
 ENTRY(__sigsetjmp)
+__sigsetjmp_local:
 
 	/* Record whether the user is intending to save the sigmask.  */
 	st	%o1, [%o0 + O_mask_was_saved]
diff --git a/sysdeps/unix/sysv/linux/sparc64/sigjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/sigjmp.S
index 940ccbcf68..940ccbcf68 100644
--- a/sysdeps/unix/sysv/linux/sparc64/sigjmp.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigjmp.S
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S b/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
new file mode 100644
index 0000000000..30dace5903
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
@@ -0,0 +1,39 @@
+/* Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <sysdep.h>
+	.text
+
+ENTRY (syscall)
+
+	mov	%o0,%g1
+	mov	%o1,%o0
+	mov	%o2,%o1
+	mov	%o3,%o2
+	mov	%o4,%o3
+	mov	%o5,%o4
+
+	ta	0x11
+
+	bcc,pt %xcc,1f
+	 nop
+	SYSCALL_ERROR_HANDLER
+
+1:	retl
+
+PSEUDO_END (syscall)
diff --git a/sysdeps/unix/sysv/linux/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
index 66ba470994..66ba470994 100644
--- a/sysdeps/unix/sysv/linux/sparc64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
diff --git a/sysdeps/unix/sysv/linux/sparc64/sysdep.S b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.S
index 736578083c..736578083c 100644
--- a/sysdeps/unix/sysv/linux/sparc64/sysdep.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.S
diff --git a/sysdeps/unix/sysv/linux/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
index f01c1f43cd..c880e4a2dc 100644
--- a/sysdeps/unix/sysv/linux/sparc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
@@ -44,43 +44,65 @@
 	.type name,@function;
 
 #ifdef PIC
-#define SYSCALL_ERROR_HANDLER1(R)					\
+# ifdef _LIBC_REENTRANT
+#  define SYSCALL_ERROR_HANDLER						\
 	.global C_SYMBOL_NAME(errno);					\
 	.type C_SYMBOL_NAME(errno),@object;				\
-0:	rd %pc,%g1;							\
-	sethi %hi(_GLOBAL_OFFSET_TABLE_-(0b-.)),%g2;			\
-	add %g2,%lo(_GLOBAL_OFFSET_TABLE_-(0b-.)),%g2;			\
-	add %g2,%g1,%g1;						\
-	sethi %hi(errno),%g2;						\
-	add %g2,%lo(errno),%g2;						\
-	ldx [%g1+%g2],%g2;						\
-	st R,[%g2]
+	save %sp,-160,%sp;						\
+  101:	call 102f;							\
+	sethi %hi(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2;			\
+  102:	or %g2,%lo(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2;			\
+	sethi %hi(errno),%i1;						\
+	add %g2,%o7,%l7;						\
+	or %i1,%lo(errno),%i1;						\
+	ldx [%l7+%i1],%g2;						\
+	st %i0,[%g2];							\
+	call __errno_location;						\
+	 nop;								\
+	st %i0,[%o0];							\
+	sub %g0,1,%i0;							\
+	jmpl %i7+8, %g0;						\
+	 restore
+# else
+#  define SYSCALL_ERROR_HANDLER						\
+	.global C_SYMBOL_NAME(errno);					\
+	.type C_SYMBOL_NAME(errno),@object;				\
+	mov %o7,%g3;							\
+  101:	call 102f;							\
+	sethi %hi(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2;			\
+  102:	or %g2,%lo(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2;			\
+	sethi %hi(errno),%o1;						\
+	add %g2,%o7,%l7;						\
+	or %o1,%lo(errno),%o1;						\
+	mov %g3,%o7;							\
+	ldx [%l7+%o1],%g2;						\
+	st %o0,[%g2]
+# endif
 #else
-#define SYSCALL_ERROR_HANDLER1(R)					\
+# ifdef _LIBC_REENTRANT
+#  define SYSCALL_ERROR_HANDLER						\
 	.global C_SYMBOL_NAME(errno);					\
 	.type C_SYMBOL_NAME(errno),@object;				\
+	save %sp,-160,%sp;						\
 	sethi %hi(errno),%g1;						\
-	add %g1,%g4,%g1;						\
-	st R,[%g1+%lo(errno)]
-#endif
-
-#ifdef _LIBC_REENTRANT
-#define SYSCALL_ERROR_HANDLER						\
-	.global C_SYMBOL_NAME(__errno_location);			\
-        .type C_SYMBOL_NAME(__errno_location),@function;		\
-	save %sp,-128,%sp;						\
-	SYSCALL_ERROR_HANDLER1(%i0);					\
+	or %g1,%lo(errno),%g1;						\
+	st %i0,[%g1+%g4];						\
 	call __errno_location;						\
 	 nop;								\
 	st %i0,[%o0];							\
 	sub %g0,1,%i0;							\
 	jmpl %i7+8, %g0;						\
 	 restore
-#else
-#define SYSCALL_ERROR_HANDLER						\
-	SYSCALL_ERROR_HANDLER1(%o0);					\
+# else
+#  define SYSCALL_ERROR_HANDLER						\
+	.global C_SYMBOL_NAME(errno);					\
+	.type C_SYMBOL_NAME(errno),@object;				\
+	sethi %hi(errno),%g1;						\
+	or %g1,%lo(errno),%g1;						\
+	st %i0,[%g1+%g4];						\
 	retl;								\
 	 sub %g0,1,%i0
+# endif
 #endif
 
 #define PSEUDO(name, syscall_name, args)				\
diff --git a/sysdeps/unix/sysv/linux/sparc64/ucontext.h b/sysdeps/unix/sysv/linux/sparc/sparc64/ucontext.h
index 160e2fc43a..160e2fc43a 100644
--- a/sysdeps/unix/sysv/linux/sparc64/ucontext.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ucontext.h
diff --git a/sysdeps/unix/sysv/minix/bits/sigaction.h b/sysdeps/unix/sysv/minix/bits/sigaction.h
index 5bf5985c51..732befc630 100644
--- a/sysdeps/unix/sysv/minix/bits/sigaction.h
+++ b/sysdeps/unix/sysv/minix/bits/sigaction.h
@@ -31,14 +31,14 @@ struct sigaction
 
 /* Bits in `sa_flags'.  */
 #ifdef	__USE_MISC
-#define	SA_ONSTACK	0x1	/* Take signal on signal stack.  */
-#define	SA_RESETHAND	0x2	/* Reset signal handler when signal caught.  */
-#define	SA_NODEFER	0x4	/* Don't block signal while catching it.  */
-#define	SA_RESTART	0x8	/* Don't restart syscall on signal return.  */
-#define	SA_SIGINFO	0x10	/* Extended signal handling.  */
-#define	SA_NOCLDWAIT	0x20	/* Don't create zombies.  */
-#define	SA_COMPAT	0x80	/* Internal flag for old signal catchers.  */
-#define	SA_DISABLE	0x100	/* Disable alternate signal stack.  */
+# define SA_ONSTACK	0x1	/* Take signal on signal stack.  */
+# define SA_RESETHAND	0x2	/* Reset signal handler when signal caught.  */
+# define SA_NODEFER	0x4	/* Don't block signal while catching it.  */
+# define SA_RESTART	0x8	/* Restart syscall on signal return.  */
+# define SA_SIGINFO	0x10	/* Extended signal handling.  */
+# define SA_NOCLDWAIT	0x20	/* Don't create zombies.  */
+# define SA_COMPAT	0x80	/* Internal flag for old signal catchers.  */
+# define SA_DISABLE	0x100	/* Disable alternate signal stack.  */
 #endif
 #define	SA_NOCLDSTOP	0x40	/* Don't send SIGCHLD when children stop.  */
 
diff --git a/sysdeps/unix/sysv/sysv4/bits/sigaction.h b/sysdeps/unix/sysv/sysv4/bits/sigaction.h
index 3a2ffb2e10..ce3ab5e60c 100644
--- a/sysdeps/unix/sysv/sysv4/bits/sigaction.h
+++ b/sysdeps/unix/sysv/sysv4/bits/sigaction.h
@@ -35,13 +35,13 @@ struct sigaction
 
 /* Bits in `sa_flags'.  */
 #ifdef __USE_MISC
-#define	SA_ONSTACK	0x1	/* Take signal on signal stack.  */
-#define SA_RESETHAND	0x2	/* Reset to SIG_DFL on entry to handler.  */
-#define	SA_RESTART	0x4	/* Don't restart syscall on signal return.  */
-#define SA_SIGINFO	0x8	/* Provide additional info to the handler.  */
-#define SA_NODEFER	0x10	/* Don't automatically block the signal when
+# define SA_ONSTACK	0x1	/* Take signal on signal stack.  */
+# define SA_RESETHAND	0x2	/* Reset to SIG_DFL on entry to handler.  */
+# define SA_RESTART	0x4	/* Restart syscall on signal return.  */
+# define SA_SIGINFO	0x8	/* Provide additional info to the handler.  */
+# define SA_NODEFER	0x10	/* Don't automatically block the signal when
 				   its handler is being executed.  */
-#define SA_NOCLDWAIT	0x10000	/* Don't save zombie processes.  */
+# define SA_NOCLDWAIT	0x10000	/* Don't save zombie processes.  */
 #endif
 #define	SA_NOCLDSTOP	0x20000	/* Don't send SIGCHLD when children stop.  */