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

[Commits] r17928 - in /fsf/trunk/libc: ./ elf/ localedata/ localedata/locales/ stdlib/ sysdeps/powerpc/powerpc32/ sysdeps/s390/s390-32...



Author: eglibc
Date: Fri Apr  6 00:02:06 2012
New Revision: 17928

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

Added:
    fsf/trunk/libc/sysdeps/sh/sh4/fpu/fedisblxcpt.c
    fsf/trunk/libc/sysdeps/sh/sh4/fpu/feenablxcpt.c
    fsf/trunk/libc/sysdeps/sh/sh4/fpu/fegetexcept.c
    fsf/trunk/libc/sysdeps/sh/sh4/fpu/feupdateenv.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/elf/dl-lookup.c
    fsf/trunk/libc/elf/dynamic-link.h
    fsf/trunk/libc/elf/rtld.c
    fsf/trunk/libc/localedata/ChangeLog
    fsf/trunk/libc/localedata/locales/ca_ES
    fsf/trunk/libc/stdlib/stdlib.h
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/dl-machine.h
    fsf/trunk/libc/sysdeps/s390/s390-32/dl-machine.h
    fsf/trunk/libc/sysdeps/sh/sh4/fpu/fegetenv.c
    fsf/trunk/libc/sysdeps/sh/sh4/fpu/fesetround.c
    fsf/trunk/libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c
    fsf/trunk/libc/sysdeps/sh/sh4/fpu/ftestexcept.c
    fsf/trunk/libc/sysdeps/sparc/sparc32/dl-machine.h
    fsf/trunk/libc/sysdeps/sparc/sparc64/dl-machine.h
    fsf/trunk/libc/sysdeps/x86_64/memset.S

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri Apr  6 00:02:06 2012
@@ -1,3 +1,58 @@
+2012-04-05  David S. Miller  <davem@xxxxxxxxxxxxx>
+
+	* elf/dynamic-link.h (_ELF_DYNAMIC_DO_RELOC): Reduce down to one
+	definition.
+	* sysdeps/powerpc/powerpc32/dl-machine.h
+	(ELF_MACHINE_PLTREL_OVERLAP): Delete.
+	* sysdeps/s390/s390-32/dl-machine.h
+	(ELF_MACHINE_PLTREL_OVERLAP): Likewise.
+	* sysdeps/sparc/sparc32/dl-machine.h
+	(ELF_MACHINE_PLTREL_OVERLAP): Likewise.
+	* sysdeps/sparc/sparc64/dl-machine.h
+	(ELF_MACHINE_PLTREL_OVERLAP): Likewise.
+
+	* elf/rtld.c (dl_main): If DL_DEBUG_UNUSED is enabled, turn off
+	lazy binding.
+	* elf/dl-lookup.c (_dl_lookup_symbol_x): If DL_DEBUG_UNUSED, ignore
+	undefined symbol errors.
+
+	* elf/rtld.c (dl_main): Skip VDSO when checking for unused
+	DT_NEEDED entries.
+
+2012-04-05  Michael Matz  <matz@xxxxxxx>
+
+	[BZ #13592]
+	* sysdeps/x86_64/memset.S: Fix size paramater comparisions.
+
+2012-04-05  Andreas Jaeger  <aj@xxxxxxx>
+
+	[BZ #13908]
+	* stdlib/stdlib.h: Don't warn about unused result of mktemp, fix
+	comment.
+
+2012-04-05  Nobuhiro Iwamatsu  <iwamatsu@xxxxxxxxxxx>
+
+	* sysdeps/sh/sh4/fpu/fesetround.c (fesetround): Fix return value
+	which ROUND is no valid rounding mode.
+
+2012-04-05  Nobuhiro Iwamatsu  <iwamatsu@xxxxxxxxxxx>
+
+	* sysdeps/sh/sh4/fpu/fegetenv.c (fegetenv): Set fpscr register which
+	read again.
+	* sysdeps/sh/sh4/fpu/ftestexcept.c: Likewise.
+
+2012-04-05  Nobuhiro Iwamatsu  <iwamatsu@xxxxxxxxxxx>
+
+	* sysdeps/sh/sh4/fpu/fraiseexcpt.c (feraiseexcept): Produce
+	an exception using FPU order intentionally.
+
+2012-04-05  Nobuhiro Iwamatsu  <iwamatsu@xxxxxxxxxxx>
+
+	* sysdeps/sh/sh4/fpu/fedisblxcpt.c: New file.
+	* sysdeps/sh/sh4/fpu/feenablxcpt.c: New file.
+	* sysdeps/sh/sh4/fpu/fegetexcept.c: New file.
+	* sysdeps/sh/sh4/fpu/feupdateenv.c: New file.
+
 2012-04-05  Simon Josefsson  <simon@xxxxxxxxxxxxx>
 
 	[BZ #12340]

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Fri Apr  6 00:02:06 2012
@@ -11,15 +11,15 @@
 
   174, 350, 369, 411, 2541, 2547, 2548, 2551, 2552, 2553, 2554, 2562, 2563,
   2565, 2566, 2576, 2678, 3335, 3866, 3868, 3976, 3992, 4026, 4108, 4596,
-  4822, 5077, 5461, 5805, 5993, 6471, 6730, 6884, 6907, 6911, 9739, 9902,
-  10110, 10135, 10140, 10210, 10346, 10545, 10716, 11174, 11322, 11365,
-  11451, 11494, 12047, 13058, 13525, 13526, 13527, 13528, 13529, 13530,
-  13531, 13532, 13533, 13547, 13551, 13552, 13553, 13555, 13559, 13566,
-  13583, 13618, 13637, 13656, 13658, 13673, 13691, 13695, 13704, 13706,
-  13726, 13738, 13760, 13761, 13786, 13792, 13806, 13824, 13840, 13841,
-  13844, 13846, 13851, 13852, 13854, 13871, 13879, 13883, 13892, 13910,
-  13911, 13912, 13913, 13915, 13916, 13917, 13918, 13919, 13920, 13921,
-  13926, 13928, 13938
+  4822, 5077, 5461, 5805, 5993, 6471, 6730, 6770, 6884, 6907, 6911, 9739,
+  9902, 10110, 10135, 10140, 10210, 10346, 10545, 10716, 11174, 11322,
+  11365, 11451, 11494, 12047, 12340, 13058, 13525, 13526, 13527, 13528,
+  13529, 13530, 13531, 13532, 13533, 13547, 13551, 13552, 13553, 13555,
+  13559, 13566, 13583, 13592, 13618, 13637, 13656, 13658, 13673, 13691,
+  13695, 13704, 13706, 13726, 13738, 13760, 13761, 13786, 13792, 13806,
+  13824, 13840, 13841, 13844, 13846, 13851, 13852, 13854, 13871, 13879,
+  13883, 13892, 13908, 13910, 13911, 13912, 13913, 13915, 13916, 13917,
+  13918, 13919, 13920, 13921, 13926, 13928, 13938
 
 * ISO C11 support:
 

Modified: fsf/trunk/libc/elf/dl-lookup.c
==============================================================================
--- fsf/trunk/libc/elf/dl-lookup.c (original)
+++ fsf/trunk/libc/elf/dl-lookup.c Fri Apr  6 00:02:06 2012
@@ -769,7 +769,8 @@
   if (__builtin_expect (current_value.s == NULL, 0))
     {
       if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK)
-	  && skip_map == NULL)
+	  && skip_map == NULL
+	  && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED))
 	{
 	  /* We could find no value for a strong reference.  */
 	  const char *reference_name = undef_map ? undef_map->l_name : "";

Modified: fsf/trunk/libc/elf/dynamic-link.h
==============================================================================
--- fsf/trunk/libc/elf/dynamic-link.h (original)
+++ fsf/trunk/libc/elf/dynamic-link.h Fri Apr  6 00:02:06 2012
@@ -251,53 +251,12 @@
 
 /* On some machines, notably SPARC, DT_REL* includes DT_JMPREL in its
    range.  Note that according to the ELF spec, this is completely legal!
-   But conditionally define things so that on machines we know this will
-   not happen we do something more optimal.  */
-
-# ifdef ELF_MACHINE_PLTREL_OVERLAP
-#  define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, skip_ifunc, test_rel) \
-  do {									      \
-    struct { ElfW(Addr) start, size;					      \
-	     __typeof (((ElfW(Dyn) *) 0)->d_un.d_val) nrelative; int lazy; }  \
-    ranges[3];								      \
-    int ranges_index;							      \
-									      \
-    ranges[0].lazy = ranges[2].lazy = 0;				      \
-    ranges[1].lazy = 1;							      \
-    ranges[0].size = ranges[1].size = ranges[2].size = 0;		      \
-    ranges[0].nrelative = ranges[1].nrelative = ranges[2].nrelative = 0;      \
-									      \
-    if ((map)->l_info[DT_##RELOC])					      \
-      {									      \
-	ranges[0].start = D_PTR ((map), l_info[DT_##RELOC]);		      \
-	ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val;	      \
-	if (map->l_info[VERSYMIDX (DT_##RELOC##COUNT)] != NULL)		      \
-	  ranges[0].nrelative						      \
-	    = MIN (map->l_info[VERSYMIDX (DT_##RELOC##COUNT)]->d_un.d_val,    \
-		   ranges[0].size / sizeof (ElfW(reloc)));		      \
-      }									      \
-									      \
-    if ((do_lazy)							      \
-	&& (map)->l_info[DT_PLTREL]					      \
-	&& (!test_rel || (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC)) \
-      {									      \
-	ranges[1].start = D_PTR ((map), l_info[DT_JMPREL]);		      \
-	ranges[1].size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val;	      \
-	ranges[2].start = ranges[1].start + ranges[1].size;		      \
-	ranges[2].size = ranges[0].start + ranges[0].size - ranges[2].start;  \
-	ranges[0].size = ranges[1].start - ranges[0].start;		      \
-      }									      \
-									      \
-    for (ranges_index = 0; ranges_index < 3; ++ranges_index)		      \
-      elf_dynamic_do_##reloc ((map),					      \
-			      ranges[ranges_index].start,		      \
-			      ranges[ranges_index].size,		      \
-			      ranges[ranges_index].nrelative,		      \
-			      ranges[ranges_index].lazy,		      \
-			      skip_ifunc);				      \
-  } while (0)
-# else
-#  define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, skip_ifunc, test_rel) \
+
+   We are guarenteed that we have one of two situations.  Either DT_JMPREL
+   comes immediately after DT_REL*, or there is overlap and DT_JMPREL
+   consumes precisely the very end of the DT_REL*.  */
+
+# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, skip_ifunc, test_rel) \
   do {									      \
     struct { ElfW(Addr) start, size;					      \
 	     __typeof (((ElfW(Dyn) *) 0)->d_un.d_val) nrelative; int lazy; }  \
@@ -317,6 +276,8 @@
       {									      \
 	ElfW(Addr) start = D_PTR ((map), l_info[DT_JMPREL]);		      \
 									      \
+	if (__builtin_expect (ranges[0].size, 1))			      \
+	  ranges[0].size = (start - ranges[0].start);			      \
 	if (! ELF_DURING_STARTUP					      \
 	    && ((do_lazy)						      \
 		/* This test does not only detect whether the relocation      \
@@ -352,7 +313,6 @@
 				  skip_ifunc);				      \
       }									      \
   } while (0)
-# endif
 
 # if ELF_MACHINE_NO_REL || ELF_MACHINE_NO_RELA
 #  define _ELF_CHECK_REL 0

Modified: fsf/trunk/libc/elf/rtld.c
==============================================================================
--- fsf/trunk/libc/elf/rtld.c (original)
+++ fsf/trunk/libc/elf/rtld.c Fri Apr  6 00:02:06 2012
@@ -1967,7 +1967,12 @@
 	      if (dyn->d_tag == DT_NEEDED)
 		{
 		  l = l->l_next;
-
+#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+		  /* Skip the VDSO since it's not part of the list
+		     of objects we brought in via DT_NEEDED entries.  */
+		  if (l == GLRO(dl_sysinfo_map))
+		    l = l->l_next;
+#endif
 		  if (!l->l_used)
 		    {
 		      if (first)
@@ -2500,6 +2505,14 @@
       ++dl_debug;
     }
 
+  if (GLRO(dl_debug_mask) & DL_DEBUG_UNUSED)
+    {
+      /* In order to get an accurate picture of whether a particular
+	 DT_NEEDED entry is actually used we have to process both
+	 the PLT and non-PLT relocation entries.  */
+      GLRO(dl_lazy) = 0;
+    }
+
   if (GLRO(dl_debug_mask) & DL_DEBUG_HELP)
     {
       size_t cnt;

Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Fri Apr  6 00:02:06 2012
@@ -1,3 +1,13 @@
+2012-04-04  Jeff Law  <law@xxxxxxxxxx>
+
+	[BZ #6770]
+	* locales/ca_ES (LC_TIME): Add first_weekday and first_workday.
+
+2012-04-04  Petr Baudis  <pasky@xxxxxx>
+
+	[BZ #6770]
+	* locales/ca_ES: This locale is now maintained by Jordi Mallach.
+
 2012-04-04  Dmitry V. Levin  <ldv@xxxxxxxxxxxx>
 
 	[BZ #10346]

Modified: fsf/trunk/libc/localedata/locales/ca_ES
==============================================================================
--- fsf/trunk/libc/localedata/locales/ca_ES (original)
+++ fsf/trunk/libc/localedata/locales/ca_ES Fri Apr  6 00:02:06 2012
@@ -3,8 +3,8 @@
 %
 % Catalan Language Locale for Spain
 % Source: RAP
-% Contact: Joan Carles Soler
-% Email: Joan.Soler@xxxxx
+% Contact: Jordi Mallach
+% Email: jordi@xxxxxxx
 % Tel:
 % Fax:
 % Language: ca
@@ -138,6 +138,8 @@
 date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
+first_weekday 2
+first_workday 2
 END LC_TIME
 
 LC_PAPER

Modified: fsf/trunk/libc/stdlib/stdlib.h
==============================================================================
--- fsf/trunk/libc/stdlib/stdlib.h (original)
+++ fsf/trunk/libc/stdlib/stdlib.h Fri Apr  6 00:02:06 2012
@@ -603,8 +603,9 @@
 /* Generate a unique temporary file name from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the file name unique.
-   Returns TEMPLATE, or a null pointer if it cannot get a unique file name.  */
-extern char *mktemp (char *__template) __THROW __nonnull ((1)) __wur;
+   Always returns TEMPLATE, it's either a temporary file name or a null
+   string if it cannot get a unique file name.  */
+extern char *mktemp (char *__template) __THROW __nonnull ((1));
 #endif
 
 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED \

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/dl-machine.h
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/dl-machine.h (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/dl-machine.h Fri Apr  6 00:02:06 2012
@@ -388,8 +388,4 @@
   /* elf_machine_runtime_setup handles this. */
 }
 
-/* The SVR4 ABI specifies that the JMPREL relocs must be inside the
-   DT_RELA table.  */
-#define ELF_MACHINE_PLTREL_OVERLAP 1
-
 #endif /* RESOLVE_MAP */

Modified: fsf/trunk/libc/sysdeps/s390/s390-32/dl-machine.h
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/s390-32/dl-machine.h (original)
+++ fsf/trunk/libc/sysdeps/s390/s390-32/dl-machine.h Fri Apr  6 00:02:06 2012
@@ -227,9 +227,6 @@
 /* The S390 never uses Elf32_Rel relocations.  */
 #define ELF_MACHINE_NO_REL 1
 
-/* The S390 overlaps DT_RELA and DT_PLTREL.  */
-#define ELF_MACHINE_PLTREL_OVERLAP 1
-
 /* We define an initialization functions.  This is called very early in
    _dl_sysdep_start.  */
 #define DL_PLATFORM_INIT dl_platform_init ()

Added: fsf/trunk/libc/sysdeps/sh/sh4/fpu/fedisblxcpt.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/sh4/fpu/fedisblxcpt.c (added)
+++ fsf/trunk/libc/sysdeps/sh/sh4/fpu/fedisblxcpt.c Fri Apr  6 00:02:06 2012
@@ -1,0 +1,39 @@
+/* Disable floating-point exceptions.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Nobuhiro Iwamatsu <iwamatsu@xxxxxxxxxxx>, 2012.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fedisableexcept (int excepts)
+{
+  unsigned int temp, old_exc;
+
+  /* Get the current control register contents.  */
+  _FPU_GETCW (temp);
+
+  old_exc = (temp >> 5) & FE_ALL_EXCEPT;
+
+  excepts &= FE_ALL_EXCEPT;
+
+  temp &= ~(excepts << 5);
+  _FPU_SETCW (temp);
+
+  return old_exc;
+}

Added: fsf/trunk/libc/sysdeps/sh/sh4/fpu/feenablxcpt.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/sh4/fpu/feenablxcpt.c (added)
+++ fsf/trunk/libc/sysdeps/sh/sh4/fpu/feenablxcpt.c Fri Apr  6 00:02:06 2012
@@ -1,0 +1,38 @@
+/* Enable floating-point exceptions.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Nobuhiro Iwamatsu <iwamatsu@xxxxxxxxxxx>, 2012.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+feenableexcept (int excepts)
+{
+  unsigned int temp, old_flag;
+
+  /* Get current exceptions.  */
+  _FPU_GETCW (temp);
+
+  old_flag = (temp >> 5) & FE_ALL_EXCEPT;
+  excepts &= FE_ALL_EXCEPT;
+
+  temp |= excepts << 5;
+  _FPU_SETCW (temp);
+
+  return old_flag;
+}

Modified: fsf/trunk/libc/sysdeps/sh/sh4/fpu/fegetenv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/sh4/fpu/fegetenv.c (original)
+++ fsf/trunk/libc/sysdeps/sh/sh4/fpu/fegetenv.c Fri Apr  6 00:02:06 2012
@@ -1,5 +1,5 @@
 /* Store current floating-point environment.
-   Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2000, 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
@@ -24,6 +24,10 @@
 {
   unsigned long int temp;
   _FPU_GETCW (temp);
+  /* When read fpscr, this was initialized.
+     We need to rewrite value of temp. */
+  _FPU_SETCW (temp);
+
   envp->__fpscr = temp;
 
   return 0;

Added: fsf/trunk/libc/sysdeps/sh/sh4/fpu/fegetexcept.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/sh4/fpu/fegetexcept.c (added)
+++ fsf/trunk/libc/sysdeps/sh/sh4/fpu/fegetexcept.c Fri Apr  6 00:02:06 2012
@@ -1,0 +1,35 @@
+/* Get enabled floating-point exceptions.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Nobuhiro Iwamatsu <iwamatsu@xxxxxxxxxxx>, 2012.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetexcept (void)
+{
+  unsigned int temp;
+
+  /* Get current exceptions.  */
+  _FPU_GETCW (temp);
+  /* When read fpscr, this was initialized.
+     We need to rewrite value of temp. */
+  _FPU_SETCW (temp);
+
+  return (temp >> 5) & FE_ALL_EXCEPT;
+}

Modified: fsf/trunk/libc/sysdeps/sh/sh4/fpu/fesetround.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/sh4/fpu/fesetround.c (original)
+++ fsf/trunk/libc/sysdeps/sh/sh4/fpu/fesetround.c Fri Apr  6 00:02:06 2012
@@ -1,5 +1,5 @@
 /* Set current rounding direction.
-   Copyright (C) 1998, 2000, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2005, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@xxxxxxxxxxxxxxxxxxxxxx>, 1998.
 
@@ -27,7 +27,7 @@
 
   if ((round & ~0x3) != 0)
     /* ROUND is no valid rounding mode.  */
-    return 0;
+    return 1;
 
   /* Get current state.  */
   _FPU_GETCW (cw);
@@ -38,6 +38,6 @@
   /* Set new state.  */
   _FPU_SETCW (cw);
 
-  return 1;
+  return 0;
 }
 libm_hidden_def (fesetround)

Added: fsf/trunk/libc/sysdeps/sh/sh4/fpu/feupdateenv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/sh4/fpu/feupdateenv.c (added)
+++ fsf/trunk/libc/sysdeps/sh/sh4/fpu/feupdateenv.c Fri Apr  6 00:02:06 2012
@@ -1,0 +1,39 @@
+/* Install given floating-point environment and raise exceptions.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Nobuhiro Iwamatsu <iwamatsu@xxxxxxxxxxx>, 2012.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+feupdateenv (const fenv_t *envp)
+{
+  unsigned int temp;
+
+  _FPU_GETCW (temp);
+  temp = (temp & FE_ALL_EXCEPT);
+
+  /* Raise the saved exception. Incidently for us the implementation
+    defined format of the values in objects of type fexcept_t is the
+    same as the ones specified using the FE_* constants. */
+  fesetenv (envp);
+  feraiseexcept ((int) temp);
+
+  return 0;
+}
+libm_hidden_def (feupdateenv)

Modified: fsf/trunk/libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c (original)
+++ fsf/trunk/libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c Fri Apr  6 00:02:06 2012
@@ -1,6 +1,7 @@
 /* Raise given exceptions.
-   Copyright (C) 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2000, 2002, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
+   Contributed by Nobuhiro Iwamatsu <iwamatsu@xxxxxxxxxxx>, 2012.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -17,18 +18,47 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <fenv.h>
+#include <float.h>
 #include <fpu_control.h>
 #include <math.h>
 
 int
 feraiseexcept (int excepts)
 {
+  if (excepts == 0)
+    return 0;
+
   /* Raise exceptions represented by EXPECTS.  */
-  fexcept_t temp;
-  _FPU_GETCW (temp);
-  temp |= (excepts & FE_ALL_EXCEPT);
-  temp |= (excepts & FE_ALL_EXCEPT) << 5;
-  _FPU_SETCW (temp);
+
+  if (excepts & FE_INEXACT)
+  {
+    double d = 1.0, x = 3.0;
+    __asm__ __volatile__ ("fdiv %1, %0" : "+d" (d) : "d" (x));
+  }
+
+  if (excepts & FE_UNDERFLOW)
+  {
+    long double d = LDBL_MIN, x = 10;
+    __asm__ __volatile__ ("fdiv %1, %0" : "+d" (d) : "d" (x));
+  }
+
+  if (excepts & FE_OVERFLOW)
+  {
+    long double d = LDBL_MAX;
+    __asm__ __volatile__ ("fmul %0, %0" : "+d" (d) : "d" (d));
+  }
+
+  if (excepts & FE_DIVBYZERO)
+  {
+    double d = 1.0, x = 0.0;
+    __asm__ __volatile__ ("fdiv %1, %0" : "+d" (d) : "d" (x));
+  }
+
+  if (excepts & FE_INVALID)
+  {
+    double d = HUGE_VAL, x = 0.0;
+    __asm__ __volatile__ ("fmul %1, %0" : "+d" (d) : "d" (x));
+  }
 
   return 0;
 }

Modified: fsf/trunk/libc/sysdeps/sh/sh4/fpu/ftestexcept.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/sh4/fpu/ftestexcept.c (original)
+++ fsf/trunk/libc/sysdeps/sh/sh4/fpu/ftestexcept.c Fri Apr  6 00:02:06 2012
@@ -26,6 +26,9 @@
 
   /* Get current exceptions.  */
   _FPU_GETCW (temp);
+  /* When read fpscr, this was initialized.
+     We need to rewrite value of temp. */
+  _FPU_SETCW (temp);
 
   return temp & excepts & FE_ALL_EXCEPT;
 }

Modified: fsf/trunk/libc/sysdeps/sparc/sparc32/dl-machine.h
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/dl-machine.h (original)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/dl-machine.h Fri Apr  6 00:02:06 2012
@@ -203,9 +203,6 @@
 
 /* The SPARC never uses Elf32_Rel relocations.  */
 #define ELF_MACHINE_NO_REL 1
-
-/* The SPARC overlaps DT_RELA and DT_PLTREL.  */
-#define ELF_MACHINE_PLTREL_OVERLAP 1
 
 /* Undo the sub %sp, 6*4, %sp; add %sp, 22*4, %o0 below to get at the
    value we want in __libc_stack_end.  */

Modified: fsf/trunk/libc/sysdeps/sparc/sparc64/dl-machine.h
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/dl-machine.h (original)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/dl-machine.h Fri Apr  6 00:02:06 2012
@@ -124,9 +124,6 @@
 
 /* The SPARC never uses Elf64_Rel relocations.  */
 #define ELF_MACHINE_NO_REL 1
-
-/* The SPARC overlaps DT_RELA and DT_PLTREL.  */
-#define ELF_MACHINE_PLTREL_OVERLAP 1
 
 /* Set up the loaded object described by L so its unrelocated PLT
    entries will jump to the on-demand fixup code in dl-runtime.c.  */

Modified: fsf/trunk/libc/sysdeps/x86_64/memset.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/memset.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/memset.S Fri Apr  6 00:02:06 2012
@@ -1,6 +1,6 @@
 /* memset/bzero -- set memory area to CH/0
    Optimized version for x86-64.
-   Copyright (C) 2002-2005, 2007, 2008, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2002-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
@@ -52,7 +52,7 @@
 	imul   %r9,%rdx
 L(now_dw_aligned):
 	cmp    $0x90,%r8
-	jg     L(ck_mem_ops_method)
+	ja     L(ck_mem_ops_method)
 L(now_dw_aligned_small):
 	add    %r8,%rdi
 #ifndef PIC
@@ -604,7 +604,7 @@
 	 punpcklqdq %xmm0,%xmm0
 
 	 cmp    $0xb0,%r8 # 176
-	 jge    L(byte32sse2_pre)
+	 jae    L(byte32sse2_pre)
 
 	 add    %r8,%rdi
 # ifndef PIC
@@ -864,7 +864,7 @@
 
 	mov    __x86_64_shared_cache_size(%rip),%r9d  # The largest cache size
 	cmp    %r9,%r8
-	jg     L(sse2_nt_move_pre)
+	ja     L(sse2_nt_move_pre)
 	#jmp    L(byte32sse2)
 	.balign     16
 L(byte32sse2):
@@ -880,7 +880,7 @@
 	movdqa %xmm0,0x70(%rdi)
 
 	lea    0x80(%rdi),%rdi
-	jge    L(byte32sse2)
+	jae    L(byte32sse2)
 	add    %r8,%rdi
 # ifndef PIC
 	lea    L(SSExDx)(%rip),%r11
@@ -914,7 +914,7 @@
 	movntdq %xmm0,0x70(%rdi)
 
 	lea    0x80(%rdi),%rdi
-	jge    L(sse2_nt_move)
+	jae    L(sse2_nt_move)
 	sfence
 	add    %r8,%rdi
 # ifndef PIC

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