[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r7166 - in /trunk: libc/ libc/elf/ libc/nptl/ libc/nptl/sysdeps/unix/sysv/linux/ libc/nscd/ libc/resolv/ libc/stdlib/ libc/s...



Author: joseph
Date: Sat Oct 18 11:20:55 2008
New Revision: 7166

Log:
Merge changes between r7062 and r7165 from /fsf/trunk.

Added:
    trunk/libc/elf/tst-tls17.c
      - copied unchanged from r7165, fsf/trunk/libc/elf/tst-tls17.c
    trunk/libc/elf/tst-tlsmod17a.c
      - copied unchanged from r7165, fsf/trunk/libc/elf/tst-tlsmod17a.c
    trunk/libc/elf/tst-tlsmod17b.c
      - copied unchanged from r7165, fsf/trunk/libc/elf/tst-tlsmod17b.c
Modified:
    trunk/libc/ChangeLog
    trunk/libc/elf/Makefile
    trunk/libc/elf/dl-tls.c
    trunk/libc/nptl/ChangeLog
    trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c
    trunk/libc/nscd/connections.c
    trunk/libc/resolv/res_send.c
    trunk/libc/stdlib/divmod_1.c
    trunk/libc/stdlib/longlong.h
    trunk/libc/stdlib/mod_1.c
    trunk/libc/sysdeps/sparc/sparc64/sparcv9v/memcpy.S
    trunk/libc/sysdeps/sparc/sparc64/sparcv9v/memset.S
    trunk/libc/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S
    trunk/libc/sysdeps/unix/sysv/linux/alpha/sys/signalfd.h
    trunk/libc/sysdeps/unix/sysv/linux/sparc/sys/signalfd.h
    trunk/libc/sysdeps/unix/sysv/linux/sys/signalfd.h
    trunk/ports/ChangeLog.mips
    trunk/ports/sysdeps/mips/dl-dtprocnum.h
    trunk/ports/sysdeps/mips/dl-machine.h

Modified: trunk/libc/ChangeLog
==============================================================================
--- trunk/libc/ChangeLog (original)
+++ trunk/libc/ChangeLog Sat Oct 18 11:20:55 2008
@@ -1,3 +1,45 @@
+2008-10-17  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* elf/Makefile: Add rules to build and run tst-tls17.
+	* elf/tst-tls17.c: New test.
+	* elf/tst-tlsmod17a.c: New file.
+	* elf/tst-tlsmod17b.c: Likewise.
+
+2008-10-17  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* stdlib/divmod_1.c: Use correct type for dummy variable.
+	* stdlib/mod_1.c: Likewise.
+
+2008-10-16  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* elf/dl-tls.c (_dl_update_slotinfo): Copy all of the initial DTV.
+
+2008-10-16  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/sys/signalfd.h (signalfd): Fix __THROW vs.
+	__nonnull order for C++.
+	* sysdeps/unix/sysv/linux/alpha/sys/signalfd.h (signalfd): Likewise.
+	* sysdeps/unix/sysv/linux/sparc/sys/signalfd.h (signalfd): Likewise.
+
+2008-10-01  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
+
+	* stdlib/longlong.h: Update from GCC.
+
+2008-10-09  Jakub Jelinek <jakub@xxxxxxxxxx>
+	    David S. Miller  <davem@xxxxxxxxxxxxx>
+
+	* sysdeps/sparc/sparc64/sparcv9v/memcpy.S: When not USE_BPR,
+	make sure any registers used with 64-bit 'branch-on-register'
+	instructions have their top 32-bits clear.
+	* sysdeps/sparc/sparc64/sparcv9v/memset.S: Likewise.
+	* sysdeps/sparc/sparc64/sparcv9v2/memcpy.S: Likewise.
+
+2008-09-18  Andreas Schwab  <schwab@xxxxxxx>
+
+	[BZ #6942]
+	* resolv/res_send.c (send_vc): Fix use of unaligned address.
+        Properly handle partial reads.
+
 2008-10-01  Mark Shinwell  <shinwell@xxxxxxxxxxxxxxxx>
 
 	* elf/elf.h (STO_MIPS_PLT): New.

Modified: trunk/libc/elf/Makefile
==============================================================================
--- trunk/libc/elf/Makefile (original)
+++ trunk/libc/elf/Makefile Sat Oct 18 11:20:55 2008
@@ -167,7 +167,7 @@
 	 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
 	 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
 	 tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
-	 tst-tls16 tst-tls-dlinfo \
+	 tst-tls16 tst-tls17 tst-tls-dlinfo \
 	 tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \
 	 tst-dlmodcount tst-dlopenrpath tst-deep1 \
 	 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
@@ -182,6 +182,7 @@
 tests: $(objpfx)tst-pie1.out
 endif
 tests: $(objpfx)tst-leaks1-mem
+tlsmod17a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		testobj1_1 failobj constload2 constload3 unloadmod \
 		dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \
@@ -201,6 +202,8 @@
 		tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
 		tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
 		tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
+		$(patsubst %,tst-tlsmod17a%,$(tlsmod17a-suffixes)) \
+		tst-tlsmod17b \
 		circlemod1 circlemod1a circlemod2 circlemod2a \
 		circlemod3 circlemod3a \
 		reldep8mod1 reldep8mod2 reldep8mod3 \
@@ -721,6 +724,13 @@
 $(objpfx)tst-tls16: $(libdl)
 $(objpfx)tst-tls16.out: $(objpfx)tst-tlsmod16a.so $(objpfx)tst-tlsmod16b.so
 
+$(objpfx)tst-tls17: $(libdl)
+$(objpfx)tst-tls17.out: $(objpfx)tst-tlsmod17b.so
+$(patsubst %,$(objpfx)tst-tlsmod17a%.os,$(tlsmod17a-suffixes)): $(objpfx)tst-tlsmod17a%.os : tst-tlsmod17a.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ -DN=$* -DNOT_IN_libc=1 $<
+$(patsubst %,$(objpfx)tst-tlsmod17a%.so,$(tlsmod17a-suffixes)): $(objpfx)tst-tlsmod17a%.so: $(objpfx)ld.so
+$(objpfx)tst-tlsmod17b.so: $(patsubst %,$(objpfx)tst-tlsmod17a%.so,$(tlsmod17a-suffixes))
+
 CFLAGS-tst-align.c = $(stack-align-test-flags)
 CFLAGS-tst-align2.c = $(stack-align-test-flags)
 CFLAGS-tst-alignmod.c = $(stack-align-test-flags)

Modified: trunk/libc/elf/dl-tls.c
==============================================================================
--- trunk/libc/elf/dl-tls.c (original)
+++ trunk/libc/elf/dl-tls.c Sat Oct 18 11:20:55 2008
@@ -634,7 +634,7 @@
 		      newp = malloc ((2 + newsize) * sizeof (dtv_t));
 		      if (newp == NULL)
 			oom ();
-		      memcpy (newp, &dtv[-1], oldsize * sizeof (dtv_t));
+		      memcpy (newp, &dtv[-1], (2 + oldsize) * sizeof (dtv_t));
 		    }
 		  else
 		    {

Modified: trunk/libc/nptl/ChangeLog
==============================================================================
--- trunk/libc/nptl/ChangeLog (original)
+++ trunk/libc/nptl/ChangeLog Sat Oct 18 11:20:55 2008
@@ -1,3 +1,8 @@
+2008-09-11  Martin Schwidefsky  <schwidefsky@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
+	to force runp->refcntr to be read from memory.
+
 2008-09-08  Richard Guenther  <rguenther@xxxxxxx>
 
 	* sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c Sat Oct 18 11:20:55 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -64,6 +64,9 @@
   struct fork_handler *runp;
   while ((runp = __fork_handlers) != NULL)
     {
+      /* Make sure we read from the current RUNP pointer.  */
+      atomic_full_barrier ();
+
       unsigned int oldval = runp->refcntr;
 
       if (oldval == 0)

Modified: trunk/libc/nscd/connections.c
==============================================================================
--- trunk/libc/nscd/connections.c (original)
+++ trunk/libc/nscd/connections.c Sat Oct 18 11:20:55 2008
@@ -1824,11 +1824,13 @@
 	      if (have_paccept >= 0)
 #endif
 		{
+#if 0
 		  fd = TEMP_FAILURE_RETRY (paccept (sock, NULL, NULL, NULL,
 						    SOCK_NONBLOCK));
 #ifndef __ASSUME_PACCEPT
 		  if (have_paccept == 0)
 		    have_paccept = fd != -1 || errno != ENOSYS ? 1 : -1;
+#endif
 #endif
 		}
 #ifndef __ASSUME_PACCEPT

Modified: trunk/libc/resolv/res_send.c
==============================================================================
--- trunk/libc/resolv/res_send.c (original)
+++ trunk/libc/resolv/res_send.c Sat Oct 18 11:20:55 2008
@@ -734,11 +734,11 @@
 	 */
 	int recvresp1 = 0;
 	int recvresp2 = buf2 == NULL;
+	uint16_t rlen16;
  read_len:
-	cp = ans;
-	uint16_t rlen16;
+	cp = (u_char *)&rlen16;
 	len = sizeof(rlen16);
-	while ((n = TEMP_FAILURE_RETRY (read(statp->_vcsock, &rlen16,
+	while ((n = TEMP_FAILURE_RETRY (read(statp->_vcsock, cp,
 					     (int)len))) > 0) {
 		cp += n;
 		if ((len -= n) <= 0)
@@ -778,8 +778,16 @@
 			/* No buffer allocated for the first
 			   reply.  We can try to use the rest
 			   of the user-provided buffer.  */
+#ifdef _STRING_ARCH_unaligned
 			*anssizp2 = orig_anssizp - resplen;
 			*ansp2 = *ansp + resplen;
+#else
+			int aligned_resplen
+			  = ((resplen + __alignof__ (HEADER) - 1)
+			     & (__alignof__ (HEADER) - 1));
+			*anssizp2 = orig_anssizp - aligned_resplen;
+			*ansp2 = *ansp + aligned_resplen;
+#endif
 		} else {
 			/* The first reply did not fit into the
 			   user-provided buffer.  Maybe the second

Modified: trunk/libc/stdlib/divmod_1.c
==============================================================================
--- trunk/libc/stdlib/divmod_1.c (original)
+++ trunk/libc/stdlib/divmod_1.c Sat Oct 18 11:20:55 2008
@@ -55,7 +55,7 @@
 {
   mp_size_t i;
   mp_limb_t n1, n0, r;
-  int dummy;
+  mp_limb_t dummy;
 
   /* ??? Should this be handled at all?  Rely on callers?  */
   if (dividend_size == 0)

Modified: trunk/libc/stdlib/longlong.h
==============================================================================
--- trunk/libc/stdlib/longlong.h (original)
+++ trunk/libc/stdlib/longlong.h Sat Oct 18 11:20:55 2008
@@ -229,6 +229,19 @@
 #define UDIV_TIME 100
 #endif /* __arm__ */
 
+#if defined(__arm__)
+/* Let gcc decide how best to implement count_leading_zeros.  */
+#define count_leading_zeros(COUNT,X)	((COUNT) = __builtin_clz (X))
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+
+#if defined (__CRIS__) && __CRIS_arch_version >= 3
+#define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clz (X))
+#if __CRIS_arch_version >= 8
+#define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctz (X))
+#endif
+#endif /* __CRIS__ */
+
 #if defined (__hppa) && W_TYPE_SIZE == 32
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   __asm__ ("add %4,%5,%1\n\taddc %2,%3,%0"				\
@@ -315,7 +328,7 @@
 
 #if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
-  __asm__ ("addl %5,%1\n\tadcl %3,%0"					\
+  __asm__ ("add{l} {%5,%1|%1,%5}\n\tadc{l} {%3,%0|%0,%3}"		\
 	   : "=r" ((USItype) (sh)),					\
 	     "=&r" ((USItype) (sl))					\
 	   : "%0" ((USItype) (ah)),					\
@@ -323,7 +336,7 @@
 	     "%1" ((USItype) (al)),					\
 	     "g" ((USItype) (bl)))
 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
-  __asm__ ("subl %5,%1\n\tsbbl %3,%0"					\
+  __asm__ ("sub{l} {%5,%1|%1,%5}\n\tsbb{l} {%3,%0|%0,%3}"		\
 	   : "=r" ((USItype) (sh)),					\
 	     "=&r" ((USItype) (sl))					\
 	   : "0" ((USItype) (ah)),					\
@@ -331,30 +344,59 @@
 	     "1" ((USItype) (al)),					\
 	     "g" ((USItype) (bl)))
 #define umul_ppmm(w1, w0, u, v) \
-  __asm__ ("mull %3"							\
+  __asm__ ("mul{l} %3"							\
 	   : "=a" ((USItype) (w0)),					\
 	     "=d" ((USItype) (w1))					\
 	   : "%0" ((USItype) (u)),					\
 	     "rm" ((USItype) (v)))
 #define udiv_qrnnd(q, r, n1, n0, dv) \
-  __asm__ ("divl %4"							\
+  __asm__ ("div{l} %4"							\
 	   : "=a" ((USItype) (q)),					\
 	     "=d" ((USItype) (r))					\
 	   : "0" ((USItype) (n0)),					\
 	     "1" ((USItype) (n1)),					\
 	     "rm" ((USItype) (dv)))
-#define count_leading_zeros(count, x) \
-  do {									\
-    USItype __cbtmp;							\
-    __asm__ ("bsrl %1,%0"						\
-	     : "=r" (__cbtmp) : "rm" ((USItype) (x)));			\
-    (count) = __cbtmp ^ 31;						\
-  } while (0)
-#define count_trailing_zeros(count, x) \
-  __asm__ ("bsfl %1,%0" : "=r" (count) : "rm" ((USItype)(x)))
+#define count_leading_zeros(count, x)	((count) = __builtin_clz (x))
+#define count_trailing_zeros(count, x)	((count) = __builtin_ctz (x))
 #define UMUL_TIME 40
 #define UDIV_TIME 40
 #endif /* 80x86 */
+
+#if (defined (__x86_64__) || defined (__i386__)) && W_TYPE_SIZE == 64
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("add{q} {%5,%1|%1,%5}\n\tadc{q} {%3,%0|%0,%3}"		\
+	   : "=r" ((UDItype) (sh)),					\
+	     "=&r" ((UDItype) (sl))					\
+	   : "%0" ((UDItype) (ah)),					\
+	     "rme" ((UDItype) (bh)),					\
+	     "%1" ((UDItype) (al)),					\
+	     "rme" ((UDItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("sub{q} {%5,%1|%1,%5}\n\tsbb{q} {%3,%0|%0,%3}"		\
+	   : "=r" ((UDItype) (sh)),					\
+	     "=&r" ((UDItype) (sl))					\
+	   : "0" ((UDItype) (ah)),					\
+	     "rme" ((UDItype) (bh)),					\
+	     "1" ((UDItype) (al)),					\
+	     "rme" ((UDItype) (bl)))
+#define umul_ppmm(w1, w0, u, v) \
+  __asm__ ("mul{q} %3"							\
+	   : "=a" ((UDItype) (w0)),					\
+	     "=d" ((UDItype) (w1))					\
+	   : "%0" ((UDItype) (u)),					\
+	     "rm" ((UDItype) (v)))
+#define udiv_qrnnd(q, r, n1, n0, dv) \
+  __asm__ ("div{q} %4"							\
+	   : "=a" ((UDItype) (q)),					\
+	     "=d" ((UDItype) (r))					\
+	   : "0" ((UDItype) (n0)),					\
+	     "1" ((UDItype) (n1)),					\
+	     "rm" ((UDItype) (dv)))
+#define count_leading_zeros(count, x)	((count) = __builtin_clzl (x))
+#define count_trailing_zeros(count, x)	((count) = __builtin_ctzl (x))
+#define UMUL_TIME 40
+#define UDIV_TIME 40
+#endif /* x86_64 */
 
 #if defined (__i960__) && W_TYPE_SIZE == 32
 #define umul_ppmm(w1, w0, u, v) \
@@ -523,6 +565,11 @@
   __asm__ ("bfffo %1{%b2:%b2},%0"					\
 	   : "=d" ((USItype) (count))					\
 	   : "od" ((USItype) (x)), "n" (0))
+/* Some ColdFire architectures have a ff1 instruction supported via
+   __builtin_clz. */
+#elif defined (__mcfisaaplus__) || defined (__mcfisac__)
+#define count_leading_zeros(count,x) ((count) = __builtin_clz (x))
+#define COUNT_LEADING_ZEROS_0 32
 #endif
 #endif /* mc68000 */
 
@@ -585,14 +632,19 @@
 #endif /* __m88000__ */
 
 #if defined (__mips__) && W_TYPE_SIZE == 32
-#define umul_ppmm(w1, w0, u, v) \
-  __asm__ ("multu %2,%3"						\
-	   : "=l" ((USItype) (w0)),					\
-	     "=h" ((USItype) (w1))					\
-	   : "d" ((USItype) (u)),					\
-	     "d" ((USItype) (v)))
+#define umul_ppmm(w1, w0, u, v)						\
+  do {									\
+    UDItype __x = (UDItype) (USItype) (u) * (USItype) (v);		\
+    (w1) = (USItype) (__x >> 32);					\
+    (w0) = (USItype) (__x);						\
+  } while (0)
 #define UMUL_TIME 10
 #define UDIV_TIME 100
+
+#if (__mips == 32 || __mips == 64) && ! __mips16
+#define count_leading_zeros(COUNT,X)	((COUNT) = __builtin_clz (X))
+#define COUNT_LEADING_ZEROS_0 32
+#endif
 #endif /* __mips__ */
 
 #if defined (__ns32000__) && W_TYPE_SIZE == 32
@@ -641,7 +693,9 @@
      || defined (__powerpc__)	/* gcc */				\
      || defined (__POWERPC__)	/* BEOS */				\
      || defined (__ppc__)	/* Darwin */				\
-     || defined (PPC)		/* GNU/Linux, SysV */			\
+     || (defined (PPC) && ! defined (CPU_FAMILY)) /* gcc 2.7.x GNU&SysV */    \
+     || (defined (PPC) && defined (CPU_FAMILY)    /* VxWorks */               \
+         && CPU_FAMILY == PPC)                                                \
      ) && W_TYPE_SIZE == 32
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   do {									\
@@ -679,7 +733,10 @@
   __asm__ ("{cntlz|cntlzw} %0,%1" : "=r" (count) : "r" (x))
 #define COUNT_LEADING_ZEROS_0 32
 #if defined (_ARCH_PPC) || defined (__powerpc__) || defined (__POWERPC__) \
-  || defined (__ppc__) || defined (PPC)
+  || defined (__ppc__)                                                    \
+  || (defined (PPC) && ! defined (CPU_FAMILY)) /* gcc 2.7.x GNU&SysV */       \
+  || (defined (PPC) && defined (CPU_FAMILY)    /* VxWorks */                  \
+         && CPU_FAMILY == PPC)
 #define umul_ppmm(ph, pl, m0, m1) \
   do {									\
     USItype __m0 = (m0), __m1 = (m1);					\
@@ -828,17 +885,50 @@
   } while (0)
 #endif
 
-#if defined (__sh2__) && W_TYPE_SIZE == 32
+#if defined(__sh__) && !__SHMEDIA__ && W_TYPE_SIZE == 32
+#ifndef __sh1__
 #define umul_ppmm(w1, w0, u, v) \
   __asm__ (								\
-       "dmulu.l	%2,%3\n\tsts	macl,%1\n\tsts	mach,%0"		\
-	   : "=r" ((USItype)(w1)),					\
-	     "=r" ((USItype)(w0))					\
+       "dmulu.l	%2,%3\n\tsts%M1	macl,%1\n\tsts%M0	mach,%0"	\
+	   : "=r<" ((USItype)(w1)),					\
+	     "=r<" ((USItype)(w0))					\
 	   : "r" ((USItype)(u)),					\
 	     "r" ((USItype)(v))						\
 	   : "macl", "mach")
 #define UMUL_TIME 5
 #endif
+
+/* This is the same algorithm as __udiv_qrnnd_c.  */
+#define UDIV_NEEDS_NORMALIZATION 1
+
+#define udiv_qrnnd(q, r, n1, n0, d) \
+  do {									\
+    extern UWtype __udiv_qrnnd_16 (UWtype, UWtype)			\
+                        __attribute__ ((visibility ("hidden")));	\
+    /* r0: rn r1: qn */ /* r0: n1 r4: n0 r5: d r6: d1 */ /* r2: __m */	\
+    __asm__ (								\
+	"mov%M4 %4,r5\n"						\
+"	swap.w %3,r4\n"							\
+"	swap.w r5,r6\n"							\
+"	jsr @%5\n"							\
+"	shll16 r6\n"							\
+"	swap.w r4,r4\n"							\
+"	jsr @%5\n"							\
+"	swap.w r1,%0\n"							\
+"	or r1,%0"							\
+	: "=r" (q), "=&z" (r)						\
+	: "1" (n1), "r" (n0), "rm" (d), "r" (&__udiv_qrnnd_16)		\
+	: "r1", "r2", "r4", "r5", "r6", "pr");				\
+  } while (0)
+
+#define UDIV_TIME 80
+
+#define sub_ddmmss(sh, sl, ah, al, bh, bl)				\
+  __asm__ ("clrt;subc %5,%1; subc %4,%0"				\
+	   : "=r" (sh), "=r" (sl)					\
+	   : "0" (ah), "1" (al), "r" (bh), "r" (bl))
+
+#endif /* __sh__ */
 
 #if defined (__SH5__) && __SHMEDIA__ && W_TYPE_SIZE == 32
 #define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
@@ -1153,6 +1243,23 @@
   } while (0)
 #endif /* __vax__ */
 
+#if defined (__xtensa__) && W_TYPE_SIZE == 32
+/* This code is not Xtensa-configuration-specific, so rely on the compiler
+   to expand builtin functions depending on what configuration features
+   are available.  This avoids library calls when the operation can be
+   performed in-line.  */
+#define umul_ppmm(w1, w0, u, v)						\
+  do {									\
+    DWunion __w;							\
+    __w.ll = __builtin_umulsidi3 (u, v);				\
+    w1 = __w.s.high;							\
+    w0 = __w.s.low;							\
+  } while (0)
+#define __umulsidi3(u, v)		__builtin_umulsidi3 (u, v)
+#define count_leading_zeros(COUNT, X)	((COUNT) = __builtin_clz (X))
+#define count_trailing_zeros(COUNT, X)	((COUNT) = __builtin_ctz (X))
+#endif /* __xtensa__ */
+
 #if defined (__z8000__) && W_TYPE_SIZE == 16
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   __asm__ ("add	%H1,%H5\n\tadc	%H0,%H3"				\

Modified: trunk/libc/stdlib/mod_1.c
==============================================================================
--- trunk/libc/stdlib/mod_1.c (original)
+++ trunk/libc/stdlib/mod_1.c Sat Oct 18 11:20:55 2008
@@ -50,7 +50,7 @@
 {
   mp_size_t i;
   mp_limb_t n1, n0, r;
-  int dummy;
+  mp_limb_t dummy;
 
   /* Botch: Should this be handled at all?  Rely on callers?  */
   if (dividend_size == 0)

Modified: trunk/libc/sysdeps/sparc/sparc64/sparcv9v/memcpy.S
==============================================================================
--- trunk/libc/sysdeps/sparc/sparc64/sparcv9v/memcpy.S (original)
+++ trunk/libc/sysdeps/sparc/sparc64/sparcv9v/memcpy.S Sat Oct 18 11:20:55 2008
@@ -1,5 +1,5 @@
 /* Copy SIZE bytes from SRC to DEST.  For SUN4V Niagara.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David S. Miller (davem@xxxxxxxxxxxxx)
 
@@ -61,6 +61,9 @@
 
 	.align		32
 ENTRY(memcpy)
+#ifndef USE_BPR
+	srl		%o2, 0, %o2
+#endif
 100:	/* %o0=dst, %o1=src, %o2=len */
 	mov		%o0, %g5
 	cmp		%o2, 0

Modified: trunk/libc/sysdeps/sparc/sparc64/sparcv9v/memset.S
==============================================================================
--- trunk/libc/sysdeps/sparc/sparc64/sparcv9v/memset.S (original)
+++ trunk/libc/sysdeps/sparc/sparc64/sparcv9v/memset.S Sat Oct 18 11:20:55 2008
@@ -1,5 +1,5 @@
 /* Set a block of memory to some byte value.  For SUN4V Niagara.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David S. Miller (davem@xxxxxxxxxxxxx)
 
@@ -49,7 +49,11 @@
 
 ENTRY(__bzero)
 	clr		%o2
-1:	brz,pn		%o1, 90f
+1:
+#ifndef USE_BRP
+	srl		%o1, 0, %o1
+#endif
+	brz,pn		%o1, 90f
 	 mov		%o0, %o3
 
 	wr		%g0, ASI_P, %asi

Modified: trunk/libc/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S
==============================================================================
--- trunk/libc/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S (original)
+++ trunk/libc/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S Sat Oct 18 11:20:55 2008
@@ -1,5 +1,5 @@
 /* Copy SIZE bytes from SRC to DEST.  For SUN4V Niagara-2.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David S. Miller (davem@xxxxxxxxxxxxx)
 
@@ -163,6 +163,9 @@
 
 	.align		32
 ENTRY(memcpy)
+#ifndef USE_BPR
+	srl		%o2, 0, %o2
+#endif
 100:	/* %o0=dst, %o1=src, %o2=len */
 	mov		%o0, %g5
 	cmp		%o2, 0

Modified: trunk/libc/sysdeps/unix/sysv/linux/alpha/sys/signalfd.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/alpha/sys/signalfd.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/alpha/sys/signalfd.h Sat Oct 18 11:20:55 2008
@@ -59,7 +59,7 @@
 /* Request notification for delivery of signals in MASK to be
    performed using descriptor FD.*/
 extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
-  __nonnull ((2)) __THROW;
+  __THROW __nonnull ((2));
 
 __END_DECLS
 

Modified: trunk/libc/sysdeps/unix/sysv/linux/sparc/sys/signalfd.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/sparc/sys/signalfd.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/sparc/sys/signalfd.h Sat Oct 18 11:20:55 2008
@@ -59,7 +59,7 @@
 /* Request notification for delivery of signals in MASK to be
    performed using descriptor FD.*/
 extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
-  __nonnull ((2)) __THROW;
+  __THROW __nonnull ((2));
 
 __END_DECLS
 

Modified: trunk/libc/sysdeps/unix/sysv/linux/sys/signalfd.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/sys/signalfd.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/sys/signalfd.h Sat Oct 18 11:20:55 2008
@@ -59,7 +59,7 @@
 /* Request notification for delivery of signals in MASK to be
    performed using descriptor FD.*/
 extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
-  __nonnull ((2)) __THROW;
+  __THROW __nonnull ((2));
 
 __END_DECLS
 

Modified: trunk/ports/ChangeLog.mips
==============================================================================
--- trunk/ports/ChangeLog.mips (original)
+++ trunk/ports/ChangeLog.mips Sat Oct 18 11:20:55 2008
@@ -1,3 +1,9 @@
+2008-10-15  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/mips/dl-dtprocnum.h (DT_MIPS_NUM): Do not redefine.
+	* sysdeps/mips/dl-machine.h (STO_MIPS_PLT, R_MIPS_COPY,
+	R_MIPS_JUMP_SLOT, DT_MIPS_PLTGOT): Do not redefine.
+
 2008-10-01  Mark Shinwell  <shinwell@xxxxxxxxxxxxxxxx>
 	    Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
 	    Richard Sandiford  <rdsandiford@xxxxxxxxxxxxxx>

Modified: trunk/ports/sysdeps/mips/dl-dtprocnum.h
==============================================================================
--- trunk/ports/sysdeps/mips/dl-dtprocnum.h (original)
+++ trunk/ports/sysdeps/mips/dl-dtprocnum.h Sat Oct 18 11:20:55 2008
@@ -17,12 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-/* Until elf/elf.h in glibc is updated.  */
-#ifndef STO_MIPS_PLT
-# undef DT_MIPS_NUM
-# define DT_MIPS_NUM 0x35
-#endif
-
 /* Number of extra dynamic section entries for this architecture.  By
    default there are none.  */
 #define DT_THISPROCNUM	DT_MIPS_NUM

Modified: trunk/ports/sysdeps/mips/dl-machine.h
==============================================================================
--- trunk/ports/sysdeps/mips/dl-machine.h (original)
+++ trunk/ports/sysdeps/mips/dl-machine.h Sat Oct 18 11:20:55 2008
@@ -51,14 +51,6 @@
 # define _RTLD_EPILOGUE(entry)						\
 	".end\t" __STRING(entry) "\n\t"					\
 	".size\t" __STRING(entry) ", . - " __STRING(entry) "\n\t"
-#endif
-
-/* Until elf/elf.h in glibc is updated.  */
-#ifndef STO_MIPS_PLT
-#define STO_MIPS_PLT			0x8
-#define R_MIPS_COPY		126
-#define R_MIPS_JUMP_SLOT        127
-#define DT_MIPS_PLTGOT	     0x70000032
 #endif
 
 /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.