about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-15 06:50:42 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-15 06:50:42 +0000
commitb15cb495054a40644197395fb6a94daa4b0e81cb (patch)
tree085712cd0a7f5e68dc291c49c6adfb9c3675dcee /sysdeps
parent42be70d43174c6a6e80fbd25276d4eb04c6e5adf (diff)
downloadglibc-b15cb495054a40644197395fb6a94daa4b0e81cb.tar.gz
glibc-b15cb495054a40644197395fb6a94daa4b0e81cb.tar.xz
glibc-b15cb495054a40644197395fb6a94daa4b0e81cb.zip
Update.
2000-10-14  Ulrich Drepper  <drepper@redhat.com>

	* math/libm-test.inc (frexp_test): Add L suffix also to parameters.
	(hypot_test): Likewise.

	* sysdeps/generic/printf_fphex.c: Compute width of decimal point
	string correctly.  Handle padding correctly.

	* sysdeps/ia64/fpu/printf_fphex.c: Use sizeof in _itowa parameters
	correctly.
	* sysdeps/ieee754/ldbl-128/printf_fphex.c: Likewise.
	* sysdeps/ieee754/ldbl-96/printf_fphex.c: Likewise.

2000-10-12  Alan Modra  <alan@linuxcare.com.au>

	* FAQ.in: Add --start-group and --end-group.

2000-10-12  Alan Modra  <alan@linuxcare.com.au>

	* malloc/memusage.c: Conditionalize stack usage calculation on
	stack direction.

2000-10-12  Alan Modra  <alan@linuxcare.com.au>

	* config.h.in: Add ASM_LINE_SEP.
	* configure.in: Add test for comment and line separators.
	* include/libc-symbols.h: Define and use ASM_LINE_SEP, and add tabs to
	placate some hppa assemblers.
	* sysdeps/hppa/sysdep.h: Likewise.
	* sysdeps/gnu/siglist.c: Insert \n and \t into inline asm.
	* sysdeps/unix/sysv/linux/errlist.c: Likewise.

2000-10-12  David Huggins-Daines  <dhd@linuxcare.com>

	* sysdeps/unix/sysv/linux/Makefile: Include <bits/initspin> in
	$(sysdep_headers).
	* sysdeps/unix/sysv/linux/bits/initspin.h: Dummy version for
	non-threaded platforms.

2000-10-12  David Huggins-Daines  <dhd@linuxcare.com>

	* configure.in: Add definitions for hppa.
	* elf/elf.h: Add PLABEL32 relocation for hppa ELF32, comments
	for IPLT and EPLT relocations.
	* shlib-versions: Version symbol definitions for hppa-linux.
	* sysdeps/unix/sysv/linux/configure.in: Define $arch_minimum_kernel
	for hppa.

2000-10-12  David Huggins-Daines  <dhd@linuxcare.com>

	* sysdeps/hppa/Makefile: New file.
	* sysdeps/hppa/Versions: New file.

	* sysdeps/hppa/setjmp.S: New file.
	* sysdeps/hppa/__longjmp.S: New file.
	* sysdeps/hppa/bits/setjmp.h: New file.
	* sysdeps/hppa/frame.h: New file.

	* sysdeps/hppa/add_n.s: Don't use %r19 (linkage table pointer).
	* sysdeps/hppa/sub_n.s: Likewise.
	* sysdeps/hppa/lshift.s: Likewise.
	* sysdeps/hppa/rshift.s: Likewise.
	* sysdeps/hppa/udiv_qrnnd.s: Likewise.
	* sysdeps/hppa/hppa1.1/addmul_1.s: Likewise.
	* sysdeps/hppa/hppa1.1/submul_1.s: Likewise.
	* sysdeps/hppa/hppa1.1/mul_1.s: Likewise.
	* sysdeps/hppa/hppa1.1/udiv_qrnnd.s: Likewise.

	* sysdeps/hppa/dl-machine.h: New file.
	* sysdeps/hppa/dl-fptr.c: New file (note that this is almost
	identical to the IA-64 one).
	* sysdeps/hppa/dl-lookupcfg.h: Likewise.
	* sysdeps/hppa/dl-symaddr.c: Likewise.

	* sysdeps/hppa/elf/initfini.c: New file.
	* sysdeps/hppa/elf/start.S: New file.

	* sysdeps/hppa/fpu/bits/fenv.h: New file.
	* sysdeps/hppa/fpu/fclrexcpt.c: New file.
	* sysdeps/hppa/fpu/fedisblxcpt.c: New file.
	* sysdeps/hppa/fpu/feenablxcpt.c: New file.
	* sysdeps/hppa/fpu/fegetenv.c: New file.
	* sysdeps/hppa/fpu/fegetexcept.c: New file.
	* sysdeps/hppa/fpu/fegetround.c: New file.
	* sysdeps/hppa/fpu/feholdexcpt.c: New file.
	* sysdeps/hppa/fpu/fesetenv.c: New file.
	* sysdeps/hppa/fpu/fesetround.c: New file.
	* sysdeps/hppa/fpu/feupdateenv.c: New file.
	* sysdeps/hppa/fpu/fegetexcptflg.c: New file.
	* sysdeps/hppa/fpu/fraiseexcpt.c: New file.
	* sysdeps/hppa/fpu/fsetexcptflg.c: New file.
	* sysdeps/hppa/fpu/ftestexcept.c: New file.

	* sysdeps/unix/sysv/linux/hppa/Makefile: New file.
	* sysdeps/unix/sysv/linux/hppa/Versions: New file.
	* sysdeps/unix/sysv/linux/hppa/syscalls.list: New file.
	* sysdeps/unix/sysv/linux/hppa/sysdep.c: New file.
	* sysdeps/unix/sysv/linux/hppa/sysdep.h: New file.

	* sysdeps/unix/sysv/linux/hppa/bits/fcntl.h: New file.
	* sysdeps/unix/sysv/linux/hppa/bits/ioctls.h: New file.
	* sysdeps/unix/sysv/linux/hppa/bits/mman.h: New file.
	* sysdeps/unix/sysv/linux/hppa/bits/sigaction.h: New file.
	* sysdeps/unix/sysv/linux/hppa/bits/signum.h: New file.
	* sysdeps/unix/sysv/linux/hppa/brk.c: New file.
	* sysdeps/unix/sysv/linux/hppa/clone.S: New file.
	* sysdeps/unix/sysv/linux/hppa/socket.S: New file.
	* sysdeps/unix/sysv/linux/hppa/syscall.S: New file.
	* sysdeps/unix/sysv/linux/hppa/setrlimit.c: New file.
	* sysdeps/unix/sysv/linux/hppa/getrlimit.c: New file.
	* sysdeps/unix/sysv/linux/hppa/getrlimit64.c: New file.
	* sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h: New file.
	* sysdeps/unix/sysv/linux/hppa/kernel_stat.h: New file.
	* sysdeps/unix/sysv/linux/hppa/mmap.c: New file.
	* sysdeps/unix/sysv/linux/hppa/profil-counter.h: New file.
	* sysdeps/unix/sysv/linux/hppa/procfs.h: New file.
	* sysdeps/unix/sysv/linux/hppa/ucontext.h: New file.
	* sysdeps/unix/sysv/linux/hppa/umount.c: New file.

2000-10-12  Alan Modra  <alan@linuxcare.com.au>

	* sysdeps/hppa/hppa1.1/Implies: New file.
	* sysdeps/hppa/memusage.h: New file.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/printf_fphex.c11
-rw-r--r--sysdeps/gnu/siglist.c8
-rw-r--r--sysdeps/hppa/Makefile26
-rw-r--r--sysdeps/hppa/Versions6
-rw-r--r--sysdeps/hppa/__longjmp.S72
-rw-r--r--sysdeps/hppa/add_n.s68
-rw-r--r--sysdeps/hppa/bits/setjmp.h41
-rw-r--r--sysdeps/hppa/dl-fptr.c212
-rw-r--r--sysdeps/hppa/dl-lookupcfg.h36
-rw-r--r--sysdeps/hppa/dl-machine.h605
-rw-r--r--sysdeps/hppa/dl-symaddr.c39
-rw-r--r--sysdeps/hppa/elf/initfini.c117
-rw-r--r--sysdeps/hppa/elf/start.S58
-rw-r--r--sysdeps/hppa/fpu/bits/fenv.h78
-rw-r--r--sysdeps/hppa/fpu/fclrexcpt.c37
-rw-r--r--sysdeps/hppa/fpu/fedisblxcpt.c37
-rw-r--r--sysdeps/hppa/fpu/feenablxcpt.c37
-rw-r--r--sysdeps/hppa/fpu/fegetenv.c33
-rw-r--r--sysdeps/hppa/fpu/fegetexcept.c32
-rw-r--r--sysdeps/hppa/fpu/fegetround.c32
-rw-r--r--sysdeps/hppa/fpu/feholdexcpt.c60
-rw-r--r--sysdeps/hppa/fpu/fesetenv.c70
-rw-r--r--sysdeps/hppa/fpu/fesetround.c39
-rw-r--r--sysdeps/hppa/fpu/feupdateenv.c40
-rw-r--r--sysdeps/hppa/fpu/fgetexcptflg.c36
-rw-r--r--sysdeps/hppa/fpu/fraiseexcpt.c89
-rw-r--r--sysdeps/hppa/fpu/fsetexcptflg.c41
-rw-r--r--sysdeps/hppa/fpu/ftestexcept.c32
-rw-r--r--sysdeps/hppa/frame.h28
-rw-r--r--sysdeps/hppa/hppa1.1/Implies4
-rw-r--r--sysdeps/hppa/hppa1.1/addmul_1.s100
-rw-r--r--sysdeps/hppa/hppa1.1/mul_1.s100
-rw-r--r--sysdeps/hppa/hppa1.1/submul_1.s102
-rw-r--r--sysdeps/hppa/hppa1.1/udiv_qrnnd.s69
-rw-r--r--sysdeps/hppa/lshift.s54
-rw-r--r--sysdeps/hppa/memusage.h22
-rw-r--r--sysdeps/hppa/rshift.s54
-rw-r--r--sysdeps/hppa/setjmp.S69
-rw-r--r--sysdeps/hppa/sub_n.s68
-rw-r--r--sysdeps/hppa/sysdep.h18
-rw-r--r--sysdeps/hppa/udiv_qrnnd.s82
-rw-r--r--sysdeps/ia64/fpu/printf_fphex.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/printf_fphex.c10
-rw-r--r--sysdeps/ieee754/ldbl-96/printf_fphex.c10
-rw-r--r--sysdeps/unix/sysv/linux/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/bits/initspin.h1
-rw-r--r--sysdeps/unix/sysv/linux/configure9
-rw-r--r--sysdeps/unix/sysv/linux/configure.in3
-rw-r--r--sysdeps/unix/sysv/linux/errlist.c4
-rw-r--r--sysdeps/unix/sysv/linux/hppa/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/Versions6
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/errno.h57
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/fcntl.h148
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/ioctls.h37
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/mman.h61
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/sigaction.h75
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/signum.h82
-rw-r--r--sysdeps/unix/sysv/linux/hppa/brk.c47
-rw-r--r--sysdeps/unix/sysv/linux/hppa/clone.S82
-rw-r--r--sysdeps/unix/sysv/linux/hppa/getrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h18
-rw-r--r--sysdeps/unix/sysv/linux/hppa/kernel_stat.h32
-rw-r--r--sysdeps/unix/sysv/linux/hppa/mmap.c50
-rw-r--r--sysdeps/unix/sysv/linux/hppa/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/setrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/socket.S10
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sys/procfs.h113
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sys/ucontext.h68
-rw-r--r--sysdeps/unix/sysv/linux/hppa/syscall.S28
-rw-r--r--sysdeps/unix/sysv/linux/hppa/syscalls.list39
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sysdep.c34
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sysdep.h242
-rw-r--r--sysdeps/unix/sysv/linux/hppa/umount.c9
74 files changed, 3678 insertions, 375 deletions
diff --git a/sysdeps/generic/printf_fphex.c b/sysdeps/generic/printf_fphex.c
index d4cba3f4e7..9a80ba833b 100644
--- a/sysdeps/generic/printf_fphex.c
+++ b/sysdeps/generic/printf_fphex.c
@@ -427,11 +427,15 @@ __printf_fphex (FILE *fp,
   /* Now we have all information to compute the size.  */
   width -= ((negative || info->showsign || info->space)
 	    /* Sign.  */
-	    + 2    + 1 + 1 + precision + 1 + 1
+	    + 2    + 1 + 0 + precision + 1 + 1
 	    /* 0x    h   .   hhh         P   ExpoSign.  */
 	    + ((expbuf + sizeof expbuf) - expstr));
 	    /* Exponent.  */
 
+  /* Count the decimal point.  */
+  if (precision > 0 || info->alt)
+    width -= wide ? 1 : strlen (decimal);
+
   /* A special case when the mantissa or the precision is zero and the `#'
      is not given.  In this case we must not print the decimal point.  */
   if (precision == 0 && !info->alt)
@@ -463,9 +467,10 @@ __printf_fphex (FILE *fp,
 
   if (precision > 0)
     {
+      ssize_t tofill = precision - (numend - numstr);
       PRINT (numstr, wnumstr, MIN (numend - numstr, precision));
-      if (precision > numend - numstr)
-	PADN ('0', precision - (numend - numstr));
+      if (tofill > 0)
+	PADN ('0', tofill);
     }
 
   if (info->left && info->pad == '0' && width > 0)
diff --git a/sysdeps/gnu/siglist.c b/sysdeps/gnu/siglist.c
index 0cb30df82f..adc7ecc810 100644
--- a/sysdeps/gnu/siglist.c
+++ b/sysdeps/gnu/siglist.c
@@ -33,7 +33,7 @@
 
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-asm (".data; .globl __old_sys_siglist;  __old_sys_siglist:");
+asm (".data\n\t.globl __old_sys_siglist\n__old_sys_siglist:");
 #endif
 
 const char *const __new_sys_siglist[NSIG] =
@@ -44,10 +44,10 @@ const char *const __new_sys_siglist[NSIG] =
 };
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-asm (".type __old_sys_siglist,@object;.size __old_sys_siglist,"
+asm (".type __old_sys_siglist,@object\n\t.size __old_sys_siglist,"
         OLD_SIGLIST_SIZE_STR "*" PTR_SIZE_STR);
 
-asm (".data; .globl __old_sys_sigabbrev;  __old_sys_sigabbrev:");
+asm (".data\n\t.globl __old_sys_sigabbrev\n__old_sys_sigabbrev:");
 #endif
 
 const char *const __new_sys_sigabbrev[NSIG] =
@@ -58,7 +58,7 @@ const char *const __new_sys_sigabbrev[NSIG] =
 };
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-asm (".type __old_sys_sigabbrev,@object;.size __old_sys_sigabbrev,"
+asm (".type __old_sys_sigabbrev,@object\n\t.size __old_sys_sigabbrev,"
         OLD_SIGLIST_SIZE_STR "*" PTR_SIZE_STR);
 
 extern const char *const *__old_sys_siglist;
diff --git a/sysdeps/hppa/Makefile b/sysdeps/hppa/Makefile
new file mode 100644
index 0000000000..f6ad84358a
--- /dev/null
+++ b/sysdeps/hppa/Makefile
@@ -0,0 +1,26 @@
+# Copyright (C) 2000 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+# Contributed by David Huggins-Daines (dhd@debian.org)
+
+# 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.
+
+# We need this for all shared objects since the build process uses ld -r
+CFLAGS-.os += -ffunction-sections
+
+ifeq ($(subdir),elf)
+dl-routines += dl-symaddr dl-fptr
+rtld-routines += dl-symaddr dl-fptr
+endif
diff --git a/sysdeps/hppa/Versions b/sysdeps/hppa/Versions
new file mode 100644
index 0000000000..0c447d9f28
--- /dev/null
+++ b/sysdeps/hppa/Versions
@@ -0,0 +1,6 @@
+ld {
+  GLIBC_2.2 {
+    # hppa specific functions in the dynamic linker, but used by libc.so.
+    _dl_symbol_address; _dl_unmap; _dl_lookup_address;
+  }
+}
diff --git a/sysdeps/hppa/__longjmp.S b/sysdeps/hppa/__longjmp.S
new file mode 100644
index 0000000000..418a0b48ce
--- /dev/null
+++ b/sysdeps/hppa/__longjmp.S
@@ -0,0 +1,72 @@
+/* longjmp for PA-RISC.
+   Copyright (C) 1997, 1998 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>
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+/* __longjmp(jmpbuf, val) */
+
+	.text
+	.align 4
+	.globl __longjmp
+	.export __longjmp, code
+	.proc
+	.callinfo
+__longjmp:	
+	/* set return value */
+	copy	%r25, %r28
+	
+	ldw	0(%r26), %r3
+	ldw	8(%r26), %r4
+	ldw	12(%r26), %r5
+	ldw	16(%r26), %r6
+	ldw	20(%r26), %r7
+	ldw	24(%r26), %r8
+	ldw	28(%r26), %r9
+	ldw	32(%r26), %r10
+	ldw	36(%r26), %r11
+	ldw	40(%r26), %r12
+	ldw	44(%r26), %r13
+	ldw	48(%r26), %r14
+	ldw	52(%r26), %r15
+	ldw	56(%r26), %r16
+	ldw	60(%r26), %r17
+	ldw	64(%r26), %r18
+	ldw	68(%r26), %r19
+	ldw	72(%r26), %r27
+	ldw	76(%r26), %r30
+	
+	ldw	80(%r26), %rp
+
+	ldo	88(%r26),%r20
+	fldds,ma 8(%r20), %fr12
+	fldds,ma 8(%r20), %fr13
+	fldds,ma 8(%r20), %fr14
+	fldds,ma 8(%r20), %fr15
+	fldds,ma 8(%r20), %fr16
+	fldds,ma 8(%r20), %fr17
+	fldds,ma 8(%r20), %fr18
+	fldds,ma 8(%r20), %fr19
+	fldds,ma 8(%r20), %fr20
+	fldds	 0(%r20), %fr21
+
+	bv,n	%r0(%r2)
+	.procend
diff --git a/sysdeps/hppa/add_n.s b/sysdeps/hppa/add_n.s
index b4a1428362..87b7cd7131 100644
--- a/sysdeps/hppa/add_n.s
+++ b/sysdeps/hppa/add_n.s
@@ -1,56 +1,56 @@
-; HP-PA  __mpn_add_n -- Add two limb vectors of the same length > 0 and store
-; sum in a third limb vector.
+;! HP-PA  __mpn_add_n -- Add two limb vectors of the same length > 0 and store
+;! sum in a third limb vector.
 
-; Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
 
-; This file is part of the GNU MP Library.
+;! This file is part of the GNU MP Library.
 
-; The GNU MP 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 MP 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 MP 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.
+;! The GNU MP 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 MP 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.
+;! You should have received a copy of the GNU Library General Public License
+;! along with the GNU MP 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.
 
 
-; INPUT PARAMETERS
-; res_ptr	gr26
-; s1_ptr	gr25
-; s2_ptr	gr24
-; size		gr23
+;! INPUT PARAMETERS
+;! res_ptr	gr26
+;! s1_ptr	gr25
+;! s2_ptr	gr24
+;! size		gr23
 
-; One might want to unroll this as for other processors, but it turns
-; out that the data cache contention after a store makes such
-; unrolling useless.  We can't come under 5 cycles/limb anyway.
+;! One might want to unroll this as for other processors, but it turns
+;! out that the data cache contention after a store makes such
+;! unrolling useless.  We can't come under 5 cycles/limb anyway.
 
-	.code
+	.text
 	.export		__mpn_add_n
-__mpn_add_n
+__mpn_add_n:
 	.proc
 	.callinfo	frame=0,no_calls
 	.entry
 
-	ldws,ma		4(0,%r25),%r20
-	ldws,ma		4(0,%r24),%r19
+	ldws,ma		4(0,%r25),%r21
+	ldws,ma		4(0,%r24),%r20
 
-	addib,=		-1,%r23,L$end	; check for (SIZE == 1)
-	 add		%r20,%r19,%r28	; add first limbs ignoring cy
+	addib,=		-1,%r23,L$end	;! check for (SIZE == 1)
+	 add		%r21,%r20,%r28	;! add first limbs ignoring cy
 
-L$loop	ldws,ma		4(0,%r25),%r20
-	ldws,ma		4(0,%r24),%r19
+L$loop:	ldws,ma		4(0,%r25),%r21
+	ldws,ma		4(0,%r24),%r20
 	stws,ma		%r28,4(0,%r26)
 	addib,<>	-1,%r23,L$loop
-	 addc		%r20,%r19,%r28
+	 addc		%r21,%r20,%r28
 
-L$end	stws		%r28,0(0,%r26)
+L$end:	stws		%r28,0(0,%r26)
 	bv		0(%r2)
 	 addc		%r0,%r0,%r28
 
diff --git a/sysdeps/hppa/bits/setjmp.h b/sysdeps/hppa/bits/setjmp.h
new file mode 100644
index 0000000000..f72cdb5d86
--- /dev/null
+++ b/sysdeps/hppa/bits/setjmp.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 2000 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.  */
+
+/* Define the machine-dependent type `jmp_buf'.  HPPA version.  */
+
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
+   We use an array of 'double' instead, to make writing the assembler
+   easier, and to ensure proper alignment. Naturally, user code should
+   not depend on either representation. */
+
+#if defined __USE_MISC || defined _ASM
+#define JB_SP (76/4)
+#endif
+
+#ifndef	_ASM
+typedef double __jmp_buf[21];
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame containing a local
+   variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(_jmpbuf, _address)				\
+     ((void *)(_address) > (void *)(((unsigned long *) _jmpbuf)[JB_SP]))
diff --git a/sysdeps/hppa/dl-fptr.c b/sysdeps/hppa/dl-fptr.c
new file mode 100644
index 0000000000..8a2c1c214d
--- /dev/null
+++ b/sysdeps/hppa/dl-fptr.c
@@ -0,0 +1,212 @@
+/* Make dynamic PLABELs for function pointers. HPPA version.
+   Copyright (C) 1999, 2000 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 <unistd.h>
+#include <string.h>
+#include <sys/param.h>
+#include <sys/mman.h>
+#include <link.h>
+#include <errno.h>
+#include <ldsodefs.h>
+#include <elf/dynamic-link.h>
+#include <dl-machine.h>
+#ifdef _LIBC_REENTRANT
+# include <pt-machine.h>
+
+/* Remember, we use 0 to mean that a lock is taken on PA-RISC. */
+static int __hppa_fptr_lock = 1;
+#endif
+
+/* Because ld.so is now versioned, these functions can be in their own
+   file; no relocations need to be done to call them.  Of course, if
+   ld.so is not versioned...  */
+#if 0
+#ifndef DO_VERSIONING
+# error "This will not work with versioning turned off, sorry."
+#endif
+#endif
+
+#ifdef MAP_ANON
+/* The fd is not examined when using MAP_ANON.  */
+#define ANONFD -1
+#else
+extern int _dl_zerofd;
+#define ANONFD _dl_zerofd
+#endif
+
+struct hppa_fptr __boot_ldso_fptr[HPPA_BOOT_FPTR_SIZE];
+struct hppa_fptr *__fptr_root = NULL;
+struct hppa_fptr *__fptr_next = __boot_ldso_fptr;
+static struct hppa_fptr *__fptr_free = NULL;
+int __fptr_count = HPPA_BOOT_FPTR_SIZE;
+
+Elf32_Addr
+__hppa_make_fptr (const struct link_map *sym_map, Elf32_Addr value,
+		  struct hppa_fptr **root, struct hppa_fptr *mem)
+{
+  struct hppa_fptr **loc;
+  struct hppa_fptr *f;
+
+#ifdef _LIBC_REENTRANT
+  /* Make sure we are alone. We don't need a lock during bootstrap. */
+  if (mem == NULL)
+    while (testandset (&__hppa_fptr_lock));
+#endif
+
+  /* Search the sorted linked list for an existing entry for this
+     symbol.  */
+  loc = root;
+  f = *loc;
+  while (f != NULL && f->func <= value)
+    {
+      if (f->func == value)
+	goto found;
+      loc = &f->next;
+      f = *loc;
+    }
+
+  /* Not found.  Create a new one.  */
+  if (mem != NULL)
+    f = mem;
+  else if (__fptr_free != NULL)
+    {
+      f = __fptr_free;
+      __fptr_free = f->next;
+    }
+  else
+    {
+      if (__fptr_count == 0)
+	{
+#ifndef MAP_ANON
+# define MAP_ANON 0
+	  if (_dl_zerofd == -1)
+	    {
+	      _dl_zerofd = _dl_sysdep_open_zero_fill ();
+	      if (_dl_zerofd == -1)
+		{
+		  __close (fd);
+		  _dl_signal_error (errno, NULL,
+				    "cannot open zero fill device");
+		}
+	    }
+#endif
+
+	  __fptr_next = __mmap (0, _dl_pagesize, PROT_READ | PROT_WRITE,
+				MAP_ANON | MAP_PRIVATE, ANONFD, 0);
+	  if (__fptr_next == MAP_FAILED)
+	    _dl_signal_error(errno, NULL, "cannot map page for fptr");
+	  __fptr_count = _dl_pagesize / sizeof (struct hppa_fptr);
+	}
+      f = __fptr_next++;
+      __fptr_count--;
+    }
+
+  f->func = value;
+  /* GOT has already been relocated in elf_get_dynamic_info - don't
+     try to relocate it again.  */
+  f->gp = sym_map->l_info[DT_PLTGOT]->d_un.d_ptr;
+  f->next = *loc;
+  *loc = f;
+
+found:
+#ifdef _LIBC_REENTRANT
+  /* Release the lock.  Again, remember, zero means the lock is taken!  */
+  if (mem == NULL)
+    __hppa_fptr_lock = 1;
+#endif
+
+  /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */
+  return (Elf32_Addr) f | 2;
+}
+
+void
+_dl_unmap (struct link_map *map)
+{
+  struct hppa_fptr **floc;
+  struct hppa_fptr *f;
+  struct hppa_fptr **lloc;
+  struct hppa_fptr *l;
+
+  __munmap ((void *) map->l_map_start, map->l_map_end - map->l_map_start);
+
+#ifdef _LIBC_REENTRANT
+  /* Make sure we are alone.  */
+  while (testandset (&__hppa_fptr_lock));
+#endif
+
+  /* Search the sorted linked list for the first entry for this object.  */
+  floc = &__fptr_root;
+  f = *floc;
+  while (f != NULL && f->func < map->l_map_start)
+    {
+      floc = &f->next;
+      f = *floc;
+    }
+
+  /* We found one.  */
+  if (f != NULL && f->func < map->l_map_end)
+    {
+      /* Get the last entry.  */
+      lloc = floc;
+      l = f;
+      while (l && l->func < map->l_map_end)
+	{
+	  lloc = &l->next;
+	  l = *lloc;
+	}
+
+      /* Updated FPTR.  */
+      *floc = l;
+
+      /* Prepend them to the free list.  */
+      *lloc = __fptr_free;
+      __fptr_free = f;
+    }
+
+#ifdef _LIBC_REENTRANT
+  /* Release the lock. */
+  __hppa_fptr_lock = 1;
+#endif
+}
+
+Elf32_Addr
+_dl_lookup_address (const void *address)
+{
+  Elf32_Addr addr = (Elf32_Addr) address;
+  struct hppa_fptr *f;
+
+#ifdef _LIBC_REENTRANT
+  /* Make sure we are alone.  */
+  while (testandset (&__hppa_fptr_lock));
+#endif
+
+  for (f = __fptr_root; f != NULL; f = f->next)
+    if (f == address)
+      {
+	addr = f->func;
+	break;
+      }
+
+#ifdef _LIBC_REENTRANT
+  /* Release the lock.   */
+  __hppa_fptr_lock = 1;
+#endif
+
+  return addr;
+}
diff --git a/sysdeps/hppa/dl-lookupcfg.h b/sysdeps/hppa/dl-lookupcfg.h
new file mode 100644
index 0000000000..4f5f8998a7
--- /dev/null
+++ b/sysdeps/hppa/dl-lookupcfg.h
@@ -0,0 +1,36 @@
+/* Configuration of lookup functions.
+   Copyright (C) 2000 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.  */
+
+/* Like IA-64, PA-RISC needs more information from the symbol lookup
+   function than just the address. */
+#define DL_LOOKUP_RETURNS_MAP
+#define ELF_FUNCTION_PTR_IS_SPECIAL
+#define DL_UNMAP_IS_SPECIAL
+
+void *_dl_symbol_address (const struct link_map *map, const ElfW(Sym) *ref);
+
+#define DL_SYMBOL_ADDRESS(map, ref) _dl_symbol_address(map, ref)
+
+Elf32_Addr _dl_lookup_address (const void *address);
+
+#define DL_LOOKUP_ADDRESS(addr) _dl_lookup_address (addr)
+
+void _dl_unmap (struct link_map *map);
+
+#define DL_UNMAP(map) _dl_unmap (map)
diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
new file mode 100644
index 0000000000..e6782b3481
--- /dev/null
+++ b/sysdeps/hppa/dl-machine.h
@@ -0,0 +1,605 @@
+/* Machine-dependent ELF dynamic relocation inline functions.  PA-RISC version.
+   Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+   Contributed by David Huggins-Daines <dhd@debian.org>
+   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 dl_machine_h
+#define dl_machine_h 1
+
+#define ELF_MACHINE_NAME "hppa"
+
+#include <sys/param.h>
+#include <string.h>
+#include <link.h>
+#include <assert.h>
+
+/* These must match the definition of the stub in bfd/elf32-hppa.c. */
+#define SIZEOF_PLT_STUB (4*4)
+#define GOT_FROM_PLT_STUB (4*4)
+
+/* A PLABEL is a function descriptor.  Properly they consist of just
+   FUNC and GP.  But we want to traverse a binary tree too.  See
+   dl-fptr.c for the code (it may be made common between HPPA and
+   IA-64 in the future).
+
+   We call these 'fptr' to make it easier to steal code from IA-64. */
+
+/* ld.so currently has 12 PLABEL32 relocs.  We'll keep this constant
+   large for now in case we require more, as the rest of these will be
+   used by the dynamic program itself (libc.so has quite a few
+   PLABEL32 relocs in it). */
+#define HPPA_BOOT_FPTR_SIZE	256
+
+struct hppa_fptr
+{
+  Elf32_Addr func;
+  Elf32_Addr gp;
+  struct hppa_fptr *next;
+};
+
+extern struct hppa_fptr __boot_ldso_fptr[];
+extern struct hppa_fptr *__fptr_root;
+extern int __fptr_count;
+
+extern Elf32_Addr __hppa_make_fptr (const struct link_map *, Elf32_Addr,
+				    struct hppa_fptr **, struct hppa_fptr *);
+
+/* Return nonzero iff E_MACHINE is compatible with the running host.  */
+static inline int
+elf_machine_matches_host (Elf32_Half e_machine)
+{
+  return e_machine == EM_PARISC;
+}
+
+
+/* Return the link-time address of _DYNAMIC.  */
+static inline Elf32_Addr
+elf_machine_dynamic (void)
+{
+  Elf32_Addr dynamic;
+
+#if 0
+  /* Use this method if GOT address not yet set up.  */
+  asm ("\
+	b,l	1f,%0
+	depi	0,31,2,%0
+1:	addil	L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 8),%0
+	ldw	R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 12)(%%r1),%0"
+      : "=r" (dynamic) : : "r1");
+#else
+  /* This works because we already have our GOT address available.  */
+  dynamic = (Elf32_Addr) &_DYNAMIC;
+#endif
+
+  return dynamic;
+}
+
+/* Return the run-time load address of the shared object.  */
+static inline Elf32_Addr
+elf_machine_load_address (void)
+{
+  Elf32_Addr dynamic, dynamic_linkaddress;
+
+  asm ("\
+	b,l	1f,%0
+	depi	0,31,2,%0
+1:	addil	L'_DYNAMIC - ($PIC_pcrel$0 - 8),%0
+	ldo	R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%%r1),%1
+	addil	L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 16),%0
+	ldw	R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 20)(%%r1),%0"
+   : "=r" (dynamic_linkaddress), "=r" (dynamic) : : "r1");
+
+  return dynamic - dynamic_linkaddress;
+}
+
+/* Fixup a PLT entry to bounce directly to the function at VALUE.  */
+static inline Elf32_Addr
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+		       const Elf32_Rela *reloc,
+		       Elf32_Addr *reloc_addr, Elf32_Addr value)
+{
+  /* l is the link_map for the caller, t is the link_map for the object
+   * being called */
+  reloc_addr[1] = D_PTR (t, l_info[DT_PLTGOT]);
+  reloc_addr[0] = value;
+  /* Return the PLT slot rather than the function value so that the
+     trampoline can load the new LTP. */
+  return (Elf32_Addr) reloc_addr;
+}
+
+/* Return the final value of a plt relocation.  */
+static inline Elf32_Addr
+elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
+		       Elf32_Addr value)
+{
+  /* We are rela only */
+  return value + reloc->r_addend;
+}
+
+/* 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.  */
+
+static inline int
+elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
+{
+  extern void _dl_runtime_resolve (void);
+  extern void _dl_runtime_profile (void);
+  Elf32_Addr jmprel = D_PTR(l, l_info[DT_JMPREL]);
+
+  if (lazy && jmprel)
+    {
+      Elf32_Addr *got = NULL;
+      Elf32_Addr l_addr;
+      Elf32_Addr end_jmprel;
+      Elf32_Addr iplt;
+
+      /* Relocate all the PLT slots.  */
+      l_addr = l->l_addr;
+      end_jmprel = jmprel + l->l_info[DT_PLTRELSZ]->d_un.d_val;
+      for (iplt = jmprel; iplt < end_jmprel; iplt += sizeof (Elf32_Rela))
+	{
+	  const Elf32_Rela *reloc;
+	  Elf32_Word r_type;
+	  Elf32_Word r_sym;
+	  struct hppa_fptr *fptr;
+
+	  reloc = (const Elf32_Rela *) iplt;
+	  r_type = ELF32_R_TYPE (reloc->r_info);
+	  r_sym = ELF32_R_SYM (reloc->r_info);
+
+	  if (__builtin_expect (r_type == R_PARISC_IPLT, 1))
+	    {
+	      fptr = (struct hppa_fptr *) (reloc->r_offset + l_addr);
+	      if (r_sym != 0)
+		{
+		  /* Relocate the pointer to the stub.  */
+		  fptr->func += l_addr;
+		  /* Instead of the LTP value, we put the reloc offset
+		     here.  The trampoline code will load the proper
+		     LTP and pass the reloc offset to the fixup
+		     function.  */
+		  fptr->gp = iplt - jmprel;
+		  if (!got)
+		    {
+		      static union {
+			unsigned char c[8];
+			Elf32_Addr i[2];
+		      } sig = {{0x00,0xc0,0xff,0xee, 0xde,0xad,0xbe,0xef}};
+
+		      /* Find our .got section.  It's right after the
+			 stub.  */
+		      got = (Elf32_Addr *) (fptr->func + GOT_FROM_PLT_STUB);
+
+		      /* Sanity check to see if the address we are
+                         going to check below is within a reasonable
+                         approximation of the bounds of the PLT (or,
+                         at least, is at an address that won't fault
+                         on read).  Then check for the magic signature
+                         above. */
+		      if (fptr->func < (Elf32_Addr) fptr + sizeof(*fptr))
+			  return 0;
+		      if (fptr->func >
+			  ((Elf32_Addr) fptr
+			   + SIZEOF_PLT_STUB
+			   + ((l->l_info[DT_PLTRELSZ]->d_un.d_val / sizeof (Elf32_Rela))
+			      * 8)))
+			return 0;
+		      if (got[-2] != sig.i[0] || got[-1] != sig.i[1])
+			return 0; /* No lazy linking for you! */
+		    }
+		}
+	      else
+		{
+		  /* Relocate this *ABS* entry.  */
+		  fptr->func = reloc->r_addend + l_addr;
+		  fptr->gp = D_PTR (l, l_info[DT_PLTGOT]);
+		}
+	    }
+	  else if (__builtin_expect (r_type != R_PARISC_NONE, 0))
+	    _dl_reloc_bad_type (l, r_type, 1);
+	}
+
+      if (got)
+	{
+	  register Elf32_Addr ltp __asm__ ("%r19");
+	  /* Identify this shared object. */
+	  got[1] = (Elf32_Addr) l;
+
+	  /* This function will be called to perform the relocation. */
+	  if (__builtin_expect (!profile, 1))
+	    got[-2] =
+	      (Elf32_Addr) ((struct hppa_fptr *)
+			    ((unsigned long) &_dl_runtime_resolve & ~3))->func;
+	  else
+	    {
+	      if (_dl_name_match_p (_dl_profile, l))
+		{
+		  /* This is the object we are looking for.  Say that
+		     we really want profiling and the timers are
+		     started.  */
+		  _dl_profile_map = l;
+		}
+	      got[-2] =
+		(Elf32_Addr) ((struct hppa_fptr *)
+			      ((unsigned long) &_dl_runtime_profile & ~3))->func;
+	    }
+	  got[-1] = ltp;
+	}
+    }
+  return lazy;
+}
+
+/* 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.  */
+
+#define RTLD_START asm ("\
+	.text
+	.globl _start
+	.type _start,@function
+_start:	
+	/* The kernel does not give us an initial stack frame. */
+	ldo	64(%sp),%sp
+	/* Save the relevant arguments (yes, those are the correct
+           registers, the kernel is weird) in their stack slots. */
+	stw	%r25,-40(%sp) /* argc */
+	stw	%r24,-44(%sp) /* argv */
+
+	/* We need the LTP, and we need it now. */
+	/* $PIC_pcrel$0 points 8 bytes past the current instruction,
+	   just like a branch reloc.  This sequence gets us the runtime
+	   address of _DYNAMIC. */
+	bl	0f,%r19
+	depi	0,31,2,%r19	/* clear priviledge bits */
+0:	addil	L'_DYNAMIC - ($PIC_pcrel$0 - 8),%r19
+	ldo	R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%r1),%r26
+
+	/* Also get the link time address from the first entry of the GOT.  */
+	addil	L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 16),%r19
+	ldw	R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 20)(%r1),%r20
+
+	sub	%r26,%r20,%r20	/* Calculate load offset */
+
+	/* Rummage through the dynamic entries, looking for DT_PLTGOT.  */
+	ldw,ma	8(%r26),%r19
+1:	cmpib,=,n 3,%r19,2f	/* tag == DT_PLTGOT? */
+	cmpib,<>,n 0,%r19,1b
+	ldw,ma	8(%r26),%r19
+
+	/* Uh oh!  We didn't find one.  Abort. */
+	iitlbp	%r0,(%r0)
+
+2:	ldw	-4(%r26),%r19	/* Found it, load value. */
+	add	%r19,%r20,%r19	/* And add the load offset. */
+
+	/* Our initial stack layout is rather different from everyone
+	   else's due to the unique PA-RISC ABI.  As far as I know it
+	   looks like this:
+
+	   -----------------------------------  (this frame created above)
+	   |         32 bytes of magic       |
+	   |---------------------------------|
+	   | 32 bytes argument/sp save area  |
+	   |---------------------------------|  ((current->mm->env_end) + 63 & ~63)
+	   |         N bytes of slack        |
+	   |---------------------------------|
+	   |      envvar and arg strings     |
+	   |---------------------------------|
+	   |	    ELF auxiliary info	     |
+	   |         (up to 28 words)        |
+	   |---------------------------------|
+	   |  Environment variable pointers  |
+	   |         upwards to NULL	     |
+	   |---------------------------------|
+	   |        Argument pointers        |
+	   |         upwards to NULL	     |
+	   |---------------------------------|
+	   |          argc (1 word)          |
+	   -----------------------------------
+
+	  So, obviously, we can't just pass %sp to _dl_start.  That's
+	  okay, argv-4 will do just fine.
+
+	  The pleasant part of this is that if we need to skip
+	  arguments we can just decrement argc and move argv, because
+	  the stack pointer is utterly unrelated to the location of
+	  the environment and argument vectors. */
+
+	/* This is always within range so we'll be okay. */
+	bl	_dl_start,%rp
+	ldo	-4(%r24),%r26
+
+	/* FALLTHRU */
+	.globl _dl_start_user
+	.type _dl_start_user,@function
+_dl_start_user:
+	/* Save the entry point in %r3. */
+	copy	%ret0,%r3
+
+	/* Remember the lowest stack address. */
+	addil	LT'__libc_stack_end,%r19
+	ldw	RT'__libc_stack_end(%r1),%r20
+	stw	%sp,0(%r20)
+
+	/* See if we were called as a command with the executable file
+	   name as an extra leading argument. */
+	addil	LT'_dl_skip_args,%r19
+	ldw	RT'_dl_skip_args(%r1),%r20
+	ldw	0(%r20),%r20
+
+	ldw	-40(%sp),%r25	/* argc */
+	comib,=	0,%r20,.Lnofix  /* FIXME: will be mispredicted */
+	ldw	-44(%sp),%r24   /* argv (delay slot) */
+
+	sub	%r25,%r20,%r25
+	stw	%r25,-40(%sp)
+	sh2add	%r20,%r24,%r24
+	stw	%r24,-44(%sp)
+
+.Lnofix:
+	/* Call _dl_init(_dl_loaded, argc, argv, envp). */
+	addil	LT'_dl_loaded,%r19
+	ldw	RT'_dl_loaded(%r1),%r26
+	ldw	0(%r26),%r26
+	/* envp = argv + argc + 1 */
+	sh2add	%r25,%r24,%r23	
+	bl	_dl_init,%r2
+	ldo	4(%r23),%r23	/* delay slot */
+
+	/* Reload argc, argv  to the registers start.S expects them in (feh) */
+	ldw	-40(%sp),%r25
+	ldw	-44(%sp),%r24
+
+	/* _dl_fini does have a PLT slot now.  I don't know how to get
+	   to it though, so this hack will remain. */
+	.section .data
+__dl_fini_plabel:
+	.word	_dl_fini
+	.word	0xdeadbeef
+	.previous
+
+	addil	LT'__dl_fini_plabel,%r19
+	ldw	RT'__dl_fini_plabel(%r1),%r23
+	stw	%r19,4(%r23)
+	bv	%r0(%r3)
+	depi	2,31,2,%r23	/* delay slot */");
+
+/* This code gets called via the .plt stub, and is used in
+   dl-runtime.c to call the `fixup' function and then redirect to the
+   address it returns.
+   Enter with r19 = reloc offset, r20 = got-8, r21 = fixup ltp.  */
+#define TRAMPOLINE_TEMPLATE(tramp_name, fixup_name) \
+  extern void tramp_name (void);		    \
+  asm ( "\
+	/* Trampoline for " #tramp_name " */
+	.globl " #tramp_name "
+	.type " #tramp_name ",@function
+" #tramp_name ":
+	/* Save return pointer */
+	stw	%r2,-20(%sp)
+	/* Save argument registers in the call stack frame. */
+	stw	%r26,-36(%sp)
+	stw	%r25,-40(%sp)
+	stw	%r24,-44(%sp)
+	stw	%r23,-48(%sp)
+	/* Build a call frame. */
+	stwm	%sp,64(%sp)
+
+	/* Set up args to fixup func.  */
+	ldw	8+4(%r20),%r26	/* got[1] == struct link_map *  */
+	copy	%r19,%r25	/* reloc offset  */
+
+	/* Call the real address resolver. */
+	bl	" #fixup_name ",%r2
+	copy	%r21,%r19	/* delay slot, set fixup func ltp */
+
+	ldwm	-64(%sp),%sp
+	/* Arguments. */
+	ldw	-36(%sp),%r26
+	ldw	-40(%sp),%r25
+	ldw	-44(%sp),%r24
+	ldw	-48(%sp),%r23
+	/* Return pointer. */
+	ldw	-20(%sp),%r2
+	/* Call the real function. */
+	ldw	0(%r28),%r22
+	bv	%r0(%r22)
+	ldw	4(%r28),%r19
+");
+
+#ifndef PROF
+#define ELF_MACHINE_RUNTIME_TRAMPOLINE			\
+  TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup);	\
+  TRAMPOLINE_TEMPLATE (_dl_runtime_profile, profile_fixup);
+#else
+#define ELF_MACHINE_RUNTIME_TRAMPOLINE			\
+  TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup);	\
+  strong_alias (_dl_runtime_resolve, _dl_runtime_profile);
+#endif
+
+
+/* Nonzero iff TYPE describes a relocation that should
+   skip the executable when looking up the symbol value.  */
+#define elf_machine_lookup_noexec_p(type) ((type) == R_PARISC_COPY)
+
+/* Nonzero iff TYPE describes relocation of a PLT entry, so
+   PLT entries should not be allowed to define the value.  */
+#define elf_machine_lookup_noplt_p(type) ((type) == R_PARISC_IPLT \
+					  || (type) == R_PARISC_EPLT)
+
+/* Used by ld.so for ... something ... */
+#define ELF_MACHINE_JMP_SLOT R_PARISC_IPLT
+
+/* We only use RELA. */
+#define ELF_MACHINE_NO_REL 1
+
+#endif /* !dl_machine_h */
+
+/* These are only actually used where RESOLVE_MAP is defined, anyway. */
+#ifdef RESOLVE_MAP
+
+static inline void
+elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
+		  const Elf32_Sym *sym, const struct r_found_version *version,
+		  Elf32_Addr *const reloc_addr)
+{
+  const Elf32_Sym *const refsym = sym;
+  unsigned long const r_type = ELF32_R_TYPE (reloc->r_info);
+  struct link_map *sym_map;
+  Elf32_Addr value;
+
+#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
+     cannot be done when compiling rtld.c (i.e.  #ifdef RTLD_BOOTSTRAP)
+     because rtld.c contains the common defn for _dl_rtld_map, which is
+     incompatible with a weak decl in the same file.  */
+  weak_extern (_dl_rtld_map);
+#endif
+
+  /* RESOLVE_MAP will return a null value for undefined syms, and
+     non-null for all other syms.  In particular, relocs with no
+     symbol (symbol index of zero), also called *ABS* relocs, will be
+     resolved to MAP.  (The first entry in a symbol table is all
+     zeros, and an all zero Elf32_Sym has a binding of STB_LOCAL.)
+     See RESOLVE_MAP definition in elf/dl-reloc.c  */
+#ifdef RTLD_BOOTSTRAP
+  /* RESOLVE_MAP in rtld.c doesn't have the local sym test.  */
+  sym_map = (ELF32_ST_BIND (sym->st_info) != STB_LOCAL
+	     ? RESOLVE_MAP (&sym, version, r_type) : map);
+#else
+  sym_map = RESOLVE_MAP (&sym, version, r_type);
+#endif
+  if (sym_map)
+    {
+      value = sym ? sym_map->l_addr + sym->st_value : 0;
+      value += reloc->r_addend;
+    }
+  else
+    value = 0;
+
+  switch (r_type)
+    {
+    case R_PARISC_DIR32:
+#ifndef RTLD_BOOTSTRAP
+      /* All hell breaks loose if we try to relocate these twice,
+         because any initialized variables in ld.so that refer to
+         other ones will have their values reset.  In particular,
+         __fptr_next will be reset, sometimes causing endless loops in
+         __hppa_make_fptr().  So don't do that. */
+      if (map == &_dl_rtld_map)
+	return;
+#endif
+      /* Otherwise, nothing more to do here. */
+      break;
+
+    case R_PARISC_PLABEL32:
+      /* Easy rule: If there is a symbol and it is global, then we
+         need to make a dynamic function descriptor.  Otherwise we
+         have the address of a PLT slot for a local symbol which we
+         know to be unique. */
+      if (sym == NULL
+	  || sym_map == NULL
+	  || ELF32_ST_BIND (sym->st_info) == STB_LOCAL)
+	break;
+
+      /* Okay, we need to make ourselves a PLABEL then.  See the IA64
+         code for an explanation of how this works.  */
+#ifndef RTLD_BOOTSTRAP
+      value = __hppa_make_fptr (sym_map, value, &__fptr_root, NULL);
+#else
+      {
+	struct hppa_fptr *p_boot_ldso_fptr;
+	struct hppa_fptr **p_fptr_root;
+	int *p_fptr_count;
+	unsigned long dot;
+
+	/* Go from the top of __boot_ldso_fptr.  As on IA64, we
+	   probably haven't relocated the necessary values by this
+	   point so we have to find them ourselves. */
+
+	asm ("bl	0f,%0
+	      depi	0,31,2,%0
+0:	      addil	L'__boot_ldso_fptr - ($PIC_pcrel$0 - 8),%0
+	      ldo	R'__boot_ldso_fptr - ($PIC_pcrel$0 - 12)(%%r1),%1
+	      addil	L'__fptr_root - ($PIC_pcrel$0 - 16),%0
+	      ldo	R'__fptr_root - ($PIC_pcrel$0 - 20)(%%r1),%2
+	      addil	L'__fptr_count - ($PIC_pcrel$0 - 24),%0
+	      ldo	R'__fptr_count - ($PIC_pcrel$0 - 28)(%%r1),%3"
+	     :
+	     "=r" (dot),
+	     "=r" (p_boot_ldso_fptr),
+	     "=r" (p_fptr_root),
+	     "=r" (p_fptr_count));
+
+	value = __hppa_make_fptr (sym_map, value, p_fptr_root,
+				  &p_boot_ldso_fptr[--*p_fptr_count]);
+      }
+#endif
+      break;
+
+    case R_PARISC_IPLT:
+      if (__builtin_expect (sym_map != NULL, 1))
+	elf_machine_fixup_plt (NULL, sym_map, reloc, reloc_addr, value);
+      else
+	{
+	  /* If we get here, it's a (weak) undefined sym.  */
+	  elf_machine_fixup_plt (NULL, map, reloc, reloc_addr, value);
+	}
+      return;
+
+    case R_PARISC_COPY:
+      if (__builtin_expect (sym == NULL, 0))
+	/* This can happen in trace mode if an object could not be
+	   found.  */
+	break;
+      if (__builtin_expect (sym->st_size > refsym->st_size, 0)
+	  || (__builtin_expect (sym->st_size < refsym->st_size, 0)
+	      && __builtin_expect (_dl_verbose, 0)))
+	{
+	  const char *strtab;
+
+	  strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]);
+	  _dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>",
+			    ": Symbol `", strtab + refsym->st_name,
+			    "' has different size in shared object, "
+			    "consider re-linking\n", NULL);
+	}
+      memcpy (reloc_addr, (void *) value,
+	      MIN (sym->st_size, refsym->st_size));
+      return;
+
+    case R_PARISC_NONE:	/* Alright, Wilbur. */
+      return;
+
+    default:
+      _dl_reloc_bad_type (map, r_type, 0);
+    }
+
+  *reloc_addr = value;
+}
+
+static inline void
+elf_machine_lazy_rel (struct link_map *map,
+		      Elf32_Addr l_addr, const Elf32_Rela *reloc)
+{
+  /* We don't have anything to do here.  elf_machine_runtime_setup has
+     done all the relocs already.  */
+}
+
+#endif /* RESOLVE_MAP */
diff --git a/sysdeps/hppa/dl-symaddr.c b/sysdeps/hppa/dl-symaddr.c
new file mode 100644
index 0000000000..038404a48b
--- /dev/null
+++ b/sysdeps/hppa/dl-symaddr.c
@@ -0,0 +1,39 @@
+/* Get the symbol address.  HPPA version.
+   Copyright (C) 1999, 2000 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 <ldsodefs.h>
+#include <dl-machine.h>
+
+void *
+_dl_symbol_address (const struct link_map *map, const ElfW(Sym) *ref)
+{
+  Elf32_Addr value = (map ? map->l_addr : 0) + ref->st_value;
+
+  /* On hppa, we have to return the pointer to function descriptor. */
+  if (ELFW(ST_TYPE) (ref->st_info) == STT_FUNC)
+    return (void *) __hppa_make_fptr (map, value, &__fptr_root, NULL);
+  else
+    return (void *) value;
+}
+
+ElfW(Addr)
+_dl_start_address (const struct link_map *map, ElfW(Addr) start)
+{
+  return __hppa_make_fptr (map, start, &__fptr_root, NULL);
+}
diff --git a/sysdeps/hppa/elf/initfini.c b/sysdeps/hppa/elf/initfini.c
new file mode 100644
index 0000000000..c058ed0425
--- /dev/null
+++ b/sysdeps/hppa/elf/initfini.c
@@ -0,0 +1,117 @@
+/* Special .init and .fini section support for HPPA
+   Copyright (C) 2000 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.
+
+   In addition to the permissions in the GNU Library General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file.  (The Library General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   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, 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* This file is compiled into assembly code which is then munged by a sed
+   script into two files: crti.s and crtn.s.
+
+   * crti.s puts a function prologue at the beginning of the
+   .init and .fini sections and defines global symbols for
+   those addresses, so they can be called as functions.
+
+   * crtn.s puts the corresponding function epilogues
+   in the .init and .fini sections. */
+
+/* If we use the standard C version, the linkage table pointer won't
+   be properly preserved due to the splitting up of function prologues
+   and epilogues.  Therefore we write these in assembly to make sure
+   they do the right thing.
+
+   Note that we cannot have a weak undefined __gmon_start__, because
+   that would require this to be PIC, and the linker is currently not
+   able to generate a proper procedure descriptor for _init.  Sad but
+   true.  Anyway, HPPA is one of those horrible architectures where
+   making the comparison and indirect call is quite expensive (see the
+   comment in sysdeps/generic/initfini.c). */
+
+__asm__ ("
+
+#include \"defs.h\"
+
+/*@HEADER_ENDS*/
+
+/*@_init_PROLOG_BEGINS*/
+	.section .init
+	.align 4
+	.globl _init
+	.type _init,@function
+	.proc
+	.callinfo
+_init:
+	stw	%rp,-20(%sp)
+	stwm	%r4,64(%sp)
+	stw	%r19,-32(%sp)
+	bl	__gmon_start__,%rp
+	copy	%r19,%r4	/* delay slot */
+	copy	%r4,%r19
+	.align 4
+	.procend
+/*@_init_PROLOG_ENDS*/
+
+/*@_init_EPILOG_BEGINS*/
+	.section .init
+	copy	%r4,%r19
+	ldw	-84(%sp),%rp
+	bv	%r0(%rp)
+	ldwm	-64(%sp),%r4
+        .text
+        .align 4
+        .weak   __gmon_start__
+        .type    __gmon_start__,@function
+	.proc
+	.callinfo
+__gmon_start__:
+        bv,n %r0(%r2)
+	.procend
+/*@_init_EPILOG_ENDS*/
+
+/*@_fini_PROLOG_BEGINS*/
+	.section .fini
+	.align 4
+	.globl _fini
+	.type _fini,@function
+	.proc
+	.callinfo
+_fini:
+	stw	%rp,-20(%sp)
+	stwm	%r4,64(%sp)
+	stw	%r19,-32(%sp)
+	copy	%r19,%r4
+	.align 4
+	.procend
+/*@_fini_PROLOG_ENDS*/
+
+/*@_fini_EPILOG_BEGINS*/
+	.section .fini
+	copy	%r4,%r19
+	ldw	-84(%sp),%rp
+	bv	%r0(%rp)
+	ldwm	-64(%sp),%r4
+/*@_fini_EPILOG_ENDS*/
+
+/*@TRAILER_BEGINS*/
+");
diff --git a/sysdeps/hppa/elf/start.S b/sysdeps/hppa/elf/start.S
new file mode 100644
index 0000000000..88bb790be2
--- /dev/null
+++ b/sysdeps/hppa/elf/start.S
@@ -0,0 +1,58 @@
+
+	.text
+
+	.align 4
+
+	.import main, code
+	.import $global$, data
+	.import __libc_start_main, code
+	.import _fini, code
+	.import _init, code
+
+	
+	
+	
+	.globl _start
+	.export _start, ENTRY
+
+_start:
+
+	.proc
+	.callinfo
+
+	/* load main */
+	ldil	LP%main, %r26
+	ldo	RP%main(%r26), %r26
+
+	/* argc and argv should be in 25 and 24 */
+
+	/* Expand the stack to store the 5th through 7th args */
+	ldo	64(%sp), %sp
+	
+	/* void (*rtld_fini) (void) (actually the 6th arg) */
+	stw	%r23, -56(%sp)
+	
+	/* void (*init) (void) */
+	ldil	LP%_init, %r23
+	ldo	RP%_init(%r23), %r23
+
+	/* void (*fini) (void) */
+	ldil	LP%_fini, %r22
+	ldo	RP%_fini(%r22), %r22
+	stw	%r22, -52(%sp)
+
+	/* void *stack_end */
+	stw	%sp, -60(%sp)
+
+	/* load global */
+	ldil	L%$global$, %dp
+	ldo	R%$global$(%dp), %dp
+
+	bl	__libc_start_main,%r2
+	nop
+	/* die horribly if it returned (it shouldn't) */
+	iitlbp %r0,(%r0)
+	nop
+
+	.procend
+
diff --git a/sysdeps/hppa/fpu/bits/fenv.h b/sysdeps/hppa/fpu/bits/fenv.h
new file mode 100644
index 0000000000..7d25b9947c
--- /dev/null
+++ b/sysdeps/hppa/fpu/bits/fenv.h
@@ -0,0 +1,78 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>
+
+   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 values of the
+   appropriate enable bits in the FPU status word (which,
+   coincidentally, are the same as the flag bits, but shifted right by
+   27 bits).  */
+enum
+{
+  FE_INVALID   = 1<<4, /* V */
+#define FE_INVALID	FE_INVALID
+  FE_DIVBYZERO = 1<<3, /* Z */
+#define FE_DIVBYZERO	FE_DIVBYZERO
+  FE_OVERFLOW  = 1<<2, /* O */
+#define FE_OVERFLOW	FE_OVERFLOW
+  FE_UNDERFLOW = 1<<1, /* U */
+#define FE_UNDERFLOW	FE_UNDERFLOW
+  FE_INEXACT   = 1<<0, /* I */
+#define FE_INEXACT	FE_INEXACT
+};
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The PA-RISC FPU supports all of the four defined rounding modes.
+   We use the values of the RM field in the floating point status
+   register for the appropriate macros.  */
+enum
+  {
+    FE_TONEAREST  = 0 << 9,
+#define FE_TONEAREST	FE_TONEAREST
+    FE_TOWARDZERO = 1 << 9,
+#define FE_TOWARDZERO	FE_TOWARDZERO
+    FE_UPWARD     = 2 << 9,
+#define FE_UPWARD	FE_UPWARD
+    FE_DOWNWARD   = 3 << 9,
+#define FE_DOWNWARD	FE_DOWNWARD
+  };
+
+/* Type representing exception flags. */
+typedef unsigned int fexcept_t;
+
+/* Type representing floating-point environment.  This structure
+   corresponds to the layout of the status and exception words in the
+   register file. */
+typedef struct
+{
+  unsigned int __status_word;
+  unsigned int __exception[7];
+} 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 exceptions are masked.  */
+# define FE_NOMASK_ENV	((fenv_t *) -2)
+#endif
diff --git a/sysdeps/hppa/fpu/fclrexcpt.c b/sysdeps/hppa/fpu/fclrexcpt.c
new file mode 100644
index 0000000000..4c64027310
--- /dev/null
+++ b/sysdeps/hppa/fpu/fclrexcpt.c
@@ -0,0 +1,37 @@
+/* Clear given exceptions in current floating-point environment.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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
+feclearexcept (int excepts)
+{
+  unsigned int sw[2];
+
+  /* Get the current status word. */
+  __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
+
+  /* Clear all the relevant bits. */
+  sw[0] &= ~(excepts & FE_ALL_EXCEPT);
+  __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/hppa/fpu/fedisblxcpt.c b/sysdeps/hppa/fpu/fedisblxcpt.c
new file mode 100644
index 0000000000..95c362a263
--- /dev/null
+++ b/sysdeps/hppa/fpu/fedisblxcpt.c
@@ -0,0 +1,37 @@
+/* Disable floating-point exceptions.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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
+fedisableexcept (int excepts)
+{
+  unsigned int sw[2], old_exc;
+
+  /* Get the current status word. */
+  __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
+
+  old_exc = sw[0] & FE_ALL_EXCEPT;
+
+  sw[0] &= ~(excepts & FE_ALL_EXCEPT);
+  __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
+
+  return old_exc;
+}
diff --git a/sysdeps/hppa/fpu/feenablxcpt.c b/sysdeps/hppa/fpu/feenablxcpt.c
new file mode 100644
index 0000000000..ac46722767
--- /dev/null
+++ b/sysdeps/hppa/fpu/feenablxcpt.c
@@ -0,0 +1,37 @@
+/* Enable floating-point exceptions.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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
+feenableexcept (int excepts)
+{
+  unsigned int sw[2], old_exc;
+
+  /* Get the current status word. */
+  __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
+
+  old_exc = sw[0] & FE_ALL_EXCEPT;
+
+  sw[0] |= (excepts & FE_ALL_EXCEPT);
+  __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
+
+  return old_exc;
+}
diff --git a/sysdeps/hppa/fpu/fegetenv.c b/sysdeps/hppa/fpu/fegetenv.c
new file mode 100644
index 0000000000..0fe9773bb7
--- /dev/null
+++ b/sysdeps/hppa/fpu/fegetenv.c
@@ -0,0 +1,33 @@
+/* Store current floating-point environment.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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
+fegetenv (fenv_t *envp)
+{
+  __asm__ (
+	   "fstd %%fr0,0(%2)\n"
+	   "fstd,ma %%fr1,8(%2)\n"
+	   "fstd,ma %%fr2,8(%2)\n"
+	   "fstd %%fr3,0(%2)\n"
+	   : "=m" (*envp), "=r" (envp) : "1" (envp));
+  return 0;
+}
diff --git a/sysdeps/hppa/fpu/fegetexcept.c b/sysdeps/hppa/fpu/fegetexcept.c
new file mode 100644
index 0000000000..6bf3f6446e
--- /dev/null
+++ b/sysdeps/hppa/fpu/fegetexcept.c
@@ -0,0 +1,32 @@
+/* Get enabled floating-point exceptions.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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
+fegetexcept (void)
+{
+  unsigned int sw[2];
+
+  /* Get the current status word. */
+  __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
+
+  return sw[0] & FE_ALL_EXCEPT;
+}
diff --git a/sysdeps/hppa/fpu/fegetround.c b/sysdeps/hppa/fpu/fegetround.c
new file mode 100644
index 0000000000..6e07f8654f
--- /dev/null
+++ b/sysdeps/hppa/fpu/fegetround.c
@@ -0,0 +1,32 @@
+/* Return current rounding direction.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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)
+{
+  unsigned int sw[2];
+
+  /* Get the current status word. */
+  __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
+
+  return sw[0] & FE_DOWNWARD;
+}
diff --git a/sysdeps/hppa/fpu/feholdexcpt.c b/sysdeps/hppa/fpu/feholdexcpt.c
new file mode 100644
index 0000000000..10621786eb
--- /dev/null
+++ b/sysdeps/hppa/fpu/feholdexcpt.c
@@ -0,0 +1,60 @@
+/* Store current floating-point environment and clear exceptions.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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 <string.h>
+
+int
+feholdexcept (fenv_t *envp)
+{
+  fenv_t clear;
+
+  /* Store the environment.  */
+  {
+    fenv_t * _regs = envp;
+    __asm__ (
+	     "fstd %%fr0,0(%2)\n"
+	     "fstd,ma %%fr1,8(%2)\n"
+	     "fstd,ma %%fr2,8(%2)\n"
+	     "fstd %%fr3,0(%2)\n"
+	     : "=m" (*_regs), "=r" (_regs) : "1" (_regs));
+    memcpy (&clear, envp, sizeof (clear));
+  }
+
+  /* Now clear all exceptions.  */
+  clear.__status_word &= ~(FE_ALL_EXCEPT << 27);
+  memset (clear.__exception, 0, sizeof (clear.__exception));
+
+  /* And set all exceptions to non-stop.  */
+  clear.__status_word &= ~FE_ALL_EXCEPT;
+
+  /* Load the new environment. */
+  {
+    fenv_t * _regs = &clear + 1;
+    __asm__ (
+	     "fldd,mb -8(%2),%%fr3\n"
+	     "fldd,mb -8(%2),%%fr2\n"
+	     "fldd,mb -8(%2),%%fr1\n"
+	     "fldd -8(%2),%%fr0\n"
+	     : "=m" (*_regs), "=r" (_regs) : "1" (_regs));
+  }
+
+  return 0;
+}
diff --git a/sysdeps/hppa/fpu/fesetenv.c b/sysdeps/hppa/fpu/fesetenv.c
new file mode 100644
index 0000000000..4bfbefdd9b
--- /dev/null
+++ b/sysdeps/hppa/fpu/fesetenv.c
@@ -0,0 +1,70 @@
+/* Install given floating-point environment.
+   Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+   Based on the m68k version by
+   Andreas Schwab <schwab@suse.de>
+
+   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
+fesetenv (const fenv_t *envp)
+{
+  fenv_t temp;
+
+  /* Install the environment specified by ENVP.  But there are a few
+     values which we do not want to come from the saved environment.
+     Therefore, we get the current environment and replace the values
+     we want to use from the environment specified by the parameter.  */
+  {
+    fenv_t * _regs = &temp;
+    __asm__ (
+	     "fstd %%fr0,0(%2)\n"
+	     "fstd,ma %%fr1,8(%2)\n"
+	     "fstd,ma %%fr2,8(%2)\n"
+	     "fstd %%fr3,0(%2)\n"
+	     : "=m" (*_regs), "=r" (_regs) : "1" (_regs));
+  }
+
+  temp.__status_word &= ~(FE_ALL_EXCEPT
+			  | (FE_ALL_EXCEPT << 27)
+			  | FE_DOWNWARD);
+  if (envp == FE_DFL_ENV)
+    ;
+  else if (envp == FE_NOMASK_ENV)
+    temp.__status_word |= FE_ALL_EXCEPT;
+  else
+    temp.__status_word |= (envp->__status_word
+			   & (FE_ALL_EXCEPT
+			      | FE_DOWNWARD
+			      | (FE_ALL_EXCEPT << 27)));
+
+  /* Load the new environment. */
+  {
+    fenv_t * _regs = &temp + 1;
+    __asm__ (
+	     "fldd,mb -8(%2),%%fr3\n"
+	     "fldd,mb -8(%2),%%fr2\n"
+	     "fldd,mb -8(%2),%%fr1\n"
+	     "fldd -8(%2),%%fr0\n"
+	     : "=m" (*_regs), "=r" (_regs) : "1" (_regs));
+  }
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/hppa/fpu/fesetround.c b/sysdeps/hppa/fpu/fesetround.c
new file mode 100644
index 0000000000..0d5858f263
--- /dev/null
+++ b/sysdeps/hppa/fpu/fesetround.c
@@ -0,0 +1,39 @@
+/* Set current rounding direction.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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)
+{
+  unsigned int sw[2];
+
+  if (round & ~FE_DOWNWARD)
+    /* ROUND is not a valid rounding mode.  */
+    return 1;
+
+  /* Get the current status word. */
+  __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
+  sw[0] &= ~FE_UPWARD;
+  sw[0] |= round;
+  __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
+
+  return 0;
+}
diff --git a/sysdeps/hppa/fpu/feupdateenv.c b/sysdeps/hppa/fpu/feupdateenv.c
new file mode 100644
index 0000000000..7e2d715e25
--- /dev/null
+++ b/sysdeps/hppa/fpu/feupdateenv.c
@@ -0,0 +1,40 @@
+/* Install given floating-point environment and raise exceptions.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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
+feupdateenv (const fenv_t *envp)
+{
+  unsigned int sw[2];
+
+  /* Get the current exception status. */
+  __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
+  sw[0] &= (FE_ALL_EXCEPT << 27);
+
+  /* Install new environment.  */
+  fesetenv (envp);
+
+  /* Raise the saved exception. */
+  feraiseexcept (sw[0] >> 27);
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/hppa/fpu/fgetexcptflg.c b/sysdeps/hppa/fpu/fgetexcptflg.c
new file mode 100644
index 0000000000..800b1f4014
--- /dev/null
+++ b/sysdeps/hppa/fpu/fgetexcptflg.c
@@ -0,0 +1,36 @@
+/* Store current representation for exceptions.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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
+fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+  unsigned int sw[2];
+
+  /* Get the current status word. */
+  __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
+
+  *flagp = (sw[0] >> 27) & excepts & FE_ALL_EXCEPT;
+
+  /* Success.  */
+  return 0;
+}
+
diff --git a/sysdeps/hppa/fpu/fraiseexcpt.c b/sysdeps/hppa/fpu/fraiseexcpt.c
new file mode 100644
index 0000000000..7feeb9946f
--- /dev/null
+++ b/sysdeps/hppa/fpu/fraiseexcpt.c
@@ -0,0 +1,89 @@
+/* Raise given exceptions.
+   Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>
+
+   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>
+
+int
+feraiseexcept (int excepts)
+{
+  /* Raise exceptions represented by EXCEPTS.  But we must raise only one
+     signal at a time.  It is important that if the overflow/underflow
+     exception and the divide by zero exception are given at the same
+     time, the overflow/underflow exception follows the divide by zero
+     exception.  */
+
+  /* We do these bits in assembly to be certain GCC doesn't optimize
+     away something important, and so we can force delayed traps to
+     occur.  */
+
+  /* FIXME: These all need verification! */
+
+  /* First: invalid exception.  */
+  if (excepts & FE_INVALID)
+    {
+      /* One example of a invalid operation is 0 * Infinity.  */
+      double d = HUGE_VAL;
+      __asm__ __volatile__ ("fmpy,dbl %1,%%fr0,%0\n\t"
+			    /* FIXME: is this a proper trap barrier? */
+			    "fcpy,dbl %%fr0,%%fr0" : "=f" (d) : "0" (d));
+    }
+
+  /* Next: division by zero.  */
+  if (excepts & FE_DIVBYZERO)
+    {
+      double d = 1.0;
+      __asm__ __volatile__ ("fdiv,dbl %1,%%fr0,%0\n\t"
+			    "fcpy,dbl %%fr0,%%fr0" : "=f" (d) : "0" (d));
+    }
+
+  /* Next: overflow.  */
+  /* FIXME: Compare with IA-64 - do we have the same problem? */
+  if (excepts & FE_OVERFLOW)
+    {
+      double d = DBL_MAX;
+
+      __asm__ __volatile__ ("fmpy,dbl %1,%1,%0\n\t"
+			    "fcpy,dbl %%fr0,%%fr0" : "=f" (d) : "0" (d));
+    }
+
+  /* Next: underflow.  */
+  if (excepts & FE_UNDERFLOW)
+    {
+      double d = DBL_MIN;
+      double e = 69.69;
+
+      __asm__ __volatile__ ("fdiv,dbl %1,%2,%0\n\t"
+			    "fcpy,dbl %%fr0,%%fr0" : "=f" (d) : "0" (d), "f" (e));
+    }
+
+  /* Last: inexact.  */
+  if (excepts & FE_INEXACT)
+    {
+      double d = 1.0;
+      double e = M_PI;
+
+      __asm__ __volatile__ ("fdiv,dbl %1,%2,%0\n\t"
+			    "fcpy,dbl %%fr0,%%fr0" : "=f" (d) : "0" (d), "f" (e));
+    }
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/hppa/fpu/fsetexcptflg.c b/sysdeps/hppa/fpu/fsetexcptflg.c
new file mode 100644
index 0000000000..2e369ea721
--- /dev/null
+++ b/sysdeps/hppa/fpu/fsetexcptflg.c
@@ -0,0 +1,41 @@
+/* Set floating-point environment exception handling.
+   Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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>
+
+int
+fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+  unsigned int sw[2];
+
+  /* Get the current status word. */
+  __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
+
+  /* Install the new exception flags bits.  */
+  sw[0] &= ~(excepts & (FE_ALL_EXCEPT >> 27));
+  sw[0] |= (*flagp & excepts & FE_ALL_EXCEPT) << 27;
+
+  /* Store the new status word.  */
+  __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/hppa/fpu/ftestexcept.c b/sysdeps/hppa/fpu/ftestexcept.c
new file mode 100644
index 0000000000..15d149193f
--- /dev/null
+++ b/sysdeps/hppa/fpu/ftestexcept.c
@@ -0,0 +1,32 @@
+/* Test exception in current environment.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000
+
+   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)
+{
+  unsigned int sw[2];
+
+  /* Get the current status word. */
+  __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
+
+  return (sw[0] >> 27) & excepts & FE_ALL_EXCEPT;
+}
diff --git a/sysdeps/hppa/frame.h b/sysdeps/hppa/frame.h
new file mode 100644
index 0000000000..e6764daa24
--- /dev/null
+++ b/sysdeps/hppa/frame.h
@@ -0,0 +1,28 @@
+/* Definition of stack frame structure.  HPPA version.
+   Copyright (C) 2000 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.  */
+
+/* PA stacks grow upwards. */
+#define INNER_THAN >
+
+/* FIXME: will verify this later */
+struct layout
+{
+  void *next;
+  void *return_address;
+};
diff --git a/sysdeps/hppa/hppa1.1/Implies b/sysdeps/hppa/hppa1.1/Implies
new file mode 100644
index 0000000000..5f935a299c
--- /dev/null
+++ b/sysdeps/hppa/hppa1.1/Implies
@@ -0,0 +1,4 @@
+wordsize-32
+ieee754/flt-32
+ieee754/dbl-64
+ieee754/ldbl-128
diff --git a/sysdeps/hppa/hppa1.1/addmul_1.s b/sysdeps/hppa/hppa1.1/addmul_1.s
index 0fdcb3cb20..5b3e0482a5 100644
--- a/sysdeps/hppa/hppa1.1/addmul_1.s
+++ b/sysdeps/hppa/hppa1.1/addmul_1.s
@@ -1,71 +1,72 @@
-; HP-PA-1.1 __mpn_addmul_1 -- Multiply a limb vector with a limb and
-; add the result to a second limb vector.
+;! HP-PA-1.1 __mpn_addmul_1 -- Multiply a limb vector with a limb and
+;! add the result to a second limb vector.
 
-; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+;! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
 
-; This file is part of the GNU MP Library.
+;! This file is part of the GNU MP Library.
 
-; The GNU MP 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 MP 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 MP 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.
+;! The GNU MP 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 MP 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.
+;! You should have received a copy of the GNU Library General Public License
+;! along with the GNU MP 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.
 
 
-; INPUT PARAMETERS
-; res_ptr	r26
-; s1_ptr	r25
-; size		r24
-; s2_limb	r23
+;! INPUT PARAMETERS
+;! res_ptr	r26
+;! s1_ptr	r25
+;! size		r24
+;! s2_limb	r23
 
-; This runs at 11 cycles/limb on a PA7000.  With the used instructions, it
-; can not become faster due to data cache contention after a store.  On the
-; PA7100 it runs at 10 cycles/limb, and that can not be improved either,
-; since only the xmpyu does not need the integer pipeline, so the only
-; dual-issue we will get are addc+xmpyu.  Unrolling could gain a cycle/limb
-; on the PA7100.
+;! This runs at 11 cycles/limb on a PA7000.  With the used instructions, it
+;! can not become faster due to data cache contention after a store.  On the
+;! PA7100 it runs at 10 cycles/limb, and that can not be improved either,
+;! since only the xmpyu does not need the integer pipeline, so the only
+;! dual-issue we will get are addc+xmpyu.  Unrolling could gain a cycle/limb
+;! on the PA7100.
 
-; There are some ideas described in mul_1.s that applies to this code too.
+;! There are some ideas described in mul_1.s that applies to this code too.
 
-	.code
+	.text
 	.export		__mpn_addmul_1
-__mpn_addmul_1
+__mpn_addmul_1:	
 	.proc
 	.callinfo	frame=64,no_calls
 	.entry
 
 	ldo		64(%r30),%r30
 	fldws,ma	4(%r25),%fr5
-	stw		%r23,-16(%r30)		; move s2_limb ...
+	stw		%r23,-16(%r30)		;! move s2_limb ...
 	addib,=		-1,%r24,L$just_one_limb
-	 fldws		-16(%r30),%fr4		; ... into fr4
-	add		%r0,%r0,%r0		; clear carry
+	 fldws		-16(%r30),%fr4		;! ... into fr4
+	add		%r0,%r0,%r0		;! clear carry
 	xmpyu		%fr4,%fr5,%fr6
 	fldws,ma	4(%r25),%fr7
 	fstds		%fr6,-16(%r30)
 	xmpyu		%fr4,%fr7,%fr8
-	ldw		-12(%r30),%r19		; least significant limb in product
+	ldw		-12(%r30),%r20		;! least significant limb in product
 	ldw		-16(%r30),%r28
 
 	fstds		%fr8,-16(%r30)
 	addib,=		-1,%r24,L$end
 	 ldw		-12(%r30),%r1
 
-; Main loop
-L$loop	ldws		0(%r26),%r29
+;! Main loop
+L$loop:	
+	ldws		0(%r26),%r29
 	fldws,ma	4(%r25),%fr5
-	add		%r29,%r19,%r19
-	stws,ma		%r19,4(%r26)
-	addc		%r28,%r1,%r19
+	add		%r29,%r20,%r20
+	stws,ma		%r20,4(%r26)
+	addc		%r28,%r1,%r20
 	xmpyu		%fr4,%fr5,%fr6
 	ldw		-16(%r30),%r28
 	fstds		%fr6,-16(%r30)
@@ -73,27 +74,28 @@ L$loop	ldws		0(%r26),%r29
 	addib,<>	-1,%r24,L$loop
 	 ldw		-12(%r30),%r1
 
-L$end	ldw		0(%r26),%r29
-	add		%r29,%r19,%r19
-	stws,ma		%r19,4(%r26)
-	addc		%r28,%r1,%r19
+L$end:		
+	ldw		0(%r26),%r29
+	add		%r29,%r20,%r20
+	stws,ma		%r20,4(%r26)
+	addc		%r28,%r1,%r20
 	ldw		-16(%r30),%r28
 	ldws		0(%r26),%r29
 	addc		%r0,%r28,%r28
-	add		%r29,%r19,%r19
-	stws,ma		%r19,4(%r26)
+	add		%r29,%r20,%r20
+	stws,ma		%r20,4(%r26)
 	addc		%r0,%r28,%r28
 	bv		0(%r2)
-	 ldo		-64(%r30),%r30
+	ldo		-64(%r30),%r30
 
-L$just_one_limb
+L$just_one_limb:	
 	xmpyu		%fr4,%fr5,%fr6
 	ldw		0(%r26),%r29
 	fstds		%fr6,-16(%r30)
 	ldw		-12(%r30),%r1
 	ldw		-16(%r30),%r28
-	add		%r29,%r1,%r19
-	stw		%r19,0(%r26)
+	add		%r29,%r1,%r20
+	stw		%r20,0(%r26)
 	addc		%r0,%r28,%r28
 	bv		0(%r2)
 	 ldo		-64(%r30),%r30
diff --git a/sysdeps/hppa/hppa1.1/mul_1.s b/sysdeps/hppa/hppa1.1/mul_1.s
index cdd0c1d7fa..7f53916e83 100644
--- a/sysdeps/hppa/hppa1.1/mul_1.s
+++ b/sysdeps/hppa/hppa1.1/mul_1.s
@@ -1,92 +1,94 @@
-; HP-PA-1.1 __mpn_mul_1 -- Multiply a limb vector with a limb and store
-; the result in a second limb vector.
+;! HP-PA-1.1 __mpn_mul_1 -- Multiply a limb vector with a limb and store
+;! the result in a second limb vector.
 
-; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+;! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
 
-; This file is part of the GNU MP Library.
+;! This file is part of the GNU MP Library.
 
-; The GNU MP 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 MP 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 MP 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.
+;! The GNU MP 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 MP 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.
+;! You should have received a copy of the GNU Library General Public License
+;! along with the GNU MP 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.
 
 
-; INPUT PARAMETERS
-; res_ptr	r26
-; s1_ptr	r25
-; size		r24
-; s2_limb	r23
+;! INPUT PARAMETERS
+;! res_ptr	r26
+;! s1_ptr	r25
+;! size		r24
+;! s2_limb	r23
 
-; This runs at 9 cycles/limb on a PA7000.  With the used instructions, it can
-; not become faster due to data cache contention after a store.  On the
-; PA7100 it runs at 7 cycles/limb, and that can not be improved either, since
-; only the xmpyu does not need the integer pipeline, so the only dual-issue
-; we will get are addc+xmpyu.  Unrolling would not help either CPU.
+;! This runs at 9 cycles/limb on a PA7000.  With the used instructions, it can
+;! not become faster due to data cache contention after a store.  On the
+;! PA7100 it runs at 7 cycles/limb, and that can not be improved either, since
+;! only the xmpyu does not need the integer pipeline, so the only dual-issue
+;! we will get are addc+xmpyu.  Unrolling would not help either CPU.
 
-; We could use fldds to read two limbs at a time from the S1 array, and that
-; could bring down the times to 8.5 and 6.5 cycles/limb for the PA7000 and
-; PA7100, respectively.  We don't do that since it does not seem worth the
-; (alignment) troubles...
+;! We could use fldds to read two limbs at a time from the S1 array, and that
+;! could bring down the times to 8.5 and 6.5 cycles/limb for the PA7000 and
+;! PA7100, respectively.  We don't do that since it does not seem worth the
+;! (alignment) troubles...
 
-; At least the PA7100 is rumored to be able to deal with cache-misses
-; without stalling instruction issue.  If this is true, and the cache is
-; actually also lockup-free, we should use a deeper software pipeline, and
-; load from S1 very early!  (The loads and stores to -12(sp) will surely be
-; in the cache.)
+;! At least the PA7100 is rumored to be able to deal with cache-misses
+;! without stalling instruction issue.  If this is true, and the cache is
+;! actually also lockup-free, we should use a deeper software pipeline, and
+;! load from S1 very early;  (The loads and stores to -12(sp) will surely be
+;! in the cache.)
 
-	.code
+	.text
 	.export		__mpn_mul_1
-__mpn_mul_1
+__mpn_mul_1:	
 	.proc
 	.callinfo	frame=64,no_calls
 	.entry
 
 	ldo		64(%r30),%r30
 	fldws,ma	4(%r25),%fr5
-	stw		%r23,-16(%r30)		; move s2_limb ...
+	stw		%r23,-16(%r30)		;! move s2_limb ...
 	addib,=		-1,%r24,L$just_one_limb
-	 fldws		-16(%r30),%fr4		; ... into fr4
-	add		%r0,%r0,%r0		; clear carry
+	 fldws		-16(%r30),%fr4		;! ... into fr4
+	add		%r0,%r0,%r0		;! clear carry
 	xmpyu		%fr4,%fr5,%fr6
 	fldws,ma	4(%r25),%fr7
 	fstds	 	%fr6,-16(%r30)
 	xmpyu		%fr4,%fr7,%fr8
-	ldw		-12(%r30),%r19		; least significant limb in product
+	ldw		-12(%r30),%r20		;! least significant limb in product
 	ldw		-16(%r30),%r28
 
 	fstds		%fr8,-16(%r30)
 	addib,=		-1,%r24,L$end
 	 ldw		-12(%r30),%r1
 
-; Main loop
-L$loop	fldws,ma	4(%r25),%fr5
-	stws,ma		%r19,4(%r26)
-	addc		%r28,%r1,%r19
+;! Main loop
+L$loop:	
+	fldws,ma	4(%r25),%fr5
+	stws,ma		%r20,4(%r26)
+	addc		%r28,%r1,%r20
 	xmpyu		%fr4,%fr5,%fr6
 	ldw		-16(%r30),%r28
 	fstds		%fr6,-16(%r30)
 	addib,<>	-1,%r24,L$loop
 	 ldw		-12(%r30),%r1
 
-L$end	stws,ma		%r19,4(%r26)
-	addc		%r28,%r1,%r19
+L$end:	
+	stws,ma		%r20,4(%r26)
+	addc		%r28,%r1,%r20
 	ldw		-16(%r30),%r28
-	stws,ma		%r19,4(%r26)
+	stws,ma		%r20,4(%r26)
 	addc		%r0,%r28,%r28
 	bv		0(%r2)
 	 ldo		-64(%r30),%r30
 
-L$just_one_limb
+L$just_one_limb:	
 	xmpyu		%fr4,%fr5,%fr6
 	fstds		%fr6,-16(%r30)
 	ldw		-16(%r30),%r28
diff --git a/sysdeps/hppa/hppa1.1/submul_1.s b/sysdeps/hppa/hppa1.1/submul_1.s
index a4a385467e..f2c19c7bc8 100644
--- a/sysdeps/hppa/hppa1.1/submul_1.s
+++ b/sysdeps/hppa/hppa1.1/submul_1.s
@@ -1,77 +1,78 @@
-; HP-PA-1.1 __mpn_submul_1 -- Multiply a limb vector with a limb and
-; subtract the result from a second limb vector.
+;! HP-PA-1.1 __mpn_submul_1 -- Multiply a limb vector with a limb and
+;! subtract the result from a second limb vector.
 
-; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+;! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
 
-; This file is part of the GNU MP Library.
+;! This file is part of the GNU MP Library.
 
-; The GNU MP 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 MP 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 MP 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.
+;! The GNU MP 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 MP 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.
+;! You should have received a copy of the GNU Library General Public License
+;! along with the GNU MP 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.
 
 
-; INPUT PARAMETERS
-; res_ptr	r26
-; s1_ptr	r25
-; size		r24
-; s2_limb	r23
+;! INPUT PARAMETERS
+;! res_ptr	r26
+;! s1_ptr	r25
+;! size		r24
+;! s2_limb	r23
 
-; This runs at 12 cycles/limb on a PA7000.  With the used instructions, it
-; can not become faster due to data cache contention after a store.  On the
-; PA7100 it runs at 11 cycles/limb, and that can not be improved either,
-; since only the xmpyu does not need the integer pipeline, so the only
-; dual-issue we will get are addc+xmpyu.  Unrolling could gain a cycle/limb
-; on the PA7100.
+;! This runs at 12 cycles/limb on a PA7000.  With the used instructions, it
+;! can not become faster due to data cache contention after a store.  On the
+;! PA7100 it runs at 11 cycles/limb, and that can not be improved either,
+;! since only the xmpyu does not need the integer pipeline, so the only
+;! dual-issue we will get are addc+xmpyu.  Unrolling could gain a cycle/limb
+;! on the PA7100.
 
-; There are some ideas described in mul_1.s that applies to this code too.
+;! There are some ideas described in mul_1.s that applies to this code too.
 
-; It seems possible to make this run as fast as __mpn_addmul_1, if we use
-; 	sub,>>=	%r29,%r19,%r22
-;	addi	1,%r28,%r28
-; but that requires reworking the hairy software pipeline...
+;! It seems possible to make this run as fast as __mpn_addmul_1, if we use
+;! 	sub,>>=	%r29,%r20,%r22
+;!	addi	1,%r28,%r28
+;! but that requires reworking the hairy software pipeline...
 
-	.code
+	.text
 	.export		__mpn_submul_1
-__mpn_submul_1
+__mpn_submul_1:	
 	.proc
 	.callinfo	frame=64,no_calls
 	.entry
 
 	ldo		64(%r30),%r30
 	fldws,ma	4(%r25),%fr5
-	stw		%r23,-16(%r30)		; move s2_limb ...
+	stw		%r23,-16(%r30)		;! move s2_limb ...
 	addib,=		-1,%r24,L$just_one_limb
-	 fldws		-16(%r30),%fr4		; ... into fr4
-	add		%r0,%r0,%r0		; clear carry
+	 fldws		-16(%r30),%fr4		;! ... into fr4
+	add		%r0,%r0,%r0		;! clear carry
 	xmpyu		%fr4,%fr5,%fr6
 	fldws,ma	4(%r25),%fr7
 	fstds		%fr6,-16(%r30)
 	xmpyu		%fr4,%fr7,%fr8
-	ldw		-12(%r30),%r19		; least significant limb in product
+	ldw		-12(%r30),%r20		;! least significant limb in product
 	ldw		-16(%r30),%r28
 
 	fstds		%fr8,-16(%r30)
 	addib,=		-1,%r24,L$end
 	 ldw		-12(%r30),%r1
 
-; Main loop
-L$loop	ldws		0(%r26),%r29
+;! Main loop
+L$loop:	
+	ldws		0(%r26),%r29
 	fldws,ma	4(%r25),%fr5
-	sub		%r29,%r19,%r22
-	add		%r22,%r19,%r0
+	sub		%r29,%r20,%r22
+	add		%r22,%r20,%r0
 	stws,ma		%r22,4(%r26)
-	addc		%r28,%r1,%r19
+	addc		%r28,%r1,%r20
 	xmpyu		%fr4,%fr5,%fr6
 	ldw		-16(%r30),%r28
 	fstds		%fr6,-16(%r30)
@@ -79,22 +80,23 @@ L$loop	ldws		0(%r26),%r29
 	addib,<>	-1,%r24,L$loop
 	 ldw		-12(%r30),%r1
 
-L$end	ldw		0(%r26),%r29
-	sub		%r29,%r19,%r22
-	add		%r22,%r19,%r0
+L$end:	
+	ldw		0(%r26),%r29
+	sub		%r29,%r20,%r22
+	add		%r22,%r20,%r0
 	stws,ma		%r22,4(%r26)
-	addc		%r28,%r1,%r19
+	addc		%r28,%r1,%r20
 	ldw		-16(%r30),%r28
 	ldws		0(%r26),%r29
 	addc		%r0,%r28,%r28
-	sub		%r29,%r19,%r22
-	add		%r22,%r19,%r0
+	sub		%r29,%r20,%r22
+	add		%r22,%r20,%r0
 	stws,ma		%r22,4(%r26)
 	addc		%r0,%r28,%r28
 	bv		0(%r2)
 	 ldo		-64(%r30),%r30
 
-L$just_one_limb
+L$just_one_limb:	
 	xmpyu		%fr4,%fr5,%fr6
 	ldw		0(%r26),%r29
 	fstds		%fr6,-16(%r30)
diff --git a/sysdeps/hppa/hppa1.1/udiv_qrnnd.s b/sysdeps/hppa/hppa1.1/udiv_qrnnd.s
index bf7dc70cd7..c0a02d89ad 100644
--- a/sysdeps/hppa/hppa1.1/udiv_qrnnd.s
+++ b/sysdeps/hppa/hppa1.1/udiv_qrnnd.s
@@ -1,53 +1,55 @@
-; HP-PA  __udiv_qrnnd division support, used from longlong.h.
-; This version runs fast on PA 7000 and later.
+;! HP-PA  __udiv_qrnnd division support, used from longlong.h.
+;! This version runs fast on PA 7000 and later.
 
-; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+;! Copyright (C) 1993, 1994 Free Software Foundation, Inc.
 
-; This file is part of the GNU MP Library.
+;! This file is part of the GNU MP Library.
 
-; The GNU MP 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 MP 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 MP 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.
+;! The GNU MP 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 MP 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.
+;! You should have received a copy of the GNU Library General Public License
+;! along with the GNU MP 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.
 
 
-; INPUT PARAMETERS
-; rem_ptr	gr26
-; n1		gr25
-; n0		gr24
-; d		gr23
+;! INPUT PARAMETERS
+;! rem_ptr	gr26
+;! n1		gr25
+;! n0		gr24
+;! d		gr23
 
-	.code
-L$0000	.word		0x43f00000
+	.text
+L$0000:	
+	.word		0x43f00000
 	.word		0x0
 	.export		__udiv_qrnnd
-__udiv_qrnnd
+__udiv_qrnnd:	
 	.proc
 	.callinfo	frame=64,no_calls
 	.entry
 	ldo		64(%r30),%r30
 
-	stws		%r25,-16(0,%r30)	; n_hi
-	stws		%r24,-12(0,%r30)	; n_lo
-	ldil		L'L$0000,%r19
-	ldo		R'L$0000(%r19),%r19
+	stws		%r25,-16(0,%r30)	;! n_hi
+	stws		%r24,-12(0,%r30)	;! n_lo
+	b,l		L$0,%r1
+	ldo		L$0000-L$0(%r1),%r1
+L$0:
 	fldds		-16(0,%r30),%fr5
 	stws		%r23,-12(0,%r30)
 	comib,<=	0,%r25,L$1
 	fcnvxf,dbl,dbl	%fr5,%fr5
-	fldds		0(0,%r19),%fr4
+	fldds		0(0,%r1),%fr4
 	fadd,dbl	%fr4,%fr5,%fr5
-L$1
+L$1:	
 	fcpy,sgl	%fr0,%fr6L
 	fldws		-12(0,%r30),%fr6R
 	fcnvxf,dbl,dbl	%fr6,%fr4
@@ -62,13 +64,14 @@ L$1
 	ldws		-12(0,%r30),%r21
 	ldws		-16(0,%r30),%r20
 	sub		%r24,%r21,%r22
-	subb		%r25,%r20,%r19
-	comib,=		0,%r19,L$2
+	subb		%r25,%r20,%r1
+	comib,=		0,%r1,L$2
 	ldo		-64(%r30),%r30
 
 	add		%r22,%r23,%r22
 	ldo		-1(%r28),%r28
-L$2	bv		0(%r2)
+L$2:	
+	bv		0(%r2)
 	stws		%r22,0(0,%r26)
 
 	.exit
diff --git a/sysdeps/hppa/lshift.s b/sysdeps/hppa/lshift.s
index abac6ec201..de6dd761ca 100644
--- a/sysdeps/hppa/lshift.s
+++ b/sysdeps/hppa/lshift.s
@@ -1,34 +1,34 @@
-; HP-PA  __mpn_lshift --
+;! HP-PA  __mpn_lshift --
 
-; Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
 
-; This file is part of the GNU MP Library.
+;! This file is part of the GNU MP Library.
 
-; The GNU MP 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 MP 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 MP 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.
+;! The GNU MP 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 MP 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.
+;! You should have received a copy of the GNU Library General Public License
+;! along with the GNU MP 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.
 
 
-; INPUT PARAMETERS
-; res_ptr	gr26
-; s_ptr		gr25
-; size		gr24
-; cnt		gr23
+;! INPUT PARAMETERS
+;! res_ptr	gr26
+;! s_ptr	gr25
+;! size		gr24
+;! cnt		gr23
 
-	.code
+	.text
 	.export		__mpn_lshift
-__mpn_lshift
+__mpn_lshift:
 	.proc
 	.callinfo	frame=64,no_calls
 	.entry
@@ -39,12 +39,12 @@ __mpn_lshift
 	subi		32,%r23,%r1
 	mtsar		%r1
 	addib,=		-1,%r24,L$0004
-	vshd		%r0,%r22,%r28		; compute carry out limb
+	vshd		%r0,%r22,%r28		;! compute carry out limb
 	ldws,mb		-4(0,%r25),%r29
 	addib,=		-1,%r24,L$0002
 	vshd		%r22,%r29,%r20
 
-L$loop	ldws,mb		-4(0,%r25),%r22
+L$loop:	ldws,mb		-4(0,%r25),%r22
 	stws,mb		%r20,-4(0,%r26)
 	addib,=		-1,%r24,L$0003
 	vshd		%r29,%r22,%r20
@@ -53,12 +53,12 @@ L$loop	ldws,mb		-4(0,%r25),%r22
 	addib,<>	-1,%r24,L$loop
 	vshd		%r22,%r29,%r20
 
-L$0002	stws,mb		%r20,-4(0,%r26)
+L$0002:	stws,mb		%r20,-4(0,%r26)
 	vshd		%r29,%r0,%r20
 	bv		0(%r2)
 	stw		%r20,-4(0,%r26)
-L$0003	stws,mb		%r20,-4(0,%r26)
-L$0004	vshd		%r22,%r0,%r20
+L$0003:	stws,mb		%r20,-4(0,%r26)
+L$0004:	vshd		%r22,%r0,%r20
 	bv		0(%r2)
 	stw		%r20,-4(0,%r26)
 
diff --git a/sysdeps/hppa/memusage.h b/sysdeps/hppa/memusage.h
new file mode 100644
index 0000000000..5a06b7b656
--- /dev/null
+++ b/sysdeps/hppa/memusage.h
@@ -0,0 +1,22 @@
+/* Copyright (C) 2000 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.  */
+
+#define GETSP() ({ register uintptr_t stack_ptr asm ("%r30"); stack_ptr; })
+#define STACK_GROWS_UPWARD 1
+
+#include <sysdeps/generic/memusage.h>
diff --git a/sysdeps/hppa/rshift.s b/sysdeps/hppa/rshift.s
index c1480e5abf..bba60cf2c4 100644
--- a/sysdeps/hppa/rshift.s
+++ b/sysdeps/hppa/rshift.s
@@ -1,34 +1,34 @@
-; HP-PA  __mpn_rshift -- 
+;! HP-PA  __mpn_rshift -- 
 
-; Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
 
-; This file is part of the GNU MP Library.
+;! This file is part of the GNU MP Library.
 
-; The GNU MP 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 MP 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 MP 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.
+;! The GNU MP 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 MP 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.
+;! You should have received a copy of the GNU Library General Public License
+;! along with the GNU MP 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.
 
 
-; INPUT PARAMETERS
-; res_ptr	gr26
-; s_ptr		gr25
-; size		gr24
-; cnt		gr23
+;! INPUT PARAMETERS
+;! res_ptr	gr26
+;! s_ptr	gr25
+;! size		gr24
+;! cnt		gr23
 
-	.code
+	.text
 	.export		__mpn_rshift
-__mpn_rshift
+__mpn_rshift:
 	.proc
 	.callinfo	frame=64,no_calls
 	.entry
@@ -36,12 +36,12 @@ __mpn_rshift
 	ldws,ma		4(0,%r25),%r22
 	mtsar		%r23
 	addib,=		-1,%r24,L$0004
-	vshd		%r22,%r0,%r28		; compute carry out limb
+	vshd		%r22,%r0,%r28		;! compute carry out limb
 	ldws,ma		4(0,%r25),%r29
 	addib,=		-1,%r24,L$0002
 	vshd		%r29,%r22,%r20
 
-L$loop	ldws,ma		4(0,%r25),%r22
+L$loop:	ldws,ma		4(0,%r25),%r22
 	stws,ma		%r20,4(0,%r26)
 	addib,=		-1,%r24,L$0003
 	vshd		%r22,%r29,%r20
@@ -50,12 +50,12 @@ L$loop	ldws,ma		4(0,%r25),%r22
 	addib,<>	-1,%r24,L$loop
 	vshd		%r29,%r22,%r20
 
-L$0002	stws,ma		%r20,4(0,%r26)
+L$0002:	stws,ma		%r20,4(0,%r26)
 	vshd		%r0,%r29,%r20
 	bv		0(%r2)
 	stw		%r20,0(0,%r26)
-L$0003	stws,ma		%r20,4(0,%r26)
-L$0004	vshd		%r0,%r22,%r20
+L$0003:	stws,ma		%r20,4(0,%r26)
+L$0004:	vshd		%r0,%r22,%r20
 	bv		0(%r2)
 	stw		%r20,0(0,%r26)
 
diff --git a/sysdeps/hppa/setjmp.S b/sysdeps/hppa/setjmp.S
new file mode 100644
index 0000000000..0890975b88
--- /dev/null
+++ b/sysdeps/hppa/setjmp.S
@@ -0,0 +1,69 @@
+/* setjmp for HPPA.
+   Copyright (C) 1995, 1996, 1997, 1999 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>
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+
+	.text
+	.align 4
+	.import __sigjmp_save, code
+	.globl __sigsetjmp
+	.export __sigsetjmp, code
+	.proc
+	.callinfo
+__sigsetjmp:
+	stw	%r3, 0(%r26)
+	stw	%r4, 8(%r26)
+	stw	%r5, 12(%r26)
+	stw	%r6, 16(%r26)
+	stw	%r7, 20(%r26)
+	stw	%r8, 24(%r26)
+	stw	%r9, 28(%r26)
+	stw	%r10, 32(%r26)
+	stw	%r11, 36(%r26)
+	stw	%r12, 40(%r26)
+	stw	%r13, 44(%r26)
+	stw	%r14, 48(%r26)
+	stw	%r15, 52(%r26)
+	stw	%r16, 56(%r26)
+	stw	%r17, 60(%r26)
+	stw	%r18, 64(%r26)
+	stw	%r19, 68(%r26)
+	stw	%r27, 72(%r26)
+	stw	%r30, 76(%r26)
+
+	stw	%rp, 80(%r26)
+
+	ldo	88(%r26),%r19
+	fstds,ma %fr12, 8(%r19) /* 88 */
+	fstds,ma %fr13, 8(%r19) /* 96 */
+	fstds,ma %fr14, 8(%r19) /* 104 */
+	fstds,ma %fr15, 8(%r19) /* 112 */
+	fstds,ma %fr16, 8(%r19) /* 120 */
+	fstds,ma %fr17, 8(%r19) /* 128 */
+	fstds,ma %fr18, 8(%r19) /* 136 */
+	fstds,ma %fr19, 8(%r19) /* 144 */
+	fstds,ma %fr20, 8(%r19) /* 152 */
+	fstds	 %fr21, 0(%r19) /* 160 */
+	b __sigjmp_save
+	nop
+	.procend
diff --git a/sysdeps/hppa/sub_n.s b/sysdeps/hppa/sub_n.s
index 04fa3e1e33..b50bb11e51 100644
--- a/sysdeps/hppa/sub_n.s
+++ b/sysdeps/hppa/sub_n.s
@@ -1,56 +1,56 @@
-; HP-PA  __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
-; store difference in a third limb vector.
+;! HP-PA  __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+;! store difference in a third limb vector.
 
-; Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
 
-; This file is part of the GNU MP Library.
+;! This file is part of the GNU MP Library.
 
-; The GNU MP 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 MP 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 MP 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.
+;! The GNU MP 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 MP 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.
+;! You should have received a copy of the GNU Library General Public License
+;! along with the GNU MP 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.
 
 
-; INPUT PARAMETERS
-; res_ptr	gr26
-; s1_ptr	gr25
-; s2_ptr	gr24
-; size		gr23
+;! INPUT PARAMETERS
+;! res_ptr	gr26
+;! s1_ptr	gr25
+;! s2_ptr	gr24
+;! size		gr23
 
-; One might want to unroll this as for other processors, but it turns
-; out that the data cache contention after a store makes such
-; unrolling useless.  We can't come under 5 cycles/limb anyway.
+;! One might want to unroll this as for other processors, but it turns
+;! out that the data cache contention after a store makes such
+;! unrolling useless.  We can't come under 5 cycles/limb anyway.
 
-	.code
+	.text
 	.export		__mpn_sub_n
-__mpn_sub_n
+__mpn_sub_n:
 	.proc
 	.callinfo	frame=0,no_calls
 	.entry
 
-	ldws,ma		4(0,%r25),%r20
-	ldws,ma		4(0,%r24),%r19
+	ldws,ma		4(0,%r25),%r21
+	ldws,ma		4(0,%r24),%r20
 
-	addib,=		-1,%r23,L$end	; check for (SIZE == 1)
-	 sub		%r20,%r19,%r28	; subtract first limbs ignoring cy
+	addib,=		-1,%r23,L$end	;! check for (SIZE == 1)
+	 sub		%r21,%r20,%r28	;! subtract first limbs ignoring cy
 
-L$loop	ldws,ma		4(0,%r25),%r20
-	ldws,ma		4(0,%r24),%r19
+L$loop:	ldws,ma		4(0,%r25),%r21
+	ldws,ma		4(0,%r24),%r20
 	stws,ma		%r28,4(0,%r26)
 	addib,<>	-1,%r23,L$loop
-	 subb		%r20,%r19,%r28
+	 subb		%r21,%r20,%r28
 
-L$end	stws		%r28,0(0,%r26)
+L$end:	stws		%r28,0(0,%r26)
 	addc		%r0,%r0,%r28
 	bv		0(%r2)
 	 subi		1,%r28,%r28
diff --git a/sysdeps/hppa/sysdep.h b/sysdeps/hppa/sysdep.h
index 735882da09..2ac9840355 100644
--- a/sysdeps/hppa/sysdep.h
+++ b/sysdeps/hppa/sysdep.h
@@ -20,6 +20,11 @@
 
 #include <sysdeps/generic/sysdep.h>
 #include <sys/syscall.h>
+#include "config.h"
+
+#ifndef ASM_LINE_SEP
+#define ASM_LINE_SEP ;
+#endif
 
 #ifdef	__ASSEMBLER__
 
@@ -34,13 +39,12 @@
    incomplete stabs information.  Fake some entries here which specify
    the current source file.  */
 #define	ENTRY(name)							      \
-  .SPACE $TEXT$;							      \
-  .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY;			      \
-  .align ALIGNARG(4);							      \
-  .NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY;			      \
-  .EXPORT C_SYMBOL_NAME(name),ENTRY,PRIV_LEV=3,ARGW0=GR,RTNVAL=GR;	      \
+  .SPACE $TEXT$							ASM_LINE_SEP  \
+  .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY		ASM_LINE_SEP  \
+  .align ALIGNARG(4)						ASM_LINE_SEP  \
+  .NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY		ASM_LINE_SEP  \
+  .EXPORT C_SYMBOL_NAME(name),ENTRY,PRIV_LEV=3,ARGW0=GR,RTNVAL=GR ASM_LINE_SEP\
   C_LABEL(name)								      \
-
   CALL_MCOUNT
 
 #undef	END
@@ -53,7 +57,7 @@
 /* The mcount code relies on a normal frame pointer being on the stack
    to locate our caller, so push one just for its benefit.  */
 #define CALL_MCOUNT \
-  XXX
+  XXX	ASM_LINE_SEP
 #else
 #define CALL_MCOUNT		/* Do nothing.  */
 #endif
diff --git a/sysdeps/hppa/udiv_qrnnd.s b/sysdeps/hppa/udiv_qrnnd.s
index 9b45eb40df..053205720b 100644
--- a/sysdeps/hppa/udiv_qrnnd.s
+++ b/sysdeps/hppa/udiv_qrnnd.s
@@ -1,45 +1,45 @@
-; HP-PA  __udiv_qrnnd division support, used from longlong.h.
-; This version runs fast on pre-PA7000 CPUs.
+;! HP-PA  __udiv_qrnnd division support, used from longlong.h.
+;! This version runs fast on pre-PA7000 CPUs.
 
-; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+;! Copyright (C) 1993, 1994 Free Software Foundation, Inc.
 
-; This file is part of the GNU MP Library.
+;! This file is part of the GNU MP Library.
 
-; The GNU MP 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 MP 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 MP 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.
+;! The GNU MP 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 MP 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.
+;! You should have received a copy of the GNU Library General Public License
+;! along with the GNU MP 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.
 
 
-; INPUT PARAMETERS
-; rem_ptr	gr26
-; n1		gr25
-; n0		gr24
-; d		gr23
+;! INPUT PARAMETERS
+;! rem_ptr	gr26
+;! n1		gr25
+;! n0		gr24
+;! d		gr23
 
-; The code size is a bit excessive.  We could merge the last two ds;addc
-; sequences by simply moving the "bb,< Odd" instruction down.  The only
-; trouble is the FFFFFFFF code that would need some hacking.
+;! The code size is a bit excessive.  We could merge the last two ds;addc
+;! sequences by simply moving the "bb,< Odd" instruction down.  The only
+;! trouble is the FFFFFFFF code that would need some hacking.
 
-	.code
+	.text
 	.export		__udiv_qrnnd
-__udiv_qrnnd
+__udiv_qrnnd:
 	.proc
 	.callinfo	frame=0,no_calls
 	.entry
 
 	comb,<		%r23,0,L$largedivisor
-	 sub		%r0,%r23,%r1		; clear cy as side-effect
+	 sub		%r0,%r23,%r1		;! clear cy as side-effect
 	ds		%r0,%r1,%r0
 	addc		%r24,%r24,%r24
 	ds		%r25,%r23,%r25
@@ -111,12 +111,12 @@ __udiv_qrnnd
 	bv		0(%r2)
 	 addc		%r28,%r28,%r28
 
-L$largedivisor
-	extru		%r24,31,1,%r19		; r19 = n0 & 1
+L$largedivisor:
+	extru		%r24,31,1,%r20		;! r20 = n0 & 1
 	bb,<		%r23,31,L$odd
-	 extru		%r23,30,31,%r22		; r22 = d >> 1
-	shd		%r25,%r24,1,%r24	; r24 = new n0
-	extru		%r25,30,31,%r25		; r25 = new n1
+	 extru		%r23,30,31,%r22		;! r22 = d >> 1
+	shd		%r25,%r24,1,%r24	;! r24 = new n0
+	extru		%r25,30,31,%r25		;! r25 = new n1
 	sub		%r0,%r22,%r21
 	ds		%r0,%r21,%r0
 	addc		%r24,%r24,%r24
@@ -185,14 +185,14 @@ L$largedivisor
 	ds		%r25,%r22,%r25
 	comclr,>=	%r25,%r0,%r0
 	addl		%r25,%r22,%r25
-	sh1addl		%r25,%r19,%r25
+	sh1addl		%r25,%r20,%r25
 	stws		%r25,0(0,%r26)
 	bv		0(%r2)
 	 addc		%r24,%r24,%r28
 
-L$odd	addib,sv,n	1,%r22,L$FF..		; r22 = (d / 2 + 1)
-	shd		%r25,%r24,1,%r24	; r24 = new n0
-	extru		%r25,30,31,%r25		; r25 = new n1
+L$odd:	addib,sv,n	1,%r22,L$FF..		;! r22 = (d / 2 + 1)
+	shd		%r25,%r24,1,%r24	;! r24 = new n0
+	extru		%r25,30,31,%r25		;! r25 = new n1
 	sub		%r0,%r22,%r21
 	ds		%r0,%r21,%r0
 	addc		%r24,%r24,%r24
@@ -262,8 +262,8 @@ L$odd	addib,sv,n	1,%r22,L$FF..		; r22 = (d / 2 + 1)
 	addc		%r24,%r24,%r28
 	comclr,>=	%r25,%r0,%r0
 	addl		%r25,%r22,%r25
-	sh1addl		%r25,%r19,%r25
-; We have computed (n1,,n0) / (d + 1), q' = r28, r' = r25
+	sh1addl		%r25,%r20,%r25
+;! We have computed (n1,,n0) / (d + 1), q' = r28, r' = r25
 	add,nuv		%r28,%r25,%r25
 	addl		%r25,%r1,%r25
 	addc		%r0,%r28,%r28
@@ -273,9 +273,9 @@ L$odd	addib,sv,n	1,%r22,L$FF..		; r22 = (d / 2 + 1)
 	bv		0(%r2)
 	 addc		%r0,%r28,%r28
 
-; This is just a special case of the code above.
-; We come here when d == 0xFFFFFFFF
-L$FF..	add,uv		%r25,%r24,%r24
+;! This is just a special case of the code above.
+;! We come here when d == 0xFFFFFFFF
+L$FF..:	add,uv		%r25,%r24,%r24
 	sub,<<		%r24,%r23,%r0
 	ldo		1(%r24),%r24
 	stws		%r24,0(0,%r26)
diff --git a/sysdeps/ia64/fpu/printf_fphex.c b/sysdeps/ia64/fpu/printf_fphex.c
index fca607c861..3fa88a76ca 100644
--- a/sysdeps/ia64/fpu/printf_fphex.c
+++ b/sysdeps/ia64/fpu/printf_fphex.c
@@ -34,8 +34,9 @@ do {									      \
 									      \
       numstr = _itoa_word (num, numbuf + sizeof numbuf, 16,		      \
 			   info->spec == 'A');				      \
-      wnumstr = _itowa_word (num, wnumbuf + sizeof wnumbuf, 16,		      \
-			     info->spec == 'A');			      \
+      wnumstr = _itowa_word (num,					      \
+			     wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t),   \
+			     16, info->spec == 'A');			      \
 									      \
       /* Fill with zeroes.  */						      \
       while (numstr > numbuf + (sizeof numbuf - 64 / 4))		      \
@@ -50,7 +51,7 @@ do {									      \
       /* We have 3 bits from the mantissa in the leading nibble.	      \
 	 Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'.  */      \
       exponent = fpnum.ldbl.ieee.exponent;				      \
-									      \
+									     \
       if (exponent == 0)						      \
 	{								      \
 	  if (zero_mantissa)						      \
diff --git a/sysdeps/ieee754/ldbl-128/printf_fphex.c b/sysdeps/ieee754/ldbl-128/printf_fphex.c
index 5f20dba228..5e328c7dd8 100644
--- a/sysdeps/ieee754/ldbl-128/printf_fphex.c
+++ b/sysdeps/ieee754/ldbl-128/printf_fphex.c
@@ -39,15 +39,17 @@ do {									      \
 	{								      \
 	  numstr = _itoa_word (num1, numbuf + sizeof numbuf, 16,	      \
 			       info->spec == 'A');			      \
-	  wnumstr = _itowa_word (num1, wnumbuf + sizeof wnumbuf, 16,	      \
-				 info->spec == 'A');			      \
+	  wnumstr = _itowa_word (num1,
+				 wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t),\
+				 16, info->spec == 'A');		      \
 	}								      \
       else								      \
 	{								      \
 	  numstr = _itoa (num1, numbuf + sizeof numbuf, 16,		      \
 			  info->spec == 'A');				      \
-	  wnumstr = _itowa (num1, wnumbuf + sizeof wnumbuf, 16,		      \
-			    info->spec == 'A');				      \
+	  wnumstr = _itowa (num1,					      \
+			    wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t),    \
+			    16, info->spec == 'A');			      \
 	}								      \
 									      \
       while (numstr > numbuf + (sizeof numbuf - 64 / 4))		      \
diff --git a/sysdeps/ieee754/ldbl-96/printf_fphex.c b/sysdeps/ieee754/ldbl-96/printf_fphex.c
index 36d6014cea..9be0132e20 100644
--- a/sysdeps/ieee754/ldbl-96/printf_fphex.c
+++ b/sysdeps/ieee754/ldbl-96/printf_fphex.c
@@ -38,14 +38,16 @@ do {									      \
 	{								      \
 	  numstr = _itoa_word (num, numbuf + sizeof numbuf, 16,		      \
 			       info->spec == 'A');			      \
-	  wnumstr = _itowa_word (num, wnumbuf + sizeof wnumbuf, 16,	      \
-				 info->spec == 'A');			      \
+	  wnumstr = _itowa_word (num,					      \
+				 wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t),\
+				 16, info->spec == 'A');		      \
 	}								      \
       else								      \
 	{								      \
 	  numstr = _itoa (num, numbuf + sizeof numbuf, 16, info->spec == 'A');\
-	  wnumstr = _itowa (num, wnumbuf + sizeof wnumbuf, 16,		      \
-			    info->spec == 'A');				      \
+	  wnumstr = _itowa (num,					      \
+			    wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t),    \
+			    16, info->spec == 'A');			      \
 	}								      \
 									      \
       /* Fill with zeroes.  */						      \
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index d972f9ca29..08070eefbc 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -86,7 +86,7 @@ inhibit-siglist := yes
 endif
 
 ifeq ($(subdir),posix)
-sysdep_headers += bits/pthreadtypes.h
+sysdep_headers += bits/pthreadtypes.h bits/initspin.h
 endif
 
 ifeq ($(subdir),inet)
diff --git a/sysdeps/unix/sysv/linux/bits/initspin.h b/sysdeps/unix/sysv/linux/bits/initspin.h
new file mode 100644
index 0000000000..936f178497
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/initspin.h
@@ -0,0 +1 @@
+/* No thread support. */
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index c1d811da21..e6d4a7d029 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -61,6 +61,9 @@ case "$machine" in
   ia64*)
     arch_minimum_kernel=2.4.0
     ;;
+  hppa*)
+    arch_minimum_kernel=2.3.99
+    ;;
   *)
     arch_minimum_kernel=2.0.10
     ;;
@@ -82,10 +85,10 @@ fi
 
 if test -n "$minimum_kernel"; then
   echo $ac_n "checking for kernel header at least $minimum_kernel""... $ac_c" 1>&6
-echo "configure:86: checking for kernel header at least $minimum_kernel" >&5
+echo "configure:89: checking for kernel header at least $minimum_kernel" >&5
   decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
   cat > conftest.$ac_ext <<EOF
-#line 89 "configure"
+#line 92 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 #if LINUX_VERSION_CODE < $decnum
@@ -197,7 +200,7 @@ if test $host = $build; then
     ac_prefix=$ac_default_prefix
   fi
   echo $ac_n "checking for symlinks in ${ac_prefix}/include""... $ac_c" 1>&6
-echo "configure:201: checking for symlinks in ${ac_prefix}/include" >&5
+echo "configure:204: checking for symlinks in ${ac_prefix}/include" >&5
   ac_message=
   if test -L ${ac_prefix}/include/net; then
     ac_message="$ac_message
diff --git a/sysdeps/unix/sysv/linux/configure.in b/sysdeps/unix/sysv/linux/configure.in
index 05b58e9e79..7d538e8d51 100644
--- a/sysdeps/unix/sysv/linux/configure.in
+++ b/sysdeps/unix/sysv/linux/configure.in
@@ -48,6 +48,9 @@ case "$machine" in
   ia64*)
     arch_minimum_kernel=2.4.0
     ;;
+  hppa*)
+    arch_minimum_kernel=2.3.99
+    ;;
   *)
     arch_minimum_kernel=2.0.10
     ;;
diff --git a/sysdeps/unix/sysv/linux/errlist.c b/sysdeps/unix/sysv/linux/errlist.c
index d985f49394..eee2b4c650 100644
--- a/sysdeps/unix/sysv/linux/errlist.c
+++ b/sysdeps/unix/sysv/linux/errlist.c
@@ -24,13 +24,13 @@
 #define SYS_NERR __new_sys_nerr
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-asm (".data; .globl __old_sys_errlist;  __old_sys_errlist:");
+asm (".data\n\t.globl __old_sys_errlist\n__old_sys_errlist:");
 #endif
 
 #include <sysdeps/gnu/errlist.c>
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-asm (".type __old_sys_errlist,@object;.size __old_sys_errlist,"
+asm (".type __old_sys_errlist,@object\n\t.size __old_sys_errlist,"
      OLD_ERRLIST_SIZE_STR "*" PTR_SIZE_STR);
 
 extern const char *const *__old_sys_errlist;
diff --git a/sysdeps/unix/sysv/linux/hppa/Makefile b/sysdeps/unix/sysv/linux/hppa/Makefile
new file mode 100644
index 0000000000..1c93ec52d9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/Makefile
@@ -0,0 +1,2 @@
+# linux/hppa does not use -lmilli anymore
+gnulib := -lgcc
diff --git a/sysdeps/unix/sysv/linux/hppa/Versions b/sysdeps/unix/sysv/linux/hppa/Versions
new file mode 100644
index 0000000000..475fbe1721
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/Versions
@@ -0,0 +1,6 @@
+libc {
+  GLIBC_2.2 {
+    # New rlimit interface
+    getrlimit; setrlimit; getrlimit64; setrlimit64;
+  }
+}
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/errno.h b/sysdeps/unix/sysv/linux/hppa/bits/errno.h
new file mode 100644
index 0000000000..db4eaf6364
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/errno.h
@@ -0,0 +1,57 @@
+/* Error constants.  Linux/HPPA specific version.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000 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.  */
+
+#ifdef _ERRNO_H
+
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+# include <linux/errno.h>
+
+/* Linux also has no ECANCELED error code.  Since it is not used here
+   we define it to an invalid value.  */
+# define ECANCELED	125
+
+# ifndef __ASSEMBLER__
+/* We now need a declaration of the `errno' variable.  */
+extern int errno;
+
+/* Function to get address of global `errno' variable.  */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+
+#  if defined _LIBC
+/* We wouldn't need a special macro anymore but it is history.  */
+#   define __set_errno(val) (*__errno_location ()) = (val)
+#  endif /* _LIBC */
+
+#  if !defined _LIBC || defined _LIBC_REENTRANT
+/* When using threads, errno is a per-thread value.  */
+#   define errno (*__errno_location ())
+#  endif
+# endif /* !__ASSEMBLER__ */
+#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough.  We must
+   define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+   defined.  */
+# define EDOM	33	/* Math argument out of domain of function.  */
+# define EILSEQ	84	/* Illegal byte sequence.  */
+# define ERANGE	34	/* Math result not representable.  */
+#endif /* !_ERRNO_H && __need_Emath */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
new file mode 100644
index 0000000000..687ffc8582
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -0,0 +1,148 @@
+/* O_*, F_*, FD_* bit values for Linux/HPPA.
+   Copyright (C) 1995-1999, 2000 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 _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <sys/types.h>
+
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+   located on an ext2 file system */
+#define O_RDONLY	00000000
+#define O_WRONLY	00000001
+#define O_RDWR		00000002
+#define O_ACCMODE	00000003
+#define O_APPEND	00000010
+#define O_BLKSEEK	00000100 /* HPUX only */
+#define O_CREAT		00000400 /* not fcntl */
+#define O_TRUNC		00001000 /* not fcntl */
+#define O_EXCL		00002000 /* not fcntl */
+#define O_ASYNC		00020000
+#define O_SYNC		00100000
+#define O_NONBLOCK	00200004 /* HPUX has separate NDELAY & NONBLOCK */
+#define O_NDELAY	O_NONBLOCK
+#define O_NOCTTY	00400000 /* not fcntl */
+
+
+#ifdef __USE_GNU
+# define O_DIRECT	00040000 /* direct disk access hint - currently ignored */
+# define O_DIRECTORY	00010000 /* must be a directory */
+# define O_NOFOLLOW	00000200 /* don't follow links */
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE	00004000
+#endif
+
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC		01000000 /* HPUX only */
+# define O_RSYNC		02000000 /* HPUX only */
+#endif
+
+/* Values for the second argument to `fcntl'.  */
+#define F_DUPFD		0	/* Duplicate file descriptor.  */
+#define F_GETFD		1	/* Get file descriptor flags.  */
+#define F_SETFD		2	/* Set file descriptor flags.  */
+#define F_GETFL		3	/* Get file status flags.  */
+#define F_SETFL		4	/* Set file status flags.  */
+#define F_GETLK		5	/* Get record locking info.  */
+#define F_SETLK		6	/* Set record locking info (non-blocking).  */
+#define F_SETLKW	7	/* Set record locking info (blocking).  */
+
+#define F_GETLK64	8	/* Get record locking info.  */
+#define F_SETLK64	9	/* Set record locking info (non-blocking).  */
+#define F_SETLKW64	10	/* Set record locking info (blocking).  */
+
+#if defined __USE_BSD || defined __USE_XOPEN2K
+# define F_GETOWN	11	/* Get owner of socket (receiver of SIGIO).  */
+# define F_SETOWN	12	/* Set owner of socket (receiver of SIGIO).  */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG	13	/* Set number of signal to be sent.  */
+# define F_GETSIG	14	/* Get number of signal to be sent.  */
+#endif
+
+/* for F_[GET|SET]FL */
+#define FD_CLOEXEC	1	/* actually anything with low bit set goes */
+
+/* For posix fcntl() and `l_type' field of a `struct flock' for lockf().  */
+#define F_RDLCK		1	/* Read lock.  */
+#define F_WRLCK		2	/* Write lock.  */
+#define F_UNLCK		3	/* Remove lock.  */
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK		4	/* or 3 */
+#define F_SHLCK		8	/* or 4 */
+
+#ifdef __USE_BSD
+/* operations for bsd flock(), also used by the kernel implementation */
+# define LOCK_SH	1	/* shared lock */
+# define LOCK_EX	2	/* exclusive lock */
+# define LOCK_NB	4	/* or'd with one of the above to prevent
+				   blocking */
+# define LOCK_UN	8	/* remove lock */
+#endif
+
+struct flock
+  {
+    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
+#ifndef __USE_FILE_OFFSET64
+    __off_t l_start;	/* Offset where the lock begins.  */
+    __off_t l_len;	/* Size of the locked area; zero means until EOF.  */
+#else
+    __off64_t l_start;	/* Offset where the lock begins.  */
+    __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
+#endif
+    __pid_t l_pid;	/* Process holding the lock.  */
+  };
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+  {
+    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
+    __off64_t l_start;	/* Offset where the lock begins.  */
+    __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
+    __pid_t l_pid;	/* Process holding the lock.  */
+  };
+#endif
+
+/* Define some more compatibility macros to be backward compatible with
+   BSD systems which did not managed to hide these kernel macros.  */
+#ifdef	__USE_BSD
+# define FAPPEND	O_APPEND
+# define FFSYNC		O_FSYNC
+# define FASYNC		O_ASYNC
+# define FNONBLOCK	O_NONBLOCK
+# define FNDELAY	O_NDELAY
+#endif /* Use BSD.  */
+
+/* Advise to `posix_fadvise'.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_FADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_FADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_FADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+# define POSIX_FADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_FADV_DONTNEED	4 /* Don't need these pages.  */
+# define POSIX_FADV_NOREUSE	5 /* Data will be accessed once.  */
+#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h b/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h
new file mode 100644
index 0000000000..bad78b60e8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 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
+   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_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Use the definitions from the kernel header files.  */
+#include <asm/ioctls.h>
+
+/* Oh well, this is necessary since the kernel data structure is
+   different from the user-level version.  */
+#undef  TCGETS
+#undef  TCSETS
+#undef  TCSETSW
+#undef  TCSETSF
+#define TCGETS	_IOR ('T', 16, char[36])
+#define TCSETS	_IOW ('T', 17, char[36])
+#define TCSETSW	_IOW ('T', 18, char[36])
+#define TCSETSF	_IOW ('T', 19, char[36])
+
+#include <linux/sockios.h>
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/sysdeps/unix/sysv/linux/hppa/bits/mman.h
new file mode 100644
index 0000000000..78c0171fae
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/mman.h
@@ -0,0 +1,61 @@
+/* Definitions for POSIX memory map interface.  Insert rest of disclaimer here */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* these are basically taken from the kernel definitions */
+
+#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 */
+
+#define MAP_SHARED	0x01		/* Share changes */
+#define MAP_PRIVATE	0x02		/* Changes are private */
+#define MAP_TYPE	0x03		/* Mask for type of mapping */
+#define MAP_FIXED	0x04		/* Interpret addr exactly */
+#define MAP_ANONYMOUS	0x10		/* don't use a file */
+
+#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
+#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
+#define MAP_LOCKED	0x2000		/* pages are locked */
+#define MAP_NORESERVE	0x4000		/* don't check for reservations */
+#define MAP_GROWSDOWN	0x8000		/* stack-like segment */
+
+#define MS_SYNC		1		/* synchronous memory sync */
+#define MS_ASYNC	2		/* sync memory asynchronously */
+#define MS_INVALIDATE	4		/* invalidate the caches */
+
+#define MCL_CURRENT	1		/* lock all current mappings */
+#define MCL_FUTURE	2		/* lock all future mappings */
+
+#define MADV_NORMAL     0               /* no further special treatment */
+#define MADV_RANDOM     1               /* expect random page references */
+#define MADV_SEQUENTIAL 2               /* expect sequential page references */
+#define MADV_WILLNEED   3               /* will need these pages */
+#define MADV_DONTNEED   4               /* dont need these pages */
+#define MADV_SPACEAVAIL 5               /* insure that resources are reserved */
+#define MADV_VPS_PURGE  6               /* Purge pages from VM page cache */
+#define MADV_VPS_INHERIT 7              /* Inherit parents page size */
+
+/* The range 12-64 is reserved for page size specification. */
+#define MADV_4K_PAGES   12              /* Use 4K pages  */
+#define MADV_16K_PAGES  14              /* Use 16K pages */
+#define MADV_64K_PAGES  16              /* Use 64K pages */
+#define MADV_256K_PAGES 18              /* Use 256K pages */
+#define MADV_1M_PAGES   20              /* Use 1 Megabyte pages */
+#define MADV_4M_PAGES   22              /* Use 4 Megabyte pages */
+#define MADV_16M_PAGES  24              /* Use 16 Megabyte pages */
+#define MADV_64M_PAGES  26              /* Use 64 Megabyte pages */
+
+/* compatibility flags */
+#define MAP_ANON	MAP_ANONYMOUS
+#define MAP_FILE	0
+#define MAP_VARIABLE	0
+
+/* Flags for `mremap'.  */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE 1
+#endif
+
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h b/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h
new file mode 100644
index 0000000000..cec71b294e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h
@@ -0,0 +1,75 @@
+/* Definitions for Linux/hppa sigaction.
+   Copyright (C) 1996, 1997, 2000 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 _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives.  */
+struct sigaction
+  {
+    /* Signal handler.  */
+#ifdef __USE_POSIX199309
+    union
+      {
+	/* Used if SA_SIGINFO is not set.  */
+	__sighandler_t sa_handler;
+	/* Used if SA_SIGINFO is set.  */
+	void (*sa_sigaction) (int, siginfo_t *, void *);
+      }
+    __sigaction_handler;
+# define sa_handler	__sigaction_handler.sa_handler
+# define sa_sigaction	__sigaction_handler.sa_sigaction
+#else
+    __sighandler_t sa_handler;
+#endif
+
+    /* Special flags.  */
+    unsigned long int sa_flags;
+
+    /* Additional set of signals to be blocked.  */
+    __sigset_t sa_mask;
+  };
+
+/* Bits in `sa_flags'.  */
+
+#define SA_NOCLDSTOP  0x00000008  /* Don't send SIGCHLD when children stop.  */
+#define SA_NOCLDWAIT  0x00000080  /* Don't create zombie on child death.  */
+#define SA_SIGINFO    0x00000010  /* Invoke signal-catching function with
+				     three arguments instead of one.  */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK   0x00000001 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESETHAND 0x00000004 /* Reset to SIG_DFL on entry to handler.  */
+# define SA_NODEFER   0x00000020 /* Don't automatically block the signal
+				    when its handler is being executed.  */
+# define SA_RESTART   0x00000040 /* Restart syscall on signal return.  */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historic no-op.  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
+# define SA_STACK     SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'.  */
+#define SIG_BLOCK          0	/* for blocking signals */
+#define SIG_UNBLOCK        1	/* for unblocking signals */
+#define SIG_SETMASK        2	/* for setting the signal mask */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/signum.h b/sysdeps/unix/sysv/linux/hppa/bits/signum.h
new file mode 100644
index 0000000000..45ed06ae14
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/signum.h
@@ -0,0 +1,82 @@
+/* Signal number definitions.  Linux version.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999 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.  */
+
+#ifdef	_SIGNAL_H
+
+/* Fake signal functions.  */
+#define SIG_ERR	((__sighandler_t) -1)		/* Error return.  */
+#define SIG_DFL	((__sighandler_t) 0)		/* Default action.  */
+#define SIG_IGN	((__sighandler_t) 1)		/* Ignore signal.  */
+
+#ifdef __USE_UNIX98
+# define SIG_HOLD	((__sighandler_t) 2)	/* Add signal to hold mask.  */
+#endif
+
+
+/* Signals.  */
+#define	SIGHUP		1	/* Hangup (POSIX).  */
+#define	SIGINT		2	/* Interrupt (ANSI).  */
+#define	SIGQUIT		3	/* Quit (POSIX).  */
+#define	SIGILL		4	/* Illegal instruction (ANSI).  */
+#define	SIGTRAP		5	/* Trace trap (POSIX).  */
+#define	SIGABRT		6	/* Abort (ANSI).  */
+#define	SIGIOT		6	/* IOT trap (4.2 BSD).  */
+#define	SIGEMT		7
+#define	SIGFPE		8	/* Floating-point exception (ANSI).  */
+#define	SIGKILL		9	/* Kill, unblockable (POSIX).  */
+#define	SIGBUS		10	/* BUS error (4.2 BSD).  */
+#define	SIGSEGV		11	/* Segmentation violation (ANSI).  */
+#define SIGSYS		12	/* Bad system call.  */
+#define	SIGPIPE		13	/* Broken pipe (POSIX).  */
+#define	SIGALRM		14	/* Alarm clock (POSIX).  */
+#define	SIGTERM		15	/* Termination (ANSI).  */
+#define	SIGUSR1		16	/* User-defined signal 1 (POSIX).  */
+#define SIGUSR2		17	/* User-defined signal 2 (POSIX).  */
+#define	SIGCLD		SIGCHLD	/* Same as SIGCHLD (System V).  */
+#define	SIGCHLD		18	/* Child status has changed (POSIX).  */
+#define	SIGPWR		19	/* Power failure restart (System V).  */
+#define	SIGVTALRM	20	/* Virtual alarm clock (4.2 BSD).  */
+#define	SIGPROF		21	/* Profiling alarm clock (4.2 BSD).  */
+#define	SIGPOLL		SIGIO	/* Pollable event occurred (System V).  */
+#define	SIGIO		22	/* I/O now possible (4.2 BSD).  */
+#define	SIGWINCH	23	/* Window size change (4.3 BSD, Sun).  */
+#define	SIGSTOP		24	/* Stop, unblockable (POSIX).  */
+#define	SIGTSTP		25	/* Keyboard stop (POSIX).  */
+#define	SIGCONT		26	/* Continue (POSIX).  */
+#define	SIGTTIN		27	/* Background read from tty (POSIX).  */
+#define	SIGTTOU		28	/* Background write to tty (POSIX).  */
+#define	SIGURG		29	/* Urgent condition on socket (4.2 BSD).  */
+#define SIGLOST		30	/* Operating System Has Lost (HP/UX). */
+#define SIGUNUSED	31
+#define	SIGXCPU		33	/* CPU limit exceeded (4.2 BSD).  */
+#define	SIGXFSZ		34	/* File size limit exceeded (4.2 BSD).  */
+#define	SIGSTKFLT	36	/* Stack fault.  */
+
+#define	_NSIG		64	/* Biggest signal number + 1
+				   (including real-time signals).  */
+
+#define SIGRTMIN        (__libc_current_sigrtmin ())
+#define SIGRTMAX        (__libc_current_sigrtmax ())
+
+/* These are the hard limits of the kernel.  These values should not be
+   used directly at user level.  */
+#define __SIGRTMIN	37
+#define __SIGRTMAX	(_NSIG - 1)
+
+#endif	/* <signal.h> included.  */
diff --git a/sysdeps/unix/sysv/linux/hppa/brk.c b/sysdeps/unix/sysv/linux/hppa/brk.c
new file mode 100644
index 0000000000..9ed6c4f1f7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/brk.c
@@ -0,0 +1,47 @@
+/* brk system call for Linux/i386.
+   Copyright (C) 1995, 1996 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 <errno.h>
+#include <unistd.h>
+#include <sysdep.h>
+
+/* This must be initialized data because commons can't have aliases.  */
+void *__curbrk = 0;
+
+/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt
+   to work around different old braindamage in the old Linux ELF dynamic
+   linker.  */
+weak_alias (__curbrk, ___brk_addr)
+
+int
+__brk (void *addr)
+{
+  void *newbrk, *scratch;
+
+  __curbrk = newbrk = INLINE_SYSCALL(brk, 1, addr);
+
+  if (newbrk < addr)
+    {
+      __set_errno (ENOMEM);
+      return -1;
+    }
+
+  return 0;
+}
+weak_alias (__brk, brk)
diff --git a/sysdeps/unix/sysv/linux/hppa/clone.S b/sysdeps/unix/sysv/linux/hppa/clone.S
new file mode 100644
index 0000000000..510e0ff799
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/clone.S
@@ -0,0 +1,82 @@
+/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000.
+   Based on the Alpha version by Richard Henderson <rth@tamu.edu>, 1996.
+
+   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.  */
+
+/* clone() is even more special than fork() as it mucks with stacks
+   and invokes a function in the right context after its all over.  */
+
+#include <asm/unistd.h>
+#include <sysdep.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
+
+        .text
+ENTRY(__clone)
+	/* FIXME: I have no idea how profiling works on hppa. */
+
+	/* Sanity check arguments.  */
+	comib,<> 0,%arg0,.Lerror	/* no NULL function pointers */
+	ldi	EINVAL,%ret0
+	comib,<> 0,%arg1,.Lerror	/* no NULL stack pointers */
+	nop
+
+	/* Save the fn ptr and arg on the new stack.  */
+	stwm	%arg3,64(%arg1)
+	stw	%arg3,-60(%arg1)
+
+	/* Do the system call */
+	copy	%arg2,%arg0
+	ble	0x100(%sr7,%r0)
+	ldi	__NR_clone,%r20
+
+	ldi	-4096,%r1
+	comclr,>>= %r1,%ret0,%r0	/* Note: unsigned compare. */
+	b,n	.Lerror
+
+	comib,=,n 0,%ret0,thread_start
+
+	/* Successful return from the parent */
+	bv	%r0(%rp)
+	nop
+
+	/* Something bad happened -- no child created */
+.Lerror:
+	b	__syscall_error
+	nop
+
+thread_start:
+	/* Load up the arguments.  */
+	ldw	-60(%sp),%arg0
+	ldwm	-64(%sp),%r22
+
+	/* Call the user's function */
+	bl	$$dyncall,%r31
+	copy	%r31,%rp
+
+	bl	_exit,%rp
+	copy	%ret0,%arg0
+
+	/* Die horribly.  */
+	iitlbp	%r0,(%r0)
+
+PSEUDO_END(__clone)
+
+weak_alias(__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/hppa/getrlimit.c b/sysdeps/unix/sysv/linux/hppa/getrlimit.c
new file mode 100644
index 0000000000..fc06dbd641
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/getrlimit.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getrlimit.c>
diff --git a/sysdeps/unix/sysv/linux/hppa/getrlimit64.c b/sysdeps/unix/sysv/linux/hppa/getrlimit64.c
new file mode 100644
index 0000000000..fef018f471
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/getrlimit64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h b/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h
new file mode 100644
index 0000000000..af048cbe7d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h
@@ -0,0 +1,18 @@
+/* We have a separate header file here because we do not support
+   SA_RESTORER on hppa. */
+
+/* This is the sigaction struction from the Linux 2.1.20 kernel.  */
+/* Blah.  This is bogus.  We don't ever use it. */
+struct old_kernel_sigaction {
+	__sighandler_t k_sa_handler;
+	unsigned long sa_mask;
+	unsigned long sa_flags;
+};
+
+/* This is the sigaction structure from the Linux 2.1.68 kernel.  */
+
+struct kernel_sigaction {
+	__sighandler_t k_sa_handler;
+	unsigned long sa_flags;
+	sigset_t sa_mask;
+};
diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
new file mode 100644
index 0000000000..a1fa3779a8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
@@ -0,0 +1,32 @@
+/* definition of "struct stat" from the kernel */
+struct kernel_stat {
+	unsigned long	st_dev;		/* dev_t is 32 bits on parisc */
+	unsigned long  	st_ino;		/* 32 bits */
+	unsigned short 	st_mode;	/* 16 bits */
+	unsigned short	st_nlink;	/* 16 bits */
+	unsigned short	st_reserved1;	/* old st_uid */
+	unsigned short	st_reserved2;	/* old st_gid */
+	unsigned long 	st_rdev;
+	unsigned long   st_size;
+	unsigned long  	st_atime;
+	unsigned long	st_spare1;
+        unsigned long   st_mtime;
+	unsigned long	st_spare2;
+	unsigned long   st_ctime;
+	unsigned long	st_spare3;
+	long		st_blksize;
+	long		st_blocks;
+	unsigned long	__unused1;	/* ACL stuff */
+	unsigned long	__unused2;	/* network */
+	unsigned long  	__unused3;	/* network */
+	unsigned long	__unused4;	/* cnodes */
+	unsigned short	__unused5;	/* netsite */
+	short		st_fstype;
+	unsigned long  	st_realdev;
+	unsigned short	st_basemode;
+	unsigned short	st_spareshort;
+	unsigned long  	st_uid;
+	unsigned long   st_gid;
+	unsigned long	st_spare4[3];
+};
+
diff --git a/sysdeps/unix/sysv/linux/hppa/mmap.c b/sysdeps/unix/sysv/linux/hppa/mmap.c
new file mode 100644
index 0000000000..333d848c0d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/mmap.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 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
+   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 <sys/types.h>
+#include <sys/mman.h>
+#include <errno.h>
+
+/* Map addresses starting near ADDR and extending for LEN bytes.  From
+   OFFSET into the file FD describes according to PROT and FLAGS.  If ADDR
+   is nonzero, it is the desired mapping address.  If the MAP_FIXED bit is
+   set in FLAGS, the mapping will be at ADDR exactly (which must be
+   page-aligned); otherwise the system chooses a convenient nearby address.
+   The return value is the actual mapping address chosen or MAP_FAILED
+   for errors (in which case `errno' is set).  A successful `mmap' call
+   deallocates any previous mapping for the affected region.  */
+
+#include <sysdep.h>
+
+__ptr_t
+__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
+{
+	
+	__ptr_t ret;
+
+	ret = INLINE_SYSCALL(mmap, 6, addr, len, prot, flags, fd, offset);
+
+	/* check if it's really a negative number */
+	if(((unsigned long)ret & 0xfffff000) == 0xfffff000)
+		return MAP_FAILED;
+
+	return ret;
+
+}
+
+strong_alias (__mmap, mmap)
diff --git a/sysdeps/unix/sysv/linux/hppa/profil-counter.h b/sysdeps/unix/sysv/linux/hppa/profil-counter.h
new file mode 100644
index 0000000000..8a6a0bcf3d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/profil-counter.h
@@ -0,0 +1,2 @@
+/* We can use the ix86 version.  */
+#include <sysdeps/unix/sysv/linux/i386/profil-counter.h>
diff --git a/sysdeps/unix/sysv/linux/hppa/setrlimit.c b/sysdeps/unix/sysv/linux/hppa/setrlimit.c
new file mode 100644
index 0000000000..bfaef74c38
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/setrlimit.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>
diff --git a/sysdeps/unix/sysv/linux/hppa/socket.S b/sysdeps/unix/sysv/linux/hppa/socket.S
new file mode 100644
index 0000000000..dfbb721a82
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/socket.S
@@ -0,0 +1,10 @@
+#include <sysdep.h>
+
+	.globl __socket
+PSEUDO(__socket, socket, 3)
+
+PSEUDO_END(__socket)
+
+#ifndef NO_WEAK_ALIAS
+weak_alias (__socket, socket)
+#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/sys/procfs.h b/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
new file mode 100644
index 0000000000..b6c756f7c0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
@@ -0,0 +1,113 @@
+/* Copyright (C) 1996, 1997, 1999, 2000 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_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somewhat modelled after the file of the same name on SVR4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  It doesn't have anything to do with the /proc file
+   system, even though Linux has one.
+
+   Anyway, the whole purpose of this file is for GDB and GDB only.
+   Don't read too much into it.  Don't use it for anything other than
+   GDB unless you know what you are doing.  */
+
+#include <features.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+#include <asm/elf.h>
+
+__BEGIN_DECLS
+
+struct elf_siginfo
+  {
+    int si_signo;			/* Signal number.  */
+    int si_code;			/* Extra code.  */
+    int si_errno;			/* Errno.  */
+  };
+
+/* Definitions to generate Intel SVR4-like core files.  These mostly
+   have the same names as the SVR4 types with "elf_" tacked on the
+   front to prevent clashes with Linux definitions, and the typedef
+   forms have been avoided.  This is mostly like the SVR4 structure,
+   but more Linuxy, with things that Linux does not support and which
+   GDB doesn't really use excluded.  */
+
+struct elf_prstatus
+  {
+    struct elf_siginfo pr_info;		/* Info associated with signal.  */
+    short int pr_cursig;		/* Current signal.  */
+    unsigned long int pr_sigpend;	/* Set of pending signals.  */
+    unsigned long int pr_sighold;	/* Set of held signals.  */
+    __pid_t pr_pid;
+    __pid_t pr_ppid;
+    __pid_t pr_pgrp;
+    __pid_t pr_sid;
+    struct timeval pr_utime;		/* User time.  */
+    struct timeval pr_stime;		/* System time.  */
+    struct timeval pr_cutime;		/* Cumulative user time.  */
+    struct timeval pr_cstime;		/* Cumulative system time.  */
+    elf_gregset_t pr_reg;		/* GP registers.  */
+    int pr_fpvalid;			/* True if math copro being used.  */
+  };
+
+
+#define ELF_PRARGSZ     (80)    /* Number of chars for args.  */
+
+struct elf_prpsinfo
+  {
+    char pr_state;			/* Numeric process state.  */
+    char pr_sname;			/* Char for pr_state.  */
+    char pr_zomb;			/* Zombie.  */
+    char pr_nice;			/* Nice val.  */
+    unsigned long int pr_flag;		/* Flags.  */
+    unsigned int pr_uid;
+    unsigned int pr_gid;
+    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+    /* Lots missing */
+    char pr_fname[16];			/* Filename of executable.  */
+    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
+  };
+
+
+/* The rest of this file provides the types for emulation of the
+   Solaris <proc_service.h> interfaces that should be implemented by
+   users of libthread_db.  */
+
+/* Addresses.  */
+typedef void *psaddr_t;
+
+/* Register sets.  Linux has different names.  */
+typedef elf_gregset_t prgregset_t;
+typedef elf_fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+   therefore have only one PID type.  */
+typedef __pid_t lwpid_t;
+
+/* Process status and info.  In the end we do provide typedefs for them.  */
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+
+__END_DECLS
+
+#endif	/* sys/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h b/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
new file mode 100644
index 0000000000..60022f951f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
@@ -0,0 +1,68 @@
+/* Copyright (C) 1997, 1998, 2000 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.  */
+
+/* Don't rely on this, the interface is currently messed up and may need to
+   be broken to be fixed.  */
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+
+/* Type for general register.  */
+typedef unsigned long int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	42
+#define NFPREG	33
+
+/* Container for all general registers.  */
+typedef struct gregset {
+	greg_t	g_regs[32];
+	greg_t  sr_regs[5];
+	greg_t	g_pad[5];
+} gregset_t;
+
+/* Container for all FPU registers.  */
+typedef struct fpregset {
+	double	fp_dregs[32];
+} fpregset_t;
+
+/* Context to describe whole processor state.  */
+typedef struct
+  {
+    gregset_t gregs;
+    fpregset_t fpregs;
+  } mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/hppa/syscall.S b/sysdeps/unix/sysv/linux/hppa/syscall.S
new file mode 100644
index 0000000000..413c572c34
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/syscall.S
@@ -0,0 +1,28 @@
+/* Copyright (C) 1995, 1996, 1998 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>
+
+/* Please consult the file sysdeps/unix/sysv/linux/i386/sysdep.h for
+   more information about the value -4095 used below.*/
+
+	.text
+ENTRY (syscall)
+	b .
+	nop
+
diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list
new file mode 100644
index 0000000000..f0d6431abe
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -0,0 +1,39 @@
+# File name	Caller	Syscall name	# args	Strong name	Weak names
+
+# semaphore and shm system calls
+msgctl		-	msgctl		i:iip	__msgctl	msgctl
+msgget		-	msgget		i:ii	__msgget	msgget
+msgrcv		-	msgrcv		i:ibnii	__msgrcv	msgrcv
+msgsnd		-	msgsnd		i:ibni	__msgsnd	msgsnd
+shmat		-	shmat		i:ipi	__shmat		shmat
+shmctl		-	shmctl		i:iip	__shmctl	shmctl
+shmdt		-	shmdt		i:s	__shmdt		shmdt
+shmget		-	shmget		i:iii	__shmget	shmget
+semop		-	semop		i:ipi	__semop		semop
+semget		-	semget		i:iii	__semget	semget
+semctl		-	semctl		i:iiii	__semctl	semctl
+
+# proper socket implementations:
+accept		-	accept		i:iBN	__libc_accept	__accept accept
+bind		-	bind		i:ipi	__bind		bind
+connect		-	connect		i:ipi	__libc_connect	__connect connect
+getpeername	-	getpeername	i:ipp	__getpeername	getpeername
+getsockname	-	getsockname	i:ipp	__getsockname	getsockname
+getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
+listen		-	listen		i:ii	__listen	listen
+recv		-	recv		i:ibni	__libc_recv	__recv recv
+recvfrom	-	recvfrom	i:ibniBN	__libc_recvfrom	__recvfrom recvfrom
+recvmsg		-	recvmsg		i:ipi	__libc_recvmsg	recvmsg
+send		-	send		i:ibni	__libc_send	__send send
+sendmsg		-	sendmsg		i:ipi	__libc_sendmsg	sendmsg
+sendto		-	sendto		i:ibnibn	__libc_sendto	__sendto sendto
+setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
+shutdown	-	shutdown	i:ii	__shutdown	shutdown
+socket		-	socket		i:iii	__socket	socket
+socketpair	-	socketpair	i:iiif	__socketpair	socketpair
+
+ptrace		-	ptrace		4	__ptrace	ptrace
+
+getresuid	-	getresuid	i:ppp	getresuid
+getresgid	-	getresgid	i:ppp	getresgid
+
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.c b/sysdeps/unix/sysv/linux/hppa/sysdep.c
new file mode 100644
index 0000000000..0559cc7065
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1997, 1998 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>
+#include <errno.h>
+
+/* This routine is jumped to by all the syscall handlers, to stash
+   an error number into errno.  */
+int
+__syscall_error (int err_no)
+{
+  __set_errno (err_no);
+  return -1;
+}
+
+/* We also have to have a 'real' definition of errno.  */
+#undef errno
+int errno = 0;
+weak_alias (errno, _errno)
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.h b/sysdeps/unix/sysv/linux/hppa/sysdep.h
new file mode 100644
index 0000000000..73d9a38b1a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep.h
@@ -0,0 +1,242 @@
+/* Assembler macros for PA-RISC.
+   Copyright (C) 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999.
+   Linux/PA-RISC changes by Philipp Rumpf, <prumpf@tux.org>, March 2000.
+
+   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 <asm/unistd.h>
+#include <sysdeps/generic/sysdep.h>
+#include <sys/syscall.h>
+#include "config.h"
+
+#ifndef ASM_LINE_SEP
+#define ASM_LINE_SEP ;
+#endif
+
+#undef SYS_ify
+#define SYS_ify(syscall_name)	(__NR_##syscall_name)
+
+
+#ifdef __ASSEMBLER__
+
+/* Syntactic details of assembler.  */
+
+#define ALIGNARG(log2) log2
+
+/* For Linux we can use the system call table in the header file
+	/usr/include/asm/unistd.h
+   of the kernel.  But these symbols do not follow the SYS_* syntax
+   so we have to redefine the `SYS_ify' macro here.  */
+#undef SYS_ify
+#define SYS_ify(syscall_name)	__NR_##syscall_name
+
+/* ELF-like local names start with `.L'.  */
+#undef L
+#define L(name)	.L##name
+
+/* Linux uses a negative return value to indicate syscall errors,
+   unlike most Unices, which use the condition codes' carry flag.
+
+   Since version 2.1 the return value of a system call might be
+   negative even if the call succeeded.  E.g., the `lseek' system call
+   might return a large offset.  Therefore we must not anymore test
+   for < 0, but test for a real error by making sure the value in %eax
+   is a real error number.  Linus said he will make sure the no syscall
+   returns a value in -1 .. -4095 as a valid result so we can safely
+   test with -4095.  */
+
+/* We don't want the label for the error handle to be global when we define
+   it here.  */
+#ifdef PIC
+# define SYSCALL_ERROR_LABEL 0f
+#else
+# define SYSCALL_ERROR_LABEL syscall_error
+#endif
+
+/* Define an entry point visible from C.
+
+   There is currently a bug in gdb which prevents us from specifying
+   incomplete stabs information.  Fake some entries here which specify
+   the current source file.  */
+#define	ENTRY(name)						\
+	.text					ASM_LINE_SEP	\
+	.export C_SYMBOL_NAME(name)		ASM_LINE_SEP	\
+	.type	C_SYMBOL_NAME(name),@function	ASM_LINE_SEP	\
+	C_LABEL(name)						\
+	CALL_MCOUNT
+
+#define ret \
+	bv 0(2)					ASM_LINE_SEP	\
+	nop
+
+#undef	END
+#define END(name)						\
+1:	.size	C_SYMBOL_NAME(name),1b-C_SYMBOL_NAME(name)
+
+/* If compiled for profiling, call `mcount' at the start of each function.  */
+#ifdef	PROF
+/* The mcount code relies on a normal frame pointer being on the stack
+   to locate our caller, so push one just for its benefit.  */
+#define CALL_MCOUNT		/* XXX */
+#else
+#define CALL_MCOUNT		/* Do nothing.  */
+#endif
+
+/* syscall wrappers consist of
+	#include <sysdep.h>
+	PSEUDO(...)
+	ret
+	PSEUDO_END(...)
+
+   which means
+	ENTRY(name)
+	DO_CALL(...)
+	nop
+	bv 0(2)
+	nop
+*/
+
+#define	PSEUDO(name, syscall_name, args)				      \
+  ENTRY (name)								      \
+  DO_CALL(args, syscall_name)					ASM_LINE_SEP  \
+  nop
+
+#undef	PSEUDO_END
+#define	PSEUDO_END(name)						      \
+  END (name)
+
+#define JUMPTARGET(name)	name
+#define SYSCALL_PIC_SETUP	/* Nothing.  */
+
+/* Linux takes system call arguments in registers:
+	syscall number	gr20
+	arg 1		gr26
+	arg 2		gr25
+	arg 3		gr24
+	arg 4		gr23
+	arg 5		gr22
+	arg 6		gr21
+
+   The compiler calls us by the C convention:
+	syscall number	in the DO_CALL macro
+	arg 1		gr26
+	arg 2		gr25
+	arg 3		gr24
+	arg 4		gr23
+	arg 5		-52(gr30)
+	arg 6		-56(gr30)
+
+   gr22 and gr21 are caller-saves, so we can just load the arguments
+   there and generally be happy. */
+
+/* the cmpb...no_error code below inside DO_CALL
+ * is intended to mimic the if (__sys_res...)
+ * code inside INLINE_SYSCALL
+ */
+
+#undef	DO_CALL
+#define DO_CALL(args, syscall_name)				\
+	DOARGS_##args						\
+	ble  0x100(%sr2,%r0)			ASM_LINE_SEP	\
+	ldi SYS_ify (syscall_name), %r20	ASM_LINE_SEP	\
+	ldi -0x1000,%r1				ASM_LINE_SEP	\
+	cmpb,>>=,n %r1,%ret0,0f			ASM_LINE_SEP	\
+	stw %rp, -20(%sr0,%r30)			ASM_LINE_SEP	\
+	stw %ret0, -24(%sr0,%r30)		ASM_LINE_SEP	\
+	.import __errno_location,code		ASM_LINE_SEP	\
+	bl __errno_location,%rp			ASM_LINE_SEP	\
+	ldo 64(%r30), %r30			ASM_LINE_SEP	\
+	ldo -64(%r30), %r30			ASM_LINE_SEP	\
+	ldw -24(%r30), %r26			ASM_LINE_SEP	\
+	sub %r0, %r26, %r26			ASM_LINE_SEP	\
+	stw %r26, 0(%sr0,%ret0)			ASM_LINE_SEP	\
+	ldo -1(%r0), %ret0			ASM_LINE_SEP	\
+	ldw -20(%r30), %rp			ASM_LINE_SEP	\
+0:						ASM_LINE_SEP	\
+	UNDOARGS_##args
+
+#define DOARGS_0 /* nothing */
+#define DOARGS_1 /* nothing */
+#define DOARGS_2 /* nothing */
+#define DOARGS_3 /* nothing */
+#define DOARGS_4 /* nothing */
+#define DOARGS_5 ldw -52(%r30), %r22		ASM_LINE_SEP
+#define DOARGS_6 ldw -52(%r30), %r22		ASM_LINE_SEP	\
+		 ldw -56(%r30), %r21		ASM_LINE_SEP
+
+
+#define UNDOARGS_0 /* nothing */
+#define UNDOARGS_1 /* nothing */
+#define UNDOARGS_2 /* nothing */
+#define UNDOARGS_3 /* nothing */
+#define UNDOARGS_4 /* nothing */
+#define UNDOARGS_5 /* nothing */
+#define UNDOARGS_6 /* nothing */
+
+#else
+
+#undef INLINE_SYSCALL
+#define INLINE_SYSCALL(name, nr, args...)	({		\
+	unsigned long __sys_res;				\
+	{							\
+		register unsigned long __res asm("r28");	\
+		LOAD_ARGS_##nr(args)				\
+		asm volatile(					\
+			"ble  0x100(%%sr2, %%r0)\n\t"	\
+			" ldi %1, %%r20"			\
+			: "=r" (__res)				\
+			: "i" (SYS_ify(name)) ASM_ARGS_##nr	\
+			 );					\
+		__sys_res = __res;				\
+	}							\
+	if (__sys_res >= (unsigned long)-4095) {		\
+		__set_errno(-__sys_res);			\
+		__sys_res == (unsigned long)-1;			\
+	}							\
+	__sys_res;						\
+})
+
+#define LOAD_ARGS_0()
+#define LOAD_ARGS_1(r26)					\
+	register unsigned long __r26 __asm__("r26") = (unsigned long)r26;	\
+	LOAD_ARGS_0()
+#define LOAD_ARGS_2(r26,r25)					\
+	register unsigned long __r25 __asm__("r25") = (unsigned long)r25;	\
+	LOAD_ARGS_1(r26)
+#define LOAD_ARGS_3(r26,r25,r24)				\
+	register unsigned long __r24 __asm__("r24") = (unsigned long)r24;	\
+	LOAD_ARGS_2(r26,r25)
+#define LOAD_ARGS_4(r26,r25,r24,r23)				\
+	register unsigned long __r23 __asm__("r23") = (unsigned long)r23;	\
+	LOAD_ARGS_3(r26,r25,r24)
+#define LOAD_ARGS_5(r26,r25,r24,r23,r22)			\
+	register unsigned long __r22 __asm__("r22") = (unsigned long)r22;	\
+	LOAD_ARGS_4(r26,r25,r24,r23)
+#define LOAD_ARGS_6(r26,r25,r24,r23,r22,r21)			\
+	register unsigned long __r21 __asm__("r21") = (unsigned long)r21;	\
+	LOAD_ARGS_5(r26,r25,r24,r23,r22)
+
+#define ASM_ARGS_0 
+#define ASM_ARGS_1 , "r" (__r26)
+#define ASM_ARGS_2 , "r" (__r26), "r" (__r25)
+#define ASM_ARGS_3 , "r" (__r26), "r" (__r25), "r" (__r24)
+#define ASM_ARGS_4 , "r" (__r26), "r" (__r25), "r" (__r24), "r" (__r23)
+#define ASM_ARGS_5 , "r" (__r26), "r" (__r25), "r" (__r24), "r" (__r23), "r" (__r22)
+#define ASM_ARGS_6 , "r" (__r26), "r" (__r25), "r" (__r24), "r" (__r23), "r" (__r22), "r" (__r21)
+
+#endif	/* __ASSEMBLER__ */
diff --git a/sysdeps/unix/sysv/linux/hppa/umount.c b/sysdeps/unix/sysv/linux/hppa/umount.c
new file mode 100644
index 0000000000..39cb251030
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/umount.c
@@ -0,0 +1,9 @@
+/* since we don't have an oldumount system call, do what the kernel
+   does down here */
+
+long __umount(char *name)
+{
+	return __umount2(name, 0);
+}
+
+weak_alias(__umount, umount);