1. Jan 06, 2018
    • Palmer Dabbelt's avatar
      Strip shared objects in subdirectories of lib · 9188997d
      Palmer Dabbelt authored
      The RISC-V port will have libraries in subdirectories of lib, like
      "lib64/lp64d".  This adds support for stripping these installed
      libraries.
      9188997d
    • Palmer Dabbelt's avatar
      Add linux-4.15 VDSO hash for RISC-V · c4d52d26
      Palmer Dabbelt authored
      The RISC-V Linux port defines VDSO symbols
      c4d52d26
    • Palmer Dabbelt's avatar
      Allow make-link-multidir to make subdirectories · e1891cce
      Palmer Dabbelt authored
      The RISC-V Linux ABI doesn't define any libraries that go directly in
      lib, instead they go into lib/ilp32 or lib/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.
      e1891cce
    • Palmer Dabbelt's avatar
      Add RISC-V dynamic relocations to elf.h · fca7152c
      Palmer Dabbelt authored
      These relocations can appear in shared objects on RISC-V ELF systems.
      fca7152c
    • Samuel Thibault's avatar
      hurd: Add jmp_buf-macros.h · fad7d57e
      Samuel Thibault authored
      * sysdeps/mach/hurd/i386/jmp_buf-macros.h: New file.
      fad7d57e
    • Tulio Magno Quites Machado Filho's avatar
      powerpc: Fix error message during relocation overflow · 3a32b716
      Tulio Magno Quites Machado Filho authored
      
      
      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: default avatarTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
      Reviewed-by: default avatarAdhemerval Zanella <adhemerval.zanella@linaro.org>
      3a32b716
    • Aurelien Jarno's avatar
      resource/tst-getrlimit.c: Add copyright header · a6d0afb5
      Aurelien Jarno authored
      The initial year is based on the date in the original ChangeLog entry
      (2005-06-21).
      a6d0afb5
    • Aurelien Jarno's avatar
      Add test for getrlimit/setrlimit/prlimit with infinity value · 19be56d8
      Aurelien Jarno authored
      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.
      19be56d8
    • Aurelien Jarno's avatar
      prlimit: Translate old_rlimit from RLIM64_INFINITY to RLIM_INFINITY [BZ #22678] · 24731685
      Aurelien Jarno authored
      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.
      24731685
    • Aurelien Jarno's avatar
      Alpha: Fix the RLIM_INFINITY and RLIM64_INFINITY constants · 8e900969
      Aurelien Jarno authored
      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.
      8e900969
    • Aurelien Jarno's avatar
      Alpha: Add wrappers to get/setrlimit64 to fix RLIM64_INFINITY constant [BZ #22648] · 0d0bc784
      Aurelien Jarno authored
      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 045c13d1 ("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.
      0d0bc784
  2. Jan 05, 2018
    • Florian Weimer's avatar
      NEWS: Deprecate static dlopen · f1a844ac
      Florian Weimer authored
      f1a844ac
    • Florian Weimer's avatar
      2fc21aaa
    • Joseph Myers's avatar
      Increase some test timeouts. · ba374b6d
      Joseph Myers authored
      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.
      ba374b6d
    • Adhemerval Zanella's avatar
      alpha: Remove s_trunc{f} implementation (BZ#22666) · b0a4eca2
      Adhemerval Zanella authored
      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: default avatarAdhemerval Zanella <adhemerval.zanella@linaro.org>
      b0a4eca2
    • Adhemerval Zanella's avatar
      alpha: Remove s_ceil{f} and s_floor{f} implementation (BZ#22665) · 4854ddd8
      Adhemerval Zanella authored
      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: default avatarAdhemerval Zanella <adhemerval.zanella@linaro.org>
      4854ddd8
    • Florian Weimer's avatar
      i386: In makecontext, align the stack before calling exit [BZ #22667] · 8a5df95f
      Florian Weimer authored
      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.
      8a5df95f
    • Florian Weimer's avatar
      elf: Support dlvsym within libc.so · 82eef55f
      Florian Weimer authored
      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.
      82eef55f
  3. Jan 04, 2018
  4. Jan 03, 2018
    • Wilco Dijkstra's avatar
      Improve math_errhandling · 3c7d0312
      Wilco Dijkstra authored
      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.
      3c7d0312
    • Joseph Myers's avatar
      Update MIPS libm-test-ulps. · 7eff0954
      Joseph Myers authored
      	* sysdeps/mips/mips32/libm-test-ulps: Update.
      	* sysdeps/mips/mips64/libm-test-ulps: Likewise.
      7eff0954
    • Florian Weimer's avatar
      misc/tst-pselect.c: Add copyright header · 77f49956
      Florian Weimer authored
      
      
      The initial year is based on the date in the original ChangeLog entry
      (2006-01-21).
      
      Reviewed-by: default avatarCarlos O'Donell <carlos@redhat.com>
      77f49956
    • Aurelien Jarno's avatar
      Simplify getrlimit64.c · 3e4226ff
      Aurelien Jarno authored
      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.
      3e4226ff
    • Aurelien Jarno's avatar
      Fix typos in getrlimit64.c and setrlimit64.c · d35989be
      Aurelien Jarno authored
      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.
      d35989be
    • Joseph Myers's avatar
      Update powerpc-nofpu libm-test-ulps. · 28fd6a44
      Joseph Myers authored
      	* sysdeps/powerpc/nofpu/libm-test-ulps: Update.
      28fd6a44
    • Joseph Myers's avatar
      Update ARM libm-test-ulps. · a4933a15
      Joseph Myers authored
      	* sysdeps/arm/libm-test-ulps: Update.
      a4933a15
    • Joseph Myers's avatar
      Reduce command length in regen-ulps. · b9256ab6
      Joseph Myers authored
      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.
      b9256ab6
    • Rajalakshmi Srinivasaraghavan's avatar
  5. Jan 02, 2018
    • Aurelien Jarno's avatar
      Remove alpha specific fmax, fmin to fix sNaN handling [BZ #22660] · 6a9dd7a7
      Aurelien Jarno authored
      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.
      6a9dd7a7
    • Dmitry V. Levin's avatar
      linux/arm: sync sys/ptrace.h with Linux 4.15 [BZ #22433] · b05cb613
      Dmitry V. Levin authored
      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.
      b05cb613
    • Dmitry V. Levin's avatar
      elf: check for rpath emptiness before making a copy of it · dbba87d5
      Dmitry V. Levin authored
      * elf/dl-load.c (decompose_rpath): Check for rpath emptiness before
      making a copy of it.
      dbba87d5
    • Joseph Myers's avatar
      Update miscellaneous files from upstream sources. · 66ac23de
      Joseph Myers authored
      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.
      66ac23de
  6. Jan 01, 2018
    • Zack Weinberg's avatar
      bf800d70
    • Joseph Myers's avatar
      Update copyright dates not handled by scripts/update-copyrights. · 09533208
      Joseph Myers authored
      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_ve...
      09533208
    • Joseph Myers's avatar
      Update copyright dates with scripts/update-copyrights. · 688903eb
      Joseph Myers authored
      	* 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.
      688903eb
    • Zack Weinberg's avatar
      Correct improper-inclusion check in bits/libio-ldbl.h. · 4f820792
      Zack Weinberg authored
      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.
      4f820792
  7. Dec 31, 2017
    • Aurelien Jarno's avatar
      elf: Check for empty tokens before dynamic string token expansion [BZ #22625] · 3e3c904d
      Aurelien Jarno authored
      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.
      3e3c904d
  8. Dec 30, 2017
    • Dmitry V. Levin's avatar
      linux/x86: sync sys/ptrace.h with Linux 4.14 [BZ #22433] · c48831d0
      Dmitry V. Levin authored
      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.
      c48831d0