about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog23
-rw-r--r--io/sys/poll.h5
-rw-r--r--libc.map2
-rw-r--r--math/atest-exp.c8
-rw-r--r--math/atest-exp2.c8
-rw-r--r--math/atest-sincos.c4
-rw-r--r--resolv/inet_addr.c51
-rw-r--r--sysdeps/alpha/Makefile7
-rw-r--r--sysdeps/alpha/dl-machine.h22
-rw-r--r--sysdeps/alpha/elf/start.S24
-rw-r--r--sysdeps/alpha/fpu/fraiseexcpt.c10
-rw-r--r--sysdeps/i386/fpu/bits/mathinline.h2
-rw-r--r--sysdeps/libm-ieee754/e_exp10.c1
-rw-r--r--sysdeps/libm-ieee754/e_exp10f.c1
-rw-r--r--sysdeps/libm-ieee754/e_exp10l.c1
15 files changed, 102 insertions, 67 deletions
diff --git a/ChangeLog b/ChangeLog
index aaa3e0d4f6..fe2d543fd1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+1998-06-27  7:07  Richard Henderson  <rth@cygnus.com>
+
+	* math/atest-exp.c (exp_mpn, main): Cast to mp_limb_t appropriately.
+	* math/atest-exp2.c (exp_mpn, main): Likewise.
+	* math/atest-sincos.c (main): Likewise.
+
+	* resolv/inet_addr.c (inet_aton): Check for 32-bit overflow.  Move
+	base handling away from strtoul.  Always reset errno.
+
+	* sysdeps/alpha/Makefile (elf): Kill -mno-fp-regs.
+
+	* sysdeps/alpha/dl-machine.h (elf_machine_runtime_setup): Only set
+	_dl_profile_map if _dl_name_match_p.
+	(RTLD_START): Fix .prologue.  Set __libc_stack_end.
+	* sysdeps/alpha/elf/start.S: Pass sp as arg 7.  Kill __data_start.
+
+	* sysdeps/alpha/fpu/fraiseexcpt.c (feraiseexcept): Mark tmp
+	as early-clobber.
+
+	* sysdeps/libm-ieee754/e_exp10.c: Include "math_private.h".
+	* sysdeps/libm-ieee754/e_exp10f.c: Likewise.
+	* sysdeps/libm-ieee754/e_exp10l.c: Likewise.
+
 1998-06-26  Ulrich Drepper  <drepper@cygnus.com>
 
 	* sysdeps/i386/fpu/bits/mathinline.h (__finite): Use alias-safe
diff --git a/io/sys/poll.h b/io/sys/poll.h
index b9af2cfc0e..9cb60e72ea 100644
--- a/io/sys/poll.h
+++ b/io/sys/poll.h
@@ -1,5 +1,5 @@
 /* Compatibility definitions for System V `poll' interface.
-   Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1996, 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
@@ -41,7 +41,8 @@ struct pollfd
    an event to occur; if TIMEOUT is -1, block until an event occurs.
    Returns the number of file descriptors with events, zero if timed out,
    or -1 for errors.  */
-
+extern int __poll __P ((struct pollfd *__fds, unsigned long int __nfds,
+			int __timeout));
 extern int poll __P ((struct pollfd *__fds, unsigned long int __nfds,
 		      int __timeout));
 
diff --git a/libc.map b/libc.map
index 314bd8b959..ff0d42c2af 100644
--- a/libc.map
+++ b/libc.map
@@ -497,7 +497,7 @@ GLIBC_2.1 {
     __xstat64; __fxstat64; __lxstat64;
     __pread64; __pwrite64;
     __backtrace; __backtrace_symbols;
-    _dl_mcount; _dl_mcount_wrapper;
+    _dl_mcount; _dl_mcount_wrapper; __poll;
 
     # helper functions
     __libc_current_sigrtmin; __libc_current_sigrtmax; __libc_allocate_rtsig;
diff --git a/math/atest-exp.c b/math/atest-exp.c
index 28e572c444..4cab953e46 100644
--- a/math/atest-exp.c
+++ b/math/atest-exp.c
@@ -67,9 +67,9 @@ exp_mpn (mp1 ex, mp1 x)
 
    memset (xp, 0, sizeof (mp1));
    memset (ex, 0, sizeof (mp1));
-   xp[FRAC / mpbpl] = 1 << FRAC % mpbpl;
+   xp[FRAC / mpbpl] = (mp_limb_t)1 << FRAC % mpbpl;
    memset (tol,0, sizeof (mp1));
-   tol[(FRAC - TOL) / mpbpl] = 1 << (FRAC - TOL) % mpbpl;
+   tol[(FRAC - TOL) / mpbpl] = (mp_limb_t)1 << (FRAC - TOL) % mpbpl;
 
    n = 0;
 
@@ -119,7 +119,7 @@ main (void)
 
    memset (maxerror, 0, sizeof (mp1));
    memset (xt, 0, sizeof (mp1));
-   xt[(FRAC - N2) / mpbpl] = 1 << (FRAC - N2) % mpbpl;
+   xt[(FRAC - N2) / mpbpl] = (mp_limb_t)1 << (FRAC - N2) % mpbpl;
 
    for (i = 0; i < 1 << N2; i++)
    {
@@ -166,7 +166,7 @@ main (void)
 
    /* Check exp_mpn against precomputed value of exp(1).  */
    memset (x, '\0', sizeof (mp1));
-   x[FRAC / mpbpl] = 1 << FRAC % mpbpl;
+   x[FRAC / mpbpl] = (mp_limb_t)1 << FRAC % mpbpl;
    exp_mpn (ex, x);
 
    memset (e2, '\0', sizeof (mp1));
diff --git a/math/atest-exp2.c b/math/atest-exp2.c
index 1f5d7ccd86..7243944c66 100644
--- a/math/atest-exp2.c
+++ b/math/atest-exp2.c
@@ -107,9 +107,9 @@ exp_mpn (mp1 ex, mp1 x)
 
    memset (xp, 0, sizeof (mp1));
    memset (ex, 0, sizeof (mp1));
-   xp[FRAC / mpbpl] = 1 << FRAC % mpbpl;
+   xp[FRAC / mpbpl] = (mp_limb_t)1 << FRAC % mpbpl;
    memset (tol, 0, sizeof (mp1));
-   tol[(FRAC - TOL) / mpbpl] = 1 << (FRAC - TOL) % mpbpl;
+   tol[(FRAC - TOL) / mpbpl] = (mp_limb_t)1 << (FRAC - TOL) % mpbpl;
 
    n = 0;
 
@@ -170,7 +170,7 @@ main (void)
 
   memset (maxerror, 0, sizeof (mp1));
   memset (xt, 0, sizeof (mp1));
-  xt[(FRAC - N2) / mpbpl] = 1 << (FRAC - N2) % mpbpl;
+  xt[(FRAC - N2) / mpbpl] = (mp_limb_t)1 << (FRAC - N2) % mpbpl;
 
   for (i = 0; i < (1 << N2); ++i)
     {
@@ -219,7 +219,7 @@ main (void)
 
   /* Check exp_mpn against precomputed value of exp(1).  */
   memset (x, 0, sizeof (mp1));
-  x[FRAC / mpbpl] = 1 << FRAC % mpbpl;
+  x[FRAC / mpbpl] = (mp_limb_t)1 << FRAC % mpbpl;
   exp_mpn (ex, x);
   read_mpn_hex (e2, exp1);
   if (mpn_cmp (ex, e2, SZ) >= 0)
diff --git a/math/atest-sincos.c b/math/atest-sincos.c
index 98f1e719b1..2f4187c9c0 100644
--- a/math/atest-sincos.c
+++ b/math/atest-sincos.c
@@ -156,7 +156,7 @@ main (void)
   memset (sin_maxerror, 0, sizeof (mp1));
   memset (cos_maxerror, 0, sizeof (mp1));
   memset (xt, 0, sizeof (mp1));
-  xt[(FRAC - N2) / mpbpl] = 1 << (FRAC - N2) % mpbpl;
+  xt[(FRAC - N2) / mpbpl] = (mp_limb_t)1 << (FRAC - N2) % mpbpl;
 
   for (i = 0; i < 1 << N2; i++)
     {
@@ -232,7 +232,7 @@ main (void)
 
    /* Check Range-Kutta against precomputed values of sin(1) and cos(1).  */
    memset (x, 0, sizeof (mp1));
-   x[FRAC / mpbpl] = 1 << FRAC % mpbpl;
+   x[FRAC / mpbpl] = (mp_limb_t)1 << FRAC % mpbpl;
    sincosx_mpn (si, co, x, ox);
 
    memset (s2, 0, sizeof (mp1));
diff --git a/resolv/inet_addr.c b/resolv/inet_addr.c
index 635dd4596d..68659e9a04 100644
--- a/resolv/inet_addr.c
+++ b/resolv/inet_addr.c
@@ -102,13 +102,14 @@ inet_aton(cp, addr)
 	register u_int32_t val;	/* changed from u_long --david */
 	register int base, n;
 	register char c;
-	u_int parts[4];
-	register u_int *pp = parts;
+	u_int32_t parts[4];
+	register u_int32_t *pp = parts;
+
 #ifdef _LIBC
 	int saved_errno = errno;
-
 	__set_errno (0);
 #endif
+
 	c = *cp;
 	for (;;) {
 		/*
@@ -117,7 +118,18 @@ inet_aton(cp, addr)
 		 * 0x=hex, 0=octal, isdigit=decimal.
 		 */
 		if (!isdigit(c))
-			return (0);
+			goto ret_0;
+#ifdef _LIBC
+		{
+			unsigned long ul = strtoul (cp, (char **) &cp, 0);
+			if (ul == ULONG_MAX && errno == ERANGE)
+				goto ret_0;
+			if (ul > 0xfffffffful)
+				goto ret_0;
+			val = ul;
+		}
+		c = *cp;
+#else
 		base = 10;
 		if (c == '0') {
 			c = *++cp;
@@ -126,15 +138,6 @@ inet_aton(cp, addr)
 			else
 				base = 8;
 		}
-#ifdef _LIBC
-		val = strtoul (cp, (char **) &cp, base);
-		if (val == ULONG_MAX && errno == ERANGE)
-		{
-			__set_errno (saved_errno);
-			return 0;
-		}
-		c = *cp;
-#else
 		val = 0;
 		for (;;) {
 			if (isascii(c) && isdigit(c)) {
@@ -156,7 +159,7 @@ inet_aton(cp, addr)
 			 *	a.b	(with b treated as 24 bits)
 			 */
 			if (pp >= parts + 3)
-				return (0);
+				goto ret_0;
 			*pp++ = val;
 			c = *++cp;
 		} else
@@ -166,7 +169,7 @@ inet_aton(cp, addr)
 	 * Check for trailing characters.
 	 */
 	if (c != '\0' && (!isascii(c) || !isspace(c)))
-		return (0);
+		goto ret_0;
 	/*
 	 * Concoct the address according to
 	 * the number of parts specified.
@@ -175,30 +178,40 @@ inet_aton(cp, addr)
 	switch (n) {
 
 	case 0:
-		return (0);		/* initial nondigit */
+		goto ret_0;		/* initial nondigit */
 
 	case 1:				/* a -- 32 bits */
 		break;
 
 	case 2:				/* a.b -- 8.24 bits */
 		if (val > 0xffffff)
-			return (0);
+			goto ret_0;
 		val |= parts[0] << 24;
 		break;
 
 	case 3:				/* a.b.c -- 8.8.16 bits */
 		if (val > 0xffff)
-			return (0);
+			goto ret_0;
 		val |= (parts[0] << 24) | (parts[1] << 16);
 		break;
 
 	case 4:				/* a.b.c.d -- 8.8.8.8 bits */
 		if (val > 0xff)
-			return (0);
+			goto ret_0;
 		val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
 		break;
 	}
 	if (addr)
 		addr->s_addr = htonl(val);
+
+#ifdef _LIBC
+	__set_errno (saved_errno);
+#endif
 	return (1);
+
+ret_0:
+#ifdef _LIBC
+	__set_errno (saved_errno);
+#endif
+	return (0);
 }
diff --git a/sysdeps/alpha/Makefile b/sysdeps/alpha/Makefile
index 6cf4a173a6..250a31779c 100644
--- a/sysdeps/alpha/Makefile
+++ b/sysdeps/alpha/Makefile
@@ -31,12 +31,7 @@ endif
 
 ifeq ($(subdir),elf)
 # The ld.so startup code cannot use literals until it self-relocates.
- ifeq ($(elf),yes)
-  CFLAGS-rtld.c = -mbuild-constants
- endif
-# The rest of ld.so shouldn't use FP regs for block moves so
-# that the lazy link trampoline doesn't have to save them.
-sysdep-CFLAGS += -mno-fp-regs
+CFLAGS-rtld.c = -mbuild-constants
 endif
 
 divrem := divl divq reml remq
diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h
index 455fd7b695..8f639a94b9 100644
--- a/sysdeps/alpha/dl-machine.h
+++ b/sysdeps/alpha/dl-machine.h
@@ -106,8 +106,13 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
       else
 	{
 	  *(Elf64_Addr *)(plt + 16) = (Elf64_Addr) &_dl_runtime_profile;
-	  /* Say that we really want profiling and the timers are started.  */
-	  _dl_profile_map = l;
+
+	  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;
+	    }
 	}
 
       /* Identify this shared object */
@@ -131,7 +136,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 " #tramp_name ":
 	lda	$sp, -168($sp)
 	.frame	$sp, 168, $26
-	/* Preserve all registers that C normally doesn't.  */
+	/* Preserve all integer registers that C normally doesn't.  */
 	stq	$26, 0($sp)
 	stq	$0, 8($sp)
 	stq	$1, 16($sp)
@@ -157,7 +162,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 	/* Set up our $gp */
 	br	$gp, .+4
 	ldgp	$gp, 0($gp)
-	.prologue 1
+	.prologue 0
 	/* Set up the arguments for fixup: */
 	/* $16 = link_map out of plt0 */
 	/* $17 = offset of reloc entry = ($28 - $27 - 20) /12 * 24 */
@@ -216,11 +221,13 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 
 #define RTLD_START asm ("\
 .text
+	.set at
 	.globl _start
 	.ent _start
 _start:
 	br	$gp, 0f
 0:	ldgp	$gp, 0($gp)
+	.prologue 0
 	/* Pass pointer to argument block to _dl_start.  */
 	mov	$sp, $16
 	bsr	$26, "ASM_ALPHA_NG_SYMBOL_PREFIX"_dl_start..ng
@@ -229,8 +236,12 @@ _start:
 	.globl _dl_start_user
 	.ent _dl_start_user
 _dl_start_user:
+	.frame $30,0,$31,0
+	.prologue 0
 	/* Save the user entry point address in s0.  */
 	mov	$0, $9
+	/* Store the highest stack address.  */
+	stq	$30, __libc_stack_end
 	/* See if we were run as a command with the executable file
 	   name as an extra leading argument.  If so, adjust the stack
 	   pointer to skip _dl_skip_args words.  */
@@ -253,15 +264,14 @@ _dl_start_user:
 	ldgp	$gp, 0($26)
 	br	1b
 2:	/* Clear the startup flag.  */
-	.set at
 	stl	$31, _dl_starting_up
-	.set noat
 	/* Pass our finalizer function to the user in $0. */
 	lda	$0, _dl_fini
 	/* Jump to the user's entry point.  */
 	mov	$9, $27
 	jmp	($9)
 	.end _dl_start_user
+	.set noat
 .previous");
 
 /* Nonzero iff TYPE describes relocation of a PLT entry, so
diff --git a/sysdeps/alpha/elf/start.S b/sysdeps/alpha/elf/start.S
index 1330d1fda2..ecb8174152 100644
--- a/sysdeps/alpha/elf/start.S
+++ b/sysdeps/alpha/elf/start.S
@@ -29,13 +29,14 @@ _start:
 	mov	zero, fp
 	br	gp, 1f
 1:	ldgp	gp, 0(gp)
+	subq	sp, 16, sp
 	.prologue 1
 
   /* Load address of the user's main function.  */
 	lda	a0, main
 
-	ldl	a1, 0(sp)	/* get argc */
-	lda	a2, 8(sp)	/* get argv */
+	ldl	a1, 16(sp)	/* get argc */
+	lda	a2, 24(sp)	/* get argv */
 
   /* Load address of our own entry points to .fini and .init.  */
 	lda	a3, _init
@@ -44,10 +45,12 @@ _start:
   /* Store address of the shared library termination function.  */
 	mov	v0, a5
 
+  /* Provide the highest stack address to the user code.  */
+	stq	sp, 0(sp)
+
   /* Call the user's main function, and exit with its value.
-     But let the libc call main.    */
+     But let the libc call main.  */
 	jsr	ra, __libc_start_main
-	ldgp	gp, 0(ra)
 
   /* Die very horribly if exit returns.  Call_pal hlt is callable from
      kernel mode only; this will result in an illegal instruction trap.  */
@@ -56,16 +59,3 @@ _start:
 
 /* For ECOFF backwards compatibility. */
 weak_alias(_start, __start)
-
-/* Define a symbol for the first piece of initialized data.  */
-	.data
-	.globl __data_start
-__data_start:
-	.long 0
-
-#ifdef __ELF__
-	.size __data_start, 4
-	.type __data_start, @object
-#endif
-
-weak_alias(__data_start, data_start)
diff --git a/sysdeps/alpha/fpu/fraiseexcpt.c b/sysdeps/alpha/fpu/fraiseexcpt.c
index c2a96e3f87..9b61ddb843 100644
--- a/sysdeps/alpha/fpu/fraiseexcpt.c
+++ b/sysdeps/alpha/fpu/fraiseexcpt.c
@@ -39,28 +39,28 @@ feraiseexcept (int excepts)
     {
       /* One example of a invalid operation is 0 * Infinity.  */
       __asm__ __volatile__("mult/sui $f31,%1,%0; trapb"
-			   : "=f"(tmp) : "f"(HUGE_VAL));
+			   : "=&f"(tmp) : "f"(HUGE_VAL));
     }
 
   /* Next: division by zero.  */
   if (FE_DIVBYZERO & excepts)
     {
       __asm__ __volatile__("cmpteq $f31,$f31,%1; divt/sui %1,$f31,%0; trapb"
-			   : "=f"(tmp), "=f"(dummy));
+			   : "=&f"(tmp), "=f"(dummy));
     }
 
   /* Next: overflow.  */
   if (FE_OVERFLOW & excepts)
     {
       __asm__ __volatile__("mult/sui %1,%1,%0; trapb"
-			   : "=f"(tmp) : "f"(DBL_MAX));
+			   : "=&f"(tmp) : "f"(DBL_MAX));
     }
 
   /* Next: underflow.  */
   if (FE_UNDERFLOW & excepts)
     {
       __asm__ __volatile__("divt/sui %1,%2,%0; trapb"
-			   : "=f"(tmp) : "f"(DBL_MIN),
+			   : "=&f"(tmp) : "f"(DBL_MIN),
 					 "f"((double) (1UL << 60)));
     }
 
@@ -68,6 +68,6 @@ feraiseexcept (int excepts)
   if (FE_INEXACT & excepts)
     {
       __asm__ __volatile__("divt/sui %1,%2,%0; trapb"
-			   : "=f"(tmp) : "f"(1.0), "f"(M_PI));
+			   : "=&f"(tmp) : "f"(1.0), "f"(M_PI));
     }
 }
diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h
index 836e5a3050..465592c764 100644
--- a/sysdeps/i386/fpu/bits/mathinline.h
+++ b/sysdeps/i386/fpu/bits/mathinline.h
@@ -582,7 +582,7 @@ __MATH_INLINE int
 __finite (double __x)
 {
   return (__extension__
-	  (((((union { double __d; int __i[2]; }) {__d: __x}).i[1]
+	  (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1]
 	     | 0x800fffff) + 1) >> 31));
 }
 
diff --git a/sysdeps/libm-ieee754/e_exp10.c b/sysdeps/libm-ieee754/e_exp10.c
index 3b367641cd..55d676ec09 100644
--- a/sysdeps/libm-ieee754/e_exp10.c
+++ b/sysdeps/libm-ieee754/e_exp10.c
@@ -18,6 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <math.h>
+#include "math_private.h"
 
 
 double
diff --git a/sysdeps/libm-ieee754/e_exp10f.c b/sysdeps/libm-ieee754/e_exp10f.c
index 200eecd833..d6cc9dc03d 100644
--- a/sysdeps/libm-ieee754/e_exp10f.c
+++ b/sysdeps/libm-ieee754/e_exp10f.c
@@ -18,6 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <math.h>
+#include "math_private.h"
 
 
 float
diff --git a/sysdeps/libm-ieee754/e_exp10l.c b/sysdeps/libm-ieee754/e_exp10l.c
index e2820d24f7..cf8658b747 100644
--- a/sysdeps/libm-ieee754/e_exp10l.c
+++ b/sysdeps/libm-ieee754/e_exp10l.c
@@ -18,6 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <math.h>
+#include "math_private.h"
 
 
 long double