about summary refs log tree commit diff
path: root/stdlib
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-08-08 15:51:48 +0000
committerUlrich Drepper <drepper@redhat.com>2006-08-08 15:51:48 +0000
commit2d1e6277e92bd907578cd01d017b1d6aa34485be (patch)
tree17c5c9fd04f176d31f629f78517e37169a291e76 /stdlib
parentd0ccde254046e59e05469b4da6f4e0d2f74e1f7f (diff)
downloadglibc-2d1e6277e92bd907578cd01d017b1d6aa34485be.tar.gz
glibc-2d1e6277e92bd907578cd01d017b1d6aa34485be.tar.xz
glibc-2d1e6277e92bd907578cd01d017b1d6aa34485be.zip
* stdlib/strtol_l.c (__strtol_ul_max_tab, __strtol_ul_rem_tab,
	__strtol_ull_max_tab, __strtol_ull_rem_tab): Declare.
	(DEF): Don't put the var into .gnu.linkonce.r.* section.
	Only provide var definitions in strtol_l (or for *ull*
	in strtoll_l).

	* stdio-common/bug16.c (tests): New array.
	(do_tests): Allow the first hexadecimal digit
	to be 1, 2, 4 or 8.  Do 3 additional tests.

	* sysdeps/s390/fpu/libm-test-ulps: Update.

	* sysdeps/unix/sysv/linux/s390/s390-32/fchownat.c (fchownat): Use
	fchownat syscall if available.
	* sysdeps/unix/sysv/linux/powerpc/fchownat.c (fchownat): Likewise.
	* sysdeps/unix/sysv/linux/sh/fchownat.c (fchownat): Likewise.
	* sysdeps/unix/sysv/linux/i386/fchownat.c (fchownat): Likewise.

	(rec_dirsearch) [case HIGHER_NAME]: Correctly size ndomain array.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/strtol_l.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/stdlib/strtol_l.c b/stdlib/strtol_l.c
index 156083c748..e02a2747d0 100644
--- a/stdlib/strtol_l.c
+++ b/stdlib/strtol_l.c
@@ -1,5 +1,5 @@
 /* Convert string representing a number to integer value, using given locale.
-   Copyright (C) 1997, 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2002, 2004, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -168,10 +168,15 @@
 /* Define tables of maximum values and remainders in order to detect
    overflow.  Do this at compile-time in order to avoid the runtime
    overhead of the division.  */
+extern const unsigned long __strtol_ul_max_tab[] attribute_hidden;
+extern const unsigned char __strtol_ul_rem_tab[] attribute_hidden;
+#if defined(QUAD) && __WORDSIZE == 32
+extern const unsigned long long __strtol_ull_max_tab[] attribute_hidden;
+extern const unsigned char __strtol_ull_rem_tab[] attribute_hidden;
+#endif
 
 #define DEF(TYPE, NAME)							   \
-  const TYPE NAME[] attribute_hidden					   \
-	__attribute__((section(".gnu.linkonce.r." #NAME))) =		   \
+  const TYPE NAME[] attribute_hidden =					   \
   {									   \
     F(2), F(3), F(4), F(5), F(6), F(7), F(8), F(9), F(10), 		   \
     F(11), F(12), F(13), F(14), F(15), F(16), F(17), F(18), F(19), F(20),  \
@@ -179,20 +184,22 @@
     F(31), F(32), F(33), F(34), F(35), F(36)				   \
   }
 
-#define F(X)	ULONG_MAX / X
+#if !UNSIGNED && !defined (USE_WIDE_CHAR) && !defined (QUAD)
+# define F(X)	ULONG_MAX / X
   DEF (unsigned long, __strtol_ul_max_tab);
-#undef F
-#if defined(QUAD) && __WORDSIZE == 32
+# undef F
+# define F(X)	ULONG_MAX % X
+  DEF (unsigned char, __strtol_ul_rem_tab);
+# undef F
+#endif
+#if !UNSIGNED && !defined (USE_WIDE_CHAR) && defined (QUAD) \
+    && __WORDSIZE == 32
 # define F(X)	ULONG_LONG_MAX / X
   DEF (unsigned long long, __strtol_ull_max_tab);
 # undef F
 # define F(X)	ULONG_LONG_MAX % X
   DEF (unsigned char, __strtol_ull_rem_tab);
 # undef F
-#else
-# define F(X)	ULONG_MAX % X
-  DEF (unsigned char, __strtol_ul_rem_tab);
-# undef F
 #endif
 #undef DEF