about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* malloc: Simplify static malloc interposition [BZ #20432]Florian Weimer2016-08-2615-160/+706
| | | | | | | | Existing interposed mallocs do not define the glibc-internal fork callbacks (and they should not), so statically interposed mallocs lead to link failures because the strong reference from fork pulls in glibc's malloc, resulting in multiple definitions of malloc-related symbols.
* Fix test-skeleton C99 designed initializationAdhemerval Zanella2016-08-262-1/+6
| | | | | | | | | | | | | | | | | | | | | ISO C forbids empty initializer braces (6.7.9 initializer-list must contain at least one initializer). However GCC allows it, generating a warning depending of the version. With GCC 4.8 on ARM I noticed tst-initializers1.c fails to build with: In file included from tst-initializers1.c:60:0: ../test-skeleton.c: In function 'delayed_exit_thread': ../test-skeleton.c:687:10: error: missing initializer for field 'tv_sec' of 'struct timespec' [-Werror=missing-field-initializers] struct timespec remaining = {} While with GCC 5.1 the same warning is just spilled with -pedantic. To be safe this patch just zero initialize the struct as expected. Tested on armhf. * test-skeleton.c (delayed_exit_thread): Add initializer on struct timespec C99 designated initialization.
* Correct incorrect bug number in changelogFlorian Weimer2016-08-261-1/+1
|
* nptl: Avoid expected SIGALRM in most tests [BZ #20432]Florian Weimer2016-08-2615-101/+293
| | | | | | | | | | Before this change, several tests did not detect early deadlocks because they used SIGALRM as the expected signal, and they ran for the full default TIMEOUT seconds. This commit adds a new delayed_exit function to the test skeleton, along with several error-checking wrappers to pthread functions. Additional error checking is introduced into several tests.
* X86-64: Correct CFA in _dl_runtime_resolveH.J. Lu2016-08-262-0/+8
| | | | | | | | | When stack is re-aligned in _dl_runtime_resolve, there is no need to adjust CFA when allocating register save area on stack. * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve): Don't adjust CFA when allocating register save area on re-aligned stack.
* string: More tests for strcmp, strcasecmp, strncmp, strncasecmpFlorian Weimer2016-08-263-1/+218
|
* Reduce memory size of tsearch red-black tree.Mark Wielaard2016-08-252-153/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A tsearch red-black tree node contains 3 pointers (key, left, right) and 1 bit to hold the red-black flag. When allocating new nodes this 1 bit is expanded to a full word. Causing the overhead per node to be 3 times the key size. We can reduce this overhead to just 2 times the key size. malloc returns naturally aligned memory. All nodes are internally allocated with malloc and the left/right node pointers are used as implementation details. So we can use the low bits of the left/right node pointers to store extra information. Replace all direct accesses of the struct node_t node pointers and red-black value with defines that take care of the red-black flag in the low bit of the (left) node pointer. This reduces the size of the nodes on 32-bit systems from 16 to 12 bytes and on 64-bit systems from 32 to 24 bytes. Also fix a call to CHECK_TREE so the code can be build (and tested) with DEBUGGING defined again. V2 changes: - Add assert after malloc to catch any odd pointers from bad interposed mallocs. - Rename implementation flag to USE_MALLOC_LOW_BIT. ChangeLog: * misc/tsearch.c (struct node_t): Reduce to 3 pointers if USE_MALLOC_LOW_BIT. Define pointer/value accessors. (check_tree_recurse): Use newly defined accessors. (check_tree): Likewise. (maybe_split_for_insert): Likewise. (__tfind): Likewise. (__tdelete): Likewise. (trecurse): Likewise. (tdestroy_recurse): Likewise. (__tsearch): Likewise. And add asserts for malloc alignment. (__twalk): Cast root to node in case CHECK_TREE is defined.
* localedata: lt_LT: use hyphens in d_fmt [BZ #20497]Ernestas Kulik2016-08-242-1/+6
| | | | | | | The standard currently in effect (LST ISO 8601:1997) mandates the use of hyphens (as opposed to full stops, currently) in date formats. It also matches current CLDR data (v29), Wikipedia's & Wikia's settings, and Microsoft's Lithuanian Style Guide.
* mach: Add more allowed external headersSamuel Thibault2016-08-212-1/+5
| | | | * scripts/check-local-headers.sh (exclude): Add mach_debug/.
* Convert _Complex tangent functions to generated codePaul E. Murphy2016-08-1930-1860/+246
| | | | | | This converts s_c{,a}tan{,h}{f,,l} into a single templated file c{,a}tan{,h}_template.c with the exception of alpha.
* Prepare to convert _Complex tangent functionsPaul E. Murphy2016-08-195-0/+545
| | | | | | | This patch has no function changes, except to ensure the git history correctly tracks the changes to convert the double version of these functions into a templated version.
* Convert _Complex sine functions to generated codePaul E. Murphy2016-08-1940-2354/+303
| | | | | Refactor s_c{,a}sin{,h}{f,,l} into a single templated macro.
* Prepare to convert _Complex sine functionsPaul E. Murphy2016-08-196-0/+694
| | | | | | | This patch has no function changes, except to ensure the git history correctly tracks the changes to convert the double version of these functions into a templated version.
* X86: Change bit_YMM_state to (1 << 2)H.J. Lu2016-08-192-1/+5
| | | | | | | All other state bits, except for bit_YMM_state, are defined as (1 << N). This patch changes bit_YMM_state from (2 << 1) to (1 << 2). * sysdeps/x86/cpu-features.h (bit_YMM_state): Set to (1 << 2).
* Merge common usage of mul_split functionPaul E. Murphy2016-08-1914-346/+146
| | | | | | | | | | | A number of files share identical code for the mul_split function. This moves the duplicated function mul_split into its own header, and refactors the fma usage into a single selection macro. Likewise, mul_split when used by a long double implementation is renamed mul_splitl for clarity.
* Convert _Complex cosine functions to generated codePaul E. Murphy2016-08-1933-1162/+174
| | | | | | This is fairly straight fowards. m68k overrides are updated to use the framework, and thus are simplified a bit.
* Prepare to convert _Complex cosine functionsPaul E. Murphy2016-08-195-0/+346
| | | | | | | This patch has no function changes, except to ensure the git history correctly tracks the changes to convert the double version of these functions into a templated version.
* Add tst-wcstod-roundPaul E. Murphy2016-08-195-199/+303
| | | | | | This extends tst-strtod-round with a few trivial changes to also test the wide character variants of strto* using similar macros to other shared tests.
* Add tests for fortification of bcopy and bzero.Zack Weinberg2016-08-192-0/+65
| | | | * debug/tst-chk1.c: Add tests for fortification of bcopy and bzero.
* Fix incorrect double-checked locking related to _res_hconf.initialized.Torvald Riegel2016-08-186-7/+23
| | | | | | | | | | | | | | | | | | _res_hconf.initialized was not suitable for use in a multi-threaded environment due to the lack of atomics and memory barriers. Use of it was also unnecessary because _res_hconf_init did the right thing by using __libc_once. This patch fixes the glibc-internal uses by just calling _res_hconf_init unconditionally, and switches to a release MO atomic store for _res_hconf.initialized to fix the glibc side of the synchronization problem (which will maintain backward compatibility, but cannot fix the lack of acquire MO on any glibc-external loads). [BZ #20477] * resolv/res_hconf.c (do_init): Use atomic access. * resolv/res_hconf.h: Add comments. * nscd/aicache.c (addhstaiX): Call _res_hconf_init unconditionally. * nss/getXXbyYY_r.c (REENTRANT_NAME): Likewise. * sysdeps/posix/getaddrinfo.c (gaih_inet): Likewise.
* Get rid of array-bounds warning in __kernel_rem_pio2[f] with gcc 6.1 -O3.Stefan Liebler2016-08-183-0/+27
| | | | | | | | | | | | | | | | | | On s390x I get the following werror when build with gcc 6.1 (or current gcc head) and -O3: ../sysdeps/ieee754/dbl-64/k_rem_pio2.c: In function ‘__kernel_rem_pio2’: ../sysdeps/ieee754/dbl-64/k_rem_pio2.c:254:18: error: array subscript is below array bounds [-Werror=array-bounds] for (k = 1; iq[jk - k] == 0; k++) ~~^~~~~~~~ I get the same error with sysdeps/ieee754/flt-32/k_rem_pio2f.c. This patch adds DIAG_* macros around it. ChangeLog: * sysdeps/ieee754/dbl-64/k_rem_pio2.c (__kernel_rem_pio2): Use DIAG_*_NEEDS_COMMENT macro to get rid of array-bounds warning. * sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f): Likewise.
* argp: Do not override GCC keywords with macros [BZ #16907]Florian Weimer2016-08-183-55/+14
| | | | | | | | | | | glibc provides fallback definitions already. It is not necessary to suppress warnings for unknown attributes because GCC does this automatically for system headers. This commit does not sync with gnulib because gnulib has started to use _GL_* macros in the header file, which are arguably in the gnulib implementation space and not suitable for an installed glibc header file.
* ldbl-128: Remove unused sqrtl declaration in e_asinl.cPaul E. Murphy2016-08-172-1/+5
| | | | | This did not alter compilation for s390x and aarch64 targets.
* Support for type-generic libm function implementations libmPaul E. Murphy2016-08-1733-373/+441
| | | | | | | | | | | | | | | | | | | | | | | This defines a new classes of libm objects. The <func>_template.c file which is used in conjunction with the new makefile hooks to derive variants for each type supported by the target machine. The headers math-type-macros-TYPE.h are used to supply macros to a common implementation of a function in a file named FUNC_template.c and glued togethor via a generated file matching existing naming in the build directory. This has the properties of preserving the existing override mechanism and not requiring any arcane build system twiddling. Likewise, it enables machines to override these files without any additional work. I have verified the built objects for ppc64, x86_64, alpha, arm, and m68k do not change in any meaningful way with these changes using the Fedora cross toolchains. I have verified the x86_64 and ppc64 changes still run.
* nptl/tst-once5: Reduce time to expected failureFlorian Weimer2016-08-172-0/+7
|
* Do not override objects in libc.a in other static libraries [BZ #20452]Florian Weimer2016-08-1714-1/+50
| | | | | With this change, we no longer add sysdep.o and similar objects which are present in libc.a to other static libraries.
* Fix soft-fp extended.h unpacking (GCC bug 77265).Joseph Myers2016-08-162-0/+10
| | | | | | | | | | | | | | | | | | | | | | | soft-fp unpacking for x86 "extended" fails to clear the implicit mantissa high bit that is explicit in that format, resulting in problems for operations that expect this bit to be clear in raw unpacked values. Specifically, the code for this format is used only for conversions to and from TFmode (__float128) in libgcc, where this issue results in GCC bug 77265, extension of long double infinity to __float128 wrongly produces a NaN. This patch fixes this by always masking out the implicit bit on unpacking, so that the results of unpacking meet the expectations of the rest of the soft-fp code for a normal IEEE format. Tested for x86_64 in libgcc in conjunction with a GCC testcase for this issue (this code isn't used in glibc, only in libgcc). * soft-fp/extended.h [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_E): Mask implicit bit out of unpacked value. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_EP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_EP): Likewise.
* Add fesetexcept: sparc.Joseph Myers2016-08-162-0/+33
| | | | | | This patch adds a SPARC version of fesetexcept. Untested. * sysdeps/sparc/fpu/fesetexcept.c: New file.
* Add fesetexcept: sh.Joseph Myers2016-08-162-0/+34
| | | | | | This patch adds an SH version of fesetexcept. Untested. * sysdeps/sh/sh4/fpu/fesetexcept.c: New file.
* Add fesetexcept: s390.Joseph Myers2016-08-162-0/+35
| | | | | | | This patch adds an S/390 version of fesetexcept. Tested and corrected by Stefan Liebler. * sysdeps/s390/fpu/fesetexcept.c: New file.
* Add fesetexcept: powerpc.Joseph Myers2016-08-164-0/+111
| | | | | | | | This patch adds PowerPC versions of fesetexcept. * sysdeps/powerpc/fpu/fesetexcept.c: New file. * sysdeps/powerpc/nofpu/fesetexcept.c: Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c: Likewise.
* Add fesetexcept: mips.Joseph Myers2016-08-162-0/+34
| | | | | | This patch adds a MIPS version of fesetexcept. * sysdeps/mips/fpu/fesetexcept.c: New file.
* Add fesetexcept: m68k.Joseph Myers2016-08-162-0/+33
| | | | | | This patch adds an M68K version of fesetexcept. Untested. * sysdeps/m68k/fpu/fesetexcept.c: New file.
* Add fesetexcept: ia64.Joseph Myers2016-08-162-0/+33
| | | | | | This patch adds an IA64 version of fesetexcept. Untested. * sysdeps/ia64/fpu/fesetexcept.c: New file.
* Add fesetexcept: hppa.Joseph Myers2016-08-162-0/+37
| | | | | | This patch adds an HPPA version of fesetexcept. Untested. * sysdeps/hppa/fpu/fesetexcept.c: New file.
* Add fesetexcept: arm.Joseph Myers2016-08-162-0/+40
| | | | | | This patch adds an ARM version of fesetexcept. * sysdeps/arm/fesetexcept.c: New file.
* Add fesetexcept: alpha.Joseph Myers2016-08-162-0/+33
| | | | | | This patch adds an Alpha version of fesetexcept. Untested. * sysdeps/alpha/fpu/fesetexcept.c: New file.
* Add fesetexcept: aarch64.Joseph Myers2016-08-162-0/+36
| | | | | | This patch adds an AArch64 version of fesetexcept. Untested. * sysdeps/aarch64/fpu/fesetexcept.c: New file.
* Add fesetexcept.Joseph Myers2016-08-1638-3/+419
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TS 18661-1 defines an fesetexcept function for setting floating-point exception flags without the side-effect of causing enabled traps to be taken. This patch series implements this function for glibc. The present patch adds the fallback stub implementation, x86 and x86_64 implementations, documentation, tests and ABI baseline updates. The remaining patches, some of them untested, add implementations for other architectures. The implementations generally follow those of the fesetexceptflag function. As for fesetexceptflag, the approach taken for architectures where setting flags causes enabled traps to be taken is to set the flags (and potentially cause traps) rather than refusing to set the flags and returning an error. Since ISO C and TS 18661 provide no way to enable traps, this is formally in accordance with the standards. The NEWS entry should be considered a placeholder, since this patch series is intended to be followed by further such series adding other TS 18661-1 features, so that the NEWS entry would end up looking more like * New <fenv.h> features from TS 18661-1:2014 are added to libm: the fesetexcept, fetestexceptflag, fegetmode and fesetmode functions, the femode_t type and the FE_DFL_MODE macro. with hopefully more such entries for other features, rather than having an entry for a single function in the end. I believe we have consensus for adding TS 18661-1 interfaces as per <https://sourceware.org/ml/libc-alpha/2016-06/msg00421.html>. Tested for x86_64, x86, mips64 (hard float, and soft float to test the fallback version), arm (hard float) and powerpc (hard float, soft float and e500). * math/fesetexcept.c: New file. * sysdeps/i386/fpu/fesetexcept.c: Likewise. * sysdeps/x86_64/fpu/fesetexcept.c: Likewise. * math/fenv.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (fesetexcept): New function declaration. * manual/arith.texi (fesetexcept): Document function. * math/Versions (fesetexcept): New libm symbol at version GLIBC_2.25. * math/Makefile (libm-support): Add fesetexcept. (tests): Add test-fesetexcept and test-fesetexcept-traps. * math/test-fesetexcept.c: New file. * math/test-fesetexcept-traps.c: Likewise. * sysdeps/nacl/libm.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
* Add CVE-2016-6323 missing from NEWS entryFlorian Weimer2016-08-161-1/+1
|
* Add NEWS entry for CVE-2016-6323Florian Weimer2016-08-162-1/+6
|
* nptl/tst-tls3-malloc: Force freeing of thread stacksFlorian Weimer2016-08-163-1/+21
| | | | | | | | It turns out that due to the reduced stack size in tst-tls3 and the (fixed) default stack cache size, allocated TLS variables are never freed, so the test coverage for tst-tls3-malloc is less than complete. This change increases the thread stack size for tst-tls3-malloc only, to make sure thread stacks and TLS variables are freed.
* arm: mark __startcontext as .cantunwind (bug 20435)Andreas Schwab2016-08-152-0/+13
| | | | | __startcontext marks the bottom of the call stack of the contexts created by makecontext.
* locales: et_EE: locale has wrong {p,n}_cs_precedes value [BZ #20459]Märt Põder2016-08-152-2/+9
| | | | | | | | According to "Requirements of information technology in Estonian language and cultural environment" the monetary symbol should be written after the amount number: https://www.evs.ee/products/evs-8-2008
* Add comment from sysdeps/powerpc/fpu/fraiseexcpt.c to fsetexcptflg.c.Joseph Myers2016-08-122-0/+4
| | | | | * sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Add comment from fraiseexcpt.c.
* Fix test-fexcept when "inexact" implicitly raised.Joseph Myers2016-08-122-2/+37
| | | | | | | | | | | | | | | | | | ISO C allows feraiseexcept to raise "inexact", in addition to the requested exceptions, when requested to raise "overflow" or "underflow". Testing on ARM and PowerPC e500 (where glibc's feraiseexcept has this property) showed that the new test-fexcept test failed to allow for this; this patch fixes it, by wrapping feraiseexcept to clear FE_INEXACT if implicitly raised and not raised before the call. (It would also be possible to do this with fesetexcept, which always affects exactly the requested flags, but this patch avoids making this fix depend on the fesetexcept changes.) Tested for x86_64, x86, arm and e500. * math/test-fexcept.c (feraiseexcept_exact): New function. (test_set): Call feraiseexcept_exact instead of feraiseexcept. (test_except): Likewise.
* Add missing reference to bug 20452Florian Weimer2016-08-111-0/+1
|
* Fix powerpc fesetexceptflag clearing FE_INVALID (bug 20455).Joseph Myers2016-08-102-1/+9
| | | | | | | | | | | | | | | | As shown by the test math/test-fexcept, the powerpc fesetexceptflag implementation fails to clear a previously set FE_INVALID flag, when that flag is clear in the saved exceptions and FE_INVALID is included in the mask of flags to restore, because it fails to mask out the sub-exceptions of FE_INVALID from the FPSCR state. This patch fixes the masking logic accordingly. Tested for powerpc. [BZ #20455] * sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Mask out all FE_INVALID sub-exceptions from FPSCR when FE_INVALID specified to be restored.
* Add tests for fegetexceptflag, fesetexceptflag.Joseph Myers2016-08-106-1/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that there was no meaningful test coverage for fegetexceptflag and fesetexceptflag (one test ensures that calls to them compile and link, but nothing to verify they work correctly). This patch adds tests for these functions. fesetexceptflag is meant to set the relevant exception flag bits to the saved state without causing enabled traps to be taken. On some architectures, it is not possible to set exception flag bits without causing enabled traps to occur. Such architectures need to define EXCEPTION_SET_FORCES_TRAP to 1 in their math-tests.h, as is done in this patch for powerpc. x86 avoids needing to define this because the traps resulting from setting exception bits don't occur until the next floating-point operation or fwait instruction. Tested for x86_64, x86 and powerpc. Note that test-fexcept fails for powerpc because of a pre-existing bug in fesetexceptflag for powerpc, which I'll fix separately. * math/test-fexcept-traps.c: New file. * math/test-fexcept.c: Likewise. * math/Makefile (tests): Add test-fexcept and test-fexcept-traps. * sysdeps/generic/math-tests.h (EXCEPTION_SET_FORCES_TRAP): New macro. * sysdeps/powerpc/math-tests.h [!__NO_FPRS__] (EXCEPTION_SET_FORCES_TRAP): Likewise.
* locales: en_CA: update d_fmt [BZ #9842]Martin Pitt2016-08-102-1/+6
| | | | | | | | | | | | | | | | | | | | The date format in en_CA/LC_TIME specifies the date format as "%d/%m/%y". However, it should be "%Y-%m-%d". This is the standard date format in Canada as specified by the Canadian Standards Association in CSA Z234.5:1989, which adopts the ISO 8601 standard. Here's the web page from the National Research Council of Canada citing ISO 8601 as the standard date/time format in Canada: http://www.nrc-cnrc.gc.ca/eng/services/time/faq/#Q8 International Standard ISO 8601 specifies numeric representations of date and time. The recommended full format is of the form 2001-12-31 23:59:28.73 UTC. The intent of this standard is to avoid confusion in international communications which can arise with the many different national notations. This format has the advantage that it permits dates to be readily sorted in chronological order by computer systems. Windows 8+ and OS X also switched to this format.