about summary refs log tree commit diff
path: root/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
* hurd: Fix pwritev*Samuel Thibault2018-01-071-0/+1
| | | | | | | | | 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-061-0/+2
| | | | | | | | | | | | `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-061-0/+2
| | | | | | | | | | | 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-061-0/+3
| | | | | | | | | | 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-061-0/+2
| | | | | | | | | | | | | | | 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-061-0/+15
| | | | | | | | | | | | | | | | | | | 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-061-0/+4
| | | | | | | | | | 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-061-0/+1
| | | | * posix/tst-glob_symlinks.c [!PATH_MAX]: Define PATH_MAX macro.
* i386: Regenerate libm-test-ulps for for gcc 7 on i686Samuel Thibault2018-01-061-0/+2
| | | | | * sysdeps/i386/fpu/libm-test-ulps: Regenerated for GCC 7 with "-O2 -march=i686".
* hurd: Fix build without NO_HIDDENSamuel Thibault2018-01-061-0/+4
| | | | | | * 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-061-0/+4
| | | | * sysdeps/mach/hurd/i386/jmp_buf-macros.h: New file.
* powerpc: Fix error message during relocation overflowTulio Magno Quites Machado Filho2018-01-051-0/+5
| | | | | | | | | | | | 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-051-0/+2
| | | | | 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-051-0/+3
| | | | | | | | | | | | | | | | | | 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-051-0/+6
| | | | | | | | | | | | | | | | | 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-051-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #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.
* Increase some test timeouts.Joseph Myers2018-01-041-0/+6
| | | | | | | | | 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-041-0/+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-041-0/+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-041-0/+8
| | | | | | 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-041-0/+25
| | | | | | | | | | 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.
* Mention CVE-2017-16997 in ChangeLogFlorian Weimer2018-01-041-0/+1
|
* hurd: Fix support/support_enter_mount_namespace.c buildSamuel Thibault2018-01-041-0/+5
| | | | | * support/support_enter_mount_namespace.c [!CLONE_NEWNS]: Do not include <sys/mount.h>.
* Improve math_errhandlingWilco Dijkstra2018-01-031-0/+5
| | | | | | | | | | | Currently math_errhandling is always set to MATH_ERRNO | MATH_ERREXCEPT even if -fno-math-errno is used. It is not defined at all when fast-math is used. Set it to 0 with fast-math - this is noncomforming but more useful than not define math_errhandling at all. Also take __NO_MATH_ERRNO__ into account and update comment. * math/math.h (math_errhandling): Set to 0 with __FAST_MATH__. Add __NO_MATH_ERRNO__ check.
* Update MIPS libm-test-ulps.Joseph Myers2018-01-021-0/+5
| | | | | * sysdeps/mips/mips32/libm-test-ulps: Update. * sysdeps/mips/mips64/libm-test-ulps: Likewise.
* misc/tst-pselect.c: Add copyright headerFlorian Weimer2018-01-021-0/+4
| | | | | | | The initial year is based on the date in the original ChangeLog entry (2006-01-21). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Simplify getrlimit64.cAurelien Jarno2018-01-021-0/+4
| | | | | | | Changelog: * sysdeps/unix/sysv/linux/alpha/getrlimit64.c (__old_getrlimit64): Drop __RLIM_T_MATCHES_RLIM64_T conditional as __old_getrlimit64 is never defined in that case.
* Fix typos in getrlimit64.c and setrlimit64.cAurelien Jarno2018-01-021-0/+9
| | | | | | | | | | Changelog: * sysdeps/unix/sysv/linux/alpha/getrlimit64.c: Fix a typo in the comment. * sysdeps/unix/sysv/linux/alpha/setrlimit64.c: Fix a typo in the comment. (settrlimit): Rename into setrlimit. (__sttrlimit): Rename into __setrlimit.
* Update powerpc-nofpu libm-test-ulps.Joseph Myers2018-01-021-0/+2
| | | | * sysdeps/powerpc/nofpu/libm-test-ulps: Update.
* Update ARM libm-test-ulps.Joseph Myers2018-01-021-0/+2
| | | | * sysdeps/arm/libm-test-ulps: Update.
* Reduce command length in regen-ulps.Joseph Myers2018-01-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | I found that "make regen-ulps" failed when building with unmodified GNU make 4.1, and an objdir /some/where/math/ longer than about 37 characters, because the list of tests in the "for run in $^" loop exceeded the Linux kernel's MAX_ARG_STRLEN limit (131072 bytes) on the length of a single argument passed to a command. Some GNU/Linux distributions have a patch to make to work around this limit (see e.g. Debian bug 688601), but clearly this ought to work without needing such a patch. This patch arranges for the shell loop to be over the test names without a $(objdir) prefix, which reduces the space used to less than half MAX_ARG_STRLEN. (I think we ought to aim to get rid of bits/mathinline.h completely - filing GCC bugs for any optimizations GCC can't currently do with -ffast-math - which would mean we could halve the number of libm tests run because separate inline function tests would no longer be needed. However, with a long directory name even half the number of tests could make this command exceed MAX_ARG_STRLEN without my patch.) Tested regen-ulps on a system where it failed before this patch. * math/Makefile (run-regen-ulps): Add $(objpfx) to test name here. (regen-ulps): Use $(libm-tests) not $^ in shell loop.
* Update NEWS to add cosf and sincosf optimizationRajalakshmi Srinivasaraghavan2018-01-021-0/+4
|
* Remove alpha specific fmax, fmin to fix sNaN handling [BZ #22660]Aurelien Jarno2018-01-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Various fmax and fmin function implementations mishandle sNaN arguments: (a) When both arguments are NaNs, the return value should be a qNaN, but sometimes it is an sNaN if at least one argument is an sNaN. (b) Under TS 18661-1 semantics, if either argument is an sNaN then the result should be a qNaN (whereas if one argument is a qNaN and the other is not a NaN, the result should be the non-NaN argument). Various implementations treat sNaNs like qNaNs here. One way to fix that is to detect the sNaN and add a special case. That said there is no FPU instruction to do that, so it requires transfering the FP value to an integer register and testing bits. This becomes quite complicated so it's probably better to just use the generic versions of these functions which just do that through issignaling. Changelog: [BZ #22660] * sysdeps/alpha/fpu/s_fmax.S: Remove file. * sysdeps/alpha/fpu/s_fmaxf.S: Likewise. * sysdeps/alpha/fpu/s_fmin.S: Likewise. * sysdeps/alpha/fpu/s_fminf.S: Likewise.
* linux/arm: sync sys/ptrace.h with Linux 4.15 [BZ #22433]Dmitry V. Levin2018-01-011-0/+3
| | | | | | | | | | | | | Clone generic linux/sys/ptrace.h, remove x86-specific PTRACE_GETFPXREGS and PTRACE_SETFPXREGS constants, add the following arm-specific __ptrace_request constants: PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS, PTRACE_GET_THREAD_AREA, PTRACE_SET_SYSCALL, PTRACE_GETCRUNCHREGS, PTRACE_SETCRUNCHREGS, PTRACE_GETVFPREGS, PTRACE_SETVFPREGS, PTRACE_GETHBPREGS, PTRACE_SETHBPREGS, and PTRACE_GETFDPIC. Tested with strace. * sysdeps/unix/sysv/linux/arm/sys/ptrace.h: New file.
* elf: check for rpath emptiness before making a copy of itDmitry V. Levin2018-01-011-0/+5
| | | | | * elf/dl-load.c (decompose_rpath): Check for rpath emptiness before making a copy of it.
* Update miscellaneous files from upstream sources.Joseph Myers2018-01-011-0/+6
| | | | | | | | | | | | | This patch updates various files from their upstream sources. This brings in copyright date updates for some of those files. Tested for x86_64. * manual/texinfo.tex: Update to version 2017-12-26.21 with trailing whitespace removed. * scripts/config.guess: Update to version 2018-01-01. * scripts/config.sub: Update to version 2018-01-01. * scripts/move-if-change: Update from gnulib.
* Update copyright dates not handled by scripts/update-copyrights.Joseph Myers2018-01-011-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've updated copyright dates in glibc for 2018. This is the patch for the changes not generated by scripts/update-copyrights and subsequent build / regeneration of generated files. Please remember to include 2018 in the dates for any new files added in future (which means updating any existing uncommitted patches you have that add new files to use the new copyright dates in them). * NEWS: Update copyright dates. * catgets/gencat.c (print_version): Likewise. * csu/version.c (banner): Likewise. * debug/catchsegv.sh: Likewise. * debug/pcprofiledump.c (print_version): Likewise. * debug/xtrace.sh (do_version): Likewise. * elf/ldconfig.c (print_version): Likewise. * elf/ldd.bash.in: Likewise. * elf/pldd.c (print_version): Likewise. * elf/sotruss.sh: Likewise. * elf/sprof.c (print_version): Likewise. * iconv/iconv_prog.c (print_version): Likewise. * iconv/iconvconfig.c (print_version): Likewise. * locale/programs/locale.c (print_version): Likewise. * locale/programs/localedef.c (print_version): Likewise. * login/programs/pt_chown.c (print_version): Likewise. * malloc/memusage.sh (do_version): Likewise. * malloc/memusagestat.c (print_version): Likewise. * malloc/mtrace.pl: Likewise. * manual/libc.texinfo: Likewise. * nptl/version.c (banner): Likewise. * nscd/nscd.c (print_version): Likewise. * nss/getent.c (print_version): Likewise. * nss/makedb.c (print_version): Likewise. * posix/getconf.c (main): Likewise. * scripts/test-installation.pl: Likewise. * sysdeps/unix/sysv/linux/lddlibc4.c (main): Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-011-0/+7
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* Correct improper-inclusion check in bits/libio-ldbl.h.Zack Weinberg2017-12-311-0/+5
| | | | | | | | | | | The patch which moved libio.h proper into the bits directory also changed the name of its guard macro, and I neglected to check whether anything depended on that name. It turns out that there is a conditionally-used bits header that looks at it; this broke the libgcc build on at least sparc64-*-* and sparcv9-*-*. * libio/bits/libio-ldbl.h: Correct check for improper inclusion. Add own multiple include guard.
* elf: Check for empty tokens before dynamic string token expansion [BZ #22625]Aurelien Jarno2017-12-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | The fillin_rpath function in elf/dl-load.c loops over each RPATH or RUNPATH tokens and interprets empty tokens as the current directory ("./"). In practice the check for empty token is done *after* the dynamic string token expansion. The expansion process can return an empty string for the $ORIGIN token if __libc_enable_secure is set or if the path of the binary can not be determined (/proc not mounted). Fix that by moving the check for empty tokens before the dynamic string token expansion. In addition, check for NULL pointer or empty strings return by expand_dynamic_string_token. The above changes highlighted a bug in decompose_rpath, an empty array is represented by the first element being NULL at the fillin_rpath level, but by using a -1 pointer in decompose_rpath and other functions. Changelog: [BZ #22625] * elf/dl-load.c (fillin_rpath): Check for empty tokens before dynamic string token expansion. Check for NULL pointer or empty string possibly returned by expand_dynamic_string_token. (decompose_rpath): Check for empty path after dynamic string token expansion.
* linux/x86: sync sys/ptrace.h with Linux 4.14 [BZ #22433]Dmitry V. Levin2017-12-291-0/+3
| | | | | | | | | | Clone generic linux/sys/ptrace.h, add the following x86-specific __ptrace_request constants: PTRACE_GET_THREAD_AREA, PTRACE_SET_THREAD_AREA, PTRACE_ARCH_PRCTL, PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP, and PTRACE_SINGLEBLOCK. [BZ #22433] * sysdeps/unix/sysv/linux/x86/sys/ptrace.h: New file.
* linux: update sys/ptrace.h commentsDmitry V. Levin2017-12-291-0/+11
| | | | | | | | | | | | | * sysdeps/unix/sysv/linux/sys/ptrace.h (__ptrace_request): Add comments about PTRACE_PEEKSIGINFO, PTRACE_GETSIGMASK, PTRACE_SETSIGMASK, and PTRACE_SECCOMP_GET_FILTER. Update comments about PTRACE_SINGLESTEP and PTRACE_SYSCALL. * sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/ia64/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/s390/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/tile/sys/ptrace.h: Likewise.
* linux: move a shared part of sys/ptrace.h to bits/ptrace-shared.hDmitry V. Levin2017-12-291-0/+18
| | | | | | | | | | | | | | | | | | | | | Move a shared part of sys/ptrace.h which is the same on all architectures to a separate file. * sysdeps/unix/sysv/linux/sys/ptrace.h: Include <bits/ptrace-shared.h>. (__ptrace_setoptions, __ptrace_eventcodes, __ptrace_peeksiginfo_args, __ptrace_peeksiginfo_flags, ptrace): Move to ... * sysdeps/unix/sysv/linux/bits/ptrace-shared.h: ... new file. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add bits/ptrace-shared.h. * sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h: Include <bits/ptrace-shared.h>. (__ptrace_setoptions, __ptrace_eventcodes, __ptrace_peeksiginfo_args, __ptrace_peeksiginfo_flags, ptrace): Remove. * sysdeps/unix/sysv/linux/ia64/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/s390/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/tile/sys/ptrace.h: Likewise.
* scandir: fix wrong assumption about errno [BZ #17804]Aurelien Jarno2017-12-291-0/+6
| | | | | | | | | | | | | | | malloc and realloc may set errno to ENOMEM even if they are successful. The scandir code wrongly assume that they do not change errno, this causes scandir to fail with ENOMEM even if malloc succeed. The code already handles that readdir might set errno by calling __set_errno (0) to clear the error. Move that part at the end of the loop to also take malloc and realloc into account. Changelog: [BZ #17804] * dirent/scandir-tail.c (SCANDIR_TAIL): Move __set_errno (0) at the end of the loop. Improve comments.
* manual: clarify errno value on success [BZ #22615]Aurelien Jarno2017-12-291-0/+6
| | | | | | | | | | | | | The current glibc manual is ambiguous about the errno value on success and suggests that it is left unchanged. Some functions might and sometimes do change the errno value, however they never set it to 0. This patch from Zack Weinberg clarifies this section of the manual. Changelog: [BZ #22615] * manual/errno.texi (Checking for Errors): Explicitly say that errno might be set on success.
* tst-realloc: do not check for errno on success [BZ #22611]Aurelien Jarno2017-12-291-0/+6
| | | | | | | | | | | POSIX explicitly says that applications should check errno only after failure, so the errno value can be clobbered on success as long as it is not set to zero. Changelog: [BZ #22611] * malloc/tst-realloc.c (do_test): Remove the test checking that errno is unchanged on success.
* elf: remove redundant is_path argumentDmitry V. Levin2017-12-271-0/+7
| | | | | | | | | | | is_path argument is no longer used and could be safely removed. * elf/dl-dst.h (DL_DST_COUNT): Remove is_path argument, all callers updated. * elf/dl-load.c (is_dst, _dl_dst_count, _dl_dst_substitute, expand_dynamic_string_token): Likewise. * sysdeps/generic/ldsodefs.h (_dl_dst_count, _dl_dst_substitute): Remove is_path argument.
* elf: remove redundant code from is_dstDmitry V. Levin2017-12-271-0/+3
| | | | | | | | | | | | | | | | | is_dst is called either by _dl_dst_count or by _dl_dst_substitute. _dl_dst_count is called by DL_DST_COUNT only. DL_DST_COUNT is called either by expand_dst with is_path == 0 or by expand_dynamic_string_token. _dl_dst_substitute is called either from expand_dst with is_path == 0 or from expand_dynamic_string_token. The latter function is called either from _dl_map_object with is_path == 0 or from fillin_rpath with is_path == 1 and name containing no ':'. In any case (is_path && name[i] == ':') is always false and all code depending on it can be safely removed. * elf/dl-load.c (is_dst): Remove checks that is_path is set and name contains ':', and all code depending on these checks.
* elf: remove redundant code from _dl_dst_substituteDmitry V. Levin2017-12-271-0/+5
| | | | | | | | | | | | | | There are just two users of _dl_dst_substitute: one is expand_dst that sets is_path argument to 0, another one is expand_dynamic_string_token. The latter function also has just two users: one is _dl_map_object that sets is_path argument to 0, another one is fillin_rpath that sets is_path argument to 1 and name argument contains no ':'. In any case (is_path && name[i] == ':') is always false and all code depending on it can be safely removed. * elf/dl-load.c (_dl_dst_substitute): Remove checks that is_path is set and name contains ':', and all code depending on these checks.