about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/_strerror.c2
-rw-r--r--sysdeps/generic/des_impl.c2
-rw-r--r--sysdeps/generic/dl-cache.c21
-rw-r--r--sysdeps/generic/memcmp.c54
-rw-r--r--sysdeps/generic/pread.c3
-rw-r--r--sysdeps/generic/pread64.c3
-rw-r--r--sysdeps/generic/pwrite.c3
-rw-r--r--sysdeps/generic/pwrite64.c3
-rw-r--r--sysdeps/i386/i486/bits/string.h12
-rw-r--r--sysdeps/libm-ieee754/s_llrintl.c23
-rw-r--r--sysdeps/libm-ieee754/s_lrintl.c4
-rw-r--r--sysdeps/libm-ieee754/s_nextafterxf.c2
-rw-r--r--sysdeps/m68k/fpu/bits/mathinline.h69
-rw-r--r--sysdeps/m68k/fpu/s_lrint.c16
-rw-r--r--sysdeps/m68k/fpu/s_lrintf.c3
-rw-r--r--sysdeps/m68k/fpu/s_lrintl.c3
-rw-r--r--sysdeps/m68k/fpu/s_scalbln.c2
-rw-r--r--sysdeps/m68k/fpu/s_scalblnf.c2
-rw-r--r--sysdeps/m68k/fpu/s_scalblnl.c2
-rw-r--r--sysdeps/m68k/fpu/s_scalbn.c29
-rw-r--r--sysdeps/m68k/fpu/s_scalbnf.c4
-rw-r--r--sysdeps/m68k/fpu/s_scalbnl.c4
-rw-r--r--sysdeps/m68k/sys/ucontext.h108
-rw-r--r--sysdeps/posix/pread.c6
-rw-r--r--sysdeps/posix/pread64.c60
-rw-r--r--sysdeps/posix/pwrite.c3
-rw-r--r--sysdeps/posix/pwrite64.c59
-rw-r--r--sysdeps/powerpc/bits/fenv.h4
-rw-r--r--sysdeps/powerpc/bits/mathinline.h6
-rw-r--r--sysdeps/powerpc/dl-machine.h5
-rw-r--r--sysdeps/sparc/sparc32/elf/start.S2
-rw-r--r--sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/pread64.c1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/pwrite64.c1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h16
-rw-r--r--sysdeps/unix/sysv/linux/net/if_arp.h3
-rw-r--r--sysdeps/unix/sysv/linux/net/if_packet.h26
-rw-r--r--sysdeps/unix/sysv/linux/pread.c28
-rw-r--r--sysdeps/unix/sysv/linux/pread64.c53
-rw-r--r--sysdeps/unix/sysv/linux/pwrite.c28
-rw-r--r--sysdeps/unix/sysv/linux/pwrite64.c53
-rw-r--r--sysdeps/unix/sysv/linux/s_pread64.c30
-rw-r--r--sysdeps/unix/sysv/linux/s_pwrite64.c30
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/socket.S48
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/sys/prctl.h32
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list2
51 files changed, 760 insertions, 124 deletions
diff --git a/sysdeps/generic/_strerror.c b/sysdeps/generic/_strerror.c
index 83156293a5..bcba45d519 100644
--- a/sysdeps/generic/_strerror.c
+++ b/sysdeps/generic/_strerror.c
@@ -45,7 +45,7 @@ _strerror_internal (int errnum, char *buf, size_t buflen)
       const size_t unklen = strlen (unk);
       char *p = buf + buflen;
       *--p = '\0';
-      p = _itoa (errnum, p, 10, 0);
+      p = _itoa_word (errnum, p, 10, 0);
       return memcpy (p - unklen, unk, unklen);
     }
 
diff --git a/sysdeps/generic/des_impl.c b/sysdeps/generic/des_impl.c
index e0a3af9dd9..f801a841fc 100644
--- a/sysdeps/generic/des_impl.c
+++ b/sysdeps/generic/des_impl.c
@@ -18,6 +18,8 @@
 
 /* We must not distribute the DES implementation as part of the glibc.
    So we have to provide a dummy version here.  */
+#include <des.h>
+
 int
 _des_crypt (char *buf, unsigned len, struct desparams *desp)
 {
diff --git a/sysdeps/generic/dl-cache.c b/sysdeps/generic/dl-cache.c
index c704fd869d..36d6c707d3 100644
--- a/sysdeps/generic/dl-cache.c
+++ b/sysdeps/generic/dl-cache.c
@@ -53,10 +53,7 @@ _dl_load_cache_lookup (const char *name)
   static struct cache_file *cache;
   static size_t cachesize;
   unsigned int i;
-
-  if (cache == (void *) -1)
-    /* Previously looked for the cache file and didn't find it.  */
-    return NULL;
+  const char *best;
 
   if (cache == NULL)
     {
@@ -76,6 +73,11 @@ _dl_load_cache_lookup (const char *name)
 	}
     }
 
+  if (cache == (void *) -1)
+    /* Previously looked for the cache file and didn't find it.  */
+    return NULL;
+
+  best = NULL;
   for (i = 0; i < cache->nlibs; ++i)
     if ((cache->libs[i].flags == 1 ||
 	 cache->libs[i].flags == 3) && /* ELF library entry.  */
@@ -85,7 +87,14 @@ _dl_load_cache_lookup (const char *name)
 	/* Does the name match?  */
 	! strcmp (name, ((const char *) &cache->libs[cache->nlibs] +
 			 cache->libs[i].key)))
-      return (const char *) &cache->libs[cache->nlibs] + cache->libs[i].value;
+      {
+	best = ((const char *) &cache->libs[cache->nlibs]
+		+ cache->libs[i].value);
 
-  return NULL;
+	if (cache->libs[i].flags == 3)
+	  /* We've found an exact match for the shared object and no
+	     general `ELF' release.  Stop searching.  */
+	  break;
+      }
+  return best;
 }
diff --git a/sysdeps/generic/memcmp.c b/sysdeps/generic/memcmp.c
index 844cdc6afb..213ccc07de 100644
--- a/sysdeps/generic/memcmp.c
+++ b/sysdeps/generic/memcmp.c
@@ -18,56 +18,64 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
 #endif
 
 #undef	__ptr_t
-#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
-#define	__ptr_t	void *
+#if defined __cplusplus || (defined __STDC__ && __STDC__)
+# define __ptr_t	void *
 #else /* Not C++ or ANSI C.  */
-#undef	const
-#define	const
-#define	__ptr_t	char *
+# undef	const
+# define const
+# define __ptr_t	char *
 #endif /* C++ or ANSI C.  */
 
-#if defined (HAVE_STRING_H) || defined (_LIBC)
-#include <string.h>
+#ifndef __P
+# if defined __GNUC__ || (defined __STDC__ && __STDC__)
+#  define __P(args) args
+# else
+#  define __P(args) ()
+# endif  /* GCC.  */
+#endif  /* Not __P.  */
+
+#if defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
 #endif
 
 #undef memcmp
 
 #ifdef _LIBC
 
-#include <memcopy.h>
+# include <memcopy.h>
 
 #else	/* Not in the GNU C library.  */
 
-#include <sys/types.h>
+# include <sys/types.h>
 
 /* Type to use for aligned memory operations.
    This should normally be the biggest type supported by a single load
    and store.  Must be an unsigned type.  */
-#define	op_t	unsigned long int
-#define OPSIZ	(sizeof(op_t))
+# define op_t	unsigned long int
+# define OPSIZ	(sizeof(op_t))
 
 /* Threshold value for when to enter the unrolled loops.  */
-#define	OP_T_THRES	16
+# define OP_T_THRES	16
 
 /* Type to use for unaligned operations.  */
 typedef unsigned char byte;
 
-#ifndef WORDS_BIGENDIAN
-#define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2)))
-#else
-#define MERGE(w0, sh_1, w1, sh_2) (((w0) << (sh_1)) | ((w1) >> (sh_2)))
-#endif
+# ifndef WORDS_BIGENDIAN
+#  define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2)))
+# else
+#  define MERGE(w0, sh_1, w1, sh_2) (((w0) << (sh_1)) | ((w1) >> (sh_2)))
+# endif
 
 #endif	/* In the GNU C library.  */
 
 #ifdef WORDS_BIGENDIAN
-#define CMP_LT_OR_GT(a, b) ((a) > (b) ? 1 : -1)
+# define CMP_LT_OR_GT(a, b) ((a) > (b) ? 1 : -1)
 #else
-#define CMP_LT_OR_GT(a, b) memcmp_bytes ((a), (b))
+# define CMP_LT_OR_GT(a, b) memcmp_bytes ((a), (b))
 #endif
 
 /* BE VERY CAREFUL IF YOU CHANGE THIS CODE!  */
@@ -90,9 +98,9 @@ typedef unsigned char byte;
 
 static int memcmp_bytes __P((op_t, op_t));
 
-#ifdef  __GNUC__
+# ifdef  __GNUC__
 __inline
-#endif
+# endif
 static int
 memcmp_bytes (a, b)
      op_t a, b;
@@ -376,6 +384,6 @@ memcmp (s1, s2, len)
 }
 
 #ifdef weak_alias
-#undef bcmp
+# undef bcmp
 weak_alias (memcmp, bcmp)
 #endif
diff --git a/sysdeps/generic/pread.c b/sysdeps/generic/pread.c
index 5fdaf7b4af..82548d0272 100644
--- a/sysdeps/generic/pread.c
+++ b/sysdeps/generic/pread.c
@@ -22,7 +22,7 @@
 /* Read NBYTES into BUF from FD at the given position OFFSET without
    changing the file pointer.  Return the number read or -1.  */
 ssize_t
-pread (int fd, void *buf, size_t nbytes, off_t offset)
+__pread (int fd, void *buf, size_t nbytes, off_t offset)
 {
   if (nbytes == 0)
     return 0;
@@ -40,5 +40,6 @@ pread (int fd, void *buf, size_t nbytes, off_t offset)
   __set_errno (ENOSYS);
   return -1;
 }
+weak_alias (__pread, pread)
 stub_warning (pread)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/pread64.c b/sysdeps/generic/pread64.c
index fdf622250b..e1596038ac 100644
--- a/sysdeps/generic/pread64.c
+++ b/sysdeps/generic/pread64.c
@@ -22,7 +22,7 @@
 /* Read NBYTES into BUF from FD at the given position OFFSET without
    changing the file pointer.  Return the number read or -1.  */
 ssize_t
-pread64 (int fd, void *buf, size_t nbytes, off64_t offset)
+__pread64 (int fd, void *buf, size_t nbytes, off64_t offset)
 {
   if (nbytes == 0)
     return 0;
@@ -40,5 +40,6 @@ pread64 (int fd, void *buf, size_t nbytes, off64_t offset)
   __set_errno (ENOSYS);
   return -1;
 }
+weak_alias (__pread64, pread64)
 stub_warning (pread64)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/pwrite.c b/sysdeps/generic/pwrite.c
index 48a1dc6089..8eec560c9d 100644
--- a/sysdeps/generic/pwrite.c
+++ b/sysdeps/generic/pwrite.c
@@ -22,7 +22,7 @@
 /* Write NBYTES of BUF to FD at given position OFFSET without changing
    the file position.  Return the number written, or -1.  */
 ssize_t
-pwrite (int fd, const void *buf, size_t nbytes, off_t offset)
+__pwrite (int fd, const void *buf, size_t nbytes, off_t offset)
 {
   if (nbytes == 0)
     return 0;
@@ -40,5 +40,6 @@ pwrite (int fd, const void *buf, size_t nbytes, off_t offset)
   __set_errno (ENOSYS);
   return -1;
 }
+weak_alias (__pwrite, pwrite)
 stub_warning (pwrite)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/pwrite64.c b/sysdeps/generic/pwrite64.c
index df229f877f..d84b63576a 100644
--- a/sysdeps/generic/pwrite64.c
+++ b/sysdeps/generic/pwrite64.c
@@ -22,7 +22,7 @@
 /* Write NBYTES of BUF to FD at given position OFFSET without changing
    the file position.  Return the number written, or -1.  */
 ssize_t
-pwrite64 (int fd, const void *buf, size_t nbytes, off64_t offset)
+__pwrite64 (int fd, const void *buf, size_t nbytes, off64_t offset)
 {
   if (nbytes == 0)
     return 0;
@@ -40,5 +40,6 @@ pwrite64 (int fd, const void *buf, size_t nbytes, off64_t offset)
   __set_errno (ENOSYS);
   return -1;
 }
+weak_alias (__pwrite64, pwrite64)
 stub_warning (pwrite64)
 #include <stub-tag.h>
diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h
index 80fcc48a2b..210bf7f745 100644
--- a/sysdeps/i386/i486/bits/string.h
+++ b/sysdeps/i386/i486/bits/string.h
@@ -979,12 +979,14 @@ __strchr_g (__const char *__s, int __c)
 }
 
 
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Find the first occurrence of C in S.  This is the BSD name.  */
-#define _HAVE_STRING_ARCH_index 1
-#define index(s, c) \
+# define _HAVE_STRING_ARCH_index 1
+# define index(s, c) \
   (__extension__ (__builtin_constant_p (c)				      \
 		  ? __strchr_c (s, ((c) & 0xff) << 8)			      \
 		  : __strchr_g (s, c)))
+#endif
 
 
 /* Find the last occurrence of C in S.  */
@@ -1075,12 +1077,14 @@ __strrchr_g (__const char *__s, int __c)
 #endif
 
 
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Find the last occurrence of C in S.  This is the BSD name.  */
-#define _HAVE_STRING_ARCH_rindex 1
-#define rindex(s, c) \
+# define _HAVE_STRING_ARCH_rindex 1
+# define rindex(s, c) \
   (__extension__ (__builtin_constant_p (c)				      \
 		  ? __strrchr_c (s, ((c) & 0xff) << 8)			      \
 		  : __strrchr_g (s, c)))
+#endif
 
 
 /* Return the length of the initial segment of S which
diff --git a/sysdeps/libm-ieee754/s_llrintl.c b/sysdeps/libm-ieee754/s_llrintl.c
index 29fc3a300d..d3b9b12d76 100644
--- a/sysdeps/libm-ieee754/s_llrintl.c
+++ b/sysdeps/libm-ieee754/s_llrintl.c
@@ -34,7 +34,7 @@ long long int
 __llrintl (long double x)
 {
   int32_t se,j0;
-  u_int32_t i0, i1, i;
+  u_int32_t i0, i1;
   long long int result;
   volatile long double w;
   long double t;
@@ -45,23 +45,11 @@ __llrintl (long double x)
   sx = (se >> 15) & 1;
   j0 = (se & 0x7fff) - 0x3fff;
 
-  if (j0 < 31)
+  if (j0 < (int32_t) (8 * sizeof (long long int)))
     {
       if (j0 < -1)
 	return 0;
-      else
-	{
-	  w = two63[sx] + x;
-	  t = w - two63[sx];
-	  GET_LDOUBLE_WORDS (se, i0, i1, t);
-	  j0 = (se & 0x7fff) - 0x3fff;
-
-	  result = i0 >> (31 - j0);
-	}
-    }
-  else if (j0 < (int32_t) (8 * sizeof (long long int)))
-    {
-      if (j0 >= 63)
+      else if (j0 >= 63)
 	result = ((long long int) i0 << (j0 - 31)) | (i1 << (j0 - 63));
       else
 	{
@@ -70,7 +58,10 @@ __llrintl (long double x)
 	  GET_LDOUBLE_WORDS (se, i0, i1, t);
 	  j0 = (se & 0x7fff) - 0x3fff;
 
-	  result = ((long long int) i0 << (j0 - 31)) | (j >> (63 - j0));
+	  if (j0 < 31)
+	    result = i0 >> (31 - j0);
+	  else
+	    result = ((long long int) i0 << (j0 - 31)) | (i1 >> (63 - j0));
 	}
     }
   else
diff --git a/sysdeps/libm-ieee754/s_lrintl.c b/sysdeps/libm-ieee754/s_lrintl.c
index 8607851669..5a41427f72 100644
--- a/sysdeps/libm-ieee754/s_lrintl.c
+++ b/sysdeps/libm-ieee754/s_lrintl.c
@@ -34,7 +34,7 @@ long int
 __lrintl (long double x)
 {
   int32_t se,j0;
-  u_int32_t i0,i1,i;
+  u_int32_t i0, i1;
   long int result;
   volatile long double w;
   long double t;
@@ -70,7 +70,7 @@ __lrintl (long double x)
 	  GET_LDOUBLE_WORDS (se, i0, i1, t);
 	  j0 = (se & 0x7fff) - 0x3fff;
 
-	  result = ((long int) i0 << (j0 - 31)) | (j >> (63 - j0));
+	  result = ((long int) i0 << (j0 - 31)) | (i1 >> (63 - j0));
 	}
     }
   else
diff --git a/sysdeps/libm-ieee754/s_nextafterxf.c b/sysdeps/libm-ieee754/s_nextafterxf.c
index 7e870805e2..a4726b41b8 100644
--- a/sysdeps/libm-ieee754/s_nextafterxf.c
+++ b/sysdeps/libm-ieee754/s_nextafterxf.c
@@ -25,7 +25,7 @@ static char rcsid[] = "$NetBSD: $";
 #else
 	float __nextafterxf(x,y)
 	float x;
-	log double y;
+	long double y;
 #endif
 {
 	int32_t hx,ix,iy;
diff --git a/sysdeps/m68k/fpu/bits/mathinline.h b/sysdeps/m68k/fpu/bits/mathinline.h
index 1e68ea00c0..c3ed76c0de 100644
--- a/sysdeps/m68k/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/fpu/bits/mathinline.h
@@ -76,12 +76,16 @@
 /* This is used when defining the functions themselves.  Define them with
    __ names, and with `static inline' instead of `extern inline' so the
    bodies will always be used, never an external function call.  */
-# define __m81_u(x)		__CONCAT(__,x)
-# define __m81_inline		static __inline
+#define __m81_u(x)		__CONCAT(__,x)
+#define __m81_inline		static __inline
 #else
-# define __m81_u(x)		x
-# define __m81_inline		extern __inline
-# define __M81_MATH_INLINES	1
+#define __m81_u(x)		x
+#ifdef __cplusplus
+#define __m81_inline		__inline
+#else
+#define __m81_inline		extern __inline
+#endif
+#define __M81_MATH_INLINES	1
 #endif
 
 /* Define a const math function.  */
@@ -95,12 +99,12 @@
    is the name of the fpu operation (without leading f).  */
 
 #if defined __USE_MISC || defined __USE_ISOC9X
-# define __inline_mathop(func, op)			\
+#define __inline_mathop(func, op)			\
   __inline_mathop1(double, func, op)			\
   __inline_mathop1(float, __CONCAT(func,f), op)		\
   __inline_mathop1(long double, __CONCAT(func,l), op)
 #else
-# define __inline_mathop(func, op)			\
+#define __inline_mathop(func, op)			\
   __inline_mathop1(double, func, op)
 #endif
 
@@ -309,13 +313,19 @@ __m81_defun (int, __CONCAT(__signbit,s), (float_type __value))		  \
 }									  \
 									  \
 __m81_defun (float_type, __CONCAT(__scalbn,s),				  \
-	     (float_type __x, long int __n))				  \
+	     (float_type __x, int __n))					  \
 {									  \
   float_type __result;							  \
   __asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x));  \
   return __result;							  \
 }									  \
 									  \
+__m81_defun (float_type, __CONCAT(__scalbln,s),				  \
+	     (float_type __x, long int __n))				  \
+{									  \
+  return __CONCAT(__scalbn,s) (__x, __n);				  \
+}									  \
+									  \
 __m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x))	  \
 {									  \
   float_type __result;							  \
@@ -330,12 +340,26 @@ __m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x))	  \
   return __result;							  \
 }									  \
 									  \
+__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x))		  \
+{									  \
+  long int __result;							  \
+  __asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x));		  \
+  return __result;							  \
+}									  \
+									  \
 __m81_inline void							  \
 __m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx,	  \
 			      float_type *__cosx)			  \
 {									  \
   __asm ("fsincos%.x %2,%1:%0"						  \
 	 : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x));			  \
+}									  \
+									  \
+__m81_inline float_type							  \
+__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y,		  \
+			   float_type __z)				  \
+{									  \
+  return (__x * __y) + __z;						  \
 }
 
 /* This defines the three variants of the inline functions.  */
@@ -344,17 +368,12 @@ __inline_functions (float,f)
 __inline_functions (long double,l)
 #undef __inline_functions
 
-__m81_defun (long int, __lrint, (long double __x))
-{
-  long int __result;
-  __asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x));
-  return __result;
-}
-
 #if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
 
 /* Define inline versions of the user visible functions.  */
 
+/* Note that there must be no whitespace before the argument passed for
+   NAME, to make token pasting work correctly with -traditional.  */
 #define __inline_forward_c(rettype, name, args1, args2)	\
 extern __inline rettype __attribute__((__const__))	\
 name args1						\
@@ -375,7 +394,8 @@ __inline_forward_c(double,ceil, (double __x), (__x))
 #ifdef __USE_MISC
 __inline_forward_c(int,isinf, (double __value), (__value))
 __inline_forward_c(int,finite, (double __value), (__value))
-__inline_forward_c(double,scalbn, (double __x, long int __n), (__x, __n))
+__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n))
+__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
 #endif
 #if defined __USE_MISC || defined __USE_XOPEN
 #ifndef __USE_ISOC9X /* Conflict with macro of same name.  */
@@ -384,6 +404,9 @@ __inline_forward_c(int,isnan, (double __value), (__value))
 #endif
 #ifdef __USE_ISOC9X
 __inline_forward_c(double,nearbyint, (double __value), (__value))
+__inline_forward_c(long int,lrint, (double __value), (__value))
+__inline_forward_c(double,fma, (double __x, double __y, double __z),
+		   (__x, __y, __z))
 #endif
 #ifdef __USE_GNU
 __inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
@@ -399,11 +422,15 @@ __inline_forward_c(float,ceilf, (float __x), (__x))
 #ifdef __USE_MISC
 __inline_forward_c(int,isinff, (float __value), (__value))
 __inline_forward_c(int,finitef, (float __value), (__value))
-__inline_forward_c(float,scalbnf, (float __x, long int __n), (__x, __n))
+__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n))
+__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
 __inline_forward_c(int,isnanf, (float __value), (__value))
 #endif
 #ifdef __USE_ISOC9X
 __inline_forward_c(float,nearbyintf, (float __value), (__value))
+__inline_forward_c(long int,lrintf, (float __value), (__value))
+__inline_forward_c(float,fmaf, (float __x, float __y, float __z),
+		   (__x, __y, __z))
 #endif
 #ifdef __USE_GNU
 __inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx),
@@ -417,13 +444,17 @@ __inline_forward_c(long double,ceill, (long double __x), (__x))
 #ifdef __USE_MISC
 __inline_forward_c(int,isinfl, (long double __value), (__value))
 __inline_forward_c(int,finitel, (long double __value), (__value))
-__inline_forward_c(long double,scalbnl, (long double __x, long int __n),
+__inline_forward_c(long double,scalbnl, (long double __x, int __n), (__x, __n))
+__inline_forward_c(long double,scalblnl, (long double __x, long int __n),
 		   (__x, __n))
 __inline_forward_c(int,isnanl, (long double __value), (__value))
 #endif
 #ifdef __USE_ISOC9X
 __inline_forward_c(long double,nearbyintl, (long double __value), (__value))
-__inline_forward_c(long int,lrint, (long double __value), (__value))
+__inline_forward_c(long int,lrintl, (long double __value), (__value))
+__inline_forward_c(long double,fmal,
+		   (long double __x, long double __y, long double __z),
+		   (__x, __y, __z))
 #endif
 #ifdef __USE_GNU
 __inline_forward(void,sincosl,
diff --git a/sysdeps/m68k/fpu/s_lrint.c b/sysdeps/m68k/fpu/s_lrint.c
index a7044113af..511d28880c 100644
--- a/sysdeps/m68k/fpu/s_lrint.c
+++ b/sysdeps/m68k/fpu/s_lrint.c
@@ -22,10 +22,20 @@
 #define __LIBC_M81_MATH_INLINES
 #include <math.h>
 
+#ifndef suffix
+#define suffix /*empty*/
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define CONCATX(a,b) __CONCAT(a,b)
+
 long int
-__lrint (long double x)
+CONCATX(__lrint,suffix) (float_type x)
 {
-  return __m81_u(__lrint) (x);
+  return __m81_u(CONCATX(__lrint,suffix)) (x);
 }
 
-weak_alias (__lrint, lrint)
+#define weak_aliasx(a,b) weak_alias(a,b)
+weak_aliasx (CONCATX(__lrint,suffix), CONCATX(lrint,suffix))
diff --git a/sysdeps/m68k/fpu/s_lrintf.c b/sysdeps/m68k/fpu/s_lrintf.c
new file mode 100644
index 0000000000..44924cb82f
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_lrintf.c
@@ -0,0 +1,3 @@
+#define suffix f
+#define float_type float
+#include <s_lrint.c>
diff --git a/sysdeps/m68k/fpu/s_lrintl.c b/sysdeps/m68k/fpu/s_lrintl.c
new file mode 100644
index 0000000000..cd0bd23b8a
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_lrintl.c
@@ -0,0 +1,3 @@
+#define suffix l
+#define float_type long double
+#include <s_lrint.c>
diff --git a/sysdeps/m68k/fpu/s_scalbln.c b/sysdeps/m68k/fpu/s_scalbln.c
new file mode 100644
index 0000000000..1009713fbc
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_scalbln.c
@@ -0,0 +1,2 @@
+/* Nothing to do.  This function is the same as scalbn.  So we define an
+   alias.  */
diff --git a/sysdeps/m68k/fpu/s_scalblnf.c b/sysdeps/m68k/fpu/s_scalblnf.c
new file mode 100644
index 0000000000..5e558c3540
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_scalblnf.c
@@ -0,0 +1,2 @@
+/* Nothing to do.  This function is the same as scalbnf.  So we define an
+   alias.  */
diff --git a/sysdeps/m68k/fpu/s_scalblnl.c b/sysdeps/m68k/fpu/s_scalblnl.c
new file mode 100644
index 0000000000..cda2ec11c8
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_scalblnl.c
@@ -0,0 +1,2 @@
+/* Nothing to do.  This function is the same as scalbnl.  So we define an
+   alias.  */
diff --git a/sysdeps/m68k/fpu/s_scalbn.c b/sysdeps/m68k/fpu/s_scalbn.c
index d3ba27fa46..1b219ec108 100644
--- a/sysdeps/m68k/fpu/s_scalbn.c
+++ b/sysdeps/m68k/fpu/s_scalbn.c
@@ -17,10 +17,22 @@
    Boston, MA 02111-1307, USA.  */
 
 #define __LIBC_M81_MATH_INLINES
+#define scalbln __no_scalbln_decl
+#define scalblnf __no_scalblnf_decl
+#define scalblnl __no_scalblnl_decl
+#define __scalbln __no__scalbln_decl
+#define __scalblnf __no__scalblnf_decl
+#define __scalblnl __no__scalblnl_decl
 #include <math.h>
-
-#ifndef FUNC
-#define FUNC scalbn
+#undef scalbln
+#undef scalblnf
+#undef scalblnl
+#undef __scalbln
+#undef __scalblnf
+#undef __scalblnl
+
+#ifndef suffix
+#define suffix /*empty*/
 #endif
 #ifndef float_type
 #define float_type double
@@ -29,12 +41,15 @@
 #define __CONCATX(a,b) __CONCAT(a,b)
 
 float_type
-__CONCATX(__,FUNC) (x, exp)
+__CONCATX(__scalbn,suffix) (x, exp)
      float_type x;
-     long int exp;
+     int exp;
 {
-  return __m81_u(__CONCATX(__,FUNC))(x, exp);
+  return __m81_u(__CONCATX(__scalbn,suffix))(x, exp);
 }
 
 #define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (__CONCATX(__,FUNC), FUNC)
+#define strong_aliasx(a,b) strong_alias(a,b)
+weak_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(scalbn,suffix))
+strong_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(__scalbln,suffix))
+weak_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(scalbln,suffix))
diff --git a/sysdeps/m68k/fpu/s_scalbnf.c b/sysdeps/m68k/fpu/s_scalbnf.c
index 33459718e9..547971836a 100644
--- a/sysdeps/m68k/fpu/s_scalbnf.c
+++ b/sysdeps/m68k/fpu/s_scalbnf.c
@@ -1,5 +1,3 @@
-#ifndef FUNC
-#define FUNC scalbnf
-#endif
+#define suffix f
 #define float_type float
 #include <s_scalbn.c>
diff --git a/sysdeps/m68k/fpu/s_scalbnl.c b/sysdeps/m68k/fpu/s_scalbnl.c
index c6ad95079c..874bafb04b 100644
--- a/sysdeps/m68k/fpu/s_scalbnl.c
+++ b/sysdeps/m68k/fpu/s_scalbnl.c
@@ -1,5 +1,3 @@
-#ifndef FUNC
-#define FUNC scalbnl
-#endif
+#define suffix l
 #define float_type long double
 #include <s_scalbn.c>
diff --git a/sysdeps/m68k/sys/ucontext.h b/sysdeps/m68k/sys/ucontext.h
new file mode 100644
index 0000000000..4776e7d821
--- /dev/null
+++ b/sysdeps/m68k/sys/ucontext.h
@@ -0,0 +1,108 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* System V/m68k ABI compliant context switching support.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* Type for general register.  */
+typedef int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	18
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+/* Number of each register is the `gregset_t' array.  */
+enum
+{
+  R_D0 = 0,
+#define R_D0	R_D0
+  R_D1 = 1,
+#define R_D1	R_D1
+  R_D2 = 2,
+#define R_D2	R_D2
+  R_D3 = 3,
+#define R_D3	R_D3
+  R_D4 = 4,
+#define R_D4	R_D4
+  R_D5 = 5,
+#define R_D5	R_D5
+  R_D6 = 6,
+#define R_D6	R_D6
+  R_D7 = 7,
+#define R_D7	R_D7
+  R_A0 = 8,
+#define R_A0	R_A0
+  R_A1 = 9,
+#define R_A1	R_A1
+  R_A2 = 10,
+#define R_A2	R_A2
+  R_A3 = 11,
+#define R_A3	R_A3
+  R_A4 = 12,
+#define R_A4	R_A4
+  R_A5 = 13,
+#define R_A5	R_A5
+  R_A6 = 14,
+#define R_A6	R_A6
+  R_A7 = 15,
+#define R_A7	R_A7
+  R_SP = 15,
+#define R_SP	R_SP
+  R_PC = 16,
+#define R_PC	R_PC
+  R_PS = 17
+#define R_PS	R_PS
+};
+
+/* Structure to describe FPU registers.  */
+typedef struct fpregset
+{
+  int f_pcr;
+  int f_psr;
+  int f_fpiaddr;
+  int f_fpregs[8][3];
+} fpregset_t;
+
+/* Context to describe whole processor state.  */
+typedef struct
+{
+  int version;
+  gregset_t gregs;
+} mcontext_t;
+
+#define MCONTEXT_VERSION 1
+
+/* Userlevel context.  */
+typedef struct ucontext
+{
+  unsigned long int uc_flags;
+  struct ucontext *uc_links;
+  __sigset_t uc_sigmask;
+  stack_t uc_stack;
+  mcontext_t uc_mcontext;
+  long int uc_filler[201];
+} ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/sysdeps/posix/pread.c b/sysdeps/posix/pread.c
index 300aabac65..22b8ca82bd 100644
--- a/sysdeps/posix/pread.c
+++ b/sysdeps/posix/pread.c
@@ -23,7 +23,7 @@
 #include <unistd.h>
 
 ssize_t
-pread (int fd, void *buf, size_t nbyte, off_t offset)
+__pread (int fd, void *buf, size_t nbyte, off_t offset)
 {
   /* Since we must not change the file pointer preserve the value so that
      we can restore it later.  */
@@ -54,3 +54,7 @@ pread (int fd, void *buf, size_t nbyte, off_t offset)
 
   return result;
 }
+
+#ifndef __pread
+weak_alias (__pread, pread)
+#endif
diff --git a/sysdeps/posix/pread64.c b/sysdeps/posix/pread64.c
new file mode 100644
index 0000000000..00b1f33bf2
--- /dev/null
+++ b/sysdeps/posix/pread64.c
@@ -0,0 +1,60 @@
+/* Read block from given position in file without changing file pointer.
+   POSIX version.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+ssize_t
+__pread64 (int fd, void *buf, size_t nbyte, off64_t offset)
+{
+  /* Since we must not change the file pointer preserve the value so that
+     we can restore it later.  */
+  int save_errno;
+  ssize_t result;
+  off64_t old_offset = lseek64 (fd, 0, SEEK_CUR);
+  if (old_offset == (off64_t) -1)
+    return -1;
+
+  /* Set to wanted position.  */
+  if (lseek64 (fd, offset, SEEK_SET) == (off64_t) -1)
+    return -1;
+
+  /* Write out the data.  */
+  result = read (fd, buf, nbyte);
+
+  /* Now we have to restore the position.  If this fails we have to
+     return this as an error.  But if the writing also failed we
+     return this error.  */
+  save_errno = errno;
+  if (lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1)
+    {
+      if (result == -1)
+	__set_errno (save_errno);
+      return -1;
+    }
+  __set_errno (save_errno);
+
+  return result;
+}
+
+#ifndef __pread64
+weak_alias (__pread64, pread64)
+#endif
diff --git a/sysdeps/posix/pwrite.c b/sysdeps/posix/pwrite.c
index 7c1ed45cca..65806a2e68 100644
--- a/sysdeps/posix/pwrite.c
+++ b/sysdeps/posix/pwrite.c
@@ -23,7 +23,7 @@
 #include <unistd.h>
 
 ssize_t
-pwrite (int fd, const void *buf, size_t nbyte, off_t offset)
+__pwrite (int fd, const void *buf, size_t nbyte, off_t offset)
 {
   /* Since we must not change the file pointer preserve the value so that
      we can restore it later.  */
@@ -54,3 +54,4 @@ pwrite (int fd, const void *buf, size_t nbyte, off_t offset)
 
   return result;
 }
+weak_alias (__pwrite, pwrite)
diff --git a/sysdeps/posix/pwrite64.c b/sysdeps/posix/pwrite64.c
new file mode 100644
index 0000000000..4045ed4344
--- /dev/null
+++ b/sysdeps/posix/pwrite64.c
@@ -0,0 +1,59 @@
+/* Write block to given position in file without changing file pointer.
+   POSIX version.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+ssize_t
+__pwrite64 (int fd, const void *buf, size_t nbyte, off64_t offset)
+{
+  /* Since we must not change the file pointer preserve the value so that
+     we can restore it later.  */
+  int save_errno;
+  ssize_t result;
+  off64_t old_offset = lseek64 (fd, 0, SEEK_CUR);
+  if (old_offset == (off64_t) -1)
+    return -1;
+
+  /* Set to wanted position.  */
+  if (lseek64 (fd, offset, SEEK_SET) == (off64_t) -1)
+    return -1;
+
+  /* Write out the data.  */
+  result = write (fd, buf, nbyte);
+
+  /* Now we have to restore the position.  If this fails we have to
+     return this as an error.  But if the writing also failed we
+     return this error.  */
+  save_errno = errno;
+  if (lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1)
+    {
+      if (result == -1)
+	__set_errno (save_errno);
+      return -1;
+    }
+  __set_errno (save_errno);
+
+  return result;
+}
+#ifndef __pwrite64
+weak_alias (__pwrite64, pwrite64)
+#endif
diff --git a/sysdeps/powerpc/bits/fenv.h b/sysdeps/powerpc/bits/fenv.h
index 8c26a2548f..9bb6600324 100644
--- a/sysdeps/powerpc/bits/fenv.h
+++ b/sysdeps/powerpc/bits/fenv.h
@@ -144,7 +144,7 @@ extern const fenv_t *__fe_nomask_env __P ((void));
 # define FE_NOMASK_ENV	(__fe_nomask_env ())
 #endif
 
-#ifdef __OPTIMIZE__
+#if defined __OPTIMIZE__ && !defined _SOFT_FLOAT
 /* Inline definition for fegetround.  */
 # define fegetround() \
   (__extension__  ({ int __fegetround_result;				      \
@@ -175,4 +175,4 @@ extern const fenv_t *__fe_nomask_env __P ((void));
 			    : : "i"(32 - __builtin_ffs (__excepts)));	      \
 		     } else						      \
 		       (feclearexcept) (__excepts); }))
-#endif /* __OPTIMIZE__ */
+#endif /* __OPTIMIZE__ && !_SOFT_FLOAT */
diff --git a/sysdeps/powerpc/bits/mathinline.h b/sysdeps/powerpc/bits/mathinline.h
index d7cabaf28b..24f186adf1 100644
--- a/sysdeps/powerpc/bits/mathinline.h
+++ b/sysdeps/powerpc/bits/mathinline.h
@@ -32,9 +32,9 @@ __sgn1 (double __x)
 {
   return __x >= 0.0 ? 1.0 : -1.0;
 }
-#endif /* __NO_MATH_INLINES && __OPTIMZE__ */
+#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
 
-#if __USE_ISOC9X
+#if __USE_ISOC9X && !defined _SOFT_FLOAT
 # define __unordered_cmp(x, y) \
   (__extension__							      \
    ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
@@ -48,6 +48,6 @@ __sgn1 (double __x)
 # define islessequal(x, y) ((__unordered_cmp (x, y) & 0xA) != 0)
 # define islessgreater(x, y) ((__unordered_cmp (x, y) & 0xC) != 0)
 # define isunordered(x, y) (__unordered_cmp (x, y) & 1)
-#endif /* __USE_ISOC9X */
+#endif /* __USE_ISOC9X && !_SOFT_FLOAT */
 
 #endif /* __GNUC__  */
diff --git a/sysdeps/powerpc/dl-machine.h b/sysdeps/powerpc/dl-machine.h
index 6ab79e79ac..6857f214a9 100644
--- a/sysdeps/powerpc/dl-machine.h
+++ b/sysdeps/powerpc/dl-machine.h
@@ -243,8 +243,7 @@ _dl_prof_resolve:
  # ...unwind the stack frame, and jump to the PLT entry we updated.
 	addi 1,1,48
 	bctr
-0:
-	.size	 _dl_prof_resolve,0b-_dl_prof_resolve
+	.size	 _dl_prof_resolve,.-_dl_prof_resolve
  # Undo '.section text'.
 	.previous
 ");
@@ -741,7 +740,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
     }
   else if (rinfo == R_PPC_JMP_SLOT)
     {
-      elf_machine_fixup_plt (map, reloc, reloc_addr, finalvalue);
+      elf_machine_fixup_plt (map, reloc, reloc_addr, finaladdr);
     }
   else
     {
diff --git a/sysdeps/sparc/sparc32/elf/start.S b/sysdeps/sparc/sparc32/elf/start.S
index 8e01b30fc7..24715e68be 100644
--- a/sysdeps/sparc/sparc32/elf/start.S
+++ b/sysdeps/sparc/sparc32/elf/start.S
@@ -54,7 +54,7 @@ _start:
      argument info starts after one register window (16 words) past the SP.  */
 	ld	[%sp+22*4], %o0
 	add	%sp, 23*4, %o1
-	sll	%o0, 4, %o2
+	sll	%o0, 2, %o2
 	add	%o2, %o1, %o2
 	sethi	%hi(__environ), %g2
 	add	%o2, 4, %o2
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 4bfc3eb352..8db8094dc1 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -76,6 +76,10 @@ sysdep_headers += netinet/in_systm.h netinet/udp.h \
 		  sys/socketvar.h
 endif
 
+ifeq ($(subdir),posix)
+sysdep_routines += s_pread64 s_pwrite64
+endif
+
 # Don't compile the ctype glue code, since there is no old non-GNU C library.
 inhibit-glue = yes
 
diff --git a/sysdeps/unix/sysv/linux/alpha/pread64.c b/sysdeps/unix/sysv/linux/alpha/pread64.c
new file mode 100644
index 0000000000..b7f298dea8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/pread64.c
@@ -0,0 +1 @@
+/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/alpha/pwrite64.c b/sysdeps/unix/sysv/linux/alpha/pwrite64.c
new file mode 100644
index 0000000000..b7f298dea8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/pwrite64.c
@@ -0,0 +1 @@
+/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index 71407062fb..9e4cd39a8f 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -21,6 +21,8 @@ getpeername	-	getpeername	3	__getpeername	getpeername
 getpriority	-	getpriority	2	__getpriority	getpriority
 mmap		-	mmap		6	__mmap		mmap
 llseek		EXTRA	lseek		3	llseek
+pread		EXTRA	pread		4	__pread		pread __pread64 pread64
+pwrite		EXTRA	pwrite		4	__pwrite	pwrite __pwrite64 pwrite64
 
 # these are actually common with the x86:
 fstatfs		-	fstatfs		2	__fstatfs	fstatfs
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 2a8d6ed004..8f859d2e3e 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -136,10 +136,10 @@ struct msghdr
     socklen_t msg_namelen;	/* Length of address data.  */
 
     struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
-    int msg_iovlen;		/* Number of elements in the vector.  */
+    size_t msg_iovlen;		/* Number of elements in the vector.  */
 
     __ptr_t msg_control;	/* Ancillary data (eg BSD filedesc passing). */
-    socklen_t msg_controllen;	/* Ancillary data buffer length.  */
+    size_t msg_controllen;	/* Ancillary data buffer length.  */
 
     int msg_flags;		/* Flags on received message.  */
   };
@@ -147,7 +147,7 @@ struct msghdr
 /* Structure used for storage of ancillary data object information.  */
 struct cmsghdr
   {
-    socklen_t cmsg_len;		/* Length of data in cmsg_data plus length
+    size_t cmsg_len;		/* Length of data in cmsg_data plus length
 				   of cmsghdr structure.  */
     int cmsg_level;		/* Originating protocol.  */
     int cmsg_type;		/* Protocol specific type.  */
@@ -195,6 +195,16 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
   return (struct cmsghdr *) __p;
 }
 
+/* Socket level message types.  This must match the definitions in
+   <linux/socket.h>.  */
+enum
+  {
+    SCM_RIGHTS = 0x01,		/* Data array contains access rights.  */
+#define SCM_RIGHTS SCM_RIGHTS
+    __SCM_CREDENTIALS = 0x02,	/* Data array is `struct ucred'.  */
+    __SCM_CONNECT = 0x03	/* Data array is `struct scm_connect'.  */
+  };
+
 
 /* Get socket manipulation related informations from kernel headers.  */
 #include <asm/socket.h>
diff --git a/sysdeps/unix/sysv/linux/net/if_arp.h b/sysdeps/unix/sysv/linux/net/if_arp.h
index d784f0cfc7..80f4516344 100644
--- a/sysdeps/unix/sysv/linux/net/if_arp.h
+++ b/sysdeps/unix/sysv/linux/net/if_arp.h
@@ -69,7 +69,7 @@ struct arphdr
 
 /* ARP protocol HARDWARE identifiers. */
 #define ARPHRD_NETROM	0		/* From KA9Q: NET/ROM pseudo. */
-#define ARPHRD_ETHER 	1		/* Ethernet 10Mbps.  */
+#define ARPHRD_ETHER 	1		/* Ethernet 10/100Mbps.  */
 #define	ARPHRD_EETHER	2		/* Experimental Ethernet.  */
 #define	ARPHRD_AX25	3		/* AX.25 Level 2.  */
 #define	ARPHRD_PRONET	4		/* PROnet token ring.  */
@@ -92,6 +92,7 @@ struct arphdr
 #define ARPHRD_PPP	512
 #define ARPHRD_HDLC	513		/* (Cisco) HDLC.  */
 #define ARPHRD_LAPB	516		/* LAPB.  */
+#define ARPHRD_ASH	517		/* ASH.  */
 
 #define ARPHRD_TUNNEL	768		/* IPIP tunnel.  */
 #define ARPHRD_TUNNEL6	769		/* IPIP6 tunnel.  */
diff --git a/sysdeps/unix/sysv/linux/net/if_packet.h b/sysdeps/unix/sysv/linux/net/if_packet.h
new file mode 100644
index 0000000000..60155eeac3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/net/if_packet.h
@@ -0,0 +1,26 @@
+/* Definitions for use with Linux SOCK_PACKET sockets.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef __IF_PACKET_H
+#define __IF_PACKET_H
+
+/* For now we can just use the kernel definitions.  */
+#include <linux/if_packet.h>
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c
new file mode 100644
index 0000000000..eeb26eb663
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pread.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <unistd.h>
+
+ssize_t
+__pread (int fd, void *buf, size_t nbytes, off_t offset)
+{
+  return __pread64 (fd, buf, nbytes, (off64_t) offset);
+}
+
+weak_alias (__pread, pread)
diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c
new file mode 100644
index 0000000000..e2505dbaa4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pread64.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+extern ssize_t __syscall_pread64 (int fd, void *buf, size_t count,
+				  off_t offset_hi, off_t offset_lo);
+
+static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
+				  off64_t offset) internal_function;
+
+
+ssize_t
+__pread64 (fd, buf, count, offset)
+     int fd;
+     void *buf;
+     size_t count;
+     off64_t offset;
+{
+  ssize_t result;
+
+  /* First try the syscall.  */
+  result = __syscall_pread64 (fd, buf, count, (off_t) (offset >> 32),
+			      (off_t) (offset & 0xffffffff));
+  if (result == -1 && errno == ENOSYS)
+    /* No system call available.  Use the emulation.  */
+    result = __emulate_pread64 (fd, buf, count, offset);
+
+  return result;
+}
+
+weak_alias (__pread64, pread64)
+
+#define __pread64(fd, buf, count, offset) \
+     static internal_function __emulate_pread64 (fd, buf, count, offset)
+#include <sysdeps/posix/pread64.c>
diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c
new file mode 100644
index 0000000000..d8695db2a8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pwrite.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <unistd.h>
+
+ssize_t
+__pwrite (int fd, const void *buf, size_t nbytes, off_t offset)
+{
+  return __pwrite64 (fd, buf, nbytes, (off64_t) offset);
+}
+
+weak_alias (__pwrite, pwrite)
diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c
new file mode 100644
index 0000000000..f2b4bcbe4e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pwrite64.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+extern ssize_t __syscall_pwrite64 (int fd, const void *buf, size_t count,
+				   off_t offset_hi, off_t offset_lo);
+
+static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
+				   off64_t offset) internal_function;
+
+
+ssize_t
+__pwrite64 (fd, buf, count, offset)
+     int fd;
+     const void *buf;
+     size_t count;
+     off64_t offset;
+{
+  ssize_t result;
+
+  /* First try the syscall.  */
+  result = __syscall_pwrite64 (fd, buf, count, (off_t) (offset >> 32),
+			       (off_t) (offset & 0xffffffff));
+  if (result == -1 && errno == ENOSYS)
+    /* No system call available.  Use the emulation.  */
+    result = __emulate_pwrite64 (fd, buf, count, offset);
+
+  return result;
+}
+
+weak_alias (__pwrite64, pwrite64)
+
+#define __pwrite64(fd, buf, count, offset) \
+     static internal_function __emulate_pwrite64 (fd, buf, count, offset)
+#include <sysdeps/posix/pwrite64.c>
diff --git a/sysdeps/unix/sysv/linux/s_pread64.c b/sysdeps/unix/sysv/linux/s_pread64.c
new file mode 100644
index 0000000000..9c25a05e18
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s_pread64.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+/* This file is used if no system call is available.  */
+ssize_t
+__syscall_pread64 (int fd, char *buf, size_t count,
+		   off_t offset_hi, off_t offset_lo)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
diff --git a/sysdeps/unix/sysv/linux/s_pwrite64.c b/sysdeps/unix/sysv/linux/s_pwrite64.c
new file mode 100644
index 0000000000..bed11fd8ee
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s_pwrite64.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+/* This file is used if no system call is available.  */
+ssize_t
+__syscall_pwrite64 (int fd, const char *buf, size_t count,
+		    off_t offset_hi, off_t offset_lo)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h b/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h
index 9bbe6bcdab..384c5c219b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h
@@ -76,12 +76,12 @@
 	cmp	%g2, 0
 	beq	3f
 	 sethi	%hi(__libc_multiple_libcs), %g3
-	ld	[%g4+%g2], %g2
+	ld	[%g2], %g2
 	subcc	%g0, %g2, %g0
 	subx	%g0, -1, %g2
 3:	or	%g3, %lo(__libc_multiple_libcs), %g3
 	cmp	%g2, 0
-	st	%g2, [%g3+%g4]
+	st	%g2, [%g3]
 	/* If so, argc et al are in %o0-%o2 already.  Otherwise, load them.  */
 	bnz	" #INIT "
 	 nop
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
index bdfc2fcc6d..4c65ac7f3c 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
@@ -23,6 +23,13 @@
 #define P(a, b) P2(a, b)
 #define P2(a, b) a##b
 
+#ifndef NARGS
+#ifdef socket
+#error NARGS not defined
+#endif
+#define NARGS 3
+#endif
+
 	.text
 /* The socket-oriented system calls are handled unusually in Linux.
    They are all gated through the single `socketcall' system call number.
@@ -34,25 +41,36 @@
 
 .globl P(__,socket)
 ENTRY (P(__,socket))
-	mov SYS_ify(socketcall), %g1    /* System call number */
 
-	/* Use ## so `socket' is a separate token that might be #define'd.  */
-	mov P(SOCKOP_,socket), %o0	/* Subcode is first arg to syscall.  */
-	mov %i0,%o1		        /* args pointer is second arg to syscall */
+	/* Drop up to 6 arguments (recvfrom) into the memory allocated by
+	   the caller for varargs, since that's really what we have.  */
+	st %o0, [%sp + 68 + 0]
+	st %o1, [%sp + 68 + 4]
+#if NARGS > 2
+	st %o2, [%sp + 68 + 8]
+#if NARGS > 3
+	st %o3, [%sp + 68 + 12]
+#if NARGS > 4
+	st %o4, [%sp + 68 + 16]
+#if NARGS > 5
+	st %o5, [%sp + 68 + 20]
+#endif
+#endif
+#endif
+#endif
 
+	mov P(SOCKOP_,socket), %o0	/* arg 1: socket subfunction */
+	add %sp, 68, %o1		/* arg 2: parameter block */
+	LOADSYSCALL(socketcall)
 	t 0x10
-	bcc,a	1
-	nop
-	save %sp,96,%sp
-	call __errno_location
-	nop
-	st %i0,[%o0]
-	restore
+
+        bcs,a 1f
+	 nop
 	retl
-	mov -1,%o0
-1:
-	ret
+	 nop
+
+1:	SYSCALL_ERROR_HANDLER
 
-PSEUDO_END (P(__,socket))
+END (P(__,socket))
 
 weak_alias (P(__,socket), socket)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c
new file mode 100644
index 0000000000..b7f298dea8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c
@@ -0,0 +1 @@
+/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c
new file mode 100644
index 0000000000..b7f298dea8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c
@@ -0,0 +1 @@
+/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
index e5425e9a29..d0bee8fa07 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
@@ -2,6 +2,8 @@
 
 # Whee! 64-bit systems naturally implement llseek.
 llseek		EXTRA	lseek		3	llseek
+pread		EXTRA	pread		4	__pread		pread __pread64 pread64
+pwrite		EXTRA	pwrite		4	__pwrite	pwrite __pwrite64 pwrite64
 
 # Override select.S in parent directory:
 select		-	select		5	__select	select
diff --git a/sysdeps/unix/sysv/linux/sys/prctl.h b/sysdeps/unix/sysv/linux/sys/prctl.h
new file mode 100644
index 0000000000..b5b4412fc4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sys/prctl.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYS_PRCTL_H
+#define _SYS_PRCTL_H	1
+
+#include <features.h>
+#include <linux/prctl.h>  /*  The magic values come from here  */
+
+__BEGIN_DECLS
+
+/* Control process execution.  */
+extern int prctl __P ((int __option, ...));
+
+__END_DECLS
+
+#endif  /* sys/prctl.h */
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 6028a04aaf..a1fe445739 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -38,7 +38,9 @@ quotactl	EXTRA	quotactl	4	quotactl
 s_getdents	EXTRA	getdents	3	__getdents
 s_getpriority	getpriority getpriority	2	__syscall_getpriority
 s_poll		poll	poll		3	__syscall_poll
+s_pread64	EXTRA	pread		5	__syscall_pread64
 s_ptrace	ptrace	ptrace		4	__syscall_ptrace
+s_pwrite64	EXTRA	pwrite		5	__syscall_pwrite64
 s_reboot	EXTRA	reboot		3	__syscall_reboot
 s_sigaction	sigaction sigaction	3	__syscall_sigaction
 s_sigsuspend	sigsuspend sigsuspend	3	__syscall_sigsuspend