summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog24
-rw-r--r--ctype/ctype.h2
-rw-r--r--iconv/skeleton.c2
-rw-r--r--intl/gettext.c2
-rw-r--r--intl/ngettext.c2
-rw-r--r--resolv/inet_ntop.c12
-rw-r--r--sysdeps/sparc/sparc32/dl-machine.h36
-rw-r--r--sysdeps/sparc/sparc64/dl-machine.h35
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/setjmp.h34
-rw-r--r--wcsmbs/wcwidth.h4
-rw-r--r--wctype/wctrans.c4
11 files changed, 101 insertions, 56 deletions
diff --git a/ChangeLog b/ChangeLog
index 085f539991..283c8ea490 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,29 @@
+2000-04-05  Cristian Gafton  <gafton@redhat.com>
+
+	* ctype/ctype.h (__isctype_l): Define even if not __OPTIMIZE__
+	because it is used in generic code.
+	* wctype/wctrans.c: Define __ctype32_toupper and __ctype32_tolower.
+	* wcsmbs/wcwidth.h: Declare __ctype32_b.
+	* intl/gettext.c: Include <locale.h>.
+	* intl/ngettext.c: Likewise.
+
+2000-04-05  Jakub Jelinek  <jakub@redhat.com>
+
+	* resolv/inet_ntop.c (inet_ntop4, inet_ntop6, inet_ntop): Use
+	socklen_t type for size.
+	* sysdeps/sparc/sparc32/dl-machine.h (RTLD_START): Rewrite for new
+	init function interface.
+	* sysdeps/sparc/sparc64/dl-machine.h (RTLD_START): Likewise.
+	* sysdeps/unix/sysv/linux/sparc/bits/setjmp.h: Don't include
+	sys/ucontext.h.
+	(__jmp_buf): Declare the whole type structure here, don't use
+	ucontext.
+
 2000-04-05  Ulrich Drepper  <drepper@redhat.com>
 
+	* iconv/skeleton.c (put16u): Fix typo.
+	Reported by Bruno Haible <haible@ilog.fr>.
+
 	* sysdeps/unix/sysv/linux/alpha/init-first.h: Not needed anymore.
 	* sysdeps/unix/sysv/linux/arm/init-first.h: Likewise.
 	* sysdeps/unix/sysv/linux/mips/init-first.h: Likewise.
diff --git a/ctype/ctype.h b/ctype/ctype.h
index fe8f4b16e9..510b28ce3d 100644
--- a/ctype/ctype.h
+++ b/ctype/ctype.h
@@ -212,10 +212,8 @@ toupper (int __c) __THROW
 
 /* These definitions are similar to the ones above but all functions
    take as an argument a handle for the locale which shall be used.  */
-# ifdef __OPTIMIZE__
 #  define __isctype_l(c, type, locale) \
   ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type)
-# endif
 
 # define __exctype_l(name)	extern int name (int, __locale_t) __THROW
 
diff --git a/iconv/skeleton.c b/iconv/skeleton.c
index 4a1c7554bf..27b1cab234 100644
--- a/iconv/skeleton.c
+++ b/iconv/skeleton.c
@@ -168,7 +168,7 @@ static int to_object;
 #  define put16u(addr, val) \
      ({ uint16_t __val = (val);						      \
 	((unsigned char *) (addr))[1] = __val;				      \
-	((unsigned char *) (addr))[2] = __val >> 8;			      \
+	((unsigned char *) (addr))[0] = __val >> 8;			      \
 	(void) 0; })
 #  define put32u(addr, val) \
      ({ uint32_t __val = (val);						      \
diff --git a/intl/gettext.c b/intl/gettext.c
index c9ba112b55..0607185d4c 100644
--- a/intl/gettext.c
+++ b/intl/gettext.c
@@ -41,6 +41,8 @@
 # include "libgettext.h"
 #endif
 
+#include <locale.h>
+
 /* @@ end of prolog @@ */
 
 /* Names for the libintl functions are a problem.  They must not clash
diff --git a/intl/ngettext.c b/intl/ngettext.c
index 3ffdc6996f..1addf87752 100644
--- a/intl/ngettext.c
+++ b/intl/ngettext.c
@@ -43,6 +43,8 @@
 # include "libgettext.h"
 #endif
 
+#include <locale.h>
+
 /* @@ end of prolog @@ */
 
 /* Names for the libintl functions are a problem.  They must not clash
diff --git a/resolv/inet_ntop.c b/resolv/inet_ntop.c
index 2f076d4ba4..a95f684945 100644
--- a/resolv/inet_ntop.c
+++ b/resolv/inet_ntop.c
@@ -40,9 +40,9 @@ static char rcsid[] = "$Id$";
  * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
  */
 
-static const char *inet_ntop4 __P((const u_char *src, char *dst, size_t size))
+static const char *inet_ntop4 __P((const u_char *src, char *dst, socklen_t size))
      internal_function;
-static const char *inet_ntop6 __P((const u_char *src, char *dst, size_t size))
+static const char *inet_ntop6 __P((const u_char *src, char *dst, socklen_t size))
      internal_function;
 
 /* char *
@@ -58,7 +58,7 @@ inet_ntop(af, src, dst, size)
 	int af;
 	const void *src;
 	char *dst;
-	size_t size;
+	socklen_t size;
 {
 	switch (af) {
 	case AF_INET:
@@ -88,7 +88,7 @@ internal_function
 inet_ntop4(src, dst, size)
 	const u_char *src;
 	char *dst;
-	size_t size;
+	socklen_t size;
 {
 	static const char fmt[] = "%u.%u.%u.%u";
 	char tmp[sizeof "255.255.255.255"];
@@ -111,7 +111,7 @@ internal_function
 inet_ntop6(src, dst, size)
 	const u_char *src;
 	char *dst;
-	size_t size;
+	socklen_t size;
 {
 	/*
 	 * Note that int32_t and int16_t need only be "at least" large enough
@@ -189,7 +189,7 @@ inet_ntop6(src, dst, size)
 	/*
 	 * Check for overflow, copy, and we're done.
 	 */
-	if ((size_t)(tp - tmp) > size) {
+	if ((socklen_t)(tp - tmp) > size) {
 		__set_errno (ENOSPC);
 		return (NULL);
 	}
diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h
index 0b98002593..a160f7d41f 100644
--- a/sysdeps/sparc/sparc32/dl-machine.h
+++ b/sysdeps/sparc/sparc32/dl-machine.h
@@ -234,12 +234,11 @@ _dl_start_user:
 	ld	[%i0], %i0
 	tst	%i0
 	beq	3f
-	 nop
+	 ld	[%sp+22*4], %i5		/* load argc */
 	/* Find out how far to shift.  */
-	ld	[%sp+22*4], %i1		/* load argc */
-	sub	%i1, %i0, %i1
+	sub	%i5, %i0, %i5
 	sll	%i0, 2, %i2
-	st	%i1, [%sp+22*4]
+	st	%i5, [%sp+22*4]
 	add	%sp, 23*4, %i1
 	add	%i1, %i2, %i2
 	/* Copy down argv */
@@ -265,24 +264,17 @@ _dl_start_user:
 	st	%i4, [%i1+4]
 	bne	23b
 	 add	%i1, 8, %i1
-  /* Load searchlist of the main object to pass to _dl_init_next.  */
-3:	sethi	%hi(_dl_main_searchlist), %g1
-	or	%g1, %lo(_dl_main_searchlist), %g1
-	ld	[%l7+%g1], %l1
-	ld	[%l1], %l1
-  /* Call _dl_init_next to return the address of an initializer to run.  */
-4:	call	_dl_init_next
-	 mov	%l1, %o0
-	tst	%o0
-	beq	5f
-	 nop
-	jmpl	%o0, %o7
-	 sub	%o7, 28, %o7
-  /* Clear the startup flag.  */
-5:	sethi	%hi(_dl_starting_up), %g1
-	or	%g1, %lo(_dl_starting_up), %g1
-	ld	[%l7+%g1], %g1
-	st	%g0, [%g1]
+  /* %o0 = _dl_loaded, %o1 = argc, %o2 = argv, %o3 = envp.  */
+3:	sethi	%hi(_dl_loaded), %o0
+	add	%sp, 23*4, %o2
+	orcc	%o0, %lo(_dl_loaded), %o0
+	sll	%i5, 2, %o3
+	ld	[%l7+%o0], %o0
+	add	%o3, 4, %o3
+	mov	%i5, %o1
+	add	%o2, %o3, %o3
+	call	_dl_init
+	 ld	[%o0], %o0
   /* Pass our finalizer function to the user in %g1.  */
 	sethi	%hi(_dl_fini), %g1
 	or	%g1, %lo(_dl_fini), %g1
diff --git a/sysdeps/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h
index 1c02252d53..7b89ebe733 100644
--- a/sysdeps/sparc/sparc64/dl-machine.h
+++ b/sysdeps/sparc/sparc64/dl-machine.h
@@ -540,12 +540,11 @@ _dl_start_user:
 	ldx	[%l7+%g5], %i0
 	ld	[%i0], %i0
 	brz,pt	%i0, 2f
-	 nop
+	 ldx	[%sp+" __S(STACK_BIAS) "+22*8], %i5
 	/* Find out how far to shift.  */
-	ldx	[%sp+" __S(STACK_BIAS) "+22*8], %i1
-	sub	%i1, %i0, %i1
+	sub	%i5, %i0, %i5
 	sllx	%i0, 3, %i2
-	stx	%i1, [%sp+" __S(STACK_BIAS) "+22*8]
+	stx	%i5, [%sp+" __S(STACK_BIAS) "+22*8]
 	add	%sp, " __S(STACK_BIAS) "+23*8, %i1
 	add	%i1, %i2, %i2
 	/* Copy down argv.  */
@@ -568,23 +567,17 @@ _dl_start_user:
 	stx	%i4, [%i1+8]
 	brnz,pt	%i3, 13b
 	 add	%i1, 16, %i1
-  /* Load searchlist of the main object to pass to _dl_init_next.  */
-2:	sethi	%hi(_dl_main_searchlist), %g5
-	or	%g5, %lo(_dl_main_searchlist), %g5
-	ldx	[%l7+%g5], %g5
-	ldx	[%g5], %l1
-   /* Call _dl_init_next to return the address of an initializer to run.  */
-3:	call	_dl_init_next
-	 mov	%l1, %o0
-	brz,pn	%o0, 4f
-	 nop
-	jmpl	%o0, %o7
-	 sub	%o7, 24, %o7
-   /* Clear the startup flag.  */
-4:	sethi	%hi(_dl_starting_up), %g5
-	or	%g5, %lo(_dl_starting_up), %g5
-	ldx	[%l7+%g5], %g5
-	st	%g0, [%g5]
+  /* %o0 = _dl_loaded, %o1 = argc, %o2 = argv, %o3 = envp.  */
+2:	sethi	%hi(_dl_loaded), %o0
+	add	%sp, " __S(STACK_BIAS) "+23*8, %o2
+	orcc	%o0, %lo(_dl_loaded), %o0
+	sllx	%i5, 3, %o3
+	ldx	[%l7+%o0], %o0
+	add	%o3, 8, %o3
+	mov	%i5, %o1
+	add	%o2, %o3, %o3
+	call	_dl_init
+	 ldx	[%o0], %o0
    /* Pass our finalizer function to the user in %g1.  */
 	sethi	%hi(_dl_fini), %g1
 	or	%g1, %lo(_dl_fini), %g1
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h b/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h
index 6f61e358af..c62178c135 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1999 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -25,9 +25,35 @@
 
 #if __WORDSIZE == 64
 
-#include <sys/ucontext.h>
-
-typedef ucontext_t __jmp_buf[1];
+#ifndef _ASM
+typedef struct __sparc64_jmp_buf
+  {
+    struct __sparc64_jmp_buf	*uc_link;
+    unsigned long		uc_flags;
+    unsigned long		uc_sigmask;
+    struct __sparc64_jmp_buf_mcontext
+      {
+	unsigned long		mc_gregs[19];
+	unsigned long		mc_fp;
+	unsigned long		mc_i7;
+	struct __sparc64_jmp_buf_fpu
+	  {
+	    union
+	      {
+		unsigned int	sregs[32];
+		unsigned long	dregs[32];
+		long double	qregs[16];
+	      }			mcfpu_fpregs;
+	    unsigned long	mcfpu_fprs;
+	    unsigned long	mcfpu_gsr;
+	    void		*mcfpu_fq;
+	    unsigned char	mcfpu_qcnt;
+	    unsigned char	mcfpu_qentsz;
+	    unsigned char	mcfpu_enab;
+	  }			mc_fpregs;
+      }				uc_mcontext;
+  } __jmp_buf[1];
+#endif
 
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
diff --git a/wcsmbs/wcwidth.h b/wcsmbs/wcwidth.h
index b8627c54f0..a9f8a26d49 100644
--- a/wcsmbs/wcwidth.h
+++ b/wcsmbs/wcwidth.h
@@ -25,6 +25,10 @@
 /* Array containing width information.  */
 extern unsigned char *__ctype_width;
 
+/* If the program is compiled without optimization the following declaration
+   is not visible in the header.   */
+extern unsigned int *__ctype32_b;
+
 static __inline int
 internal_wcwidth (wint_t ch)
 {
diff --git a/wctype/wctrans.c b/wctype/wctrans.c
index a9f83e40b9..771fb842ef 100644
--- a/wctype/wctrans.c
+++ b/wctype/wctrans.c
@@ -23,6 +23,10 @@
 #include <wctype.h>
 #include "../locale/localeinfo.h"
 
+/* These are not exported.  */
+extern const uint32_t *__ctype32_toupper;
+extern const uint32_t *__ctype32_tolower;
+
 wctrans_t
 wctrans (const char *property)
 {