about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* PowerPC floating point little-endian [1 of 15]Alan Modra2013-10-044-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | http://sourceware.org/ml/libc-alpha/2013-08/msg00081.html This is the first of a series of patches to ban ieee854_long_double and the ieee854_long_double macros when using IBM long double. union ieee854_long_double just isn't correct for IBM long double, especially when little-endian, and pretending it is OK has allowed a number of bugs to remain undetected in sysdeps/ieee754/ldbl-128ibm/. This changes the few places in generic code that use it. * stdio-common/printf_size.c (__printf_size): Don't use union ieee854_long_double in fpnum union. * stdio-common/printf_fphex.c (__printf_fphex): Likewise. Use signbit macro to retrieve sign from long double. * stdio-common/printf_fp.c (___printf_fp): Use signbit macro to retrieve sign from long double. * sysdeps/ieee754/ldbl-128ibm/printf_fphex.c: Adjust for fpnum change. * sysdeps/ieee754/ldbl-128/printf_fphex.c: Likewise. * sysdeps/ieee754/ldbl-96/printf_fphex.c: Likewise. * sysdeps/x86_64/fpu/printf_fphex.c: Likewise. * math/test-misc.c (main): Don't use union ieee854_long_double. ports/ * sysdeps/ia64/fpu/printf_fphex.c: Adjust for fpnum change.
* Fix for [BZ #15680] IBM long double inaccuracyAlan Modra2013-10-045-106/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://sourceware.org/ml/libc-alpha/2013-06/msg00919.html I discovered a number of places where denormals and other corner cases were being handled wrongly. - printf_fphex.c: Testing for the low double exponent being zero is unnecessary. If the difference in exponents is less than 53 then the high double exponent must be nearing the low end of its range, and the low double exponent hit rock bottom. - ldbl2mpn.c: A denormal (ie. exponent of zero) value is treated as if the exponent was one, so shift mantissa left by one. Code handling normalisation of the low double mantissa lacked a test for shift count greater than bits in type being shifted, and lacked anything to handle the case where the difference in exponents is less than 53 as in printf_fphex.c. - math_ldbl.h (ldbl_extract_mantissa): Same as above, but worse, with code testing for exponent > 1 for some reason, probably a typo for >= 1. - math_ldbl.h (ldbl_insert_mantissa): Round the high double as per mpn2ldbl.c (hi is odd or explicit mantissas non-zero) so that the number we return won't change when applying ldbl_canonicalize(). Add missing overflow checks and normalisation of high mantissa. Correct misleading comment: "The hidden bit of the lo mantissa is zero" is not always true as can be seen from the code rounding the hi mantissa. Also by inspection, lzcount can never be less than zero so remove that test. Lastly, masking bitfields to their widths can be left to the compiler. - mpn2ldbl.c: The overflow checks here on rounding of high double were just plain wrong. Incrementing the exponent must be accompanied by a shift right of the mantissa to keep the value unchanged. Above notes for ldbl_insert_mantissa are also relevant. [BZ #15680] * sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c: Comment fix. * sysdeps/ieee754/ldbl-128ibm/printf_fphex.c (PRINT_FPHEX_LONG_DOUBLE): Tidy code by moving -53 into ediff calculation. Remove unnecessary test for denormal exponent. * sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c (__mpn_extract_long_double): Correct handling of denormals. Avoid undefined shift behaviour. Correct normalisation of low mantissa when low double is denormal. * sysdeps/ieee754/ldbl-128ibm/math_ldbl.h (ldbl_extract_mantissa): Likewise. Comment. Use uint64_t* for hi64. (ldbl_insert_mantissa): Make both hi64 and lo64 parms uint64_t. Correct normalisation of low mantissa. Test for overflow of high mantissa and normalise. (ldbl_nearbyint): Use more readable constant for two52. * sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c (__mpn_construct_long_double): Fix test for overflow of high mantissa and correct normalisation. Avoid undefined shift.
* IBM long double mechanical changes to support little-endianAlan Modra2013-10-0410-184/+145
| | | | | | | | | | | | | | | | | | | | | | | http://sourceware.org/ml/libc-alpha/2013-07/msg00001.html This patch starts the process of supporting powerpc64 little-endian long double in glibc. IBM long double is an array of two ieee doubles, so making union ibm_extended_long_double reflect this fact is the correct way to access fields of the doubles. * sysdeps/ieee754/ldbl-128ibm/ieee754.h (union ibm_extended_long_double): Define as an array of ieee754_double. (IBM_EXTENDED_LONG_DOUBLE_BIAS): Delete. * sysdeps/ieee754/ldbl-128ibm/printf_fphex.c: Update all references to ibm_extended_long_double and IBM_EXTENDED_LONG_DOUBLE_BIAS. * sysdeps/ieee754/ldbl-128ibm/e_exp10l.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/e_expl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/math_ldbl.h: Likewise. * sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/strtold_l.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c: Likewise.
* Properly cache the result from looking up the nss database configAndreas Schwab2013-09-301-8/+6
|
* tst-fanotify: fix styleMike Frysinger2013-09-281-8/+9
| | | | | Reported-by: Andreas Jaeger <aj@suse.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* don't use Bash-specific ${parameter/pattern/string} expansionPatrick 'P. J.' McDermott2013-09-282-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | sysdeps/unix/make-syscalls.sh and sysdeps/unix/Makefile use GNU Bash's ${parameter/pattern/string} parameter expansion. Non-Bash shells (e.g. dash or BusyBox ash when built with CONFIG_ASH_BASH_COMPAT disabled) don't support this expansion syntax. So glibc will fail to build when $(SHELL) expands to a path that isn't provided by Bash. An example build failure: for dir in [...]; do \ test -f $dir/syscalls.list && \ { sysdirs='[...]' \ asm_CPP='gcc -c -I[...] -D_LIBC_REENTRANT -include include/libc-symbols.h -DASSEMBLER -g -Wa,--noexecstack -E -x assembler-with-cpp' \ /bin/sh sysdeps/unix/make-syscalls.sh $dir || exit 1; }; \ test $dir = sysdeps/unix && break; \ done > [build-dir]/sysd-syscallsT sysdeps/unix/make-syscalls.sh: line 273: syntax error: bad substitution This patch simply replaces the three instances of the Bash-only syntax in these files with an echo and sed command substitution. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Add SH implementation of stackguard-macros.h.Kaz Kojima2013-09-271-0/+6
|
* Faster strrchr.Ondřej Bílka2013-09-266-943/+199
|
* PowerPC: Fix POINTER_CHK_GUARD thread register for PPC64Adhemerval Zanella2013-09-251-1/+1
|
* sysdeps/mach/hurd/i386/tls.h: Remove TLS_INIT_TP_EXPENSIVE.Will Newton2013-09-241-1/+0
| | | | | | | | | | | This define was removed from the rest of the tree eight years ago. ChangeLog: 2013-09-24 Will Newton <will.newton@linaro.org> * sysdeps/mach/hurd/i386/tls.h (TLS_INIT_TP_EXPENSIVE): Remove macro.
* BZ #15754: Fix test case for ARM.Carlos O'Donell2013-09-231-1/+6
| | | | | | | Statically built binaries use __pointer_chk_guard_local, while dynamically built binaries use __pointer_chk_guard. Provide the right definition depending on the test case we are building.
* BZ #15754: CVE-2013-4788Carlos O'Donell2013-09-239-0/+67
| | | | | | | | | | | | The pointer guard used for pointer mangling was not initialized for static applications resulting in the security feature being disabled. The pointer guard is now correctly initialized to a random value for static applications. Existing static applications need to be recompiled to take advantage of the fix. The test tst-ptrguard1-static and tst-ptrguard1 add regression coverage to ensure the pointer guards are sufficiently random and initialized to a default value.
* Make __ffs hiddenAndreas Schwab2013-09-205-0/+5
|
* Consolidate common code into macrosSiddhesh Poyarekar2013-09-191-74/+62
| | | | | Consolidated common Taylor series polynomials into macros in s_sin.c to make it a bit cleaner.
* Consolidate sin/cos table lookup codeSiddhesh Poyarekar2013-09-191-114/+35
|
* Consolidate sin/cos computation for large inputsSiddhesh Poyarekar2013-09-191-47/+36
|
* Remove redundant goto linesSiddhesh Poyarekar2013-09-191-40/+3
|
* MIPS: IEEE 754-2008 NaN encoding supportMaciej W. Rozycki2013-09-181-18/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It has been a long practice for software using IEEE 754 floating-point arithmetic run on MIPS processors to use an encoding of Not-a-Number (NaN) data different to one used by software run on other processors. And as of IEEE 754-2008 revision [1] this encoding does not follow one recommended in the standard, as specified in section 6.2.1, where it is stated that quiet NaNs should have the first bit (d1) of their significand set to 1 while signalling NaNs should have that bit set to 0, but MIPS software interprets the two bits in the opposite manner. As from revision 3.50 [2][3] the MIPS Architecture provides for processors that support the IEEE 754-2008 preferred NaN encoding format. As the two formats (further referred to as "legacy NaN" and "2008 NaN") are incompatible to each other, tools have to provide support for the two formats to help people avoid using incompatible binary modules. The change is comprised of two functional groups of features, both of which are required for correct support. 1. Dynamic linker support. To enforce the NaN encoding requirement in dynamic linking a new ELF file header flag has been defined. This flag is set for 2008-NaN shared modules and executables and clear for legacy-NaN ones. The dynamic linker silently ignores any incompatible modules it encounters in dependency processing. To avoid unnecessary processing of incompatible modules in the presence of a shared module cache, a set of new cache flags has been defined to mark 2008-NaN modules for the three ABIs supported. Changes to sysdeps/unix/sysv/linux/mips/readelflib.c have been made following an earlier code quality suggestion made here: http://sourceware.org/ml/libc-ports/2009-03/msg00036.html and are therefore a little bit more extensive than the minimum required. Finally a new name has been defined for the dynamic linker so that 2008-NaN and legacy-NaN binaries can coexist on a single system that supports dual-mode operation and that a legacy dynamic linker that does not support verifying the 2008-NaN ELF file header flag is not chosen to interpret a 2008-NaN binary by accident. 2. Floating environment support. IEEE 754-2008 features are controlled in the Floating-Point Control and Status (FCSR) register and updates are needed to floating environment support so that the 2008-NaN flag is set correctly and the kernel default, inferred from the 2008-NaN ELF file header flag at the time an executable is loaded, respected. As the NaN encoding format is a property of GCC code generation that is both a user-selected GCC configuration default and can be overridden with GCC options, code that needs to know what NaN encoding standard it has been configured for checks for the __mips_nan2008 macro that is defined internally by GCC whenever the 2008-NaN mode has been selected. This mode is determined at the glibc configuration time and therefore a few consistency checks have been added to catch cases where compilation flags have been overridden by the user. The 2008 NaN set of features relies on kernel support as the in-kernel floating-point emulator needs to be aware of the NaN encoding used even on hard-float processors and configure the FPU context according to the value of the 2008 NaN ELF file header flag of the executable being started. As at this time work on kernel support is still in progress and the relevant changes have not made their way yet to linux.org master repository. Therefore the minimum version supported has been artificially set to 10.0.0 so that 2008-NaN code is not accidentally run on a Linux kernel that does not suppport it. It is anticipated that the version is adjusted later on to the actual initial linux.org kernel version to support this feature. Legacy NaN encoding support is unaffected, older kernel versions remain supported. [1] "IEEE Standard for Floating-Point Arithmetic", IEEE Computer Society, IEEE Std 754-2008, 29 August 2008 [2] "MIPS Architecture For Programmers, Volume I-A: Introduction to the MIPS32 Architecture", MIPS Technologies, Inc., Document Number: MD00082, Revision 3.50, September 20, 2012 [3] "MIPS Architecture For Programmers, Volume I-A: Introduction to the MIPS64 Architecture", MIPS Technologies, Inc., Document Number: MD00083, Revision 3.50, September 20, 2012
* e500 port: fpu_control.h.Joseph Myers2013-09-181-1/+38
|
* e500 port: setjmp/longjmp.Joseph Myers2013-09-182-36/+47
|
* Don't force -msoft-float for powerpc --without-fp.Joseph Myers2013-09-181-5/+0
|
* Format sincos32.cSiddhesh Poyarekar2013-09-181-236/+254
|
* Fix powerpc fpu_control.h namespace and parenthesis issues (bug 15966).Joseph Myers2013-09-171-12/+12
|
* Faster strchr implementation.Ondřej Bílka2013-09-114-200/+160
|
* Update powerpc-fpu ULPs.Adhemerval Zanella2013-09-111-2/+63
|
* Add O_TMPFILE to <fcntl.h>Andreas Schwab2013-09-112-0/+5
|
* Remove DO_NOT_USE_THIS conditionals.Ondřej Bílka2013-09-105-97/+0
|
* Coordinate IPv6 definitions for Linux and glibcCarlos O'Donell2013-09-061-0/+12
| | | | | | | | | | This change synchronizes the glibc headers with the Linux kernel headers and arranges to coordinate the definition of structures already defined the Linux kernel UAPI headers. It is now safe to include glibc's netinet/in.h or Linux's linux/in6.h in any order in a userspace application and you will get the same ABI. The ABI is guaranteed by UAPI and glibc.
* PowerPC: fix POWER7 memrchr for some large inputsAdhemerval Zanella2013-09-052-4/+4
|
* tst-fanotify: skip when we get back EPERMMike Frysinger2013-09-051-5/+8
| | | | | | | | Since fanotify_init requires CAP_SYS_ADMIN in order to work (which usually means running as root), we need to handle that error case too. Reported-by: Andreas Jaeger <aj@suse.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Remove --disable-versioning.Joseph Myers2013-09-046-13/+5
|
* Fix lgammaf spurious underflow (bug 15427).Joseph Myers2013-09-033-2/+110
|
* Add unaligned strcmp.Ondřej Bílka2013-09-034-2/+222
|
* tst-fanotify: new simple testMike Frysinger2013-09-022-1/+57
| | | | | | Basic test for the fanotify functions. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Fix spurious jnf underflows (bug 14155).Joseph Myers2013-09-023-6/+37
|
* Fix typo.Ondřej Bílka2013-09-021-1/+1
|
* Fix then/than typos.Ondřej Bílka2013-08-305-19/+19
|
* Fix typos.Ondřej Bílka2013-08-3012-12/+12
|
* Fix rawmemchr regression on bulldozer.Ondřej Bílka2013-08-302-109/+0
|
* Remove aix specific files.Ondřej Bílka2013-08-299-869/+0
|
* Hurd: Add ESUCCESS error_t value.Thomas Schwinge2013-08-292-1/+17
|
* Hurd: Use __executable_start symbol instead of _start.Samuel Thibault2013-08-291-2/+2
| | | | | _start points to the first instruction, not to the ELF header. __executable_start does point on the ELF header.
* Support ELFOSABI_GNU on all GNU systems.Thomas Schwinge2013-08-292-23/+48
|
* Use ELFOSABI_GNU instead of ELFOSABI_LINUX.Thomas Schwinge2013-08-291-4/+4
|
* [BZ #15522] strtod ("nan(N)") returning a sNaN in some casesThomas Schwinge2013-08-295-20/+41
|
* Fix typos.Ondřej Bílka2013-08-297-7/+7
|
* Use __glibc_unlikely instead of __builtin_expect (..., 0)Siddhesh Poyarekar2013-08-281-1/+1
|
* True stub __ifreq.Roland McGrath2013-08-271-0/+79
|
* Clean up __libc_sa_len helper.Roland McGrath2013-08-273-66/+13
|
* Replace generic bits/socket.h with 4.4 file.Roland McGrath2013-08-271-358/+0
|