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

[Commits] r19237 - in /fsf/trunk/libc: ./ elf/ include/ sysdeps/gnu/ sysdeps/unix/sysv/linux/sh/bits/



Author: eglibc
Date: Sat Jun 23 00:01:44 2012
New Revision: 19237

Log:
Import glibc-mainline for 2012-06-23

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/Makeconfig
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/config.make.in
    fsf/trunk/libc/configure
    fsf/trunk/libc/configure.in
    fsf/trunk/libc/elf/dl-close.c
    fsf/trunk/libc/elf/dl-deps.c
    fsf/trunk/libc/elf/dl-libc.c
    fsf/trunk/libc/elf/rtld.c
    fsf/trunk/libc/include/link.h
    fsf/trunk/libc/sysdeps/gnu/configure
    fsf/trunk/libc/sysdeps/gnu/configure.in
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Jun 23 00:01:44 2012
@@ -1,3 +1,43 @@
+2012-06-22  Nobuhiro Iwamatsu  <iwamatsu@xxxxxxxxxxx>
+	    Kaz Kojima  <kkojima@xxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/sh/bits/atomic.h
+	(__arch_compare_and_exchange_val_8_acq): Remove explicit nop.
+	(__arch_compare_and_exchange_val_16_acq): Likewise.
+	(__arch_compare_and_exchange_val_32_acq): Likewise.
+	(atomic_exchange_and_add): Fix gUSA sequence.
+	(atomic_add): Likewise.
+	(atomic_add_negative): Likewise.
+	(atomic_add_zero): Likewise.
+	(atomic_bit_test_set): Likewise.
+
+2012-06-22  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	[BZ #13579]
+	* include/link.h (struct link_map): Add l_free_initfini.
+	* elf/dl-deps.c (_dl_map_object_deps): Set it when assigning
+	l_initfini.
+	* elf/dl-close.c (_dl_close_worker): Don't free l_initfini.
+	* elf/rtld.c (dl_main): Clear it on all objects loaded on startup.
+	* elf/dl-libc.c (free_mem): Free l_initfini if l_free_initfini is
+	set.
+
+2012-06-22  Carlos O'Donell  <carlos_odonell@xxxxxxxxxx>
+
+	* configure.in: Use AC_LANG_SOURCE.
+	* configure: Regenerate.
+
+2012-06-22  Roland McGrath  <roland@xxxxxxxxxxxxx>
+
+	* configure.in (libc_cv_localstatedir): New substituted variable.
+	* configure: Regenerated.
+	* config.make.in (localstatedir): New variable, substituted from
+	libc_cv_localstatedir.
+	* Makeconfig (vardbdir): Use $(localstatedir) in place of /var.
+	* sysdeps/gnu/configure.in (libc_cv_localstatedir): Change
+	${prefix}/var to /var when we change ${prefix}/etc to /etc.
+	* sysdeps/gnu/configure: Regenerated.
+
 2012-06-21  Jeff Law  <law@xxxxxxxxxx>
 
 	[BZ #14277]
@@ -23,7 +63,7 @@
 	[BZ #13882]
 	* elf/dl-deps.c (_dl_map_object_deps): Fix cycle detection.  Use
 	uint16_t for elements in the "seen" array to avoid char overflows.
-        * elf/dl-fini.c (_dl_sort_fini): Likewise.
+	* elf/dl-fini.c (_dl_sort_fini): Likewise.
 	* elf/dl-open.c (dl_open_worker): Likewise.
 
 2012-06-21  Carlos O'Donell  <carlos_odonell@xxxxxxxxxx>

Modified: fsf/trunk/libc/Makeconfig
==============================================================================
--- fsf/trunk/libc/Makeconfig (original)
+++ fsf/trunk/libc/Makeconfig Sat Jun 23 00:01:44 2012
@@ -287,7 +287,7 @@
 
 # Directory for the database files and Makefile for nss_db.
 ifndef vardbdir
-vardbdir = /var/db
+vardbdir = $(localstatedir)/db
 endif
 inst_vardbdir = $(install_root)$(vardbdir)
 

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sat Jun 23 00:01:44 2012
@@ -19,18 +19,19 @@
   12193, 12194, 12297, 12298, 12301, 12340, 12354, 12416, 12495, 13058,
   13223, 13361, 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532,
   13533, 13547, 13551, 13552, 13553, 13555, 13556, 13559, 13563, 13566,
-  13576, 13583, 13592, 13594, 13613, 13618, 13637, 13656, 13658, 13673,
-  13691, 13695, 13704, 13705, 13706, 13718, 13726, 13738, 13739, 13743,
-  13750, 13758, 13760, 13761, 13775, 13786, 13787, 13792, 13806, 13824,
-  13840, 13841, 13844, 13846, 13848, 13851, 13852, 13854, 13871, 13872,
-  13873, 13879, 13882, 13883, 13884, 13885, 13886, 13892, 13895, 13908,
-  13910, 13911, 13912, 13913, 13914, 13915, 13916, 13917, 13918, 13919,
-  13920, 13921, 13922, 13923, 13924, 13926, 13927, 13928, 13938, 13941,
-  13942, 13954, 13955, 13956, 13963, 13967, 13968, 13970, 13973, 13979,
-  13983, 13986, 13996, 14012, 14027, 14033, 14034, 14036, 14040, 14043,
-  14044, 14048, 14049, 14050, 14053, 14055, 14059, 14064, 14075, 14080,
-  14083, 14103, 14104, 14109, 14112, 14117, 14122, 14123, 14134, 14153,
-  14183, 14188, 14199, 14210, 14218, 14229, 14241, 14273, 14277, 14278
+  13576, 13579, 13583, 13592, 13594, 13613, 13618, 13637, 13656, 13658,
+  13673, 13691, 13695, 13704, 13705, 13706, 13718, 13726, 13738, 13739,
+  13743, 13750, 13758, 13760, 13761, 13775, 13786, 13787, 13792, 13806,
+  13824, 13840, 13841, 13844, 13846, 13848, 13851, 13852, 13854, 13871,
+  13872, 13873, 13879, 13882, 13883, 13884, 13885, 13886, 13892, 13895,
+  13908, 13910, 13911, 13912, 13913, 13914, 13915, 13916, 13917, 13918,
+  13919, 13920, 13921, 13922, 13923, 13924, 13926, 13927, 13928, 13938,
+  13941, 13942, 13954, 13955, 13956, 13963, 13967, 13968, 13970, 13973,
+  13979, 13983, 13986, 13996, 14012, 14027, 14033, 14034, 14036, 14040,
+  14043, 14044, 14048, 14049, 14050, 14053, 14055, 14059, 14064, 14075,
+  14080, 14083, 14103, 14104, 14109, 14112, 14117, 14122, 14123, 14134,
+  14153, 14183, 14188, 14199, 14210, 14218, 14229, 14241, 14273, 14277,
+  14278
 
 * Support for the x32 ABI on x86-64 added.  The x32 target is selected by
   configuring glibc with:

Modified: fsf/trunk/libc/config.make.in
==============================================================================
--- fsf/trunk/libc/config.make.in (original)
+++ fsf/trunk/libc/config.make.in Sat Jun 23 00:01:44 2012
@@ -18,6 +18,7 @@
 infodir = @infodir@
 includedir = @includedir@
 datarootdir = @datarootdir@
+localstatedir = @libc_cv_localstatedir@
 
 # Should we use and build ldconfig?
 use-ldconfig = @use_ldconfig@

Modified: fsf/trunk/libc/configure
==============================================================================
--- fsf/trunk/libc/configure (original)
+++ fsf/trunk/libc/configure Sat Jun 23 00:01:44 2012
@@ -592,6 +592,7 @@
 libc_cv_cpp_asm_debuginfo
 libc_cv_forced_unwind
 libc_cv_rootsbindir
+libc_cv_localstatedir
 libc_cv_sysconfdir
 libc_cv_localedir
 libc_cv_slibdir
@@ -7448,6 +7449,7 @@
 use_ldconfig=no
 ldd_rewrite_script=no
 libc_cv_sysconfdir=$sysconfdir
+libc_cv_localstatedir=$localstatedir
 libc_cv_gcc_unwind_find_fde=no
 libc_cv_idn=no
 
@@ -7489,6 +7491,7 @@
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** be removed." >&5
 $as_echo "$as_me: WARNING: *** be removed." >&2;}
 fi
+
 
 
 

Modified: fsf/trunk/libc/configure.in
==============================================================================
--- fsf/trunk/libc/configure.in (original)
+++ fsf/trunk/libc/configure.in Sat Jun 23 00:01:44 2012
@@ -278,12 +278,12 @@
   AC_CACHE_CHECK([for systemtap static probe support], libc_cv_sdt, [dnl
   old_CFLAGS="$CFLAGS"
   CFLAGS="-std=gnu99 $CFLAGS"
-  AC_COMPILE_IFELSE([#include <sys/sdt.h>
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/sdt.h>
 void foo (int i, void *p)
 {
   asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
        :: STAP_PROBE_ASM_OPERANDS (2, i, p));
-}], [libc_cv_sdt=yes], [libc_cv_sdt=no])
+}]])], [libc_cv_sdt=yes], [libc_cv_sdt=no])
   CFLAGS="$old_CFLAGS"])
   if test $libc_cv_sdt = yes; then
     AC_DEFINE([USE_STAP_PROBE])
@@ -2119,6 +2119,7 @@
 use_ldconfig=no
 ldd_rewrite_script=no
 libc_cv_sysconfdir=$sysconfdir
+libc_cv_localstatedir=$localstatedir
 libc_cv_gcc_unwind_find_fde=no
 libc_cv_idn=no
 
@@ -2159,6 +2160,7 @@
 AC_SUBST(libc_cv_slibdir)
 AC_SUBST(libc_cv_localedir)
 AC_SUBST(libc_cv_sysconfdir)
+AC_SUBST(libc_cv_localstatedir)
 AC_SUBST(libc_cv_rootsbindir)
 AC_SUBST(libc_cv_forced_unwind)
 

Modified: fsf/trunk/libc/elf/dl-close.c
==============================================================================
--- fsf/trunk/libc/elf/dl-close.c (original)
+++ fsf/trunk/libc/elf/dl-close.c Sat Jun 23 00:01:44 2012
@@ -1,5 +1,5 @@
 /* Close a shared object opened by `_dl_open'.
-   Copyright (C) 1996-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 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
@@ -118,17 +118,8 @@
   if (map->l_direct_opencount > 0 || map->l_type != lt_loaded
       || dl_close_state != not_pending)
     {
-      if (map->l_direct_opencount == 0)
-	{
-	  if (map->l_type == lt_loaded)
-	    dl_close_state = rerun;
-	  else if (map->l_type == lt_library)
-	    {
-	      struct link_map **oldp = map->l_initfini;
-	      map->l_initfini = map->l_orig_initfini;
-	      _dl_scope_free (oldp);
-	    }
-	}
+      if (map->l_direct_opencount == 0 && map->l_type == lt_loaded)
+	dl_close_state = rerun;
 
       /* There are still references to this object.  Do nothing more.  */
       if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))

Modified: fsf/trunk/libc/elf/dl-deps.c
==============================================================================
--- fsf/trunk/libc/elf/dl-deps.c (original)
+++ fsf/trunk/libc/elf/dl-deps.c Sat Jun 23 00:01:44 2012
@@ -1,6 +1,5 @@
 /* Load the dependencies of a mapped object.
-   Copyright (C) 1996-2003, 2004-2007, 2010-2012
-   Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 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
@@ -488,6 +487,7 @@
 		  nneeded * sizeof needed[0]);
 	  atomic_write_barrier ();
 	  l->l_initfini = l_initfini;
+	  l->l_free_initfini = 1;
 	}
 
       /* If we have no auxiliary objects just go on to the next map.  */
@@ -688,6 +688,7 @@
   l_initfini[nlist] = NULL;
   atomic_write_barrier ();
   map->l_initfini = l_initfini;
+  map->l_free_initfini = 1;
   if (l_reldeps != NULL)
     {
       atomic_write_barrier ();
@@ -696,7 +697,7 @@
       _dl_scope_free (old_l_reldeps);
     }
   if (old_l_initfini != NULL)
-      map->l_orig_initfini = old_l_initfini;
+    _dl_scope_free (old_l_initfini);
 
   if (errno_reason)
     _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,

Modified: fsf/trunk/libc/elf/dl-libc.c
==============================================================================
--- fsf/trunk/libc/elf/dl-libc.c (original)
+++ fsf/trunk/libc/elf/dl-libc.c Sat Jun 23 00:01:44 2012
@@ -1,6 +1,5 @@
 /* Handle loading and unloading shared objects for internal libc purposes.
-   Copyright (C) 1999-2002,2004-2006,2009,2010,2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1999-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Zack Weinberg <zack@xxxxxxxxxxxxxxxxx>, 1999.
 
@@ -269,13 +268,13 @@
 
   for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
     {
-      /* Remove all additional names added to the objects.  */
       for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
 	{
 	  struct libname_list *lnp = l->l_libname->next;
 
 	  l->l_libname->next = NULL;
 
+	  /* Remove all additional names added to the objects.  */
 	  while (lnp != NULL)
 	    {
 	      struct libname_list *old = lnp;
@@ -283,6 +282,10 @@
 	      if (! old->dont_free)
 		free (old);
 	    }
+
+	  /* Free the initfini dependency list.  */
+	  if (l->l_free_initfini)
+	    free (l->l_initfini);
 	}
 
       if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0

Modified: fsf/trunk/libc/elf/rtld.c
==============================================================================
--- fsf/trunk/libc/elf/rtld.c (original)
+++ fsf/trunk/libc/elf/rtld.c Sat Jun 23 00:01:44 2012
@@ -2292,6 +2292,8 @@
 	      lnp->dont_free = 1;
 	      lnp = lnp->next;
 	    }
+	  /* Also allocated with the fake malloc().  */
+	  l->l_free_initfini = 0;
 
 	  if (l != &GL(dl_rtld_map))
 	    _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,

Modified: fsf/trunk/libc/include/link.h
==============================================================================
--- fsf/trunk/libc/include/link.h (original)
+++ fsf/trunk/libc/include/link.h Sat Jun 23 00:01:44 2012
@@ -1,6 +1,6 @@
 /* Data structure for communication from the run-time dynamic linker for
    loaded ELF shared objects.
-   Copyright (C) 1995-2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1995-2012 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
@@ -191,6 +191,9 @@
 						 during LD_TRACE_PRELINKING=1
 						 contains any DT_SYMBOLIC
 						 libraries.  */
+    unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be
+				       freed, ie. not allocated with
+				       the dummy malloc in ld.so.  */
 
     /* Collected information about own RPATH directories.  */
     struct r_search_path_struct l_rpath_dirs;
@@ -239,9 +242,6 @@
 
     /* List of object in order of the init and fini calls.  */
     struct link_map **l_initfini;
-    /* The init and fini list generated at startup, saved when the
-       object is also loaded dynamically.  */
-    struct link_map **l_orig_initfini;
 
     /* List of the dependencies introduced through symbol binding.  */
     struct link_map_reldeps

Modified: fsf/trunk/libc/sysdeps/gnu/configure
==============================================================================
--- fsf/trunk/libc/sysdeps/gnu/configure (original)
+++ fsf/trunk/libc/sysdeps/gnu/configure Sat Jun 23 00:01:44 2012
@@ -25,12 +25,18 @@
     libc_cv_slibdir=/lib
     ;;
   esac
-  # Allow the user to override the path with --sysconfdir
+  # Allow the user to override the path with --sysconfdir.
   if test "$sysconfdir" = '${prefix}/etc'; then
     libc_cv_sysconfdir=/etc
   else
     libc_cv_sysconfdir=$sysconfdir
    fi
+  # Allow the user to override the path with --localstatedir.
+  if test "$localstatedir" = '${prefix}/var'; then
+    libc_cv_localstatedir=/var
+  else
+    libc_cv_localstatedir=$localstatedir
+   fi
   libc_cv_rootsbindir=/sbin
   ;;
 esac

Modified: fsf/trunk/libc/sysdeps/gnu/configure.in
==============================================================================
--- fsf/trunk/libc/sysdeps/gnu/configure.in (original)
+++ fsf/trunk/libc/sysdeps/gnu/configure.in Sat Jun 23 00:01:44 2012
@@ -25,12 +25,18 @@
     libc_cv_slibdir=/lib
     ;;
   esac
-  # Allow the user to override the path with --sysconfdir
+  # Allow the user to override the path with --sysconfdir.
   if test "$sysconfdir" = '${prefix}/etc'; then
     libc_cv_sysconfdir=/etc
   else
     libc_cv_sysconfdir=$sysconfdir
    fi
+  # Allow the user to override the path with --localstatedir.
+  if test "$localstatedir" = '${prefix}/var'; then
+    libc_cv_localstatedir=/var
+  else
+    libc_cv_localstatedir=$localstatedir
+   fi
   libc_cv_rootsbindir=/sbin
   ;;
 esac

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h Sat Jun 23 00:01:44 2012
@@ -1,5 +1,5 @@
 /* Atomic operations used inside libc.  Linux/SH version.
-   Copyright (C) 2003, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2003-2012 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
@@ -73,11 +73,10 @@
 #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
   ({ __typeof (*(mem)) __result; \
      __asm __volatile ("\
+	mova 1f,r0\n\
 	.align 2\n\
-	mova 1f,r0\n\
-	nop\n\
 	mov r15,r1\n\
-	mov #-8,r15\n\
+	mov #(0f-1f),r15\n\
      0: mov.b @%1,%0\n\
 	cmp/eq %0,%3\n\
 	bf 1f\n\
@@ -90,10 +89,10 @@
 #define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
   ({ __typeof (*(mem)) __result; \
      __asm __volatile ("\
+	mova 1f,r0\n\
+	mov r15,r1\n\
 	.align 2\n\
-	mova 1f,r0\n\
-	nop\n\
-	mov r15,r1\n\
+	mov #(0f-1f),r15\n\
 	mov #-8,r15\n\
      0: mov.w @%1,%0\n\
 	cmp/eq %0,%3\n\
@@ -107,11 +106,10 @@
 #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
   ({ __typeof (*(mem)) __result; \
      __asm __volatile ("\
+	mova 1f,r0\n\
 	.align 2\n\
-	mova 1f,r0\n\
-	nop\n\
 	mov r15,r1\n\
-	mov #-8,r15\n\
+	mov #(0f-1f),r15\n\
      0: mov.l @%1,%0\n\
 	cmp/eq %0,%3\n\
 	bf 1f\n\
@@ -133,40 +131,43 @@
   ({ __typeof (*(mem)) __result, __tmp, __value = (value); \
      if (sizeof (*(mem)) == 1) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  mov r15,r1\n\
-	  mov #-6,r15\n\
+	  mova 1f,r0\n\
+	  .align 2\n\
+	  mov r15,r1\n\
+	  mov #(0f-1f),r15\n\
        0: mov.b @%2,%0\n\
-	  add %0,%1\n\
-	  mov.b %1,@%2\n\
+	  mov %1,r2\n\
+	  add %0,r2\n\
+	  mov.b r2,@%2\n\
        1: mov r1,r15"\
 	: "=&r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
-	: "r0", "r1", "memory"); \
+	: "r0", "r1", "r2", "memory");		       \
      else if (sizeof (*(mem)) == 2) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  mov r15,r1\n\
-	  mov #-6,r15\n\
+	  mova 1f,r0\n\
+	  .align 2\n\
+	  mov r15,r1\n\
+	  mov #(0f-1f),r15\n\
        0: mov.w @%2,%0\n\
-	  add %0,%1\n\
-	  mov.w %1,@%2\n\
+	  mov %1,r2\n\
+	  add %0,r2\n\
+	  mov.w r2,@%2\n\
        1: mov r1,r15"\
 	: "=&r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
-	: "r0", "r1", "memory"); \
+	: "r0", "r1", "r2", "memory"); \
      else if (sizeof (*(mem)) == 4) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  mov r15,r1\n\
-	  mov #-6,r15\n\
+	  mova 1f,r0\n\
+	  .align 2\n\
+	  mov r15,r1\n\
+	  mov #(0f-1f),r15\n\
        0: mov.l @%2,%0\n\
-	  add %0,%1\n\
-	  mov.l %1,@%2\n\
+	  mov %1,r2\n\
+	  add %0,r2\n\
+	  mov.l r2,@%2\n\
        1: mov r1,r15"\
 	: "=&r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
-	: "r0", "r1", "memory"); \
+	: "r0", "r1", "r2", "memory"); \
      else \
        { \
 	 __typeof (mem) memp = (mem); \
@@ -182,37 +183,37 @@
   (void) ({ __typeof (*(mem)) __tmp, __value = (value); \
 	    if (sizeof (*(mem)) == 1) \
 	      __asm __volatile ("\
-		.align 2\n\
-		mova 1f,r0\n\
-		mov r15,r1\n\
-		mov #-6,r15\n\
+		mova 1f,r0\n\
+		mov r15,r1\n\
+		.align 2\n\
+		mov #(0f-1f),r15\n\
 	     0: mov.b @%1,r2\n\
-		add r2,%0\n\
-		mov.b %0,@%1\n\
+		add %0,r2\n\
+		mov.b r2,@%1\n\
 	     1: mov r1,r15"\
 		: "=&r" (__tmp) : rNOSP (mem), "0" (__value) \
 		: "r0", "r1", "r2", "memory"); \
 	    else if (sizeof (*(mem)) == 2) \
 	      __asm __volatile ("\
-		.align 2\n\
-		mova 1f,r0\n\
-		mov r15,r1\n\
-		mov #-6,r15\n\
+		mova 1f,r0\n\
+		mov r15,r1\n\
+		.align 2\n\
+		mov #(0f-1f),r15\n\
 	     0: mov.w @%1,r2\n\
-		add r2,%0\n\
-		mov.w %0,@%1\n\
+		add %0,r2\n\
+		mov.w r2,@%1\n\
 	     1: mov r1,r15"\
 		: "=&r" (__tmp) : rNOSP (mem), "0" (__value) \
 		: "r0", "r1", "r2", "memory"); \
 	    else if (sizeof (*(mem)) == 4) \
 	      __asm __volatile ("\
-		.align 2\n\
-		mova 1f,r0\n\
-		mov r15,r1\n\
-		mov #-6,r15\n\
+		mova 1f,r0\n\
+		mov r15,r1\n\
+		.align 2\n\
+		mov #(0f-1f),r15\n\
 	     0: mov.l @%1,r2\n\
-		add r2,%0\n\
-		mov.l %0,@%1\n\
+		add %0,r2\n\
+		mov.l r2,@%1\n\
 	     1: mov r1,r15"\
 		: "=&r" (__tmp) : rNOSP (mem), "0" (__value) \
 		: "r0", "r1", "r2", "memory"); \
@@ -233,43 +234,43 @@
      __typeof (*(mem)) __tmp, __value = (value); \
      if (sizeof (*(mem)) == 1) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  mov r15,r1\n\
-	  mov #-6,r15\n\
+	  mova 1f,r0\n\
+	  mov r15,r1\n\
+	  .align 2\n\
+	  mov #(0f-1f),r15\n\
        0: mov.b @%2,r2\n\
-	  add r2,%1\n\
-	  mov.b %1,@%2\n\
-       1: mov r1,r15\n\
-	  shal %1\n\
+	  add %1,r2\n\
+	  mov.b r2,@%2\n\
+       1: mov r1,r15\n\
+	  shal r2\n\
 	  movt %0"\
 	: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
 	: "r0", "r1", "r2", "t", "memory"); \
      else if (sizeof (*(mem)) == 2) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  mov r15,r1\n\
-	  mov #-6,r15\n\
+	  mova 1f,r0\n\
+	  mov r15,r1\n\
+	  .align 2\n\
+	  mov #(0f-1f),r15\n\
        0: mov.w @%2,r2\n\
-	  add r2,%1\n\
-	  mov.w %1,@%2\n\
-       1: mov r1,r15\n\
-	  shal %1\n\
+	  add %1,r2\n\
+	  mov.w r2,@%2\n\
+       1: mov r1,r15\n\
+	  shal r2\n\
 	  movt %0"\
 	: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
 	: "r0", "r1", "r2", "t", "memory"); \
      else if (sizeof (*(mem)) == 4) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  mov r15,r1\n\
-	  mov #-6,r15\n\
+	  mova 1f,r0\n\
+	  mov r15,r1\n\
+	  .align 2\n\
+	  mov #(0f-1f),r15\n\
        0: mov.l @%2,r2\n\
-	  add r2,%1\n\
-	  mov.l %1,@%2\n\
-       1: mov r1,r15\n\
-	  shal %1\n\
+	  add %1,r2\n\
+	  mov.l r2,@%2\n\
+       1: mov r1,r15\n\
+	  shal r2\n\
 	  movt %0"\
 	: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
 	: "r0", "r1", "r2", "t", "memory"); \
@@ -282,43 +283,43 @@
      __typeof (*(mem)) __tmp, __value = (value); \
      if (sizeof (*(mem)) == 1) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  mov r15,r1\n\
-	  mov #-6,r15\n\
+	  mova 1f,r0\n\
+	  mov r15,r1\n\
+	  .align 2\n\
+	  mov #(0f-1f),r15\n\
        0: mov.b @%2,r2\n\
-	  add r2,%1\n\
-	  mov.b %1,@%2\n\
-       1: mov r1,r15\n\
-	  tst %1,%1\n\
+	  add %1,r2\n\
+	  mov.b r2,@%2\n\
+       1: mov r1,r15\n\
+	  tst r2,r2\n\
 	  movt %0"\
 	: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
 	: "r0", "r1", "r2", "t", "memory"); \
      else if (sizeof (*(mem)) == 2) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  mov r15,r1\n\
-	  mov #-6,r15\n\
+	  mova 1f,r0\n\
+	  mov r15,r1\n\
+	  .align 2\n\
+	  mov #(0f-1f),r15\n\
        0: mov.w @%2,r2\n\
-	  add r2,%1\n\
-	  mov.w %1,@%2\n\
-       1: mov r1,r15\n\
-	  tst %1,%1\n\
+	  add %1,r2\n\
+	  mov.w r2,@%2\n\
+       1: mov r1,r15\n\
+	  tst r2,r2\n\
 	  movt %0"\
 	: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
 	: "r0", "r1", "r2", "t", "memory"); \
      else if (sizeof (*(mem)) == 4) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  mov r15,r1\n\
-	  mov #-6,r15\n\
+	  mova 1f,r0\n\
+	  mov r15,r1\n\
+	  .align 2\n\
+	  mov #(0f-1f),r15\n\
        0: mov.l @%2,r2\n\
-	  add r2,%1\n\
-	  mov.l %1,@%2\n\
-       1: mov r1,r15\n\
-	  tst %1,%1\n\
+	  add %1,r2\n\
+	  mov.l r2,@%2\n\
+       1: mov r1,r15\n\
+	  tst r2,r2\n\
 	  movt %0"\
 	: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
 	: "r0", "r1", "r2", "t", "memory"); \
@@ -333,10 +334,10 @@
   (void) ({ unsigned int __mask = 1 << (bit); \
 	    if (sizeof (*(mem)) == 1) \
 	      __asm __volatile ("\
-		.align 2\n\
-		mova 1f,r0\n\
-		mov r15,r1\n\
-		mov #-6,r15\n\
+		mova 1f,r0\n\
+		mov r15,r1\n\
+		.align 2\n\
+		mov #(0f-1f),r15\n\
 	     0: mov.b @%0,r2\n\
 		or %1,r2\n\
 		mov.b r2,@%0\n\
@@ -345,10 +346,10 @@
 		: "r0", "r1", "r2", "memory"); \
 	    else if (sizeof (*(mem)) == 2) \
 	      __asm __volatile ("\
-		.align 2\n\
-		mova 1f,r0\n\
-		mov r15,r1\n\
-		mov #-6,r15\n\
+		mova 1f,r0\n\
+		mov r15,r1\n\
+		.align 2\n\
+		mov #(0f-1f),r15\n\
 	     0: mov.w @%0,r2\n\
 		or %1,r2\n\
 		mov.w r2,@%0\n\
@@ -357,10 +358,10 @@
 		: "r0", "r1", "r2", "memory"); \
 	    else if (sizeof (*(mem)) == 4) \
 	      __asm __volatile ("\
-		.align 2\n\
-		mova 1f,r0\n\
-		mov r15,r1\n\
-		mov #-6,r15\n\
+		mova 1f,r0\n\
+		mov r15,r1\n\
+		.align 2\n\
+		mov #(0f-1f),r15\n\
 	     0: mov.l @%0,r2\n\
 		or %1,r2\n\
 		mov.l r2,@%0\n\
@@ -376,49 +377,49 @@
      unsigned int __result = __mask; \
      if (sizeof (*(mem)) == 1) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  nop\n\
-	  mov r15,r1\n\
-	  mov #-8,r15\n\
+	  mova 1f,r0\n\
+	  .align 2\n\
+	  mov r15,r1\n\
+	  mov #(0f-1f),r15\n\
        0: mov.b @%2,r2\n\
-	  or r2,%1\n\
-	  and r2,%0\n\
-	  mov.b %1,@%2\n\
-       1: mov r1,r15"\
+	  mov r2,r3\n\
+	  or %1,r2\n\
+	  mov.b r2,@%2\n\
+       1: mov r1,r15\n\
+	  and r3,%0"\
 	: "=&r" (__result), "=&r" (__mask) \
 	: rNOSP (mem), "0" (__result), "1" (__mask) \
-	: "r0", "r1", "r2", "memory"); \
+	: "r0", "r1", "r2", "r3", "memory");	\
      else if (sizeof (*(mem)) == 2) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  nop\n\
-	  mov r15,r1\n\
-	  mov #-8,r15\n\
+	  mova 1f,r0\n\
+	  .align 2\n\
+	  mov r15,r1\n\
+	  mov #(0f-1f),r15\n\
        0: mov.w @%2,r2\n\
-	  or r2,%1\n\
-	  and r2,%0\n\
+	  mov r2,r3\n\
+	  or %1,r2\n\
 	  mov.w %1,@%2\n\
-       1: mov r1,r15"\
+       1: mov r1,r15\n\
+	  and r3,%0"\
 	: "=&r" (__result), "=&r" (__mask) \
 	: rNOSP (mem), "0" (__result), "1" (__mask) \
-	: "r0", "r1", "r2", "memory"); \
+	: "r0", "r1", "r2", "r3", "memory"); \
      else if (sizeof (*(mem)) == 4) \
        __asm __volatile ("\
-	  .align 2\n\
-	  mova 1f,r0\n\
-	  nop\n\
-	  mov r15,r1\n\
-	  mov #-8,r15\n\
+	  mova 1f,r0\n\
+	  .align 2\n\
+	  mov r15,r1\n\
+	  mov #(0f-1f),r15\n\
        0: mov.l @%2,r2\n\
+	  mov r2,r3\n\
 	  or r2,%1\n\
-	  and r2,%0\n\
 	  mov.l %1,@%2\n\
-       1: mov r1,r15"\
+       1: mov r1,r15\n\
+	  and r3,%0"\
 	: "=&r" (__result), "=&r" (__mask) \
 	: rNOSP (mem), "0" (__result), "1" (__mask) \
-	: "r0", "r1", "r2", "memory"); \
+	: "r0", "r1", "r2", "r3", "memory"); \
      else \
        abort (); \
      __result; })

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits