aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic
AgeCommit message (Collapse)AuthorFilesLines
2013-09-23BZ #15754: Fix test case for ARM.Carlos O'Donell1-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.
2013-09-23BZ #15754: CVE-2013-4788Carlos O'Donell1-0/+3
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.
2013-09-18MIPS: IEEE 754-2008 NaN encoding supportMaciej W. Rozycki1-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
2013-06-28Add GLRO(dl_hwcap2) for new AT_HWCAP2 auxv_t a_type.Ryan S. Arnold2-1/+5
2013-06-24[BZ #10283] localedef: align fixed maps to SHMLBAMike Frysinger1-0/+26
Many Linux arches require fixed mmaps to be aligned higher than pagesize, so use the SHMLBA define as it represents this quantity exactly. This fixes spurious errors seen on those arches like: cannot map archive header: Invalid argument URL: http://sourceware.org/bugzilla/show_bug.cgi?id=10283 Reported-by: CHIKAMA Masaki <masaki.chikama@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-06-12Fix unsafe compiler optimizationAdhemerval Zanella1-1/+6
GCC 4.8 enables -ftree-loop-distribute-patterns at -O3 by default and this optimization may transform loops into memset/memmove calls. Without proper handling this may generate unexpected PLT calls on GLIBC. This patch fixes by create memset/memmove alias to internal GLIBC __GI_memset/__GI_memmove symbols.
2013-06-12Set/restore rounding mode only when neededSiddhesh Poyarekar1-14/+41
The most common use case of math functions is with default rounding mode, i.e. rounding to nearest. Setting and restoring rounding mode is an unnecessary overhead for this, so I've added support for a context, which does the set/restore only if the FP status needs a change. The code is written such that only x86 uses these. Other architectures should be unaffected by it, but would definitely benefit if the set/restore has as much overhead relative to the rest of the code, as the x86 bits do. Here's a summary of the performance improvement due to these improvements; I've only mentioned functions that use the set/restore and have benchmark inputs for x86_64: Before: cos(): ITERS:4.69335e+08: TOTAL:28884.6Mcy, MAX:4080.28cy, MIN:57.562cy, 16248.6 calls/Mcy exp(): ITERS:4.47604e+08: TOTAL:28796.2Mcy, MAX:207.721cy, MIN:62.385cy, 15543.9 calls/Mcy pow(): ITERS:1.63485e+08: TOTAL:28879.9Mcy, MAX:362.255cy, MIN:172.469cy, 5660.86 calls/Mcy sin(): ITERS:3.89578e+08: TOTAL:28900Mcy, MAX:704.859cy, MIN:47.583cy, 13480.2 calls/Mcy tan(): ITERS:7.0971e+07: TOTAL:28902.2Mcy, MAX:1357.79cy, MIN:388.58cy, 2455.55 calls/Mcy After: cos(): ITERS:6.0014e+08: TOTAL:28875.9Mcy, MAX:364.283cy, MIN:45.716cy, 20783.4 calls/Mcy exp(): ITERS:5.48578e+08: TOTAL:28764.9Mcy, MAX:191.617cy, MIN:51.011cy, 19071.1 calls/Mcy pow(): ITERS:1.70013e+08: TOTAL:28873.6Mcy, MAX:689.522cy, MIN:163.989cy, 5888.18 calls/Mcy sin(): ITERS:4.64079e+08: TOTAL:28891.5Mcy, MAX:6959.3cy, MIN:36.189cy, 16062.8 calls/Mcy tan(): ITERS:7.2354e+07: TOTAL:28898.9Mcy, MAX:1295.57cy, MIN:380.698cy, 2503.7 calls/Mcy So the improvements are: cos: 27.9089% exp: 22.6919% pow: 4.01564% sin: 19.1585% tan: 1.96086% The downside of the change is that it will have an adverse performance impact on non-default rounding modes, but I think the tradeoff is justified.
2013-06-11Add exception information to math-tests.h and use it in libm-test.inc.Joseph Myers1-0/+18
2013-06-10Add rounding mode information to math-tests.h and use it in libm-test.inc.Joseph Myers1-0/+18
2013-06-07Avoid use of "register" as optimization hint.Joseph Myers1-2/+2
2013-06-06Fix leading whitespaces.Ondrej Bilka1-1/+1
2013-06-05Skip modifying exception mask and flags in SET_RESTORE_ROUND_53BITSiddhesh Poyarekar1-6/+6
We only need to set/restore rounding mode to ensure correct computation for non-default rounding modes.
2013-05-29Avoid crashing in LD_DEBUG when program name is unavailableSiddhesh Poyarekar1-0/+5
Resolves: #15465 The program name may be unavailable if the user application tampers with argc and argv[]. Some parts of the dynamic linker caters for this while others don't, so this patch consolidates the check and fallback into a single macro and updates all users.
2013-05-16Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).Ryan S. Arnold3-0/+4
2013-05-08Improve tgamma accuracy (bugs 2546, 2560, 5159, 15426).Joseph Myers1-0/+12
2013-05-07Declare _dl_skip_args in ldsodefs.h header.Roland McGrath1-0/+10
2013-05-06Flesh out stub not-cancel.h file.Roland McGrath1-0/+8
2013-04-25Get rid of __STDC_FORMAT_MACROS, __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROSPaul Pluzhnikov2-20/+0
2013-04-02New <math.h> macro named issignaling to check for a signaling NaN (sNaN).Thomas Schwinge1-0/+6
It is based on draft TS 18661 and currently enabled as a GNU extension.
2013-03-28Make _dl_phdr pointer to const.Roland McGrath1-1/+1
2013-03-28Consolidate declarations of _dl_phdr, _dl_phnum.Roland McGrath1-0/+6
2013-03-21On 32-bit x86, disable certain tests involving sNaN values.Thomas Schwinge1-0/+36
Follow-up to commit 495ded2c8c1eb8c0ac4b54add2dd397852e19cba.
2013-03-15Move _dl_non_dynamic_init, _dl_aux_init declarations.Roland McGrath1-0/+7
2013-03-06Remove powerpc64 bounded-pointers code.Joseph Myers1-25/+0
2013-03-01Fix NEED_DL_SYSINFO_DSO conditionals.Roland McGrath1-1/+1
2013-02-18unify xmalloc prototypes & friendsMike Frysinger1-7/+1
These prototypes are duplicated in many places. Add a dedicated header for holding prototypes for program-specific functions to avoid that. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-02-18New function _dl_find_dso_for_objectSiddhesh Poyarekar1-0/+4
Consolidate code to search for an address within a DSO.
2013-02-13Remove __ptrvalue, __bounded and __unbounded.Joseph Myers1-2/+2
2013-02-08Remove CHECK_N and bp-checks.h.Joseph Myers1-49/+0
2013-02-08ARM: Support loading unmarked objects from cache.Carlos O'Donell1-0/+1
ARM now supports loading unmarked objects from the dynamic loader cache. Unmarked objects can be used with the hard-float or soft-float ABI. We must support loading unmarked objects during the transition period from a binutils that does not mark objects to one that does mark them with the correct ELF flags. Signed-off-by: Carlos O'Donell <carlos@redhat.com>
2013-02-08Remove CHECK_1 and CHECK_1_NULL_OK.Joseph Myers1-7/+0
2013-02-08Remove CHECK_BOUNDS_LOW and CHECK_BOUNDS_HIGH for C code.Joseph Myers1-12/+0
2013-02-05Add missing includes to sysdeps/generic/malloc-sysdep.h.Roland McGrath1-0/+3
2013-02-04Remove CHECK_STRING, CHECK_STRING_NULL_OK and __ubp_memchr.Joseph Myers1-16/+0
2013-02-01Remove BOUNDED_N and BOUNDED_1.Joseph Myers1-10/+0
2013-02-01Remove bp-start.h and INIT_ARGV_and_ENVIRON.Joseph Myers1-71/+0
2013-01-31Remove CHECK_IOCTL, CHECK_FCNTL and CHECK_N_PAGES.Joseph Myers1-27/+0
2013-01-31Remove CHECK_SIGSET and CHECK_SIGSET_NULL_OK.Joseph Myers1-7/+0
2013-01-31Remove bp-semctl.h and CHECK_SEMCTL.Joseph Myers1-66/+0
2013-01-31Remove bp-thunks code.Joseph Myers1-69/+0
2013-01-10Use __extension__ with long long in installed headers.Joseph Myers1-2/+2
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers78-83/+78
2013-01-01Add script to update copyright notices and reformat some to facilitate its use.Joseph Myers1-2/+1
2012-12-06Fix warnings from generic _FPU_GETCWChris Metcalf1-3/+3
2012-12-04Fix sparc build with older compilers.David S. Miller1-1/+6
* sysdeps/generic/memcopy.h: Add multiple inclusion protection.
2012-11-27Fix strict-aliasing warnings from unwind-dw2-fde.c.Joseph Myers1-9/+18
2012-11-22Mark unwind-dw2-fde-glibc.c variable possibly unused.Joseph Myers1-2/+3
2012-11-19Add ldconfig cache tag handling for AArch64Steve McIntyre1-0/+1
* sysdeps/generic/ldconfig.h (FLAG_AARCH64_LIB64): New macro. * elf/cache.c (print_entry): Print ",AArch64" for FLAG_AARCH64_LIB64. Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org> Reviewed-by: Carlos O'Donell <carlos@systemhalted.org>
2012-11-19Add ldconfig cache tag handling for ARM hard-float ABISteve McIntyre1-1/+2
* sysdeps/generic/ldconfig.h (FLAG_ARM_LIBHF): New macro. * elf/cache.c (print_entry): Print ",hard-float" for FLAG_ARM_LIBHF. Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org> Reviewed-by: Carlos O'Donell <carlos@systemhalted.org>
2012-11-04generic paths.h: remove old paths from _PATH_STDPATHPino Toscano1-1/+1
Remove /usr/contrib/bin and /usr/old/bin from _PATH_STDPATH, since they seem to be part only of old BSDs, Solaris and HP-UX.