about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* libnsl: Do not install libnsl.so, libnsl.a if NIS is disabled [BZ #22701]Florian Weimer2018-01-122-1/+16
| | | | | | This also skips building the .o files for libnsl.a. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* hu_HU locale: Avoid double space (bug 22657).Egmont Koblinger2018-01-122-2/+10
| | | | | | | | | | | | | | | | | | | | | | | The current date format prefixes one-digit days with a space, resulting in ugly two spaces: $ LC_ALL=hu_HU.UTF-8 date 2018. jan. 1., hétfő, 21:25:35 CET ^^ The official orthography rules doesn't contain an explicit rule about this (which already gives no sane reason for double space), and an implicit example of "1848. március 9." under bullet point 296 at http://helyesiras.mta.hu/helyesiras/default/akh12 contains a single space only. It's sure not convincing on an HTML page, but I confirm that the official book edition (e.g. https://www.libri.hu/en/konyv/a-magyar-helyesiras-szabalyai-32.html) also contains a single space there. [BZ #22657] * localedata/locales/hu_HU (d_t_fmt): Avoid a leading space before the day number which may produce a double space. (date_fmt): Likewise.
* Fix s390 linknamespace fallout of bug 22702 patch.Joseph Myers2018-01-122-1/+6
| | | | | | | | | | | | | | | My fix for bug 22702 introduced linknamespace test failures on s390x-linux-gnu and s390-linux-gnu because it made remainder call __feholdexcept, and the s390 __feholdexcept calls fegetenv, and remainder is in Unix98 and XPG4.2 but fegetenv isn't. This patch makes __feholdexcept call __fegetenv instead to avoid that namespace issue. Tested (compilation) with build-many-glibcs.py for s390x-linux-gnu, where it resolves the test failures. * sysdeps/s390/fpu/feholdexcpt.c (__feholdexcept): Call __fegetenv instead of fegetenv.
* Make default libc_feholdsetround_noex_ctx use __feholdexcept (bug 22702).Joseph Myers2018-01-112-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For soft-float powerpc, the math/test-nearbyint-except-2 test fails because nearbyintl traps when traps on "inexact" are enabled on entry (and an "inexact" exception is generated internally, though cleared for the final return). The problem is the default implementation of libc_feholdsetround_noex_ctx, which does not disable exception traps. There is some ambiguity about whether the *noex* interfaces are required to do so or only permitted to do so. But given that we support fe* interfaces to enable and disable traps (on architectures with that functionality), functions that must not raise an exception (must not leave the flag set on exit if not set on entry) should also not trap on it when traps on that exception are enabled. So it is appropriate to define these interfaces to have the feholdexcept effect of disabling exception traps; this patch updates the default implementation and comments accordingly. At least some architecture versions already disable traps; there are few uses of the *noex* interfaces at all, and while it's possible there are bugs on any architecture versions failing to disable traps that appear in the exp2 and remainder implementations, there are currently no tests, other than this one for nearbyintl (where only the ldbl-128ibm implementation uses SET_RESTORE_ROUND_NOEX), that would fail as a result of such a bug. (Hard-float powerpc does disable traps here, hence the nearbyintl failure not appearing there.) Tested for powerpc (soft-float). This brings that configuration to clean math/ test results, provided you build with GCC 8 to get the fix for GCC bug 64811. [BZ #22702] * sysdeps/generic/math_private.h (libc_feresetround_noex): Update comment to say exceptions are discarded. (libc_feholdsetround_noex_ctx): Use __feholdexcept instead of __fegetenv. (SET_RESTORE_ROUND_NOEX): Update comment to say non-stop mode must be enabled.
* csu: Update __libgcc_s_init commentFlorian Weimer2018-01-112-2/+11
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Add tst-minstack-cancel, tst-minstack-exit [BZ #22636]Florian Weimer2018-01-114-1/+101
| | | | | | | | | | | | | I verified that without the guard accounting change in commit 630f4cc3aa019ede55976ea561f1a7af2f068639 (Fix stack guard size accounting) and RTLD_NOW for libgcc_s introduced by commit f993b8754080ac7572b692870e926d8b493db16c (nptl: Open libgcc.so with RTLD_NOW during pthread_cancel), the tst-minstack-cancel test fails on an AVX-512F machine. tst-minstack-exit still passes, and either of the mentioned commit by itself frees sufficient stack space to make tst-minstack-cancel pass, too. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Fix ldbl-128ibm log1pl (-qNaN) spurious "invalid" exception (bug 22693).Joseph Myers2018-01-102-2/+8
| | | | | | | | | | | | | | | The ldbl-128ibm implementation of log1pl does ordered comparisons on a negative qNaN argument, so resulting in spurious "invalid" exceptions (for soft-float powerpc; hard-float only avoids this because of GCC bug 58684 meaning ordered comparison instructions never get generated). This patch fixes this by arranging for the test for NaN or infinity arguments to handle negative arguments as well. Tested for powerpc (soft float). [BZ #22693] * sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Handle negative arguments in test for NaN or infinity argument.
* Regenerate libc.potDmitry V. Levin2018-01-102-530/+534
|
* nptl: Open libgcc.so with RTLD_NOW during pthread_cancel [BZ #22636]Florian Weimer2018-01-102-1/+7
| | | | | | | | | Disabling lazy binding reduces stack usage during unwinding. Note that RTLD_NOW only makes a difference if libgcc.so has not already been loaded, so this is only a partial fix. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* hurd: Implement faccessat without AT_EACCESS flagSamuel Thibault2018-01-107-194/+218
| | | | | | | | | | | | | | | | | | | | | | * hurd/hurd/fd.h: Include <fcntl.h> (__hurd_at_flags): New function. * hurd/lookup-at.c (__file_name_lookup_at): Replace flag computation with call to __hurd_at_flags. * include/unistd.h (__faccessat, __faccessat_noerrno): Add declaration. * sysdeps/mach/hurd/access.c (access_common): Move implementation to __faccessat (hurd_fail_seterrno, hurd_fail_noerrno): Move to sysdeps/mach/hurd/faccessat.c. (__access_noerrno): Use __faccessat_common instead of access_common. (__access): Likewise. * sysdeps/mach/hurd/euidaccess.c (__euidaccess): Replace implementation with a call to __faccessat. * sysdeps/mach/hurd/faccessat.c (faccessat): Rename into... (__faccessat_common): ... this. Move implementation of __access into it when AT_FLAGS does not contain AT_EACCESS. Make it call __hurd_at_flags, add reauthenticate_cwdir_at helper to implement AT mechanism. (__faccessat_noerrno): New function, just calls __faccessat_common. (__faccessat): New function, just calls __faccessat_common. (faccessat): Define weak alias.
* Fix powerpc-nofpu fmaxmagl, fminmagl spurious "invalid" exception (bug 22691).Joseph Myers2018-01-102-0/+7
| | | | | | | | | | | | | | For soft-float powerpc, fmaxmagl and fminmagl generate spurious "invalid" exceptions for quiet NaN arguments. This is another case of the problems with fabsl inline expansion via comparisons, and so is fixed by building those functions with -fno-builtin-fabsl. Tested for powerpc (soft-float). [BZ #22691] * sysdeps/powerpc/nofpu/Makefile [$(subdir) = math] (CFLAGS-s_fmaxmagl.c): New variable. [$(subdir) = math] (CFLAGS-s_fminmagl.c: Likewise.
* Fix ldbl-128ibm lrintl, lroundl missing "invalid" exceptions (bug 22690).Joseph Myers2018-01-103-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ldbl-128ibm implementations of lrintl and lroundl are missing "invalid" exceptions for certain overflow cases when compiled with GCC 8. The cause of this is after-the-fact integer overflow checks that fail when the compiler optimizes on the basis of integer overflow being undefined; GCC 8 must be able to detect new cases of undefinedness here. Failure: lrint (-0x80000001p0): Exception "Invalid operation" not set Failure: lrint_downward (-0x80000001p0): Exception "Invalid operation" not set Failure: lrint_towardzero (-0x80000001p0): Exception "Invalid operation" not set Failure: lrint_upward (-0x80000001p0): Exception "Invalid operation" not set Failure: lround (-0x80000001p0): Exception "Invalid operation" not set Failure: lround_downward (-0x80000001p0): Exception "Invalid operation" not set Failure: lround_towardzero (-0x80000001p0): Exception "Invalid operation" not set Failure: lround_upward (-0x80000001p0): Exception "Invalid operation" not set (Tested that these failures occur before the patch for powerpc soft-float, but the issue applies in principle for hard-float as well, whether or not the particular optimizations in fact occur there at present.) This patch fixes the bug by ensuring the additions / subtractions in question cast arguments to unsigned long int, or use 1UL as a constant argument, so that the arithmetic occurs in an unsigned type with the result then converted back to a signed type. Tested for powerpc (soft-float). [BZ #22690] * sysdeps/ieee754/ldbl-128ibm/s_lrintl.c (__lrintl): Use unsigned long int for arguments of possibly overflowing addition or subtraction. * sysdeps/ieee754/ldbl-128ibm/s_lroundl.c (__lroundl): Likewise.
* Fix powerpc-nofpu remainderl wrong sign of zero result (bug 22688).Joseph Myers2018-01-092-0/+5
| | | | | | | | | | | | | For soft-float powerpc, the remainderl function produces zero results with the wrong sign for various inputs. This is another instance of the problem with incorrect built-in fabsl expansion, so is fixed by this patch using -fno-builtin-fabsl for this function. Tested for powerpc (soft-float). [BZ #22688] * sysdeps/powerpc/nofpu/Makefile [$(subdir) = math] (CFLAGS-e_remainderl.c): New variable.
* Fix powerpc-nofpu complex long double functions spurious "invalid" exception ↵Joseph Myers2018-01-092-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (bug 22687). For soft-float powerpc, various _Complex long double functions generate spurious "invalid" exceptions, even with a compiler with GCC bug 64811 fixed. The problem is GCC's built-in fabsl expansion. Various files are already built with -fno-builtin-fabsl because in this case (IBM long double, for soft-float or e500v1) a fallback fabsl expansion based on comparisons is used, which can produce the wrong sign of a zero result. Those comparisons can also produce spurious exceptions for NaN arguments. Furthermore, __builtin_fpclassify implemently uses __builtin_fabsl, and is unaffected by -fno-builtin-fabsl, and the fpclassify macro uses __builtin_fpclassify in the absence of -fsignaling-nans. Thus, this patch arranges for the problem files using fpclassify to be built with -fsignaling-nans in this case, to avoid spurious exceptions from fpclassify. Tested for powerpc (soft-float). [BZ #22687] * sysdeps/powerpc/nofpu/Makefile (CFLAGS-s_cacosl.c): New variable. (CFLAGS-s_cacoshl.c): Likewise. (CFLAGS-s_casinhl.c): Likewise. (CFLAGS-s_catanl.c): Likewise. (CFLAGS-s_catanhl.c): Likewise. (CFLAGS-s_cexpl.c): Likewise. (CFLAGS-s_ccoshl.c): Add -fsignaling-nans. (CFLAGS-s_csinhl.c): Likewise. (CFLAGS-s_clogl.c): Likewise. (CFLAGS-s_clog10l.c): Likewise. (CFLAGS-s_csinl.c): Likewise. (CFLAGS-s_csqrtl.c): Likewise.
* hurd: Use the new file_exec_paths RPCSamuel Thibault2018-01-097-32/+167
| | | | | | | | | | | | | | | | | | | | | | From: Emilio Pozuelo Monfort <pochu27@gmail.com> From: Svante Signell <svante.signell@gmail.com> Pass the file paths of executable to the exec server, both relative and absolute, which exec needs to properly execute and avertise #!-scripts. Previously, the exec server tried to guess the name from argv[0] but argv[0] only contains the executable name by convention. * hurd/hurdexec.c (_hurd_exec): Deprecate function. (_hurd_exec_paths): New function. * hurd/hurd.h (_hurd_exec): Deprecate function. (_hurd_exec_paths): Declare function. * hurd/Versions: Export _hurd_exec_paths. * sysdeps/mach/hurd/execve.c: Include <stdlib.h> and <stdio.h> (__execve): Use __getcwd to build absolute path, and use _hurd_exec_paths instead of _hurd_exec. * sysdeps/mach/hurd/spawni.c: Likewise. * sysdeps/mach/hurd/fexecve.c: Use _hurd_exec_paths instead of _hurd_exec.
* tst-ttyname: skip the test when /dev/ptmx is not availableDmitry V. Levin2018-01-082-1/+13
| | | | | * sysdeps/unix/sysv/linux/tst-ttyname.c (do_in_chroot_1): Skip the test instead of failing in case of ENOENT returned by posix_openpt.
* resolv: Support binary labels in test frameworkFlorian Weimer2018-01-084-133/+302
| | | | | | | | | | The old implementation based on hsearch_r used an ad-hoc C string encoding and produced an incorrect format on the wire for domain names which contained bytes which needed escaping when printed. This commit switches to ns_name_pton for the wire format conversion (now that we have separate tests for it) and uses a tsearch tree with a suitable comparison function to locate compression targets.
* support: Increase usability of TEST_COMPAREFlorian Weimer2018-01-084-32/+49
| | | | | | | | | | | | | | | | | | | | | The previous implementation of the TEST_COMPARE macro would fail to compile code like this: int ret = res_send (query, sizeof (query), buf, sizeof (buf)); TEST_COMPARE (ret, sizeof (query) + 2 /* Compression reference. */ + 2 + 2 + 4 + 2 /* Type, class, TTL, RDATA length. */ + 1 /* Pascal-style string length. */ + strlen (expected_name)); This resulted in a failed static assertion, "integer conversions may alter sign of operands". A user of the TEST_COMPARE would have to add a cast to fix this. This patch reverts to the original proposed solution of a run-time check, making TEST_COMPARE usable for comparisons of numbers with types with different signedness in more contexts.
* [BZ #22637] Fix stack guard size accountingSzabolcs Nagy2018-01-085-8/+21
| | | | | | | | | | | | | | | | | | | | | Previously if user requested S stack and G guard when creating a thread, the total mapping was S and the actual available stack was S - G - static_tls, which is not what the user requested. This patch fixes the guard size accounting by pretending the user requested S+G stack. This way all later logic works out except when reporting the user requested stack size (pthread_getattr_np) or when computing the minimal stack size (__pthread_get_minstack). Normally this will increase thread stack allocations by one page. TLS accounting is not affected, that will require a separate fix. [BZ #22637] * nptl/descr.h (stackblock, stackblock_size): Update comments. * nptl/allocatestack.c (allocate_stack): Add guardsize to stacksize. * nptl/nptl-init.c (__pthread_get_minstack): Remove guardsize from stacksize. * nptl/pthread_getattr_np.c (pthread_getattr_np): Likewise.
* x86-64: Add sincosf with vector FMAH.J. Lu2018-01-087-4/+288
| | | | | | | | | | | | | | | | | | | | | | | Since the x86-64 assembly version of sincosf is higly optimized with vector instructions, there isn't much room for improvement. However s_sincosf.c written in C with vector math and intrinsics can be optimized by GCC with FMA. On Skylake, bench-sincosf reports performance improvement: Assembly FMA improvement max 104.042 101.008 3% min 9.426 8.586 10% mean 20.6209 18.2238 13% * sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines): Add s_sincosf-sse2 and s_sincosf-fma. (CFLAGS-s_sincosf-fma.c): New. * sysdeps/x86_64/fpu/multiarch/s_sincosf-fma.c: New file. * sysdeps/x86_64/fpu/multiarch/s_sincosf-sse2.S: Likewise. * sysdeps/x86_64/fpu/multiarch/s_sincosf.c: Likewise. * sysdeps/x86_64/fpu/s_sincosf.S: Don't add alias if __sincosf is defined.
* nptl: Add test for callee-saved register restore in pthread_exitFlorian Weimer2018-01-083-2/+257
| | | | | | | | | | | | | | | | GCC PR 83641 results in a miscompilation of libpthread, which causes pthread_exit not to restore callee-saved registers before running destructors for objects on the stack. This test detects this situation: info: unsigned int, direct pthread_exit call tst-thread-exit-clobber.cc:80: numeric comparison failure left: 4148288912 (0xf741dd90); from: value right: 1600833940 (0x5f6ac994); from: magic_values.v2 info: double, direct pthread_exit call info: unsigned int, indirect pthread_exit call info: double, indirect pthread_exit call error: 1 test failures
* support: Define support_static_assert for use with C and C++Florian Weimer2018-01-082-9/+21
| | | | And update TEST_COMPARE to use it, to make it usable from C++.
* getrlimit64: fix for 32-bit configurations with default version >= 2.2Aurelien Jarno2018-01-072-0/+10
| | | | | | | | | | | | | | Commit 24731685 ("prlimit: Translate old_rlimit from RLIM64_INFINITY to RLIM_INFINITY") broken the getrlimit64 for 32-bit configurations which do no need the 2GiB limited compat getrlimit (default version >= 2.2). This patch fixes that by restoring the weak alias in that case. Changelog: * sysdeps/unix/sysv/linux/getrlimit64 (getrlimit64) [!__RLIM_T_MATCHES_RLIM64_T] [!SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)]: Define as weak alias of __getrlimit64. Add libc_hidden_weak.
* hurd: Fix pwritev*Samuel Thibault2018-01-072-1/+2
| | | | | | | | | This follows c45d78aac ('posix: Fix generic p{read,write}v buffer allocation (BZ#22457)'), which made pwritev to use __mmap instead of __posix_memalign, but didn't pass PROT_READ to it, while the pwrite() call does need to read the data we have just copied over. * sysdeps/posix/pwritev_common.c: Add PROT_READ to __mmap prot.
* Avoid race conditions when rebuilding librt.soPalmer Dabbelt2018-01-062-0/+6
| | | | | | | | | | | | `make check' sometimes triggers a rebuild of librt.so using nptl/Makefile, which ignores librt's dependence on libpthread. This causes the build to blow up when we attempt to run the test suite on RISC-V. 2018-01-06 Palmer Dabbelt <palmer@sifive.com> * nptl/Makefile (/librt.so): Always depend on "$(shared-thread-library)".
* Strip shared objects in subdirectories of libPalmer Dabbelt2018-01-062-1/+3
| | | | | | | | | | | The RISC-V port will have libraries in subdirectories of lib, like "lib64/lp64d". This adds support for stripping these installed libraries. 2018-01-06 Palmer Dabbelt <palmer@sifive.com> * scripts/build-many-glibcs.py (class Glibc): Strip shared objects in subdirectories of lib.
* Add linux-4.15 VDSO hash for RISC-VPalmer Dabbelt2018-01-062-0/+5
| | | | | | | | | | The RISC-V Linux port defines VDSO symbols 2018-01-06 Palmer Dabbelt <palmer@sifive.com> * sysdeps/unix/sysv/linux/dl-vdso.h (VDSO_NAME_LINUX_4_15): New define. (VDSO_HASH_LINUX_4_15): Likewise.
* Allow make-link-multidir to make subdirectoriesPalmer Dabbelt2018-01-062-0/+3
| | | | | | | | | | | | | | | The RISC-V Linux ABI doesn't define any libraries that go directly in lib, instead they go into lib32/ilp32 or lib64/lp64. This casuse make-link-multidir to fail when attempting to make library directories when building a static libc on multilib RISC-V systems. This patch uses scripts/mkinstalldirs to make the base directory of the target symlink of make-link-multidir. 2018-01-06 Palmer Dabbelt <palmer@sifive.com> * Makerules (make-link-multidir): Make directories before linking into them.
* Add RISC-V dynamic relocations to elf.hPalmer Dabbelt2018-01-062-0/+29
| | | | | | | | | | | | | | | | | | | These relocations can appear in shared objects on RISC-V ELF systems. 2018-01-06 Palmer Dabbelt <palmer@sifive.com> * elf/elf.h (R_RISCV_NONE): New define. (R_RISCV_32): Likewise. (R_RISCV_64): Likewise. (R_RISCV_RELATIVE): Likewise. (R_RISCV_COPY): Likewise. (R_RISCV_JUMP_SLOT): Likewise. (R_RISCV_TLS_DTPMOD32): Likewise. (R_RISCV_TLS_DTPMOD64): Likewise. (R_RISCV_TLS_DTPREL32): Likewise. (R_RISCV_TLS_DTPREL64): Likewise. (R_RISCV_TLS_TPREL32): Likewise. (R_RISCV_TLS_TPREL64): Likewise.
* hurd: Fix glob64 compatibility symbolsSamuel Thibault2018-01-064-3/+94
| | | | | | | | | | This follows ccf970c7a ('posix: Add compat glob symbol to not follow dangling symbols') by adding to gnu/ the same compatibility as for Linux. * sysdeps/gnu/glob64.c (__glob): Define macro instead of glob macro. (__glob64): Define GLIBC_2_27 versioned symbol instead of glob64. * sysdeps/gnu/glob-lstat-compat.c: New file. * sysdeps/gnu/glob64-lstat-compat.c: New file.
* hurd: Fix posix glob testSamuel Thibault2018-01-062-0/+4
| | | | * posix/tst-glob_symlinks.c [!PATH_MAX]: Define PATH_MAX macro.
* i386: Regenerate libm-test-ulps for for gcc 7 on i686Samuel Thibault2018-01-062-12/+14
| | | | | * sysdeps/i386/fpu/libm-test-ulps: Regenerated for GCC 7 with "-O2 -march=i686".
* hurd: Fix build without NO_HIDDENSamuel Thibault2018-01-063-0/+12
| | | | | | * sysdeps/i386/dl-tlsdesc.S (_dl_tlsdesc_dynamic) [NO_RTLD_HIDDEN]: Call JUMPTARGET (___tls_get_addr) instead of HIDDEN_JUMPTARGET (___tls_get_addr). * sysdeps/x86_64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Likewise.
* hurd: Add jmp_buf-macros.hSamuel Thibault2018-01-062-0/+10
| | | | * sysdeps/mach/hurd/i386/jmp_buf-macros.h: New file.
* powerpc: Fix error message during relocation overflowTulio Magno Quites Machado Filho2018-01-052-1/+9
| | | | | | | | | | | | The function _itoa_word() writes characters from the higher address to the lower address, requiring the destination string to reserve that size before calling it. * sysdeps/powerpc/powerpc64/dl-machine.c (_dl_reloc_overflow): Reserve 16 chars to reloc_addr before calling _itoa_word. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* resource/tst-getrlimit.c: Add copyright headerAurelien Jarno2018-01-052-0/+19
| | | | | The initial year is based on the date in the original ChangeLog entry (2005-06-21).
* Add test for getrlimit/setrlimit/prlimit with infinity valueAurelien Jarno2018-01-053-1/+178
| | | | | | | | | | | | | | | | | | Add a test to check that the getrlimit, setrlimit and prlimit functions and their 64-bit equivalent behave correctly with RLIM_INFINITY and RLIM64_INFINITY. For that it assumes that the prlimit64 function calls the syscall directly without translating the value and that the kernel uses the -1 value to represent infinity. It first finds a resource with the hard limit set to infinity so the soft limit can be manipulated easily and check for the consistency between the value set or get by the prlimit64 and the other functions. It is Linux specific add it uses the prlimit and prlimit64 functions. Changelog: * sysdeps/unix/sysv/linux/tst-rlimit-infinity.c: New file. * sysdeps/unix/sysv/linux/Makefile (tests): Add tst-rlimit-infinity.
* prlimit: Translate old_rlimit from RLIM64_INFINITY to RLIM_INFINITY [BZ #22678]Aurelien Jarno2018-01-052-6/+15
| | | | | | | | | | | | | | | | | prlimit called without a new value fails on 32-bit machines if any of the soft or hard limits are infinity. This is because prlimit does not translate old_rlimit from RLIM64_INFINITY to RLIM_INFINITY, but checks that the value returned by the prlimit64 syscall fits into a 32-bit value, like it is done for example in getrlimit. Note that on the other hand new_rlimit is correctly translated from RLIM_INFINITY to RLIM64_INFINITY before calling the syscall. This patch fixes that. Changelog: [BZ #22678] * sysdeps/unix/sysv/linux/prlimit.c (prlimit): Translate old_rlimit from RLIM64_INFINITY to RLIM_INFINITY.
* Alpha: Fix the RLIM_INFINITY and RLIM64_INFINITY constantsAurelien Jarno2018-01-058-63/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the RLIM_INFINITY and RLIM64_INFINITY constants on alpha to match the kernel one and all other architectures. Change the getrlimit, getrlimit64, setrlimit, setrlimit64 into old compat symbols, and provide the Linux generic functions as GLIBC_2_27 version. Changelog: * sysdeps/unix/sysv/linux/getrlimit64.c [USE_VERSIONED_RLIMIT]: Do not define getrlimit and getrlimit64 as weak aliases of __getrlimit64. Define __GI_getrlimit64 as weak alias of __getrlimit64. [__RLIM_T_MATCHES_RLIM64_T]: Do not redefine SHLIB_COMPAT, use #elif instead. * sysdeps/unix/sysv/linux/setrlimit64.c [USE_VERSIONED_RLIMIT]: Do not define setrlimit and setrlimit64 as weak aliases of __setrlimit64. * sysdeps/unix/sysv/linux/alpha/bits/resource.h (RLIM_INFINITY, RLIM64_INFINITY): Fix values to match the kernel ones. * sysdeps/unix/sysv/linux/alpha/getrlimit64.c: Define USE_VERSIONED_RLIMIT. Rename __getrlimit64 into __old_getrlimit64 and provide it as getrlimit@@GLIBC_2_0 and getrlimit64@@GLIBC_2_1. Add a __getrlimit64 function and provide it as getrlimit@@GLIBC_2_27 and getrlimit64@@GLIBC_2_27. * sysdeps/unix/sysv/linux/alpha/setrlimit64.c: Ditto with setrlimit and setrlimit64. * sysdeps/unix/sysv/linux/alpha/libc.abilist (GLIBC_2.27): Add getrlimit, setrlimit, getrlimit64 and setrlimit64. * sysdeps/unix/sysv/linux/alpha/Versions (libc): Add getrlimit, setrlimit, getrlimit64 and setrlimit64.
* Alpha: Add wrappers to get/setrlimit64 to fix RLIM64_INFINITY constant [BZ ↵Aurelien Jarno2018-01-053-0/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #22648] RLIM64_INFINITY was supposed to be a glibc convention rather than anything seen by the kernel, but it ended being passed to the kernel through the prlimit64 syscall. * On the kernel side, the value is defined for the prlimit64 syscall for all architectures in include/uapi/linux/resource.h: #define RLIM64_INFINITY (~0ULL) * On the kernel side, the value is defined for getrlimit and setrlimit in arch/alpha/include/uapi/asm/resource.h #define RLIM_INFINITY 0x7ffffffffffffffful * On the GNU libc side, the value is defined in sysdeps/unix/sysv/linux/alpha/bits/resource.h: # define RLIM64_INFINITY 0x7fffffffffffffffLL This was not an issue until the getrlimit and setrlimit glibc functions have been changed in commit 045c13d185 ("Consolidate Linux setrlimit and getrlimit implementation") to use the prlimit64 syscall instead of the getrlimit and setrlimit ones. This patch fixes that by adding a wrapper to fix the value passed to or received from the kernel, before or after calling the prlimit64 syscall. Changelog: [BZ #22648] * sysdeps/unix/sysv/linux/alpha/getrlimit64.c: New file. * sysdeps/unix/sysv/linux/alpha/setrlimit64.c: Ditto.
* NEWS: Deprecate static dlopenFlorian Weimer2018-01-051-0/+4
|
* NEWS: Deprecate direct access libio internalsFlorian Weimer2018-01-051-0/+27
|
* Increase some test timeouts.Joseph Myers2018-01-044-0/+9
| | | | | | | | | This patch increases timeouts on three tests I observed timing out on slow systems. * malloc/tst-malloc-tcache-leak.c (TIMEOUT): Define to 50. * posix/tst-glob-tilde.c (TIMEOUT): Define to 200. * resolv/tst-resolv-res_ninit.c (TIMEOUT): Define to 50.
* alpha: Remove s_trunc{f} implementation (BZ#22666)Adhemerval Zanella2018-01-043-89/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in libc-alpha [1], alpha trunc{f} implementation uses addt/suc and subt/suc and although the Alpha Architecture Handbook version 3 states that that ADDx SUBx OUTPUT Exceptions (B.3 Mapping to IEEE Standard) should not generate Inexact if INE bit is set, the Alpha 21264 [2] chip manual (A.8 IEEE Floating-Point Conformance) states that ADDx SUBx OUTPUT does generate inexact exception for inexact result regardless. As Joseph noted [3] to correctly fix it on alpha we need to either avoid the instruction or avoid any inexact bit from it being set on return from the function (while preserving the inexact bit that might be set on the entry to the function). The later will result mf_fpcr followed by a mt_fpcr to get and set the fpcr which will defeat the optimization itself. So the patch just remove the alpha optimized and rely on generic implementation. It fixes the math/test-*-{trunc} on alpha. [BZ #15479] [BZ #22666] * sysdeps/alpha/fpu/s_trunc.c: Remove file. * sysdeps/alpha/fpu/s_truncf.c: Likewise. [1] https://sourceware.org/ml/libc-alpha/2018-01/msg00114.html [2] https://www.star.bnl.gov/public/daq/HARDWARE/21264_data_sheet.pdf [3] https://sourceware.org/ml/libc-alpha/2018-01/msg00086.html Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* alpha: Remove s_ceil{f} and s_floor{f} implementation (BZ#22665)Adhemerval Zanella2018-01-045-210/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in libc-alpha [1], alpha ceil{f} and floor{f} implementation uses cvttq/svm and although the Alpha Architecture Handbook version 3 states that that CVTfi OUTPUT Exceptions (B.3 Mapping to IEEE Standard) should not generate Inexact if INE bit is set on fpcr, the Alpha 21264 [1] chip manual (A.8 IEEE Floating-Point Conformance) states that CVTfi and CVTif OUTPUT does generate inexact exception for inexact result regardless. As Joseph noted [2] to correctly fix it on alpha we need to either avoid the instruction or avoid any inexact bit from it being set on return from the function (while preserving the inexact bit that might be set on the entry to the function). The later will result mf_fpcr followed by a mt_fpcr to get and set the fpcr which will defeat the optimization itself. So the patch just remove the alpha optimized and rely on generic implementation. It fixes the math/test-*-{ceil,floor} on alpha. [BZ #15479] [BZ #22665] * sysdeps/alpha/fpu/s_ceil.c: Remove file. * sysdeps/alpha/fpu/s_ceilf.c: Likewise. * sysdeps/alpha/fpu/s_floor.c: Likewise. * sysdeps/alpha/fpu/s_floorf.c: Likewise. [1] https://www.star.bnl.gov/public/daq/HARDWARE/21264_data_sheet.pdf [2] https://sourceware.org/ml/libc-alpha/2018-01/msg00086.html Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* i386: In makecontext, align the stack before calling exit [BZ #22667]Florian Weimer2018-01-044-3/+263
| | | | | | Before this change, if glibc was compiled with SSE instructions and a sufficiently recent GCC, an unaligned stack access in __run_exit_handlers would cause stdlib/tst-makecontext to crash.
* elf: Support dlvsym within libc.soFlorian Weimer2018-01-049-6/+330
| | | | | | | | | | This commit adds a new _dl_open_hook entry for dlvsym and implements the function using the existing dl_lookup_symbol_x function supplied by the dynamic loader. A new hook variable, _dl_open_hook2, is introduced, which should make this change suitable for backporting: For old statically linked binaries, __libc_dlvsym will always return NULL.
* support_enter_mount_namespace: Fix indentationSamuel Thibault2018-01-041-1/+1
| | | | * support/support_enter_mount_namespace.c: Fix indentation.
* Mention CVE-2017-16997 in ChangeLogFlorian Weimer2018-01-041-0/+1
|
* hurd: Fix support/support_enter_mount_namespace.c buildSamuel Thibault2018-01-042-0/+7
| | | | | * support/support_enter_mount_namespace.c [!CLONE_NEWNS]: Do not include <sys/mount.h>.