[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r17800 - in /fsf/trunk/libc: ./ malloc/ math/ resolv/nss_dns/ sysdeps/generic/ sysdeps/i386/fpu/ sysdeps/ieee754/ sysdeps/ie...
- To: commits@xxxxxxxxxx
- Subject: [Commits] r17800 - in /fsf/trunk/libc: ./ malloc/ math/ resolv/nss_dns/ sysdeps/generic/ sysdeps/i386/fpu/ sysdeps/ieee754/ sysdeps/ie...
- From: eglibc@xxxxxxxxxx
- Date: Wed, 28 Mar 2012 21:47:45 -0000
Author: eglibc
Date: Wed Mar 28 21:47:42 2012
New Revision: 17800
Log:
Import glibc-mainline for 2012-03-28
Added:
fsf/trunk/libc/sysdeps/powerpc/ifunc-sel.h
fsf/trunk/libc/sysdeps/powerpc/powerpc32/bzero.S
fsf/trunk/libc/sysdeps/powerpc/powerpc32/start.S
fsf/trunk/libc/sysdeps/powerpc/powerpc64/bzero.S
fsf/trunk/libc/sysdeps/powerpc/powerpc64/entry.h
fsf/trunk/libc/sysdeps/powerpc/powerpc64/start.S
fsf/trunk/libc/sysdeps/powerpc/rtld-global-offsets.sym
fsf/trunk/libc/sysdeps/s390/s390-32/configure
fsf/trunk/libc/sysdeps/s390/s390-32/configure.in
fsf/trunk/libc/sysdeps/s390/s390-32/start.S
fsf/trunk/libc/sysdeps/s390/s390-64/configure
fsf/trunk/libc/sysdeps/s390/s390-64/configure.in
fsf/trunk/libc/sysdeps/s390/s390-64/start.S
fsf/trunk/libc/sysdeps/sh/configure
fsf/trunk/libc/sysdeps/sh/configure.in
fsf/trunk/libc/sysdeps/sh/start.S
fsf/trunk/libc/sysdeps/sparc/sparc32/start.S
fsf/trunk/libc/sysdeps/sparc/sparc64/start.S
Removed:
fsf/trunk/libc/sysdeps/powerpc/elf/
fsf/trunk/libc/sysdeps/powerpc/powerpc32/elf/
fsf/trunk/libc/sysdeps/powerpc/powerpc64/elf/
fsf/trunk/libc/sysdeps/s390/s390-32/elf/
fsf/trunk/libc/sysdeps/s390/s390-64/elf/
fsf/trunk/libc/sysdeps/sh/elf/
fsf/trunk/libc/sysdeps/sparc/elf/
fsf/trunk/libc/sysdeps/sparc/sparc32/elf/
fsf/trunk/libc/sysdeps/sparc/sparc64/elf/
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/NEWS
fsf/trunk/libc/configure
fsf/trunk/libc/configure.in
fsf/trunk/libc/malloc/mallocbug.c
fsf/trunk/libc/math/libm-test.inc
fsf/trunk/libc/math/w_acoshl.c
fsf/trunk/libc/math/w_acosl.c
fsf/trunk/libc/math/w_asinl.c
fsf/trunk/libc/math/w_atan2l.c
fsf/trunk/libc/math/w_atanhl.c
fsf/trunk/libc/math/w_coshl.c
fsf/trunk/libc/math/w_exp10l.c
fsf/trunk/libc/math/w_exp2l.c
fsf/trunk/libc/math/w_fmodl.c
fsf/trunk/libc/math/w_hypotl.c
fsf/trunk/libc/math/w_j0l.c
fsf/trunk/libc/math/w_j1l.c
fsf/trunk/libc/math/w_jnl.c
fsf/trunk/libc/math/w_lgammal.c
fsf/trunk/libc/math/w_log10l.c
fsf/trunk/libc/math/w_log2l.c
fsf/trunk/libc/math/w_logl.c
fsf/trunk/libc/math/w_powl.c
fsf/trunk/libc/math/w_remainderl.c
fsf/trunk/libc/math/w_scalbl.c
fsf/trunk/libc/math/w_sinhl.c
fsf/trunk/libc/math/w_sqrtl.c
fsf/trunk/libc/math/w_tgammal.c
fsf/trunk/libc/resolv/nss_dns/dns-host.c
fsf/trunk/libc/sysdeps/generic/math_private.h
fsf/trunk/libc/sysdeps/i386/fpu/e_pow.S
fsf/trunk/libc/sysdeps/i386/fpu/e_powf.S
fsf/trunk/libc/sysdeps/i386/fpu/e_powl.S
fsf/trunk/libc/sysdeps/ieee754/k_standard.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-128/w_expl.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-96/w_expl.c
fsf/trunk/libc/sysdeps/powerpc/powerpc32/configure
fsf/trunk/libc/sysdeps/powerpc/powerpc32/configure.in
fsf/trunk/libc/sysdeps/powerpc/powerpc64/Makefile
fsf/trunk/libc/sysdeps/powerpc/powerpc64/configure
fsf/trunk/libc/sysdeps/powerpc/powerpc64/configure.in
fsf/trunk/libc/sysdeps/s390/s390-32/bsd-_setjmp.S
fsf/trunk/libc/sysdeps/s390/s390-32/bsd-setjmp.S
fsf/trunk/libc/sysdeps/s390/s390-32/setjmp.S
fsf/trunk/libc/sysdeps/s390/s390-64/bsd-_setjmp.S
fsf/trunk/libc/sysdeps/s390/s390-64/bsd-setjmp.S
fsf/trunk/libc/sysdeps/s390/s390-64/setjmp.S
fsf/trunk/libc/sysdeps/sparc/Makefile
fsf/trunk/libc/sysdeps/sparc/configure
fsf/trunk/libc/sysdeps/sparc/configure.in
fsf/trunk/libc/sysdeps/sparc/sparc32/Makefile
fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/mman.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/mman.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/mman.h
fsf/trunk/libc/sysdeps/x86_64/configure
fsf/trunk/libc/sysdeps/x86_64/configure.in
fsf/trunk/libc/sysdeps/x86_64/fpu/e_powl.S
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Mar 28 21:47:42 2012
@@ -1,3 +1,107 @@
+2012-03-28 David S. Miller <davem@xxxxxxxxxxxxx>
+
+ * sysdeps/sparc/Makefile: Add -fPIC to ASFLAGS-.os here....
+ * sysdeps/sparc/sparc32/Makefile: rather than here...
+ * sysdeps/sparc/sparc64/Makefile: and here.
+
+2012-03-28 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ * malloc/mallocbug.c: Avoid warnings about unused variables.
+
+2012-02-22 Siddhesh Poyarekar <siddhesh@xxxxxxxxxx>
+
+ [BZ #13760]
+ * resolv/nss_dns/dns-host.c (gaih_getanswer): Look for errno
+ in the right place. Discard and retry query if response is
+ larger than input buffer size.
+
+2012-03-28 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ [BZ #369]
+ [BZ #2678]
+ [BZ #3866]
+ * sysdeps/i386/fpu/e_pow.S (__ieee754_pow): Take absolute value of
+ x for large integer exponent.
+ * sysdeps/i386/fpu/e_powf.S (__ieee754_powf): Likewise.
+ * sysdeps/i386/fpu/e_powl.S (__ieee754_powl): Likewise. Adjust
+ sign of result as needed afterwards.
+ * sysdeps/x86_64/fpu/e_powl.S (__ieee754_powl): Likewise.
+ * sysdeps/ieee754/k_standard.c (__kernel_standard): Handle sign of
+ result for underflowing pow the same as for overflow.
+ (__kernel_standard_l): Handle powl overflow and underflow here
+ rather than calling __kernel_standard.
+ * math/libm-test.inc (pow_test): Add more tests.
+
+ [BZ #3868]
+ [BZ #13879]
+ [BZ #13910]
+ [BZ #13911]
+ [BZ #13912]
+ [BZ #13913]
+ [BZ #13915]
+ [BZ #13916]
+ [BZ #13917]
+ [BZ #13918]
+ [BZ #13919]
+ [BZ #13920]
+ [BZ #13921]
+ * sysdeps/generic/math_private.h (__kernel_standard_l): Declare.
+ * sysdeps/ieee754/k_standard.c: Include <float.h>.
+ (__kernel_standard_l): New function.
+ * math/w_acoshl.c (__acoshl): Use __kernel_standard_l instead of
+ __kernel_standard.
+ * math/w_acosl.c (__acosl): Likewise.
+ * math/w_asinl.c (__asinl): Likewise.
+ * math/w_atan2l.c (__atan2l): Likewise.
+ * math/w_atanhl.c (__atanhl): Likewise.
+ * math/w_coshl.c (__coshl): Likewise.
+ * math/w_exp10l.c (__exp10l): Likewise.
+ * math/w_exp2l.c (__exp2l): Likewise.
+ * math/w_fmodl.c (__fmodl): Likewise.
+ * math/w_hypotl.c (__hypotl): Likewise.
+ * math/w_j0l.c (__j0l, __y0l): Likewise.
+ * math/w_j1l.c (__j1l, __y1l): Likewise.
+ * math/w_jnl.c (__jnl, __ynl): Likewise.
+ * math/w_lgammal.c (__lgammal): Likewise.
+ * math/w_log10l.c (__log10l): Likewise.
+ * math/w_log2l.c (__log2l): Likewise.
+ * math/w_logl.c (__logl): Likewise.
+ * math/w_powl.c (__powl): Likewise.
+ * math/w_remainderl.c (__remainderl): Likewise.
+ * math/w_scalbl.c (sysv_scalbl): Likewise.
+ * math/w_sinhl.c (__sinhl): Likewise.
+ * math/w_sqrtl.c (__sqrtl): Likewise.
+ * math/w_tgammal.c (__tgammal): Likewise.
+ * sysdeps/ieee754/ldbl-128/w_expl.c (__expl): Likewise.
+ * sysdeps/ieee754/ldbl-96/w_expl.c (__expl): Likewise.
+ * math/libm-test.inc (acos_test): Add more tests.
+ (acosh_test): Likewise.
+ (asin_test): Likewise.
+ (atanh_test): Likewise.
+ (exp_test): Likewise.
+ (exp10_test): Likewise.
+ (exp2_test): Likewise.
+ (expm1_test): Likewise.
+ (lgamma_test): Likewise.
+ (log_test): Likewise.
+ (log10_test): Likewise.
+ (log1p_test): Likewise.
+ (log2_test): Likewise.
+ (pow_test): Do not allow some spurious overflow exceptions.
+ (sqrt_test): Add more tests.
+ (tgamma_test): Likewise.
+ (y0_test): Likewise.
+ (y1_test): Likewise.
+ (yn_test): Likewise.
+
+2012-03-27 Anton Blanchard <anton@xxxxxxxxx>
+
+ * sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Define MAP_STACK and
+ MAP_HUGETLB.
+ * sysdeps/unix/sysv/linux/s390/bits/mman.h: Likewise.
+ * sysdeps/unix/sysv/linux/sh/bits/mman.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/mman.h: Likewise.
+
2012-03-27 David S. Miller <davem@xxxxxxxxxxxxx>
* conform/Makefile: Run run-conformtest.sh using $(BASH).
@@ -301,9 +405,9 @@
2012-03-21 Thomas Schwinge <thomas@xxxxxxxxxxxxxxxx>
- * conform/conformtest.pl: Handle --tmpdir argument, defaulting to /tmp.
- * conform/run-conformtest.sh: Pass --tmpdir argument when invoking
- conformtest.pl
+ * conform/conformtest.pl: Handle --tmpdir argument, defaulting to /tmp.
+ * conform/run-conformtest.sh: Pass --tmpdir argument when invoking
+ conformtest.pl
2012-03-21 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Wed Mar 28 21:47:42 2012
@@ -9,15 +9,16 @@
* The following bugs are resolved with this release:
- 174, 350, 411, 2541, 2547, 2548, 2551, 2552, 2553, 2554, 2562, 2563, 2565,
- 2566, 2576, 3335, 3976, 3992, 4026, 4108, 4596, 4822, 5077, 5461, 5805,
- 5993, 6471, 6730, 6884, 6907, 6911, 9739, 9902, 10110, 10135, 10140,
- 10210, 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, 13695, 13704, 13706, 13726, 13738, 13786, 13792, 13806,
- 13824, 13840, 13841, 13844, 13846, 13851, 13852, 13854, 13871, 13883,
- 13892
+ 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, 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, 13695, 13704, 13706, 13726, 13738,
+ 13760, 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
* ISO C11 support:
Modified: fsf/trunk/libc/configure
==============================================================================
--- fsf/trunk/libc/configure (original)
+++ fsf/trunk/libc/configure Wed Mar 28 21:47:42 2012
@@ -4306,23 +4306,6 @@
# We have now validated the configuration.
-
-# Look for an `elf' subdirectory of each machine directory.
-# We prepend these rather than inserting them whereever the machine appears
-# because things specified by the machine's ELF ABI should override
-# OS-specific things, and should always be the same for any OS on the
-# machine (otherwise what's the point of an ABI?).
-elf_dirs=
-for d in $add_ons_pfx ''; do
- for m in $mach; do
- if test -d $srcdir/${d}sysdeps$m/elf; then
- elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
- fi
- done
-done
-sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
-
-
# Expand the list of system names into a full list of directories
# from each element's parent name and Implies file (if present).
set $sysnames
@@ -4403,7 +4386,7 @@
done
# Add the default directories.
-default_sysnames="sysdeps/generic/elf sysdeps/generic"
+default_sysnames="sysdeps/generic"
sysnames="$names $default_sysnames"
# The other names were emitted during the scan.
Modified: fsf/trunk/libc/configure.in
==============================================================================
--- fsf/trunk/libc/configure.in (original)
+++ fsf/trunk/libc/configure.in Wed Mar 28 21:47:42 2012
@@ -743,23 +743,6 @@
# We have now validated the configuration.
-
-# Look for an `elf' subdirectory of each machine directory.
-# We prepend these rather than inserting them whereever the machine appears
-# because things specified by the machine's ELF ABI should override
-# OS-specific things, and should always be the same for any OS on the
-# machine (otherwise what's the point of an ABI?).
-elf_dirs=
-for d in $add_ons_pfx ''; do
- for m in $mach; do
- if test -d $srcdir/${d}sysdeps$m/elf; then
- elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
- fi
- done
-done
-sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
-
-
# Expand the list of system names into a full list of directories
# from each element's parent name and Implies file (if present).
set $sysnames
@@ -841,7 +824,7 @@
done
# Add the default directories.
-default_sysnames="sysdeps/generic/elf sysdeps/generic"
+default_sysnames="sysdeps/generic"
sysnames="$names $default_sysnames"
AC_SUBST(sysnames)
# The other names were emitted during the scan.
Modified: fsf/trunk/libc/malloc/mallocbug.c
==============================================================================
--- fsf/trunk/libc/malloc/mallocbug.c (original)
+++ fsf/trunk/libc/malloc/mallocbug.c Wed Mar 28 21:47:42 2012
@@ -5,12 +5,15 @@
#define size_t unsigned int
+/* Defined as global variables to avoid warnings about unused variables. */
+char *dummy0;
+char *dummy1;
+char *fill_info_table1;
+
+
int
main (int argc, char *argv[])
{
- char *dummy0;
- char *dummy1;
- char *fill_info_table1;
char *over_top;
size_t over_top_size = 0x3000;
char *over_top_dup;
@@ -19,11 +22,11 @@
size_t i;
/* Here's what memory is supposed to look like (hex):
- size contents
- 3000 original_info_table, later fill_info_table1
+ size contents
+ 3000 original_info_table, later fill_info_table1
3fa000 dummy0
3fa000 dummy1
- 6000 info_table_2
+ 6000 info_table_2
3000 over_top
*/
Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Wed Mar 28 21:47:42 2012
@@ -746,6 +746,8 @@
/* |x| > 1: */
TEST_f_f (acos, 1.125L, nan_value, INVALID_EXCEPTION);
TEST_f_f (acos, -1.125L, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (acos, max_value, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (acos, -max_value, nan_value, INVALID_EXCEPTION);
TEST_f_f (acos, 0, M_PI_2l);
TEST_f_f (acos, minus_zero, M_PI_2l);
@@ -775,6 +777,7 @@
/* x < 1: */
TEST_f_f (acosh, -1.125L, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (acosh, -max_value, nan_value, INVALID_EXCEPTION);
TEST_f_f (acosh, 1, 0);
TEST_f_f (acosh, 7, 2.63391579384963341725009269461593689L);
@@ -800,6 +803,8 @@
/* asin x == NaN plus invalid exception for |x| > 1. */
TEST_f_f (asin, 1.125L, nan_value, INVALID_EXCEPTION);
TEST_f_f (asin, -1.125L, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (asin, max_value, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (asin, -max_value, nan_value, INVALID_EXCEPTION);
TEST_f_f (asin, 0, 0);
TEST_f_f (asin, minus_zero, minus_zero);
@@ -885,6 +890,8 @@
/* atanh (x) == NaN plus invalid exception if |x| > 1. */
TEST_f_f (atanh, 1.125L, nan_value, INVALID_EXCEPTION);
TEST_f_f (atanh, -1.125L, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (atanh, max_value, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (atanh, -max_value, nan_value, INVALID_EXCEPTION);
TEST_f_f (atanh, 0.75L, 0.972955074527656652552676371721589865L);
@@ -2994,6 +3001,11 @@
TEST_f_f (exp, 1000.0L, 0.197007111401704699388887935224332313e435L);
#endif
+ /* Bug 13922: OVERFLOW exception may be missing. */
+ TEST_f_f (exp, max_value, plus_infty, OVERFLOW_EXCEPTION_OK);
+ /* Bug 13705: spurious OVERFLOW exception may be present. */
+ TEST_f_f (exp, -max_value, 0, OVERFLOW_EXCEPTION_OK);
+
END (exp);
}
@@ -3127,6 +3139,11 @@
TEST_f_f (exp10, -1, 0.1L);
TEST_f_f (exp10, 1e6, plus_infty, OVERFLOW_EXCEPTION);
TEST_f_f (exp10, -1e6, 0);
+#ifndef TEST_LDOUBLE /* Bug 13914: spurious exceptions. */
+ TEST_f_f (exp10, max_value, plus_infty, OVERFLOW_EXCEPTION);
+ /* Bug 13924: spurious OVERFLOW exception may be present. */
+ TEST_f_f (exp10, -max_value, 0, OVERFLOW_EXCEPTION_OK);
+#endif
TEST_f_f (exp10, 0.75L, 5.62341325190349080394951039776481231L);
END (exp10);
@@ -3154,6 +3171,8 @@
TEST_f_f (exp2, -1, 0.5);
TEST_f_f (exp2, 1e6, plus_infty, OVERFLOW_EXCEPTION);
TEST_f_f (exp2, -1e6, 0);
+ TEST_f_f (exp2, max_value, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (exp2, -max_value, 0);
TEST_f_f (exp2, 0.75L, 1.68179283050742908606225095246642979L);
TEST_f_f (exp2, 100.5, 1.792728671193156477399422023278661496394e+30L);
@@ -3206,6 +3225,11 @@
/* Bug 13787: OVERFLOW exception may be missing. */
TEST_f_f (expm1, 100000.0, plus_infty, OVERFLOW_EXCEPTION_OK);
check_int ("errno for expm1(large) == ERANGE", errno, ERANGE, 0, 0, 0);
+ /* Bug 13787: OVERFLOW exception may be missing. */
+ TEST_f_f (expm1, max_value, plus_infty, OVERFLOW_EXCEPTION_OK);
+#ifndef TEST_LDOUBLE /* Bug 13923. */
+ TEST_f_f (expm1, -max_value, -1);
+#endif
END (expm1);
}
@@ -3968,6 +3992,8 @@
TEST_f_f (lgamma, -3, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
check_int ("errno for lgamma(-integer) == ERANGE", errno, ERANGE, 0, 0, 0);
TEST_f_f (lgamma, minus_infty, plus_infty);
+ TEST_f_f (lgamma, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ TEST_f_f (lgamma, max_value, plus_infty, OVERFLOW_EXCEPTION);
TEST_f_f1 (lgamma, 1, 0, 1);
@@ -4869,6 +4895,7 @@
TEST_f_f (log, 1, 0);
TEST_f_f (log, -1, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (log, -max_value, nan_value, INVALID_EXCEPTION);
TEST_f_f (log, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_f_f (log, plus_infty, plus_infty);
TEST_f_f (log, nan_value, nan_value);
@@ -4901,6 +4928,7 @@
/* log10 (x) == NaN plus invalid exception if x < 0. */
TEST_f_f (log10, -1, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (log10, -max_value, nan_value, INVALID_EXCEPTION);
TEST_f_f (log10, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_f_f (log10, plus_infty, plus_infty);
@@ -4933,6 +4961,7 @@
TEST_f_f (log1p, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
TEST_f_f (log1p, -2, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (log1p, -max_value, nan_value, INVALID_EXCEPTION);
TEST_f_f (log1p, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_f_f (log1p, plus_infty, plus_infty);
@@ -4964,6 +4993,7 @@
TEST_f_f (log2, 1, 0);
TEST_f_f (log2, -1, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (log2, -max_value, nan_value, INVALID_EXCEPTION);
TEST_f_f (log2, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_f_f (log2, plus_infty, plus_infty);
@@ -5572,8 +5602,7 @@
TEST_ff_f (pow, 0, -0x1p127, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
errno = 0;
- /* Bug 13879: spurious OVERFLOW exception may be present. */
- TEST_ff_f (pow, 0, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|OVERFLOW_EXCEPTION_OK);
+ TEST_ff_f (pow, 0, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
errno = 0;
TEST_ff_f (pow, minus_zero, -2, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
@@ -5588,8 +5617,7 @@
TEST_ff_f (pow, minus_zero, -0x1p127, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
errno = 0;
- /* Bug 13879: spurious OVERFLOW exception may be present. */
- TEST_ff_f (pow, minus_zero, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|OVERFLOW_EXCEPTION_OK);
+ TEST_ff_f (pow, minus_zero, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
TEST_ff_f (pow, 0x1p72L, 0x1p72L, plus_infty, OVERFLOW_EXCEPTION);
@@ -5789,6 +5817,259 @@
#if defined TEST_DOUBLE || defined TEST_LDOUBLE
TEST_ff_f (pow, -7.49321e+133, -9.80818e+16, 0);
#endif
+
+ TEST_ff_f (pow, -1.0, -0xffffff, -1.0);
+ TEST_ff_f (pow, -1.0, -0x1fffffe, 1.0);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, -1.0, -0x1.fffffffffffffp+52L, -1.0);
+ TEST_ff_f (pow, -1.0, -0x1.fffffffffffffp+53L, 1.0);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, -1.0, -0x1.fffffffffffffffep+63L, -1.0);
+ TEST_ff_f (pow, -1.0, -0x1.fffffffffffffffep+64L, 1.0);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, -1.0, -0x1.ffffffffffffffffffffffffff8p+105L, -1.0);
+ TEST_ff_f (pow, -1.0, -0x1.ffffffffffffffffffffffffff8p+106L, 1.0);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, -1.0, -0x1.ffffffffffffffffffffffffffffp+112L, -1.0);
+ TEST_ff_f (pow, -1.0, -0x1.ffffffffffffffffffffffffffffp+113L, 1.0);
+# endif
+#endif
+ TEST_ff_f (pow, -1.0, -max_value, 1.0);
+
+ TEST_ff_f (pow, -1.0, 0xffffff, -1.0);
+ TEST_ff_f (pow, -1.0, 0x1fffffe, 1.0);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, -1.0, 0x1.fffffffffffffp+52L, -1.0);
+ TEST_ff_f (pow, -1.0, 0x1.fffffffffffffp+53L, 1.0);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, -1.0, 0x1.fffffffffffffffep+63L, -1.0);
+ TEST_ff_f (pow, -1.0, 0x1.fffffffffffffffep+64L, 1.0);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, -1.0, 0x1.ffffffffffffffffffffffffff8p+105L, -1.0);
+ TEST_ff_f (pow, -1.0, 0x1.ffffffffffffffffffffffffff8p+106L, 1.0);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, -1.0, 0x1.ffffffffffffffffffffffffffffp+112L, -1.0);
+ TEST_ff_f (pow, -1.0, 0x1.ffffffffffffffffffffffffffffp+113L, 1.0);
+# endif
+#endif
+ TEST_ff_f (pow, -1.0, max_value, 1.0);
+
+ TEST_ff_f (pow, -2.0, 126, 0x1p126);
+ TEST_ff_f (pow, -2.0, 127, -0x1p127);
+ TEST_ff_f (pow, -2.0, -126, 0x1p-126);
+ TEST_ff_f (pow, -2.0, -127, -0x1p-127);
+
+ TEST_ff_f (pow, -2.0, -0xffffff, minus_zero);
+ TEST_ff_f (pow, -2.0, -0x1fffffe, plus_zero);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, -2.0, -0x1.fffffffffffffp+52L, minus_zero);
+ TEST_ff_f (pow, -2.0, -0x1.fffffffffffffp+53L, plus_zero);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, -2.0, -0x1.fffffffffffffffep+63L, minus_zero);
+ TEST_ff_f (pow, -2.0, -0x1.fffffffffffffffep+64L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
+ TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
+ TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
+# endif
+#endif
+ TEST_ff_f (pow, -2.0, -max_value, plus_zero);
+
+ TEST_ff_f (pow, -2.0, 0xffffff, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -2.0, 0x1fffffe, plus_infty, OVERFLOW_EXCEPTION);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, -2.0, 0x1.fffffffffffffp+52L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -2.0, 0x1.fffffffffffffp+53L, plus_infty, OVERFLOW_EXCEPTION);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, -2.0, 0x1.fffffffffffffffep+63L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -2.0, 0x1.fffffffffffffffep+64L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, -2.0, 0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -2.0, 0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, -2.0, 0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -2.0, 0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+#endif
+ /* Bug 13873: OVERFLOW exception may be missing. */
+ TEST_ff_f (pow, -2.0, max_value, plus_infty, OVERFLOW_EXCEPTION_OK);
+
+ TEST_ff_f (pow, -max_value, 0.5, nan_value, INVALID_EXCEPTION);
+ TEST_ff_f (pow, -max_value, 1.5, nan_value, INVALID_EXCEPTION);
+ TEST_ff_f (pow, -max_value, 1000.5, nan_value, INVALID_EXCEPTION);
+ TEST_ff_f (pow, -max_value, -2, plus_zero);
+ TEST_ff_f (pow, -max_value, -3, minus_zero);
+ TEST_ff_f (pow, -max_value, 2, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, 3, minus_infty, OVERFLOW_EXCEPTION);
+
+ TEST_ff_f (pow, -max_value, -0xffffff, minus_zero);
+ TEST_ff_f (pow, -max_value, -0x1fffffe, plus_zero);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, -max_value, -0x1.fffffffffffffp+52L, minus_zero);
+ TEST_ff_f (pow, -max_value, -0x1.fffffffffffffp+53L, plus_zero);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, -max_value, -0x1.fffffffffffffffep+63L, minus_zero);
+ TEST_ff_f (pow, -max_value, -0x1.fffffffffffffffep+64L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
+ TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
+ TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
+# endif
+#endif
+ /* Bug 13872: spurious OVERFLOW exception may be present. */
+ TEST_ff_f (pow, -max_value, -max_value, plus_zero, OVERFLOW_EXCEPTION_OK);
+
+ TEST_ff_f (pow, -max_value, 0xffffff, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, 0x1fffffe, plus_infty, OVERFLOW_EXCEPTION);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, -max_value, 0x1.fffffffffffffp+52L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, 0x1.fffffffffffffp+53L, plus_infty, OVERFLOW_EXCEPTION);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, -max_value, 0x1.fffffffffffffffep+63L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, 0x1.fffffffffffffffep+64L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, -max_value, 0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, 0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, -max_value, 0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, 0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+#endif
+ /* Bug 13873: OVERFLOW exception may be missing. */
+ TEST_ff_f (pow, -max_value, max_value, plus_infty, OVERFLOW_EXCEPTION_OK);
+
+ TEST_ff_f (pow, -0.5, 126, 0x1p-126);
+ TEST_ff_f (pow, -0.5, 127, -0x1p-127);
+ TEST_ff_f (pow, -0.5, -126, 0x1p126);
+ TEST_ff_f (pow, -0.5, -127, -0x1p127);
+
+ TEST_ff_f (pow, -0.5, -0xffffff, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -0.5, -0x1fffffe, plus_infty, OVERFLOW_EXCEPTION);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, -0.5, -0x1.fffffffffffffp+52L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -0.5, -0x1.fffffffffffffp+53L, plus_infty, OVERFLOW_EXCEPTION);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, -0.5, -0x1.fffffffffffffffep+63L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -0.5, -0x1.fffffffffffffffep+64L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, -0.5, -0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -0.5, -0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, -0.5, -0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -0.5, -0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+#endif
+ /* Bug 13873: OVERFLOW exception may be missing. */
+ TEST_ff_f (pow, -0.5, -max_value, plus_infty, OVERFLOW_EXCEPTION_OK);
+
+ TEST_ff_f (pow, -0.5, 0xffffff, minus_zero);
+ TEST_ff_f (pow, -0.5, 0x1fffffe, plus_zero);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, -0.5, 0x1.fffffffffffffp+52L, minus_zero);
+ TEST_ff_f (pow, -0.5, 0x1.fffffffffffffp+53L, plus_zero);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, -0.5, 0x1.fffffffffffffffep+63L, minus_zero);
+ TEST_ff_f (pow, -0.5, 0x1.fffffffffffffffep+64L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
+ TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
+ TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
+# endif
+#endif
+ TEST_ff_f (pow, -0.5, max_value, plus_zero);
+
+ TEST_ff_f (pow, -min_value, 0.5, nan_value, INVALID_EXCEPTION);
+ TEST_ff_f (pow, -min_value, 1.5, nan_value, INVALID_EXCEPTION);
+ TEST_ff_f (pow, -min_value, 1000.5, nan_value, INVALID_EXCEPTION);
+ TEST_ff_f (pow, -min_value, -2, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, -3, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, 1, -min_value);
+ TEST_ff_f (pow, -min_value, 2, plus_zero);
+ TEST_ff_f (pow, -min_value, 3, minus_zero);
+
+ TEST_ff_f (pow, -min_value, -0xffffff, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, -0x1fffffe, plus_infty, OVERFLOW_EXCEPTION);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, -min_value, -0x1.fffffffffffffp+52L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, -0x1.fffffffffffffp+53L, plus_infty, OVERFLOW_EXCEPTION);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, -min_value, -0x1.fffffffffffffffep+63L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, -0x1.fffffffffffffffep+64L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, -min_value, -0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, -0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, -min_value, -0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, -0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, OVERFLOW_EXCEPTION);
+# endif
+#endif
+ /* Bug 13873: OVERFLOW exception may be missing. */
+ TEST_ff_f (pow, -min_value, -max_value, plus_infty, OVERFLOW_EXCEPTION_OK);
+
+ TEST_ff_f (pow, -min_value, 0xffffff, minus_zero);
+ TEST_ff_f (pow, -min_value, 0x1fffffe, plus_zero);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, -min_value, 0x1.fffffffffffffp+52L, minus_zero);
+ TEST_ff_f (pow, -min_value, 0x1.fffffffffffffp+53L, plus_zero);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, -min_value, 0x1.fffffffffffffffep+63L, minus_zero);
+ TEST_ff_f (pow, -min_value, 0x1.fffffffffffffffep+64L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
+ TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
+ TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
+# endif
+#endif
+ /* Bug 13872: spurious OVERFLOW exception may be present. */
+ TEST_ff_f (pow, -min_value, max_value, plus_zero, OVERFLOW_EXCEPTION_OK);
END (pow);
}
@@ -7083,6 +7364,7 @@
/* sqrt (x) == NaN plus invalid exception for x < 0. */
TEST_f_f (sqrt, -1, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (sqrt, -max_value, nan_value, INVALID_EXCEPTION);
TEST_f_f (sqrt, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_f_f (sqrt, nan_value, nan_value);
@@ -7321,10 +7603,12 @@
START (tgamma);
TEST_f_f (tgamma, plus_infty, plus_infty);
+ TEST_f_f (tgamma, max_value, plus_infty, OVERFLOW_EXCEPTION);
TEST_f_f (tgamma, 0, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
TEST_f_f (tgamma, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
/* tgamma (x) == NaN plus invalid exception for integer x <= 0. */
TEST_f_f (tgamma, -2, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (tgamma, -max_value, nan_value, INVALID_EXCEPTION);
TEST_f_f (tgamma, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_f_f (tgamma, nan_value, nan_value);
@@ -7468,6 +7752,7 @@
START (y0);
TEST_f_f (y0, -1.0, minus_infty, INVALID_EXCEPTION);
+ TEST_f_f (y0, -max_value, minus_infty, INVALID_EXCEPTION);
TEST_f_f (y0, 0.0, minus_infty);
TEST_f_f (y0, nan_value, nan_value);
TEST_f_f (y0, plus_infty, 0);
@@ -7508,6 +7793,7 @@
START (y1);
TEST_f_f (y1, -1.0, minus_infty, INVALID_EXCEPTION);
+ TEST_f_f (y1, -max_value, minus_infty, INVALID_EXCEPTION);
TEST_f_f (y1, 0.0, minus_infty);
TEST_f_f (y1, plus_infty, 0);
TEST_f_f (y1, nan_value, nan_value);
@@ -7549,6 +7835,7 @@
/* yn (0, x) == y0 (x) */
TEST_ff_f (yn, 0, -1.0, minus_infty, INVALID_EXCEPTION);
+ TEST_ff_f (yn, 0, -max_value, minus_infty, INVALID_EXCEPTION);
TEST_ff_f (yn, 0, 0.0, minus_infty);
TEST_ff_f (yn, 0, nan_value, nan_value);
TEST_ff_f (yn, 0, plus_infty, 0);
Modified: fsf/trunk/libc/math/w_acoshl.c
==============================================================================
--- fsf/trunk/libc/math/w_acoshl.c (original)
+++ fsf/trunk/libc/math/w_acoshl.c Wed Mar 28 21:47:42 2012
@@ -26,7 +26,7 @@
{
if (__builtin_expect (isless (x, 1.0L), 0) && _LIB_VERSION != _IEEE_)
/* acosh(x<1) */
- return __kernel_standard (x, x, 229);
+ return __kernel_standard_l (x, x, 229);
return __ieee754_acoshl (x);
}
Modified: fsf/trunk/libc/math/w_acosl.c
==============================================================================
--- fsf/trunk/libc/math/w_acosl.c (original)
+++ fsf/trunk/libc/math/w_acosl.c Wed Mar 28 21:47:42 2012
@@ -30,7 +30,7 @@
{
/* acos(|x|>1) */
feraiseexcept (FE_INVALID);
- return __kernel_standard (x, x, 201);
+ return __kernel_standard_l (x, x, 201);
}
return __ieee754_acosl (x);
Modified: fsf/trunk/libc/math/w_asinl.c
==============================================================================
--- fsf/trunk/libc/math/w_asinl.c (original)
+++ fsf/trunk/libc/math/w_asinl.c Wed Mar 28 21:47:42 2012
@@ -30,7 +30,7 @@
{
/* asin(|x|>1) */
feraiseexcept (FE_INVALID);
- return __kernel_standard (x, x, 202);
+ return __kernel_standard_l (x, x, 202);
}
return __ieee754_asinl (x);
Modified: fsf/trunk/libc/math/w_atan2l.c
==============================================================================
--- fsf/trunk/libc/math/w_atan2l.c (original)
+++ fsf/trunk/libc/math/w_atan2l.c Wed Mar 28 21:47:42 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxx>, 2011.
@@ -28,7 +28,7 @@
__atan2l (long double y, long double x)
{
if (__builtin_expect (x == 0.0L && y == 0.0L, 0) && _LIB_VERSION == _SVID_)
- return __kernel_standard (y, x, 203); /* atan2(+-0,+-0) */
+ return __kernel_standard_l (y, x, 203); /* atan2(+-0,+-0) */
return __ieee754_atan2l (y, x);
}
Modified: fsf/trunk/libc/math/w_atanhl.c
==============================================================================
--- fsf/trunk/libc/math/w_atanhl.c (original)
+++ fsf/trunk/libc/math/w_atanhl.c Wed Mar 28 21:47:42 2012
@@ -26,10 +26,10 @@
{
if (__builtin_expect (isgreaterequal (fabsl (x), 1.0L), 0)
&& _LIB_VERSION != _IEEE_)
- return __kernel_standard (x, x,
- fabsl (x) > 1.0L
- ? 230 /* atanh(|x|>1) */
- : 231); /* atanh(|x|==1) */
+ return __kernel_standard_l (x, x,
+ fabsl (x) > 1.0L
+ ? 230 /* atanh(|x|>1) */
+ : 231); /* atanh(|x|==1) */
return __ieee754_atanhl (x);
}
Modified: fsf/trunk/libc/math/w_coshl.c
==============================================================================
--- fsf/trunk/libc/math/w_coshl.c (original)
+++ fsf/trunk/libc/math/w_coshl.c Wed Mar 28 21:47:42 2012
@@ -28,7 +28,7 @@
long double z = __ieee754_coshl (x);
if (__builtin_expect (!__finitel (z), 0) && __finitel (x)
&& _LIB_VERSION != _IEEE_)
- return __kernel_standard (x, x, 205); /* cosh overflow */
+ return __kernel_standard_l (x, x, 205); /* cosh overflow */
return z;
}
Modified: fsf/trunk/libc/math/w_exp10l.c
==============================================================================
--- fsf/trunk/libc/math/w_exp10l.c (original)
+++ fsf/trunk/libc/math/w_exp10l.c Wed Mar 28 21:47:42 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxx>, 2011.
@@ -31,7 +31,7 @@
if (__builtin_expect (!__finitel (z), 0)
&& __finitel (x) && _LIB_VERSION != _IEEE_)
/* exp10l overflow (246) if x > 0, underflow (247) if x < 0. */
- return __kernel_standard (x, x, 246 + !!__signbitl (x));
+ return __kernel_standard_l (x, x, 246 + !!__signbitl (x));
return z;
}
Modified: fsf/trunk/libc/math/w_exp2l.c
==============================================================================
--- fsf/trunk/libc/math/w_exp2l.c (original)
+++ fsf/trunk/libc/math/w_exp2l.c Wed Mar 28 21:47:42 2012
@@ -12,7 +12,7 @@
if (__builtin_expect (!__finitel (z), 0)
&& __finitel (x) && _LIB_VERSION != _IEEE_)
/* exp2 overflow: 244, exp2 underflow: 245 */
- return __kernel_standard (x, x, 244 + !!__signbitl (x));
+ return __kernel_standard_l (x, x, 244 + !!__signbitl (x));
return z;
}
Modified: fsf/trunk/libc/math/w_fmodl.c
==============================================================================
--- fsf/trunk/libc/math/w_fmodl.c (original)
+++ fsf/trunk/libc/math/w_fmodl.c Wed Mar 28 21:47:42 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxx>, 2011.
@@ -26,7 +26,7 @@
if (__builtin_expect (__isinf_nsl (x) || y == 0.0L, 0)
&& _LIB_VERSION != _IEEE_ && !__isnanl (y) && !__isnanl (x))
/* fmod(+-Inf,y) or fmod(x,0) */
- return __kernel_standard (x, y, 227);
+ return __kernel_standard_l (x, y, 227);
return __ieee754_fmodl (x, y);
}
Modified: fsf/trunk/libc/math/w_hypotl.c
==============================================================================
--- fsf/trunk/libc/math/w_hypotl.c (original)
+++ fsf/trunk/libc/math/w_hypotl.c Wed Mar 28 21:47:42 2012
@@ -29,7 +29,7 @@
z = __ieee754_hypotl(x,y);
if(__builtin_expect(!__finitel(z), 0)
&& __finitel(x) && __finitel(y) && _LIB_VERSION != _IEEE_)
- return __kernel_standard(x, y, 204); /* hypot overflow */
+ return __kernel_standard_l(x, y, 204); /* hypot overflow */
return z;
}
Modified: fsf/trunk/libc/math/w_j0l.c
==============================================================================
--- fsf/trunk/libc/math/w_j0l.c (original)
+++ fsf/trunk/libc/math/w_j0l.c Wed Mar 28 21:47:42 2012
@@ -28,7 +28,7 @@
if (__builtin_expect (isgreater (fabsl (x), X_TLOSS), 0)
&& _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
/* j0(|x|>X_TLOSS) */
- return __kernel_standard (x, x, 234);
+ return __kernel_standard_l (x, x, 234);
return __ieee754_j0l (x);
}
@@ -46,14 +46,14 @@
{
/* d = zero/(x-x) */
feraiseexcept (FE_INVALID);
- return __kernel_standard (x, x, 209);
+ return __kernel_standard_l (x, x, 209);
}
else if (x == 0.0L)
/* d = -one/(x-x) */
- return __kernel_standard (x, x, 208);
+ return __kernel_standard_l (x, x, 208);
else if (_LIB_VERSION != _POSIX_)
/* y0(x>X_TLOSS) */
- return __kernel_standard (x, x, 235);
+ return __kernel_standard_l (x, x, 235);
}
return __ieee754_y0l (x);
Modified: fsf/trunk/libc/math/w_j1l.c
==============================================================================
--- fsf/trunk/libc/math/w_j1l.c (original)
+++ fsf/trunk/libc/math/w_j1l.c Wed Mar 28 21:47:42 2012
@@ -28,7 +28,7 @@
if (__builtin_expect (isgreater (fabsl (x), X_TLOSS), 0)
&& _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
/* j1(|x|>X_TLOSS) */
- return __kernel_standard (x, x, 236);
+ return __kernel_standard_l (x, x, 236);
return __ieee754_j1l (x);
}
@@ -46,14 +46,14 @@
{
/* d = zero/(x-x) */
feraiseexcept (FE_INVALID);
- return __kernel_standard (x, x, 211);
+ return __kernel_standard_l (x, x, 211);
}
else if (x == 0.0L)
/* d = -one/(x-x) */
- return __kernel_standard (x, x, 210);
+ return __kernel_standard_l (x, x, 210);
else if (_LIB_VERSION != _POSIX_)
/* y1(x>X_TLOSS) */
- return __kernel_standard (x, x, 237);
+ return __kernel_standard_l (x, x, 237);
}
return __ieee754_y1l (x);
Modified: fsf/trunk/libc/math/w_jnl.c
==============================================================================
--- fsf/trunk/libc/math/w_jnl.c (original)
+++ fsf/trunk/libc/math/w_jnl.c Wed Mar 28 21:47:42 2012
@@ -59,7 +59,7 @@
|| __isnanl(x))
return z;
if(fabsl(x)>X_TLOSS) {
- return __kernel_standard((double)n,x,238); /* jn(|x|>X_TLOSS,n) */
+ return __kernel_standard_l((double)n,x,238); /* jn(|x|>X_TLOSS,n) */
} else
return z;
#endif
@@ -77,13 +77,13 @@
if(x <= 0.0){
if(x==0.0)
/* d= -one/(x-x); */
- return __kernel_standard((double)n,x,212);
+ return __kernel_standard_l((double)n,x,212);
else
/* d = zero/(x-x); */
- return __kernel_standard((double)n,x,213);
+ return __kernel_standard_l((double)n,x,213);
}
if(x>X_TLOSS && _LIB_VERSION != _POSIX_) {
- return __kernel_standard((double)n,x,239); /* yn(x>X_TLOSS,n) */
+ return __kernel_standard_l((double)n,x,239); /* yn(x>X_TLOSS,n) */
} else
return z;
#endif
Modified: fsf/trunk/libc/math/w_lgammal.c
==============================================================================
--- fsf/trunk/libc/math/w_lgammal.c (original)
+++ fsf/trunk/libc/math/w_lgammal.c Wed Mar 28 21:47:42 2012
@@ -35,10 +35,10 @@
: &local_signgam);
if(__builtin_expect(!__finitel(y), 0)
&& __finitel(x) && _LIB_VERSION != _IEEE_)
- return __kernel_standard(x, x,
- __floorl(x)==x&&x<=0.0L
- ? 215 /* lgamma pole */
- : 214); /* lgamma overflow */
+ return __kernel_standard_l(x, x,
+ __floorl(x)==x&&x<=0.0L
+ ? 215 /* lgamma pole */
+ : 214); /* lgamma overflow */
return y;
}
Modified: fsf/trunk/libc/math/w_log10l.c
==============================================================================
--- fsf/trunk/libc/math/w_log10l.c (original)
+++ fsf/trunk/libc/math/w_log10l.c Wed Mar 28 21:47:42 2012
@@ -30,12 +30,12 @@
if (x == 0.0L)
{
feraiseexcept (FE_DIVBYZERO);
- return __kernel_standard (x, x, 218); /* log10(0) */
+ return __kernel_standard_l (x, x, 218); /* log10(0) */
}
else
{
feraiseexcept (FE_INVALID);
- return __kernel_standard (x, x, 219); /* log10(x<0) */
+ return __kernel_standard_l (x, x, 219); /* log10(x<0) */
}
}
Modified: fsf/trunk/libc/math/w_log2l.c
==============================================================================
--- fsf/trunk/libc/math/w_log2l.c (original)
+++ fsf/trunk/libc/math/w_log2l.c Wed Mar 28 21:47:42 2012
@@ -30,12 +30,12 @@
if (x == 0.0L)
{
feraiseexcept (FE_DIVBYZERO);
- return __kernel_standard (x, x, 248); /* log2(0) */
+ return __kernel_standard_l (x, x, 248); /* log2(0) */
}
else
{
feraiseexcept (FE_INVALID);
- return __kernel_standard (x, x, 249); /* log2(x<0) */
+ return __kernel_standard_l (x, x, 249); /* log2(x<0) */
}
}
Modified: fsf/trunk/libc/math/w_logl.c
==============================================================================
--- fsf/trunk/libc/math/w_logl.c (original)
+++ fsf/trunk/libc/math/w_logl.c Wed Mar 28 21:47:42 2012
@@ -30,12 +30,12 @@
if (x == 0.0L)
{
feraiseexcept (FE_DIVBYZERO);
- return __kernel_standard (x, x, 216); /* log(0) */
+ return __kernel_standard_l (x, x, 216); /* log(0) */
}
else
{
feraiseexcept (FE_INVALID);
- return __kernel_standard (x, x, 217); /* log(x<0) */
+ return __kernel_standard_l (x, x, 217); /* log(x<0) */
}
}
Modified: fsf/trunk/libc/math/w_powl.c
==============================================================================
--- fsf/trunk/libc/math/w_powl.c (original)
+++ fsf/trunk/libc/math/w_powl.c Wed Mar 28 21:47:42 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxx>, 2011.
@@ -33,25 +33,25 @@
{
if (y == 0.0L)
/* pow(NaN,0.0) */
- return __kernel_standard (x, y, 242);
+ return __kernel_standard_l (x, y, 242);
}
else if (__finitel (x) && __finitel (y))
{
if (__isnanl (z))
/* pow neg**non-int */
- return __kernel_standard (x, y, 224);
+ return __kernel_standard_l (x, y, 224);
else if (x == 0.0L && y < 0.0L)
{
if (signbit (x) && signbit (z))
/* pow(-0.0,negative) */
- return __kernel_standard (x, y, 223);
+ return __kernel_standard_l (x, y, 223);
else
/* pow(+0.0,negative) */
- return __kernel_standard (x, y, 243);
+ return __kernel_standard_l (x, y, 243);
}
else
/* pow overflow */
- return __kernel_standard (x, y, 221);
+ return __kernel_standard_l (x, y, 221);
}
}
}
@@ -62,11 +62,11 @@
{
if (y == 0.0L)
/* pow(0.0,0.0) */
- return __kernel_standard (x, y, 220);
+ return __kernel_standard_l (x, y, 220);
}
else
/* pow underflow */
- return __kernel_standard (x, y, 222);
+ return __kernel_standard_l (x, y, 222);
}
return z;
Modified: fsf/trunk/libc/math/w_remainderl.c
==============================================================================
--- fsf/trunk/libc/math/w_remainderl.c (original)
+++ fsf/trunk/libc/math/w_remainderl.c Wed Mar 28 21:47:42 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxx>, 2011.
@@ -27,7 +27,7 @@
if (((__builtin_expect (y == 0.0L, 0) && ! __isnanl (x))
|| (__builtin_expect (__isinf_nsl (x), 0) && ! __isnanl (y)))
&& _LIB_VERSION != _IEEE_)
- return __kernel_standard (x, y, 228); /* remainder domain */
+ return __kernel_standard_l (x, y, 228); /* remainder domain */
return __ieee754_remainderl (x, y);
}
Modified: fsf/trunk/libc/math/w_scalbl.c
==============================================================================
--- fsf/trunk/libc/math/w_scalbl.c (original)
+++ fsf/trunk/libc/math/w_scalbl.c Wed Mar 28 21:47:42 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxx>, 2011.
@@ -30,12 +30,12 @@
if (__builtin_expect (__isinfl (z), 0))
{
if (__finitel (x))
- return __kernel_standard (x, fn, 232); /* scalb overflow */
+ return __kernel_standard_l (x, fn, 232); /* scalb overflow */
else
__set_errno (ERANGE);
}
else if (__builtin_expect (z == 0.0L, 0) && z != x)
- return __kernel_standard (x, fn, 233); /* scalb underflow */
+ return __kernel_standard_l (x, fn, 233); /* scalb underflow */
return z;
}
Modified: fsf/trunk/libc/math/w_sinhl.c
==============================================================================
--- fsf/trunk/libc/math/w_sinhl.c (original)
+++ fsf/trunk/libc/math/w_sinhl.c Wed Mar 28 21:47:42 2012
@@ -27,7 +27,7 @@
long double z = __ieee754_sinhl (x);
if (__builtin_expect (!__finitel (z), 0) && __finitel (x)
&& _LIB_VERSION != _IEEE_)
- return __kernel_standard (x, x, 225); /* sinh overflow */
+ return __kernel_standard_l (x, x, 225); /* sinh overflow */
return z;
}
Modified: fsf/trunk/libc/math/w_sqrtl.c
==============================================================================
--- fsf/trunk/libc/math/w_sqrtl.c (original)
+++ fsf/trunk/libc/math/w_sqrtl.c Wed Mar 28 21:47:42 2012
@@ -25,7 +25,7 @@
__sqrtl (long double x)
{
if (__builtin_expect (isless (x, 0.0L), 0) && _LIB_VERSION != _IEEE_)
- return __kernel_standard (x, x, 226); /* sqrt(negative) */
+ return __kernel_standard_l (x, x, 226); /* sqrt(negative) */
return __ieee754_sqrtl (x);
}
Modified: fsf/trunk/libc/math/w_tgammal.c
==============================================================================
--- fsf/trunk/libc/math/w_tgammal.c (original)
+++ fsf/trunk/libc/math/w_tgammal.c Wed Mar 28 21:47:42 2012
@@ -30,11 +30,11 @@
if(__builtin_expect(!__finitel(y), 0) && __finitel(x)
&& _LIB_VERSION != _IEEE_) {
if(x==0.0)
- return __kernel_standard(x,x,250); /* tgamma pole */
+ return __kernel_standard_l(x,x,250); /* tgamma pole */
else if(__floorl(x)==x&&x<0.0L)
- return __kernel_standard(x,x,241); /* tgamma domain */
+ return __kernel_standard_l(x,x,241); /* tgamma domain */
else
- return __kernel_standard(x,x,240); /* tgamma overflow */
+ return __kernel_standard_l(x,x,240); /* tgamma overflow */
}
return local_signgam < 0 ? - y : y;
}
Modified: fsf/trunk/libc/resolv/nss_dns/dns-host.c
==============================================================================
--- fsf/trunk/libc/resolv/nss_dns/dns-host.c (original)
+++ fsf/trunk/libc/resolv/nss_dns/dns-host.c Wed Mar 28 21:47:42 2012
@@ -1219,7 +1219,13 @@
&first);
if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND
|| (status == NSS_STATUS_TRYAGAIN
- && (errno != ERANGE || *h_errnop != NO_RECOVERY)))
+ /* We want to look at the second answer in case of an
+ NSS_STATUS_TRYAGAIN only if the error is non-recoverable, i.e.
+ *h_errnop is NO_RECOVERY. If not, and if the failure was due to
+ an insufficient buffer (ERANGE), then we need to drop the results
+ and pass on the NSS_STATUS_TRYAGAIN to the caller so that it can
+ repeat the query with a larger buffer. */
+ && (*errnop != ERANGE || *h_errnop == NO_RECOVERY)))
&& answer2 != NULL && anslen2 > 0)
{
enum nss_status status2 = gaih_getanswer_slice(answer2, anslen2, qname,
Modified: fsf/trunk/libc/sysdeps/generic/math_private.h
==============================================================================
--- fsf/trunk/libc/sysdeps/generic/math_private.h (original)
+++ fsf/trunk/libc/sysdeps/generic/math_private.h Wed Mar 28 21:47:42 2012
@@ -217,6 +217,7 @@
/* fdlibm kernel function */
extern double __kernel_standard (double,double,int);
extern float __kernel_standard_f (float,float,int);
+extern long double __kernel_standard_l (long double,long double,int);
extern double __kernel_sin (double,double,int);
extern double __kernel_cos (double,double);
extern double __kernel_tan (double,double,int);
Modified: fsf/trunk/libc/sysdeps/i386/fpu/e_pow.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/e_pow.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/e_pow.S Wed Mar 28 21:47:42 2012
@@ -114,7 +114,7 @@
fucomp %st(1) // y : x
fnstsw
sahf
- jne 2f
+ jne 3f
/* OK, we have an integer value for y. */
popl %eax
@@ -157,7 +157,12 @@
cfi_adjust_cfa_offset (8)
.align ALIGNARG(4)
-2: /* y is a real number. */
+2: /* y is a large integer (so even). */
+ fxch // x : y
+ fabs // |x| : y
+ fxch // y : x
+ .align ALIGNARG(4)
+3: /* y is a real number. */
fxch // x : y
fldl MO(one) // 1.0 : x : y
fldl MO(limit) // 0.29 : 1.0 : x : y
Modified: fsf/trunk/libc/sysdeps/i386/fpu/e_powf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/e_powf.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/e_powf.S Wed Mar 28 21:47:42 2012
@@ -114,7 +114,7 @@
fucomp %st(1) // y : x
fnstsw
sahf
- jne 2f
+ jne 3f
/* OK, we have an integer value for y. */
popl %edx
@@ -151,7 +151,12 @@
cfi_adjust_cfa_offset (4)
.align ALIGNARG(4)
-2: /* y is a real number. */
+2: /* y is a large integer (so even). */
+ fxch // x : y
+ fabs // |x| : y
+ fxch // y : x
+ .align ALIGNARG(4)
+3: /* y is a real number. */
fxch // x : y
fldl MO(one) // 1.0 : x : y
fldl MO(limit) // 0.29 : 1.0 : x : y
Modified: fsf/trunk/libc/sysdeps/i386/fpu/e_powl.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/e_powl.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/e_powl.S Wed Mar 28 21:47:42 2012
@@ -117,7 +117,7 @@
fucomp %st(1) // y : x
fnstsw
sahf
- jne 2f
+ jne 3f
/* OK, we have an integer value for y. */
popl %eax
@@ -160,7 +160,14 @@
cfi_adjust_cfa_offset (8)
.align ALIGNARG(4)
-2: /* y is a real number. */
+2: // y is a large integer (absolute value at least 1L<<63), but
+ // may be odd unless at least 1L<<64. So it may be necessary
+ // to adjust the sign of a negative result afterwards.
+ fxch // x : y
+ fabs // |x| : y
+ fxch // y : |x|
+ .align ALIGNARG(4)
+3: /* y is a real number. */
fxch // x : y
fldl MO(one) // 1.0 : x : y
fldl MO(limit) // 0.29 : 1.0 : x : y
@@ -190,18 +197,51 @@
f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x))
faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x))
fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x))
- addl $8, %esp
- cfi_adjust_cfa_offset (-8)
fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x))
- ret
-
- cfi_adjust_cfa_offset (8)
+ jmp 29f
+
28: fstp %st(1) // y*log2(x)
fldl MO(one) // 1 : y*log2(x)
fscale // 2^(y*log2(x)) : y*log2(x)
- addl $8, %esp
+ fstp %st(1) // 2^(y*log2(x))
+29: testb $2, %dh
+ jz 292f
+ // x is negative. If y is an odd integer, negate the result.
+ fldt 24(%esp) // y : abs(result)
+ fld %st // y : y : abs(result)
+ fabs // |y| : y : abs(result)
+ fcompl MO(p64) // y : abs(result)
+ fnstsw
+ sahf
+ jnc 291f
+ fldl MO(p63) // p63 : y : abs(result)
+ fxch // y : p63 : abs(result)
+ fprem // y%p63 : p63 : abs(result)
+ fstp %st(1) // y%p63 : abs(result)
+
+ // We must find out whether y is an odd integer.
+ fld %st // y : y : abs(result)
+ fistpll (%esp) // y : abs(result)
+ fildll (%esp) // int(y) : y : abs(result)
+ fucompp // abs(result)
+ fnstsw
+ sahf
+ jne 292f
+
+ // OK, the value is an integer, but is it odd?
+ popl %eax
+ cfi_adjust_cfa_offset (-4)
+ popl %edx
+ cfi_adjust_cfa_offset (-4)
+ andb $1, %al
+ jz 290f // jump if not odd
+ // It's an odd integer.
+ fchs
+290: ret
+ cfi_adjust_cfa_offset (8)
+291: fstp %st(0) // abs(result)
+292: addl $8, %esp
cfi_adjust_cfa_offset (-8)
- fstp %st(1) // 2^(y*log2(x))
ret
// pow(x,Â0) = 1
Modified: fsf/trunk/libc/sysdeps/ieee754/k_standard.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/k_standard.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/k_standard.c Wed Mar 28 21:47:42 2012
@@ -16,6 +16,7 @@
#include <math.h>
#include <math_private.h>
+#include <float.h>
#include <errno.h>
#include <assert.h>
@@ -507,6 +508,9 @@
exc.type = UNDERFLOW;
exc.name = type < 100 ? "pow" : (type < 200 ? "powf" : "powl");
exc.retval = zero;
+ y *= 0.5;
+ if (x < zero && __rint (y) != y)
+ exc.retval = -zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!matherr(&exc)) {
@@ -998,3 +1002,83 @@
{
return __kernel_standard(x, y, type);
}
+
+long double
+__kernel_standard_l (long double x, long double y, int type)
+{
+ double dx, dy;
+ struct exception exc;
+
+ if (isfinite (x))
+ {
+ long double ax = fabsl (x);
+ if (ax > DBL_MAX)
+ dx = __copysignl (DBL_MAX, x);
+ else if (ax > 0 && ax < DBL_MIN)
+ dx = __copysignl (DBL_MIN, x);
+ else
+ dx = x;
+ }
+ else
+ dx = x;
+ if (isfinite (y))
+ {
+ long double ay = fabsl (y);
+ if (ay > DBL_MAX)
+ dy = __copysignl (DBL_MAX, y);
+ else if (ay > 0 && ay < DBL_MIN)
+ dy = __copysignl (DBL_MIN, y);
+ else
+ dy = y;
+ }
+ else
+ dy = y;
+
+ switch (type)
+ {
+ case 221:
+ /* powl (x, y) overflow. */
+ exc.arg1 = dx;
+ exc.arg2 = dy;
+ exc.type = OVERFLOW;
+ exc.name = "powl";
+ if (_LIB_VERSION == _SVID_)
+ {
+ exc.retval = HUGE;
+ y *= 0.5;
+ if (x < zero && __rintl (y) != y)
+ exc.retval = -HUGE;
+ }
+ else
+ {
+ exc.retval = HUGE_VAL;
+ y *= 0.5;
+ if (x < zero && __rintl (y) != y)
+ exc.retval = -HUGE_VAL;
+ }
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (ERANGE);
+ else if (!matherr (&exc))
+ __set_errno (ERANGE);
+ return exc.retval;
+
+ case 222:
+ /* powl (x, y) underflow. */
+ exc.arg1 = dx;
+ exc.arg2 = dy;
+ exc.type = UNDERFLOW;
+ exc.name = "powl";
+ exc.retval = zero;
+ y *= 0.5;
+ if (x < zero && __rintl (y) != y)
+ exc.retval = -zero;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (ERANGE);
+ else if (!matherr (&exc))
+ __set_errno (ERANGE);
+ return exc.retval;
+
+ default:
+ return __kernel_standard (dx, dy, type);
+ }
+}
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128/w_expl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128/w_expl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128/w_expl.c Wed Mar 28 21:47:42 2012
@@ -39,9 +39,9 @@
if(_LIB_VERSION == _IEEE_) return z;
if(__finitel(x)) {
if(x>o_threshold)
- return __kernel_standard(x,x,206); /* exp overflow */
+ return __kernel_standard_l(x,x,206); /* exp overflow */
else if(x<u_threshold)
- return __kernel_standard(x,x,207); /* exp underflow */
+ return __kernel_standard_l(x,x,207); /* exp underflow */
}
return z;
#endif
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-96/w_expl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-96/w_expl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-96/w_expl.c Wed Mar 28 21:47:42 2012
@@ -33,12 +33,12 @@
if (__builtin_expect (isgreater (x, o_threshold), 0))
{
if (_LIB_VERSION != _IEEE_)
- return __kernel_standard (x, x, 206);
+ return __kernel_standard_l (x, x, 206);
}
else if (__builtin_expect (isless (x, u_threshold), 0))
{
if (_LIB_VERSION != _IEEE_)
- return __kernel_standard (x, x, 207);
+ return __kernel_standard_l (x, x, 207);
}
return __ieee754_expl (x);
Added: fsf/trunk/libc/sysdeps/powerpc/ifunc-sel.h
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/ifunc-sel.h (added)
+++ fsf/trunk/libc/sysdeps/powerpc/ifunc-sel.h Wed Mar 28 21:47:42 2012
@@ -1,0 +1,46 @@
+/* Used by the elf ifunc tests. */
+#ifndef ELF_IFUNC_SEL_H
+#define ELF_IFUNC_SEL_H 1
+
+extern int global;
+
+static inline void *
+ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void))
+{
+ register void *ret __asm__ ("r3");
+ __asm__ ("mflr 12\n\t"
+ "bcl 20,31,1f\n"
+ "1:\tmflr 11\n\t"
+ "mtlr 12\n\t"
+ "addis 12,11,global-1b@ha\n\t"
+ "lwz 12,global-1b@l(12)\n\t"
+ "addis %0,11,%2-1b@ha\n\t"
+ "addi %0,%0,%2-1b@l\n\t"
+ "cmpwi 12,1\n\t"
+ "beqlr\n\t"
+ "addis %0,11,%3-1b@ha\n\t"
+ "addi %0,%0,%3-1b@l\n\t"
+ "cmpwi 12,-1\n\t"
+ "beqlr\n\t"
+ "addis %0,11,%4-1b@ha\n\t"
+ "addi %0,%0,%4-1b@l"
+ : "=r" (ret)
+ : "X" (&global), "X" (f1), "X" (f2), "X" (f3));
+ return ret;
+}
+
+static inline void *
+ifunc_one (int (*f1) (void))
+{
+ register void *ret __asm__ ("r3");
+ __asm__ ("mflr 12\n\t"
+ "bcl 20,31,1f\n"
+ "1:\tmflr %0\n\t"
+ "mtlr 12\n\t"
+ "addis %0,%0,%1-1b@ha\n\t"
+ "addi %0,%0,%1-1b@l"
+ : "=r" (ret)
+ : "X" (f1));
+ return ret;
+}
+#endif
Added: fsf/trunk/libc/sysdeps/powerpc/powerpc32/bzero.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/bzero.S (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/bzero.S Wed Mar 28 21:47:42 2012
@@ -1,0 +1,36 @@
+/* Optimized bzero `implementation' for PowerPC.
+ 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
+ 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 <sysdep.h>
+#include <bp-sym.h>
+
+ENTRY (BP_SYM (__bzero))
+
+#if __BOUNDED_POINTERS__
+ mr r6,r4
+ li r5,0
+ mr r4,r3
+ /* Tell memset that we don't want a return value. */
+ li r3,0
+#else
+ mr r5,r4
+ li r4,0
+#endif
+ b BP_SYM (memset)@local
+END (BP_SYM (__bzero))
+weak_alias (BP_SYM (__bzero), BP_SYM (bzero))
Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/configure
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/configure (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/configure Wed Mar 28 21:47:42 2012
@@ -137,3 +137,48 @@
$as_echo "#define HAVE_PPC_SECURE_PLT 1" >>confdefs.h
fi
+
+# Check for support of thread-local storage handling in assembler and
+# linker.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for powerpc32 TLS support" >&5
+$as_echo_n "checking for powerpc32 TLS support... " >&6; }
+if ${libc_cv_powerpc32_tls+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.s <<\EOF
+ .section ".tdata","awT",@progbits
+x: .long 1
+x1: .long 1
+x2: .long 1
+ .text
+ addi 3,31,x@got@tlsgd
+ addi 3,31,x1@got@tlsld
+ addi 9,3,x1@dtprel
+ addis 9,3,x2@dtprel@ha
+ addi 9,9,x2@dtprel@l
+ lwz 0,x1@dtprel(3)
+ addis 9,3,x2@dtprel@ha
+ lwz 0,x2@dtprel@l(9)
+ lwz 9,x3@got@tprel(31)
+ add 9,9,x@tls
+ addi 9,2,x1@tprel
+ addis 9,2,x2@tprel@ha
+ addi 9,9,x2@tprel@l
+EOF
+if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ libc_cv_powerpc32_tls=yes
+else
+ libc_cv_powerpc32_tls=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_powerpc32_tls" >&5
+$as_echo "$libc_cv_powerpc32_tls" >&6; }
+if test $libc_cv_powerpc32_tls = no; then
+ as_fn_error $? "the assembler must support TLS" "$LINENO" 5
+fi
Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/configure.in
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/configure.in (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/configure.in Wed Mar 28 21:47:42 2012
@@ -30,3 +30,37 @@
if test $libc_cv_ppc_secure_plt = yes; then
AC_DEFINE(HAVE_PPC_SECURE_PLT)
fi
+
+# Check for support of thread-local storage handling in assembler and
+# linker.
+AC_CACHE_CHECK(for powerpc32 TLS support, libc_cv_powerpc32_tls, [dnl
+cat > conftest.s <<\EOF
+ .section ".tdata","awT",@progbits
+x: .long 1
+x1: .long 1
+x2: .long 1
+ .text
+ addi 3,31,x@got@tlsgd
+ addi 3,31,x1@got@tlsld
+ addi 9,3,x1@dtprel
+ addis 9,3,x2@dtprel@ha
+ addi 9,9,x2@dtprel@l
+ lwz 0,x1@dtprel(3)
+ addis 9,3,x2@dtprel@ha
+ lwz 0,x2@dtprel@l(9)
+ lwz 9,x3@got@tprel(31)
+ add 9,9,x@tls
+ addi 9,2,x1@tprel
+ addis 9,2,x2@tprel@ha
+ addi 9,9,x2@tprel@l
+EOF
+dnl
+if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
+ libc_cv_powerpc32_tls=yes
+else
+ libc_cv_powerpc32_tls=no
+fi
+rm -f conftest*])
+if test $libc_cv_powerpc32_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
+fi
Added: fsf/trunk/libc/sysdeps/powerpc/powerpc32/start.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/start.S (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/start.S Wed Mar 28 21:47:42 2012
@@ -1,0 +1,90 @@
+/* Startup code for programs linked with GNU libc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2009, 2011
+ 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
+ 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.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ 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 <sysdep.h>
+#include "bp-sym.h"
+
+ /* These are the various addresses we require. */
+#ifdef PIC
+ .section ".data"
+#else
+ .section ".rodata"
+#endif
+ .align 2
+L(start_addresses):
+ .long _SDA_BASE_
+ .long BP_SYM (main)
+ .long __libc_csu_init
+ .long __libc_csu_fini
+ ASM_SIZE_DIRECTIVE(L(start_addresses))
+
+ .section ".text"
+ENTRY(_start)
+ /* Save the stack pointer, in case we're statically linked under Linux. */
+ mr r9,r1
+ /* Set up an initial stack frame, and clear the LR. */
+ clrrwi r1,r1,4
+#ifdef PIC
+ SETUP_GOT_ACCESS(r13,got_label)
+ li r0,0
+#else
+ li r0,0
+#endif
+ stwu r1,-16(r1)
+ mtlr r0
+ stw r0,0(r1)
+ /* Set r13 to point at the 'small data area', and put the address of
+ start_addresses in r8. Also load the GOT pointer so that new PLT
+ calls work, like the one to __libc_start_main. */
+#ifdef PIC
+ addis r30,r13,_GLOBAL_OFFSET_TABLE_-got_label@ha
+ addis r8,r13,L(start_addresses)-got_label@ha
+ addi r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@l
+ lwzu r13, L(start_addresses)-got_label@l(r8)
+#else
+ lis r8,L(start_addresses)@ha
+ lwzu r13,L(start_addresses)@l(r8)
+#endif
+ /* and continue in libc-start, in glibc. */
+ b JUMPTARGET(BP_SYM (__libc_start_main))
+END(_start)
+
+/* Define a symbol for the first piece of initialized data. */
+ .section ".data"
+ .globl __data_start
+__data_start:
+ .long 0
+weak_alias (__data_start, data_start)
Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc64/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/Makefile (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/Makefile Wed Mar 28 21:47:42 2012
@@ -25,6 +25,16 @@
-ffixed-v$n)) \
-ffixed-vrsave -ffixed-vscr -mno-altivec -mno-vsx
+# Need to prevent gcc from using fprs in code used during dynamic linking.
+
+CFLAGS-dl-runtime.os = $(no-special-regs)
+CFLAGS-dl-lookup.os = $(no-special-regs)
+CFLAGS-dl-misc.os = $(no-special-regs)
+CFLAGS-rtld-mempcpy.os = $(no-special-regs)
+CFLAGS-rtld-memmove.os = $(no-special-regs)
+CFLAGS-rtld-memchr.os = $(no-special-regs)
+CFLAGS-rtld-strnlen.os = $(no-special-regs)
+
ifeq ($(subdir),csu)
sysdep_routines += hp-timing
elide-routines.os += hp-timing
Added: fsf/trunk/libc/sysdeps/powerpc/powerpc64/bzero.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/bzero.S (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/bzero.S Wed Mar 28 21:47:42 2012
@@ -1,0 +1,20 @@
+/* Optimized bzero `implementation' for PowerPC64.
+ Copyright (C) 1997, 1999, 2000, 2002 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
+ 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/>. */
+
+/* This code was moved into memset.S to solve a double stub call problem.
+ @local would have worked but it is not supported in PowerPC64 asm. */
Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc64/configure
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/configure (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/configure Wed Mar 28 21:47:42 2012
@@ -144,3 +144,67 @@
$as_echo "#define USE_PPC64_OVERLAPPING_OPD 1" >>confdefs.h
fi
+
+# Check for support of thread-local storage handling in assembler and
+# linker.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for powerpc64 TLS support" >&5
+$as_echo_n "checking for powerpc64 TLS support... " >&6; }
+if ${libc_cv_powerpc64_tls+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.s <<\EOF
+ .section ".tdata","awT",@progbits
+x: .quad 1
+x1: .quad 1
+x2: .quad 1
+x3: .quad 1
+x4: .long 1
+ .section ".toc","aw"
+.LC0:
+ .quad x@dtpmod
+ .quad x@dtprel
+.LC1:
+ .quad x1@dtpmod
+ .quad 0
+.LC2:
+ .quad x@tprel
+ .text
+ addi 3,2,x@got@tlsgd
+ addi 3,2,.LC0@toc
+ addi 3,2,x1@got@tlsld
+ addi 9,3,x1@dtprel
+ addis 9,3,x2@dtprel@ha
+ addi 9,9,x2@dtprel@l
+ ld 9,x3@got@dtprel(2)
+ addi 3,2,.LC0@toc
+ lwz 0,x1@dtprel(3)
+ ld 0,x1@dtprel(3)
+ addis 9,3,x2@dtprel@ha
+ lwz 0,x2@dtprel@l(9)
+ ld 0,x2@dtprel@l(9)
+ ld 9,x3@got@dtprel(2)
+ ld 9,x@got@tprel(2)
+ add 9,9,x@tls
+ ld 9,.LC2@toc(2)
+ add 9,9,.LC2@tls
+ addi 9,13,x1@tprel
+ addis 9,13,x2@tprel@ha
+ addi 9,9,x2@tprel@l
+EOF
+if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ libc_cv_powerpc64_tls=yes
+else
+ libc_cv_powerpc64_tls=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_powerpc64_tls" >&5
+$as_echo "$libc_cv_powerpc64_tls" >&6; }
+if test $libc_cv_powerpc64_tls = no; then
+ as_fn_error $? "the assembler must support TLS" "$LINENO" 5
+fi
Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc64/configure.in
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/configure.in (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/configure.in Wed Mar 28 21:47:42 2012
@@ -40,3 +40,56 @@
if test x$libc_cv_overlapping_opd = xyes; then
AC_DEFINE(USE_PPC64_OVERLAPPING_OPD)
fi
+
+# Check for support of thread-local storage handling in assembler and
+# linker.
+AC_CACHE_CHECK(for powerpc64 TLS support, libc_cv_powerpc64_tls, [dnl
+cat > conftest.s <<\EOF
+ .section ".tdata","awT",@progbits
+x: .quad 1
+x1: .quad 1
+x2: .quad 1
+x3: .quad 1
+x4: .long 1
+ .section ".toc","aw"
+.LC0:
+ .quad x@dtpmod
+ .quad x@dtprel
+.LC1:
+ .quad x1@dtpmod
+ .quad 0
+.LC2:
+ .quad x@tprel
+ .text
+ addi 3,2,x@got@tlsgd
+ addi 3,2,.LC0@toc
+ addi 3,2,x1@got@tlsld
+ addi 9,3,x1@dtprel
+ addis 9,3,x2@dtprel@ha
+ addi 9,9,x2@dtprel@l
+ ld 9,x3@got@dtprel(2)
+ addi 3,2,.LC0@toc
+ lwz 0,x1@dtprel(3)
+ ld 0,x1@dtprel(3)
+ addis 9,3,x2@dtprel@ha
+ lwz 0,x2@dtprel@l(9)
+ ld 0,x2@dtprel@l(9)
+ ld 9,x3@got@dtprel(2)
+ ld 9,x@got@tprel(2)
+ add 9,9,x@tls
+ ld 9,.LC2@toc(2)
+ add 9,9,.LC2@tls
+ addi 9,13,x1@tprel
+ addis 9,13,x2@tprel@ha
+ addi 9,9,x2@tprel@l
+EOF
+dnl
+if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
+ libc_cv_powerpc64_tls=yes
+else
+ libc_cv_powerpc64_tls=no
+fi
+rm -f conftest*])
+if test $libc_cv_powerpc64_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
+fi
Added: fsf/trunk/libc/sysdeps/powerpc/powerpc64/entry.h
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/entry.h (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/entry.h Wed Mar 28 21:47:42 2012
@@ -1,0 +1,33 @@
+/* Finding the entry point and start of text. PowerPC64 version.
+ Copyright (C) 2002 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
+ 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/>. */
+
+
+#ifndef __ASSEMBLY__
+extern void _start (void);
+#endif
+
+#define ENTRY_POINT _start
+
+/* We have to provide a special declaration. */
+#define ENTRY_POINT_DECL(class) class void _start (void);
+
+/* Use the address of ._start as the lowest address for which we need
+ to keep profiling records. We can't copy the ia64 scheme as our
+ entry poiny address is really the address of the function
+ descriptor, not the actual function entry. */
+#define TEXT_START (((long int *) ENTRY_POINT)[0])
Added: fsf/trunk/libc/sysdeps/powerpc/powerpc64/start.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/start.S (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/start.S Wed Mar 28 21:47:42 2012
@@ -1,0 +1,87 @@
+/* Startup code for programs linked with GNU libc. PowerPC64 version.
+ Copyright (C) 1998,1999,2000,2001,2002,2003,2009
+ 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
+ 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.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ 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 <sysdep.h>
+#include "bp-sym.h"
+
+ /* These are the various addresses we require. */
+#ifdef PIC
+ .section ".data.rel.ro.local","aw"
+#else
+ .section ".rodata"
+#endif
+ .align 3
+L(start_addresses):
+ .quad 0 /* was _SDA_BASE_ but not in 64-bit ABI*/
+/* function descriptors so don't need JUMPTARGET */
+ .quad BP_SYM(main)
+ .quad __libc_csu_init
+ .quad __libc_csu_fini
+
+ ASM_SIZE_DIRECTIVE(L(start_addresses))
+
+ .section ".toc","aw"
+.L01:
+ .tc L(start_addresses)[TC],L(start_addresses)
+ .section ".text"
+ENTRY(_start)
+ /* Save the stack pointer, in case we're statically linked under Linux. */
+ mr r9,r1
+ /* Set up an initial stack frame, and clear the LR. */
+ clrrdi r1,r1,4
+ li r0,0
+ stdu r1,-128(r1)
+ mtlr r0
+ std r0,0(r1)
+
+ /* put the address of start_addresses in r8... **
+** PPC64 ABI uses R13 for thread local, so we leave it alone */
+ ld r8,.L01(r2)
+
+ /* and continue in libc-start, in glibc. */
+ b JUMPTARGET(BP_SYM(__libc_start_main))
+/* The linker needs this nop to recognize that it's OK to call via a
+ TOC adjusting stub. */
+ nop
+
+END(_start)
+
+/* Define a symbol for the first piece of initialized data. */
+ .section ".data"
+ .globl __data_start
+__data_start:
+ .long 0
+weak_alias (__data_start, data_start)
Added: fsf/trunk/libc/sysdeps/powerpc/rtld-global-offsets.sym
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/rtld-global-offsets.sym (added)
+++ fsf/trunk/libc/sysdeps/powerpc/rtld-global-offsets.sym Wed Mar 28 21:47:42 2012
@@ -1,0 +1,7 @@
+#define SHARED 1
+
+#include <ldsodefs.h>
+
+#define rtld_global_ro_offsetof(mem) offsetof (struct rtld_global_ro, mem)
+
+RTLD_GLOBAL_RO_DL_HWCAP_OFFSET rtld_global_ro_offsetof (_dl_hwcap)
Modified: fsf/trunk/libc/sysdeps/s390/s390-32/bsd-_setjmp.S
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/s390-32/bsd-_setjmp.S (original)
+++ fsf/trunk/libc/sysdeps/s390/s390-32/bsd-_setjmp.S Wed Mar 28 21:47:42 2012
@@ -1,46 +1,1 @@
-/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. s390 version.
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@xxxxxxxxxx).
- This file is part of the GNU C Library.
-
- 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/>. */
-
-/* This just does a tail-call to `__sigsetjmp (ARG, 0)'.
- We cannot do it in C because it must be a tail-call, so frame-unwinding
- in setjmp doesn't clobber the state restored by longjmp. */
-
-#include <sysdep.h>
-
-ENTRY(_setjmp)
-#ifdef PIC
- /* We cannot use the PLT, because it requires that %r12 be set, but
- we can't save and restore our caller's value. Instead, we do an
- indirect jump through the GOT. */
- basr %r1,0
-.L0: al %r1,.L1 - .L0(0,%r1) /* get address of global offset table */
- /* get address of __sigjmp_save from got */
- l %r1,__sigjmp_save@GOT12(0,%r1)
- lhi %r3,0 /* second argument of one */
- br %r1
-.L1: .long _GLOBAL_OFFSET_TABLE_ - .L0
-#else
- basr %r1,0
-.L0: l %r1,.L1 - .L0(0,%r1) /* load address of __sigsetjmp */
- lhi %r3,0 /* second argument of zero */
- br %r1 /* branch to __sigsetjmp */
-.L1: .long __sigsetjmp
-#endif
-END (_setjmp)
-libc_hidden_def (_setjmp)
+/* We don't need any code here since the setjmp.S file contains it. */
Modified: fsf/trunk/libc/sysdeps/s390/s390-32/bsd-setjmp.S
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/s390-32/bsd-setjmp.S (original)
+++ fsf/trunk/libc/sysdeps/s390/s390-32/bsd-setjmp.S Wed Mar 28 21:47:42 2012
@@ -1,45 +1,1 @@
-/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. s390 version.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@xxxxxxxxxx).
- This file is part of the GNU C Library.
-
- 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/>. */
-
-/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
- We cannot do it in C because it must be a tail-call, so frame-unwinding
- in setjmp doesn't clobber the state restored by longjmp. */
-
-#include <sysdep.h>
-
-ENTRY(setjmp)
-#ifdef PIC
- /* We cannot use the PLT, because it requires that %r12 be set, but
- we can't save and restore our caller's value. Instead, we do an
- indirect jump through the GOT. */
- basr %r1,0
-.L0: al %r1,.L1 - .L0(0,%r1) /* get address of global offset table */
- /* get address of __sigjmp_save from got */
- l %r1,__sigjmp_save@GOT12(0,%r1)
- lhi %r3,1 /* second argument of one */
- br %r1
-.L1: .long _GLOBAL_OFFSET_TABLE_ - .L0
-#else
- basr %r1,0
-.L0: l %r1,.L1 - .L0(0,%r1) /* load address of __sigsetjmp */
- lhi %r3,1 /* second argument of zero */
- br %r1 /* branch to __sigsetjmp */
-.L1: .long __sigsetjmp
-#endif
-END (setjmp)
+/* We don't need any code here since the setjmp.S file contains it. */
Added: fsf/trunk/libc/sysdeps/s390/s390-32/configure
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/s390-32/configure (added)
+++ fsf/trunk/libc/sysdeps/s390/s390-32/configure Wed Mar 28 21:47:42 2012
@@ -1,0 +1,126 @@
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+# This file is generated from configure.in by Autoconf. DO NOT EDIT!
+ # Local configure fragment for sysdeps/s390.
+
+# Check for support of thread-local storage handling in assembler and
+# linker.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for s390 TLS support" >&5
+$as_echo_n "checking for s390 TLS support... " >&6; }
+if ${libc_cv_390_tls+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.S <<\EOF
+ .section ".tdata", "awT", @progbits
+foo: .long 25
+ .text
+ .long foo@TLSGD
+ .long foo@TLSLDM
+ .long foo@DTPOFF
+ .long foo@NTPOFF
+ .long foo@GOTNTPOFF
+ .long foo@INDNTPOFF
+ l %r1,foo@GOTNTPOFF(%r12)
+ l %r1,0(%r1):tls_load:foo
+ bas %r14,0(%r1,%r13):tls_gdcall:foo
+ bas %r14,0(%r1,%r13):tls_ldcall:foo
+EOF
+if { ac_try='${CC-cc} -S $CFLAGS conftest.S 1>&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ libc_cv_390_tls=yes
+else
+ libc_cv_390_tls=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_390_tls" >&5
+$as_echo "$libc_cv_390_tls" >&6; }
+if test $libc_cv_390_tls = no; then
+ as_fn_error $? "the assembler must support TLS" "$LINENO" 5
+fi
+
+$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
Added: fsf/trunk/libc/sysdeps/s390/s390-32/configure.in
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/s390-32/configure.in (added)
+++ fsf/trunk/libc/sysdeps/s390/s390-32/configure.in Wed Mar 28 21:47:42 2012
@@ -1,0 +1,35 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/s390.
+
+# Check for support of thread-local storage handling in assembler and
+# linker.
+AC_CACHE_CHECK(for s390 TLS support, libc_cv_390_tls, [dnl
+cat > conftest.S <<\EOF
+ .section ".tdata", "awT", @progbits
+foo: .long 25
+ .text
+ .long foo@TLSGD
+ .long foo@TLSLDM
+ .long foo@DTPOFF
+ .long foo@NTPOFF
+ .long foo@GOTNTPOFF
+ .long foo@INDNTPOFF
+ l %r1,foo@GOTNTPOFF(%r12)
+ l %r1,0(%r1):tls_load:foo
+ bas %r14,0(%r1,%r13):tls_gdcall:foo
+ bas %r14,0(%r1,%r13):tls_ldcall:foo
+EOF
+dnl
+if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS conftest.S 1>&AS_MESSAGE_LOG_FD); then
+ libc_cv_390_tls=yes
+else
+ libc_cv_390_tls=no
+fi
+rm -f conftest*])
+if test $libc_cv_390_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
+fi
+
+dnl It is always possible to access static and hidden symbols in an
+dnl position independent way.
+AC_DEFINE(PI_STATIC_AND_HIDDEN)
Modified: fsf/trunk/libc/sysdeps/s390/s390-32/setjmp.S
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/s390-32/setjmp.S (original)
+++ fsf/trunk/libc/sysdeps/s390/s390-32/setjmp.S Wed Mar 28 21:47:42 2012
@@ -1,5 +1,5 @@
-/*
- Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc.
+/* setjmp for s390, ELF version.
+ Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@xxxxxxxxxx).
This file is part of the GNU C Library.
@@ -17,17 +17,34 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _ASM
+#include <sysdep.h>
#define _ASM
-#endif
-
-#include <sysdep.h>
+#define _SETJMP_H
#include <bits/setjmp.h>
-/* Save the current program position in ENV and return 0. */
-/* R2 = pointer to jmp_buf, R3 = savemask */
+ /* We include the BSD entry points here as well but we make
+ them weak. */
+ENTRY (setjmp)
+ .weak C_SYMBOL_NAME (setjmp)
+ lhi %r3,1 /* second argument of one */
+ j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */
+END (setjmp)
+
+ /* Binary compatibility entry point. */
+ENTRY(_setjmp)
+ .weak C_SYMBOL_NAME (_setjmp)
+ lhi %r3,0 /* second argument of zero */
+ j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */
+END (_setjmp)
+libc_hidden_def (_setjmp)
+
+ENTRY(__setjmp)
+ lhi %r3,0 /* second argument of zero */
+ j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */
+END (__setjmp)
ENTRY(__sigsetjmp)
+.Linternal_sigsetjmp:
#ifdef PTR_MANGLE
stm %r6,%r13,0(%r2) /* store registers in jmp_buf */
lr %r4,%r14
@@ -58,6 +75,6 @@
basr %r1,0
.L0: l %r1,.L1-.L0(0,%r1) /* load address of __sigjmp_save */
br %r1 /* tail-call __sigjmp_save */
-.L1: .long __sigjmp_save
+.L1: .long __sigjmp_save
#endif
END (__sigsetjmp)
Added: fsf/trunk/libc/sysdeps/s390/s390-32/start.S
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/s390-32/start.S (added)
+++ fsf/trunk/libc/sysdeps/s390/s390-32/start.S Wed Mar 28 21:47:42 2012
@@ -1,0 +1,212 @@
+/* Startup code compliant to the ELF s390 ABI.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006
+ Free Software Foundation, Inc.
+ Contributed by Martin Schwidefsky (schwidefsky@xxxxxxxxxx).
+ This file is part of the GNU C Library.
+
+ 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.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ 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/>. */
+
+/*
+ This is the canonical entry point, usually the first thing in the text
+ segment. Most registers' values are unspecified, except for:
+
+ %r14 Contains a function pointer to be registered with `atexit'.
+ This is how the dynamic linker arranges to have DT_FINI
+ functions called for shared libraries that have been loaded
+ before this code runs.
+
+ %r15 The stack contains the arguments and environment:
+ 0(%r15) argc
+ 4(%r15) argv[0]
+ ...
+ (4*argc)(%r15) NULL
+ (4*(argc+1))(%r15) envp[0]
+ ...
+ NULL
+*/
+
+ .text
+ .globl _start
+ .type _start,@function
+_start:
+ /* Check if the kernel provides highgprs facility if needed by
+ the binary. */
+
+ lr %r6,%r15
+ la %r6,4(%r6) /* Skip the argument counter. */
+
+.L11: l %r5,0(%r6) /* Skip the argument vector. */
+ la %r6,4(%r6)
+ ltr %r5,%r5
+ jne .L11
+
+.L12: l %r5,0(%r6) /* Skip the environment vector. */
+ la %r6,4(%r6)
+ ltr %r5,%r5
+ jne .L12
+
+ /* Usually the auxiliary vector can be expected directly after
+ the environment variables. But we have to skip extra zeros
+ because the loader might have removed unsecure variables for
+ setuid programs. */
+
+.L26: l %r5,0(%r6)
+ la %r6,4(%r6)
+ ltr %r5,%r5
+ jz .L26
+
+ ahi %r6,-4
+
+ /* Obtain the needed values from the auxiliary vector. */
+
+ lhi %r7,16 /* AT_HWCAP */
+ lhi %r8,3 /* AT_PHDR */
+ lhi %r9,5 /* AT_PHNUM */
+ lhi %r2,4 /* AT_PHENT */
+.L13: l %r5,0(%r6)
+ clr %r5,%r7
+ jne .L15
+ l %r10,4(%r6) /* r10 = AT_HWCAP value. */
+.L15: clr %r5,%r8
+ jne .L16
+ l %r11,4(%r6) /* r11 = AT_PHDR value. */
+.L16: clr %r5,%r9
+ jne .L17
+ l %r12,4(%r6) /* r12 = AT_PHNUM value. */
+.L17: clr %r5,%r2
+ jne .L18
+ l %r0,4(%r6) /* r0 = AT_PHENT value. */
+.L18: ltr %r5,%r5
+ la %r6,8(%r6)
+ jnz .L13
+
+ /* Locate the ELF header by looking for the first PT_LOAD
+ segment with a p_offset of zero. */
+
+ lr %r4,%r11 /* Backup AT_PHDR. */
+ lhi %r7,1 /* PT_LOAD id */
+ lhi %r8,0
+.L19: cl %r7,0(%r4) /* p_type == PT_LOAD? */
+ jne .L20
+ cl %r8,4(%r4) /* p_offset == 0? */
+ jne .L20
+ l %r9,8(%r4) /* r9 = PT_LOAD.p_vaddr <- ELF header address */
+ j .L24
+.L20: alr %r4,%r0 /* r4 += AT_PHENT value */
+ brct %r12,.L19
+
+ j .+2 /* Trap, there must be such a phdr. */
+
+.L24: lr %r4,%r11 /* Backup AT_PHDR. */
+ lhi %r2,6 /* PT_PHDR id */
+.L23: cl %r2,0(%r4)
+ jne .L22
+ l %r3,8(%r4) /* r3 = PT_PHDR p_vaddr */
+ j .L25
+.L22: alr %r4,%r0 /* r4 += AT_PHENT value */
+ brct %r12,.L23
+
+ j .L14 /* No PT_PHDR found - skip checking. */
+
+.L25: slr %r11,%r3 /* AT_PHDR - PT_PHDR.p_vaddr (relocation offset)*/
+ alr %r9,%r11 /* PT_LOAD.p_vaddr += relocation offset */
+
+ l %r5,36(%r9) /* Load the e_flags field. */
+ tml %r5,1
+ jz .L14 /* Binary does not require highgprs facility. */
+
+ tml %r10,512 /* Check the AT_HWCAP value. */
+ jz 2 /* Trap if no highgprs facility available. */
+.L14:
+
+ /* Setup pointer to literal pool of _start */
+ basr %r13,0
+.L0: ahi %r13,.Llit-.L0
+
+ /* load argc and argv from stack */
+ la %r4,4(%r15) # get argv
+ l %r3,0(%r15) # get argc
+
+ /* align the stack to a double word boundary */
+ lhi %r0,-8
+ nr %r15,%r0
+
+ /* Setup a stack frame and a parameter area */
+ ahi %r15,-104 # make room on stack
+ xc 0(4,%r15),0(%r15) # clear back-chain
+
+ /* set up arguments for __libc_start_main:
+ main, argc, argv, envp, _init, _fini, rtld_fini, stack_end
+ Note that envp will be determined later in __libc_start_main
+ */
+ stm %r14,%r15,96(%r15) # store rtld_fini/stack_end to parameter area
+ la %r7,96(%r15)
+ l %r6,.L2-.Llit(%r13) # load pointer to __libc_csu_fini
+ l %r5,.L1-.Llit(%r13) # load pointer to __libc_csu_init
+ l %r2,.L3-.Llit(%r13) # load pointer to main
+ l %r1,.L4-.Llit(%r13) # load pointer to __libc_start_main
+#ifdef PIC
+ l %r12,.L5-.Llit(%r13) # load .got pointer
+ la %r6,0(%r13,%r6)
+ la %r5,0(%r13,%r5)
+ la %r12,0(%r13,%r12)
+ l %r2,0(%r12,%r2)
+ la %r1,0(%r13,%r1)
+#endif
+
+ /* ok, now branch to the libc main routine */
+ basr %r14,%r1
+
+ /* crash if __libc_start_main returns */
+ .word 0
+
+.Llit:
+#ifndef PIC
+.L1: .long __libc_csu_init
+.L2: .long __libc_csu_fini
+.L3: .long main
+.L4: .long __libc_start_main
+#else
+.L1: .long __libc_csu_init-.Llit
+.L2: .long __libc_csu_fini-.Llit
+.L3: .long main@GOT
+.L4: .long __libc_start_main@xxxxxxxxx
+.L5: .long _GLOBAL_OFFSET_TABLE_-.Llit
+#endif
+
+/* Define a symbol for the first piece of initialized data. */
+ .data
+ .globl __data_start
+__data_start:
+ .long 0
+ .weak data_start
+ data_start = __data_start
Modified: fsf/trunk/libc/sysdeps/s390/s390-64/bsd-_setjmp.S
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/s390-64/bsd-_setjmp.S (original)
+++ fsf/trunk/libc/sysdeps/s390/s390-64/bsd-_setjmp.S Wed Mar 28 21:47:42 2012
@@ -1,34 +1,1 @@
-/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. 64 bit S/390 version.
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@xxxxxxxxxx).
- This file is part of the GNU C Library.
-
- 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/>. */
-
-/* This just does a tail-call to `__sigsetjmp (ARG, 0)'.
- We cannot do it in C because it must be a tail-call, so frame-unwinding
- in setjmp doesn't clobber the state restored by longjmp. */
-
-#include <sysdep.h>
-
-ENTRY(_setjmp)
- slgr %r3,%r3 /* Second argument of zero. */
-#ifdef PIC
[... 1406 lines stripped ...]
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits