git-updates
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Sun, 28 May 2017 17:29:33 +0000 (17:29 +0000)
committerAurelien Jarno <aurel32@debian.org>
Sun, 28 May 2017 17:29:33 +0000 (17:29 +0000)
GIT update of git://sourceware.org/git/glibc.git/release/2.24/master from glibc-2.24

Gbp-Pq: Name git-updates.diff

113 files changed:
ChangeLog
NEWS
argp/argp-fmtstream.h
argp/argp.h
configure
configure.ac
conform/Makefile
elf/Makefile
elf/dl-close.c
elf/tst-nodelete-dlclose-dso.c [new file with mode: 0644]
elf/tst-nodelete-dlclose-plugin.c [new file with mode: 0644]
elf/tst-nodelete-dlclose.c [new file with mode: 0644]
iconv/gconv.h
include/arpa/nameser_compat.h
io/fts.h
localedata/ChangeLog
localedata/locales/bs_BA
malloc/arena.c
nptl/Makefile
nptl/tst-exec5.c [new file with mode: 0644]
nptl/tst-once5.cc
po/de.po
po/fi.po
po/sv.po
posix/execvpe.c
resolv/Makefile
resolv/nss_dns/dns-host.c
resolv/res_mkquery.c
resolv/res_query.c
resolv/tst-resolv-qtypes.c [new file with mode: 0644]
sysdeps/alpha/fpu/s_ceil.c
sysdeps/alpha/fpu/s_ceilf.c
sysdeps/alpha/fpu/s_floor.c
sysdeps/alpha/fpu/s_floorf.c
sysdeps/alpha/fpu/s_rint.c
sysdeps/alpha/fpu/s_rintf.c
sysdeps/alpha/fpu/s_trunc.c
sysdeps/alpha/fpu/s_truncf.c
sysdeps/arm/nacl/libc.abilist
sysdeps/generic/unsecvars.h
sysdeps/hppa/dl-machine.h
sysdeps/ia64/nptl/Makefile
sysdeps/mips/Makefile
sysdeps/mips/mips32/crti.S
sysdeps/mips/mips64/n32/crti.S
sysdeps/mips/mips64/n64/crti.S
sysdeps/mips/nptl/Makefile
sysdeps/nacl/clock.c
sysdeps/nacl/dup.c
sysdeps/posix/wait3.c
sysdeps/powerpc/fpu/libm-test-ulps
sysdeps/powerpc/ifunc-sel.h
sysdeps/powerpc/powerpc32/power6/memset.S
sysdeps/powerpc/powerpc32/power9/multiarch/Implies
sysdeps/powerpc/powerpc64/power6/memset.S
sysdeps/powerpc/powerpc64/power9/fpu/Implies
sysdeps/s390/nptl/Makefile
sysdeps/sparc/sparc32/fpu/s_fdim.S [deleted file]
sysdeps/sparc/sparc32/fpu/s_fdimf.S [deleted file]
sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S [deleted file]
sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S [deleted file]
sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S [deleted file]
sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S [deleted file]
sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S
sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S
sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S [deleted file]
sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S [deleted file]
sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S
sysdeps/sparc/sparc64/fpu/s_fdim.S [deleted file]
sysdeps/sparc/sparc64/fpu/s_fdimf.S [deleted file]
sysdeps/unix/alpha/Makefile
sysdeps/unix/sysv/linux/alpha/Makefile
sysdeps/unix/sysv/linux/arm/setcontext.S
sysdeps/unix/sysv/linux/i386/Makefile
sysdeps/unix/sysv/linux/ia64/Makefile
sysdeps/unix/sysv/linux/microblaze/Makefile
sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
sysdeps/unix/sysv/linux/powerpc/Makefile
sysdeps/unix/sysv/linux/powerpc/elision-lock.c
sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
sysdeps/unix/sysv/linux/pread.c
sysdeps/unix/sysv/linux/pread64.c
sysdeps/unix/sysv/linux/pwrite.c
sysdeps/unix/sysv/linux/pwrite64.c
sysdeps/unix/sysv/linux/s390/Makefile
sysdeps/unix/sysv/linux/sh/kernel-features.h
sysdeps/unix/sysv/linux/sh/pread.c [deleted file]
sysdeps/unix/sysv/linux/sh/pread64.c [deleted file]
sysdeps/unix/sysv/linux/sh/pwrite.c [deleted file]
sysdeps/unix/sysv/linux/sh/pwrite64.c [deleted file]
sysdeps/unix/sysv/linux/sparc/Makefile
sysdeps/unix/sysv/linux/spawni.c
sysdeps/unix/sysv/linux/sysdep.h
sysdeps/unix/sysv/linux/tile/Makefile
sysdeps/x86/cpu-features.c
sysdeps/x86/cpu-features.h
sysdeps/x86_64/dl-machine.h
sysdeps/x86_64/dl-trampoline.S
sysdeps/x86_64/dl-trampoline.h
sysdeps/x86_64/memcpy_chk.S
sysdeps/x86_64/multiarch/memcpy.S
sysdeps/x86_64/multiarch/memcpy_chk.S
sysdeps/x86_64/multiarch/memmove.S
sysdeps/x86_64/multiarch/memmove_chk.S
sysdeps/x86_64/multiarch/mempcpy.S
sysdeps/x86_64/multiarch/mempcpy_chk.S
sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S
sysdeps/x86_64/multiarch/memset.S
sysdeps/x86_64/multiarch/memset_chk.S
sysdeps/x86_64/sysdep.h

index c44c92609406938754897e33b4b15a6394f29aac..8734292665cf897609680ad2fce86a47b264e865 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,399 @@
+2017-04-28  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #21396]
+       * sysdeps/x86/cpu-features.c (init_cpu_features): Set
+       Prefer_No_AVX512 if AVX512ER isn't available.
+       * sysdeps/x86/cpu-features.h (bit_arch_Prefer_No_AVX512): New.
+       (index_arch_Prefer_No_AVX512): Likewise.
+       * sysdeps/x86_64/multiarch/memcpy.S (__new_memcpy): Don't use
+       AVX512 version if Prefer_No_AVX512 is set.
+       * sysdeps/x86_64/multiarch/memcpy_chk.S (__memcpy_chk):
+       Likewise.
+       * sysdeps/x86_64/multiarch/memmove.S (__libc_memmove): Likewise.
+       * sysdeps/x86_64/multiarch/memmove_chk.S (__memmove_chk):
+       Likewise.
+       * sysdeps/x86_64/multiarch/mempcpy.S (__mempcpy): Likewise.
+       * sysdeps/x86_64/multiarch/mempcpy_chk.S (__mempcpy_chk):
+       Likewise.
+       * sysdeps/x86_64/multiarch/memset.S (memset): Likewise.
+       * sysdeps/x86_64/multiarch/memset_chk.S (__memset_chk):
+       Likewise.
+
+2017-04-28  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * sysdeps/x86/cpu-features.c (init_cpu_features): Set
+       Prefer_No_VZEROUPPER if AVX512ER is available.
+       * sysdeps/x86/cpu-features.h
+       (bit_cpu_AVX512PF): New.
+       (bit_cpu_AVX512ER): Likewise.
+       (bit_cpu_AVX512CD): Likewise.
+       (bit_cpu_AVX512BW): Likewise.
+       (bit_cpu_AVX512VL): Likewise.
+       (index_cpu_AVX512PF): Likewise.
+       (index_cpu_AVX512ER): Likewise.
+       (index_cpu_AVX512CD): Likewise.
+       (index_cpu_AVX512BW): Likewise.
+       (index_cpu_AVX512VL): Likewise.
+       (reg_AVX512PF): Likewise.
+       (reg_AVX512ER): Likewise.
+       (reg_AVX512CD): Likewise.
+       (reg_AVX512BW): Likewise.
+       (reg_AVX512VL): Likewise.
+
+2017-01-05  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #21026]
+       * sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
+       (readahead): New syscall entry.
+
+2017-04-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #21258]
+       * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve_opt):
+       Define only if _dl_runtime_resolve is defined to
+       _dl_runtime_resolve_sse_vex.
+       * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_opt):
+       Fallthrough to _dl_runtime_resolve_sse_vex.
+
+2017-04-03  Mike Frysinger  <vapier@gentoo.org>
+
+       [BZ #21253]
+       * sysdeps/unix/sysv/linux/spawni.c (__spawnix): Increase argv_size
+       slack space by 32KiB.
+
+2017-03-31  Slava Barinov  <v.barinov@samsung.com>
+
+       [BZ #21289]
+       * io/fts.h (fts_set): Replace __REDIRECT with __REDIRECT_NTH.
+
+2017-03-20  Mike Frysinger  <vapier@gentoo.org>
+
+       [BZ #21275]
+       * sysdeps/unix/sysv/linux/spawni.c [__ia64__] (CLONE): Rename
+       __stack to __stackbase.
+       (STACK): Invert _STACK_GROWS_DOWN and _STACK_GROWS_UP order of
+       checks so we can include defined(__ia64__) first.
+
+2017-03-15  John David Anglin  <danglin@gcc.gnu.org>
+
+       * sysdeps/hppa/dl-machine.h (DL_STACK_END): Define.
+       (RTLD_START): Don't record stack end address in _dl_start_user.
+
+2017-01-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #21081]
+       * sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S
+       (L(stosb)): Add VZEROUPPER before ret.
+
+2016-11-28  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #20750]
+       * sysdeps/x86_64/sysdep.h (JUMPTARGET): Check SHARED instead
+       of PIC.
+
+2016-12-31  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #18784]
+       CVE-2015-5180
+       * include/arpa/nameser_compat.h (T_QUERY_A_AND_AAAA): Rename from
+       T_UNSPEC.  Adjust value.
+       * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname4_r): Use it.
+       * resolv/res_query.c (__libc_res_nquery): Likewise.
+       * resolv/res_mkquery.c (res_nmkquery): Check for out-of-range
+       QTYPEs.
+       * resolv/tst-resolv-qtypes.c: New file.
+       * resolv/Makefile (xtests): Add tst-resolv-qtypes.
+       (tst-resolv-qtypes): Link against libresolv and libpthread.
+
+2017-02-02  Siddhesh Poyarekar  <siddhesh@sourceware.org>
+
+       * sysdeps/generic/unsecvars.h: Add GLIBC_TUNABLES.
+
+2017-01-23  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
+           Steven Munroe  <sjmunroe@us.ibm.com>
+           Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
+
+       [BZ #20822]
+       * sysdeps/unix/sysv/linux/powerpc/elision-lock.c
+       (__lll_lock_elision): Access adapt_count via C11 atomics.
+       * sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
+       (__lll_trylock_elision): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
+       (__lll_unlock_elision):  Update adapt_count variable inside the
+       critical section using C11 atomics.
+
+2016-12-24  Carlos O'Donell  <carlos@redhat.com>
+
+       [BZ #11941]
+       * elf/dl-close.c (_dl_close): Take dl_load_lock to examine map.
+       Remove assert (map->l_init_called); if DF_1_NODELETE is set.
+       * elf/Makefile [ifeq (yes,$(build-shared))] (tests): Add
+       tst-nodelete-dlclose.
+       (modules-names): Add tst-nodelete-dlclose-dso and
+       tst-nodelete-dlclose-plugin.
+       ($(objpfx)tst-nodelete-dlclose-dso.so): Define.
+       ($(objpfx)tst-nodelete-dlclose-plugin.so): Define.
+       ($(objpfx)tst-nodelete-dlclose): Define.
+       ($(objpfx)tst-nodelete-dlclose.out): Define.
+
+2016-08-02  Aurelien Jarno  <aurelien@aurel32.net>
+
+2016-08-02  Aurelien Jarno  <aurelien@aurel32.net>
+
+       * sysdeps/alpha/fpu/s_ceil.c (__ceil): Add argument with itself
+       when it is a NaN.
+       [_IEEE_FP_INEXACT] Remove.
+       * sysdeps/alpha/fpu/s_ceilf.c (__ceilf): Likewise.
+       * sysdeps/alpha/fpu/s_floor.c (__floor): Add argument with itself
+       when it is a NaN.
+       [_IEEE_FP_INEXACT] Remove.
+       * sysdeps/alpha/fpu/s_floorf.c (__floorf): Likewise.
+       * sysdeps/alpha/fpu/s_rint.c (__rint): Add argument with itself
+       when it is a NaN.
+       * sysdeps/alpha/fpu/s_rintf.c (__rintf): Likewise.
+       * sysdeps/alpha/fpu/s_trunc.c (__trunc): Return the input value
+       when its absolute value is greater than 0x1.0p52.
+       [_IEEE_FP_INEXACT] Remove.
+       * sysdeps/alpha/fpu/s_truncf.c (__truncf): Return the input value
+       when its absolute value is greater than 0x1.0p23.
+       [_IEEE_FP_INEXACT] Remove.
+
+2016-11-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #20495]
+       [BZ #20508]
+       * sysdeps/x86/cpu-features.c (init_cpu_features): For Intel
+       processors, set Use_dl_runtime_resolve_slow and set
+       Use_dl_runtime_resolve_opt if XGETBV suports ECX == 1.
+       * sysdeps/x86/cpu-features.h (bit_arch_Use_dl_runtime_resolve_opt):
+       New.
+       (bit_arch_Use_dl_runtime_resolve_slow): Likewise.
+       (index_arch_Use_dl_runtime_resolve_opt): Likewise.
+       (index_arch_Use_dl_runtime_resolve_slow): Likewise.
+       * sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup): Use
+       _dl_runtime_resolve_avx512_opt and _dl_runtime_resolve_avx_opt
+       if Use_dl_runtime_resolve_opt is set.  Use
+       _dl_runtime_resolve_slow if Use_dl_runtime_resolve_slow is set.
+       * sysdeps/x86_64/dl-trampoline.S: Include <cpu-features.h>.
+       (_dl_runtime_resolve_opt): New.  Defined for AVX and AVX512.
+       (_dl_runtime_resolve): Add one for _dl_runtime_resolve_sse_vex.
+       * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_avx_slow):
+       New.
+       (_dl_runtime_resolve_opt): Likewise.
+       (_dl_runtime_profile): Define only if _dl_runtime_profile is
+       defined.
+
+2016-11-24  Aurelien Jarno  <aurelien@aurel32.net>
+
+       * sysdeps/x86_64/memcpy_chk.S (__memcpy_chk): Check for SHARED
+       instead of PIC.
+
+2016-11-23  Matthew Fortune  <Matthew.Fortune@imgtec.com>
+           Maciej W. Rozycki  <macro@imgtec.com>
+
+       * sysdeps/mips/mips32/crti.S (_init): Add `.insn' pseudo-op at
+       `.Lno_weak_fn' label.
+       * sysdeps/mips/mips64/n32/crti.S (_init): Likewise.
+       * sysdeps/mips/mips64/n64/crti.S (_init): Likewise.
+
+2016-11-22  Adhemerval Zanella  <adhemerva.zanella@linaro.org>
+
+       [BZ #20847]
+       * posix/execvpe.c (maybe_script_execute): Remove write past allocated
+       array bounds.
+       (__execvpe): Likewise.
+
+2016-11-15  Denis Kaganovich  <mahatma@eu.by>
+           Magnus Granberg  <zorry@gentoo.org>
+           Mike Frysinger  <vapier@gentoo.org>
+
+       [BZ #20662]
+       * configure.ac (libc_cv_predef_stack_protector): Also check for
+       __stack_chk_fail_local symbols.
+       * configure: Regenerated.
+
+2016-11-03  Joseph Myers  <joseph@codesourcery.com>
+
+       * conform/Makefile ($(linknamespace-header-tests)): Also depend on
+       $(linknamespace-symlists-tests).
+
+2016-11-06  Aurelien Jarno  <aurelien@aurel32.net>
+
+       * iconv/gconv.h (__gconv_info): Define __data element using a
+       zero-length array.
+
+2016-10-25  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/powerpc/powerpc32/power6/memset.S (memset): Use cmplwi
+       instead of cmpli.
+       * sysdeps/powerpc/powerpc64/power6/memset.S (memset): Use cmpldi
+       instead of cmpli.
+
+2016-10-24  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       * sysdeps/unix/sysv/linux/pread.c (__libc_pread): Use SYSCALL_LL_PRW.
+       * sysdeps/unix/sysv/linux/pwrite.c (__libc_pwrite): Likewise.
+       * sysdeps/unix/sysv/linux/pread64.c (__libc_pread64): Use
+       SYSCALL_LL64_PRW.
+       * sysdeps/unix/sysv/linux/pwrite64.c (__libc_pwrite64): Likewise.
+       * sysdeps/unix/sysv/linux/sh/kernel-features.h: Define
+       __ASSUME_PRW_DUMMY_ARG.
+       * sysdeps/unix/sysv/linux/sh/pread.c: Remove file.
+       * sysdeps/unix/sysv/linux/sh/pread64.c: Likewise.
+       * sysdeps/unix/sysv/linux/sh/pwrite.c: Likewise.
+       * sysdeps/unix/sysv/linux/sh/pwrite64.c: Likewise.
+       * sysdeps/unix/sysv/linux/sysdep.h: Define SYSCALL_LL_PRW and
+       SYSCALL_LL_PRW64 based on __ASSUME_PRW_DUMMY_ARG.
+
+2016-10-05  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
+
+       * sysdeps/powerpc/fpu/libm-test-ulps: Regenerated.
+
+2016-09-20  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       * sysdeps/unix/sysv/linux/spawni.c (__spawnix): Correctly block and unblock
+       all signals when executing the clone vfork child.
+       (SIGALL_SET): Remove macro.
+
+       * nptl/Makefile (tests): Add tst-exec5.
+       * nptl/tst-exec5.c: New file.
+       * sysdeps/unix/sysv/linux/spawni.c (__spawni): Correctly enable and disable
+       asynchronous cancellation.
+
+2016-09-19  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
+
+       [BZ #20615]
+       * sysdeps/powerpc/powerpc32/power9/multiarch/Implies: Replace
+       fpu directory by non-fpu.
+       * sysdeps/powerpc/powerpc64/power9/fpu/Implies: Remove dependency
+       on non-fpu directory from a fpu directory.
+
+2016-09-02  Roland McGrath  <roland@hack.frob.com>
+
+       * sysdeps/arm/nacl/libc.abilist: Add GLIBC_2.24 A.
+
+       * sysdeps/nacl/dup.c: Add libc_hidden_def.
+
+2016-09-02  Roland McGrath  <roland@hack.frob.com>
+
+       * sysdeps/posix/wait3.c: Don't treat STAT_LOC as a union, since it's
+       not any more.
+
+2016-09-02  Roland McGrath  <roland@hack.frob.com>
+
+       * sysdeps/nacl/clock.c (clock): nacl_abi_clock_t -> nacl_irt_clock_t
+
+2016-08-17  Florian Weimer  <fweimer@redhat.com>
+
+       Reduce time to expected nptl/tst-once5 failure.
+       * nptl/tst-once5.cc (TIMEOUT): Define.
+
+2016-08-18  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #16907]
+       * argp/argp.h: Switch to __BEGIN_DECLS and __END_DECLS.
+       (__THROW, __NTH, __attribute__, __restrict): Remove definitions.
+       * argp/argp-fmtstream.h: Add __BEGIN_DECLS and __END_DECLS.
+       (__attribute__): Remove definition.
+
+2016-08-15  Andreas Schwab  <schwab@suse.de>
+
+       [BZ #20435]
+       * sysdeps/unix/sysv/linux/arm/setcontext.S (__startcontext): Mark
+       as .cantunwind.
+
+2016-08-17  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #20452]
+       Avoid additional copies of objects in libc.a in static libraries.
+       * sysdeps/ia64/nptl/Makefile (libpthread-shared-only-routines):
+       Add ptw-sysdep, ptw-sigblock, ptw-sigprocmask.
+       * sysdeps/mips/Makefile (librt-shared-only-routines): Add
+       rt-sysdep.
+       * sysdeps/mips/nptl/Makefile (libpthread-shared-only-routines):
+       Add nptl-sysdep.
+       * sysdeps/s390/nptl/Makefile (libpthread-shared-only-routines):
+       Add ptw-sysdep.
+       * sysdeps/unix/alpha/Makefile (librt-shared-only-routines): Add
+       rt-sysdep.
+       * sysdeps/unix/sysv/linux/alpha/Makefile
+       (libpthread-shared-only-routines): Add ptw-sysdep,
+       ptw-sigprocmask, ptw-rt_sigaction.
+       * sysdeps/unix/sysv/linux/ia64/Makefile
+       (librt-shared-only-routines): Add rt-sysdep.
+       * sysdeps/unix/sysv/linux/i386/Makefile
+       (libpthread-shared-only-routines): Add libc-do-syscall.
+       * sysdeps/unix/sysv/linux/microblaze/Makefile
+       (libpthread-shared-only-routines): Add sysdep.
+       * sysdeps/unix/sysv/linux/powerpc/Makefile
+       (librt-shared-only-routines): Add rt-sysdep.
+       (libpthread-shared-only-routines): Add sysdep.
+       * sysdeps/unix/sysv/linux/s390/Makefile
+       (librt-shared-only-routines): Add rt-sysdep.
+       * sysdeps/unix/sysv/linux/sparc/Makefile
+       (librt-shared-only-routines): Add rt-sysdep.
+       (libpthread-shared-only-routines): Add sysdep.
+       * sysdeps/unix/sysv/linux/tile/Makefile
+       (libpthread-shared-only-routines): Likewise.
+
+2016-08-05  Aurelien Jarno  <aurelien@aurel32.net>
+
+       * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
+       [$(subdir) = math && $(have-as-vis3) = yes] (libm-sysdep_routines):
+       Remove s_fdimf-vis3, s_fdim-vis3.
+       * sysdeps/sparc/sparc32/fpu/s_fdim.S: Delete file.
+       * sysdeps/sparc/sparc32/fpu/s_fdimf.S: Likewise.
+       * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S: Likewise.
+       * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S: Likewise.
+       * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S: Likewise.
+       * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S: Likewise.
+       * sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S: Likewise.
+       * sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S: Likewise.
+       * sysdeps/sparc/sparc64/fpu/s_fdim.S: Likewise.
+       * sysdeps/sparc/sparc64/fpu/s_fdimf.S: Likewise.
+
+2016-08-02  David S. Miller  <davem@davemloft.net>
+
+       * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S
+       (__nearbyint_vis3): Don't check for sNaN before float register is
+       loaded with the incoming argument.
+       * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S
+       (__nearbyintf_vis3): Likewise.
+       * sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S (__nearbyint):
+       Likewise.
+       * sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S (__nearbyintf):
+       Likewise.
+
+2016-08-03  Aurelien Jarno  <aurelien@aurel32.net>
+
+       * sysdeps/powerpc/ifunc-sel.h (ifunc_sel): Replace beqlr instructions
+       by beq instructions jumping to the end of the function.
+       * sysdeps/powerpc/ifunc-sel.h (ifunc_sel): Add "11", "12", "cr0" to the
+       clobber list. Use "i" constraint instead of "X".
+       (ifunc_one): Add "12" to the clobber list. Use "i" constraint instead
+       of "X".
+
+2016-08-04  Carlos O'Donell  <carlos@redhat.com>
+
+       * po/de.po: Update from Translation Project.
+       * po/fi.po: Likewise.
+       * po/sv.po: Likewise.
+
+2016-08-02  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #20370]
+       * malloc/arena.c (get_free_list): Update comment.  Assert that
+       arenas on the free list have no attached threads.
+       (remove_from_free_list): New function.
+       (reused_arena): Call it.
+
+2016-08-04  Florian Weimer  <fweimer@redhat.com>
+
+       Use sysdep.o from libc.a in static libraries.
+       * sysdeps/unix/sysv/linux/i386/Makefile
+       (libpthread-shared-only-routines): Add sysdep.
+       (librt-shared-only-routines): Likewise.
+
 2016-08-01  Carlos O'Donell  <carlos@redhat.com>
 
        * version.h (RELEASE): Set to "stable"
diff --git a/NEWS b/NEWS
index b0447e7169ff61ec0bc053a8fcfec923a08e62a8..71b41ea6255f2c8f12d9531afec94f073c7dee04 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,26 @@ See the end for copying conditions.
 Please send GNU C library bug reports via <http://sourceware.org/bugzilla/>
 using `glibc' in the "product" field.
 \f
+Version 2.24.1
+
+Security related changes:
+
+* On ARM EABI (32-bit), generating a backtrace for execution contexts which
+  have been created with makecontext could fail to terminate due to a
+  missing .cantunwind annotation.  This has been observed to lead to a hang
+  (denial of service) in some Go applications compiled with gccgo.  Reported
+  by Andreas Schwab.  (CVE-2016-6323)
+
+* The DNS stub resolver functions would crash due to a NULL pointer
+  dereference when processing a query with a valid DNS question type which
+  was used internally in the implementation.  The stub resolver now uses a
+  question type which is outside the range of valid question type values.
+  (CVE-2015-5180)
+
+The following bugs are resolved with this release:
+
+  [21289] Fix symbol redirect for fts_set
+\f
 Version 2.24
 
 * The minimum Linux kernel version that this version of the GNU C Library
index bdeaa54dc21fdb8934e0adfb57174b5acda09b0b..e8c5797f388c206358ff282233637855db2f6083 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \
-  defined __STRICT_ANSI__
-#  define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
-   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \
-  defined __STRICT_ANSI__
-#  define __format__ format
-#  define __printf__ printf
-# endif
-#endif
-
 #if defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)
 /* line_wrap_stream is available, so use that.  */
 #define ARGP_FMTSTREAM_USE_LINEWRAP
@@ -111,6 +96,8 @@ struct argp_fmtstream
 
 typedef struct argp_fmtstream *argp_fmtstream_t;
 
+__BEGIN_DECLS
+
 /* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
    written on it with LMARGIN spaces and limits them to RMARGIN columns
    total.  If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
@@ -297,6 +284,8 @@ __argp_fmtstream_point (argp_fmtstream_t __fs)
 
 #endif /* __OPTIMIZE__ */
 
+__END_DECLS
+
 #endif /* ARGP_FMTSTREAM_USE_LINEWRAP */
 
 #endif /* argp-fmtstream.h */
index e67bbef7390c9f22acec07f8d26d217b1bdc215d..7cb5a69f08c5c77a6d476654cadbf1a2ab8fd211 100644 (file)
 #define __need_error_t
 #include <errno.h>
 
-#ifndef __THROW
-# define __THROW
-#endif
-#ifndef __NTH
-# define __NTH(fct) fct __THROW
-#endif
-
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \
-  defined __STRICT_ANSI__
-#  define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
-   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \
-  defined __STRICT_ANSI__
-#  define __format__ format
-#  define __printf__ printf
-# endif
-#endif
-
-/* GCC 2.95 and later have "__restrict"; C99 compilers have
-   "restrict", and "configure" may have defined "restrict".  */
-#ifndef __restrict
-# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
-#  if defined restrict || 199901L <= __STDC_VERSION__
-#   define __restrict restrict
-#  else
-#   define __restrict
-#  endif
-# endif
-#endif
-
 #ifndef __error_t_defined
 typedef int error_t;
 # define __error_t_defined
 #endif
 \f
-#ifdef  __cplusplus
-extern "C" {
-#endif
+__BEGIN_DECLS
 
 /* A description of a particular option.  A pointer to an array of
    these is passed in the OPTIONS field of an argp structure.  Each option
@@ -590,8 +554,6 @@ __NTH (__option_is_end (const struct argp_option *__opt))
 # endif
 #endif /* Use extern inlines.  */
 
-#ifdef  __cplusplus
-}
-#endif
+__END_DECLS
 
 #endif /* argp.h */
index 17625e104128303ba1f06f03f50a3cb9ea0962d1..9b5a486048092268954a91b77262c880c3052370 100755 (executable)
--- a/configure
+++ b/configure
@@ -6289,12 +6289,14 @@ echo >&5 "libc_undefs='$libc_undefs'"
 # symbols (resolved by the linker), so filter out unknown symbols.
 # This will fail to produce the correct result if the compiler
 # defaults to -fstack-protector but this produces an undefined symbol
-# other than __stack_chk_fail.  However, compilers like that have not
-# been encountered in practice.
-libc_undefs=`echo "$libc_undefs" | egrep '^(foobar|__stack_chk_fail)$'`
+# other than __stack_chk_fail or __stack_chk_fail_local. However,
+# compilers like that have not been encountered in practice.
+libc_undefs=`echo "$libc_undefs" | \
+  egrep '^(foobar|__stack_chk_fail|__stack_chk_fail_local)$'`
 case "$libc_undefs" in
 foobar) libc_cv_predef_stack_protector=no ;;
 '__stack_chk_fail
+foobar'|'__stack_chk_fail_local
 foobar') libc_cv_predef_stack_protector=yes ;;
 *) as_fn_error $? "unexpected symbols in test: $libc_undefs" "$LINENO" 5 ;;
 esac
index 33bcd621804e9b06d3fa12d09fef84291e7af891..8277d9f72797a862e19e73468b36511270b29cec 100644 (file)
@@ -1626,12 +1626,14 @@ echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
 # symbols (resolved by the linker), so filter out unknown symbols.
 # This will fail to produce the correct result if the compiler
 # defaults to -fstack-protector but this produces an undefined symbol
-# other than __stack_chk_fail.  However, compilers like that have not
-# been encountered in practice.
-libc_undefs=`echo "$libc_undefs" | egrep '^(foobar|__stack_chk_fail)$'`
+# other than __stack_chk_fail or __stack_chk_fail_local. However,
+# compilers like that have not been encountered in practice.
+libc_undefs=`echo "$libc_undefs" | \
+  egrep '^(foobar|__stack_chk_fail|__stack_chk_fail_local)$'`
 case "$libc_undefs" in
 foobar) libc_cv_predef_stack_protector=no ;;
 '__stack_chk_fail
+foobar'|'__stack_chk_fail_local
 foobar') libc_cv_predef_stack_protector=yes ;;
 *) AC_MSG_ERROR([unexpected symbols in test: $libc_undefs]) ;;
 esac],
index 32a0937b0682de91b2fbd03731c092f53c1241c1..762aac98fcb636178c6347716d8c943035426449 100644 (file)
@@ -229,6 +229,7 @@ $(linknamespace-symlist-stdlibs-tests): $(objpfx)symlist-stdlibs-%: \
 
 $(linknamespace-header-tests): $(objpfx)%/linknamespace.out: \
                               linknamespace.pl \
+                              $(linknamespace-symlists-tests) \
                               $(linknamespace-symlist-stdlibs-tests)
        (set -e; std_hdr=$*; std=$${std_hdr%%/*}; hdr=$${std_hdr#*/}; \
         mkdir -p $(@D)/scratch; \
index 593403c6409c634ff038889bf3fc6f95017a2480..847a012f846aad277d3b4d73fdc60c96d6962b97 100644 (file)
@@ -149,7 +149,8 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
         tst-nodelete) \
         tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
         tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
-        tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error
+        tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error \
+        tst-nodelete-dlclose
 #       reldep9
 ifeq ($(build-hardcoded-path-in-tests),yes)
 tests += tst-dlopen-aout
@@ -223,7 +224,8 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
                tst-array5dep tst-null-argv-lib \
                tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod \
                tst-audit11mod1 tst-audit11mod2 tst-auditmod11 \
-               tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12
+               tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 \
+               tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin
 ifeq (yes,$(have-mtls-dialect-gnu2))
 tests += tst-gnu2-tls1
 modules-names += tst-gnu2-tls1mod
@@ -1267,3 +1269,12 @@ $(objpfx)tst-ldconfig-X.out : tst-ldconfig-X.sh $(objpfx)ldconfig
        $(evaluate-test)
 
 $(objpfx)tst-dlsym-error: $(libdl)
+
+# The application depends on the DSO, and the DSO loads the plugin.
+# The plugin also depends on the DSO. This creates the circular
+# dependency via dlopen that we're testing to make sure works.
+$(objpfx)tst-nodelete-dlclose-dso.so: $(libdl)
+$(objpfx)tst-nodelete-dlclose-plugin.so: $(objpfx)tst-nodelete-dlclose-dso.so
+$(objpfx)tst-nodelete-dlclose: $(objpfx)tst-nodelete-dlclose-dso.so
+$(objpfx)tst-nodelete-dlclose.out: $(objpfx)tst-nodelete-dlclose-dso.so \
+                                  $(objpfx)tst-nodelete-dlclose-plugin.so
index 687d7de874c57f1b39ddc56e16bd7b33942462de..9f93ab76288285bc4ba22aa5f1313837b7196bf5 100644 (file)
@@ -805,19 +805,37 @@ _dl_close (void *_map)
 {
   struct link_map *map = _map;
 
-  /* First see whether we can remove the object at all.  */
+  /* We must take the lock to examine the contents of map and avoid
+     concurrent dlopens.  */
+  __rtld_lock_lock_recursive (GL(dl_load_lock));
+
+  /* At this point we are guaranteed nobody else is touching the list of
+     loaded maps, but a concurrent dlclose might have freed our map
+     before we took the lock. There is no way to detect this (see below)
+     so we proceed assuming this isn't the case.  First see whether we
+     can remove the object at all.  */
   if (__glibc_unlikely (map->l_flags_1 & DF_1_NODELETE))
     {
-      assert (map->l_init_called);
       /* Nope.  Do nothing.  */
+      __rtld_lock_unlock_recursive (GL(dl_load_lock));
       return;
     }
 
+  /* At present this is an unreliable check except in the case where the
+     caller has recursively called dlclose and we are sure the link map
+     has not been freed.  In a non-recursive dlclose the map itself
+     might have been freed and this access is potentially a data race
+     with whatever other use this memory might have now, or worse we
+     might silently corrupt memory if it looks enough like a link map.
+     POSIX has language in dlclose that appears to guarantee that this
+     should be a detectable case and given that dlclose should be threadsafe
+     we need this to be a reliable detection.
+     This is bug 20990. */
   if (__builtin_expect (map->l_direct_opencount, 1) == 0)
-    GLRO(dl_signal_error) (0, map->l_name, NULL, N_("shared object not open"));
-
-  /* Acquire the lock.  */
-  __rtld_lock_lock_recursive (GL(dl_load_lock));
+    {
+      __rtld_lock_unlock_recursive (GL(dl_load_lock));
+      _dl_signal_error (0, map->l_name, NULL, N_("shared object not open"));
+    }
 
   _dl_close_worker (map, false);
 
diff --git a/elf/tst-nodelete-dlclose-dso.c b/elf/tst-nodelete-dlclose-dso.c
new file mode 100644 (file)
index 0000000..dd930f9
--- /dev/null
@@ -0,0 +1,90 @@
+/* Bug 11941: Improper assert map->l_init_called in dlclose.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is the primary DSO that is loaded by the appliation.  This DSO
+   then loads a plugin with RTLD_NODELETE.  This plugin depends on this
+   DSO.  This dependency chain means that at application shutdown the
+   plugin will be destructed first.  Thus by the time this DSO is
+   destructed we will be calling dlclose on an object that has already
+   been destructed.  It is allowed to call dlclose in this way and
+   should not assert.  */
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+
+/* Plugin to load.  */
+static void *plugin_lib = NULL;
+/* Plugin function.  */
+static void (*plugin_func) (void);
+#define LIB_PLUGIN "tst-nodelete-dlclose-plugin.so"
+
+/* This function is never called but the plugin references it.
+   We do this to avoid any future --as-needed from removing the
+   plugin's DT_NEEDED on this DSO (required for the test).  */
+void
+primary_reference (void)
+{
+  printf ("INFO: Called primary_reference function.\n");
+}
+
+void
+primary (void)
+{
+  char *error;
+
+  plugin_lib = dlopen (LIB_PLUGIN, RTLD_NOW | RTLD_LOCAL | RTLD_NODELETE);
+  if (plugin_lib == NULL)
+    {
+      printf ("ERROR: Unable to load plugin library.\n");
+      exit (EXIT_FAILURE);
+    }
+  dlerror ();
+
+  plugin_func = (void (*) (void)) dlsym (plugin_lib, "plugin_func");
+  error = dlerror ();
+  if (error != NULL)
+    {
+      printf ("ERROR: Unable to find symbol with error \"%s\".",
+             error);
+      exit (EXIT_FAILURE);
+    }
+
+  return;
+}
+
+__attribute__ ((destructor))
+static void
+primary_dtor (void)
+{
+  int ret;
+
+  printf ("INFO: Calling primary destructor.\n");
+
+  /* The destructor runs in the test driver also, which
+     hasn't called primary, in that case do nothing.  */
+  if (plugin_lib == NULL)
+    return;
+
+  ret = dlclose (plugin_lib);
+  if (ret != 0)
+    {
+      printf ("ERROR: Calling dlclose failed with \"%s\"\n",
+             dlerror ());
+      exit (EXIT_FAILURE);
+    }
+}
diff --git a/elf/tst-nodelete-dlclose-plugin.c b/elf/tst-nodelete-dlclose-plugin.c
new file mode 100644 (file)
index 0000000..8b295c1
--- /dev/null
@@ -0,0 +1,40 @@
+/* Bug 11941: Improper assert map->l_init_called in dlclose.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This DSO simulates a plugin with a dependency on the
+   primary DSO loaded by the appliation.  */
+#include <stdio.h>
+
+extern void primary_reference (void);
+
+void
+plugin_func (void)
+{
+  printf ("INFO: Calling plugin function.\n");
+  /* Need a reference to the DSO to ensure that a potential --as-needed
+     doesn't remove the DT_NEEDED entry which we rely upon to ensure
+     destruction ordering.  */
+  primary_reference ();
+}
+
+__attribute__ ((destructor))
+static void
+plugin_dtor (void)
+{
+  printf ("INFO: Calling plugin destructor.\n");
+}
diff --git a/elf/tst-nodelete-dlclose.c b/elf/tst-nodelete-dlclose.c
new file mode 100644 (file)
index 0000000..b3d07e1
--- /dev/null
@@ -0,0 +1,36 @@
+/* Bug 11941: Improper assert map->l_init_called in dlclose.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This simulates an application using the primary DSO which loads the
+   plugin DSO.  */
+#include <stdio.h>
+#include <stdlib.h>
+
+extern void primary (void);
+
+static int
+do_test (void)
+{
+  printf ("INFO: Starting application.\n");
+  primary ();
+  printf ("INFO: Exiting application.\n");
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
index 8d8ce5813b72b286d9137f49759d8183d4653a01..a87028047ba5049f76ba45272f0ae1761496f414 100644 (file)
@@ -139,7 +139,7 @@ typedef struct __gconv_info
 {
   size_t __nsteps;
   struct __gconv_step *__steps;
-  __extension__ struct __gconv_step_data __data __flexarr;
+  __extension__ struct __gconv_step_data __data[0];
 } *__gconv_t;
 
 /* Transliteration using the locale's data.  */
index 2e735ede4c0e922bf08849603d0c1a85235d679c..7c0deed9aed4809cd92f5abd7aef7b44700ced91 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _ARPA_NAMESER_COMPAT_
 #include <resolv/arpa/nameser_compat.h>
 
-/* Picksome unused number to represent lookups of IPv4 and IPv6 (i.e.,
-   T_A and T_AAAA).  */
-#define T_UNSPEC 62321
+/* The number is outside the 16-bit RR type range and is used
+   internally by the implementation.  */
+#define T_QUERY_A_AND_AAAA 439963904
 
 #endif
index 127a0d27216ba1f43f6feafdaec9c49edd026e64..b6b45206c800436898c1d546fb89ae8824f54d6d 100644 (file)
--- a/io/fts.h
+++ b/io/fts.h
@@ -193,7 +193,7 @@ FTS *__REDIRECT (fts_open, (char * const *, int,
                                int (*)(const FTSENT **, const FTSENT **)),
                     fts64_open);
 FTSENT *__REDIRECT (fts_read, (FTS *), fts64_read);
-int     __REDIRECT (fts_set, (FTS *, FTSENT *, int), fts64_set) __THROW;
+int     __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), fts64_set);
 # else
 #  define fts_children fts64_children
 #  define fts_close fts64_close
index 4be8afc110da753ddbf366b2c65bdcbf7deac417..6db3c88c9f361bfd71a52bf842fbe4f480945218 100644 (file)
@@ -1,3 +1,9 @@
+2016-12-30  Mike Frysinger  <vapier@gentoo.org>
+
+       [BZ #20974]
+       * localedata/bs_BA (LC_MESSAGES): Delete "*." from the end of
+       yesexpr and noexpr.
+
 2016-07-07  Aurelien Jarno  <aurelien@aurel32.net>
 
        * locales/de_LI (postal_fmt): Fix indentation.
index a47f87eb373d7f559d9f17db411f46f0a73d2110..68c2f9471a09c8f6b9203c81cbf9ebd03662ef65 100644 (file)
@@ -148,8 +148,8 @@ copy "en_DK"
 END LC_CTYPE
 
 LC_MESSAGES
-yesexpr "<U005E><U005B><U002B><U0031><U0064><U0044><U0079><U0059><U005D><U002A><U002E>"
-noexpr  "<U005E><U005B><U002D><U0030><U006E><U004E><U005D><U002A><U002E>"
+yesexpr "<U005E><U005B><U002B><U0031><U0064><U0044><U0079><U0059><U005D>"
+noexpr  "<U005E><U005B><U002D><U0030><U006E><U004E><U005D>"
 yesstr  "<U0064><U0061>"
 nostr   "<U006E><U0065>"
 END LC_MESSAGES
index 229783f3b7e445199803d428798f94906fd5c8ba..4e16593d8bf0028ce05614e8af87f250f2b6e7a3 100644 (file)
@@ -702,8 +702,7 @@ _int_new_arena (size_t size)
 }
 
 
-/* Remove an arena from free_list.  The arena may be in use because it
-   was attached concurrently to a thread by reused_arena below.  */
+/* Remove an arena from free_list.  */
 static mstate
 get_free_list (void)
 {
@@ -718,7 +717,8 @@ get_free_list (void)
          free_list = result->next_free;
 
          /* The arena will be attached to this thread.  */
-         ++result->attached_threads;
+         assert (result->attached_threads == 0);
+         result->attached_threads = 1;
 
          detach_arena (replaced_arena);
        }
@@ -735,6 +735,26 @@ get_free_list (void)
   return result;
 }
 
+/* Remove the arena from the free list (if it is present).
+   free_list_lock must have been acquired by the caller.  */
+static void
+remove_from_free_list (mstate arena)
+{
+  mstate *previous = &free_list;
+  for (mstate p = free_list; p != NULL; p = p->next_free)
+    {
+      assert (p->attached_threads == 0);
+      if (p == arena)
+       {
+         /* Remove the requested arena from the list.  */
+         *previous = p->next_free;
+         break;
+       }
+      else
+       previous = &p->next_free;
+    }
+}
+
 /* Lock and return an arena that can be reused for memory allocation.
    Avoid AVOID_ARENA as we have already failed to allocate memory in
    it and it is currently locked.  */
@@ -782,14 +802,25 @@ reused_arena (mstate avoid_arena)
   (void) mutex_lock (&result->mutex);
 
 out:
-  /* Attach the arena to the current thread.  Note that we may have
-     selected an arena which was on free_list.  */
+  /* Attach the arena to the current thread.  */
   {
     /* Update the arena thread attachment counters.   */
     mstate replaced_arena = thread_arena;
     (void) mutex_lock (&free_list_lock);
     detach_arena (replaced_arena);
+
+    /* We may have picked up an arena on the free list.  We need to
+       preserve the invariant that no arena on the free list has a
+       positive attached_threads counter (otherwise,
+       arena_thread_freeres cannot use the counter to determine if the
+       arena needs to be put on the free list).  We unconditionally
+       remove the selected arena from the free list.  The caller of
+       reused_arena checked the free list and observed it to be empty,
+       so the list is very short.  */
+    remove_from_free_list (result);
+
     ++result->attached_threads;
+
     (void) mutex_unlock (&free_list_lock);
   }
 
index 0d8aadebed81da4a736befeee9984b321656ea79..fa925819ca5be6254f79008e37b4d0f6d063bf29 100644 (file)
@@ -268,7 +268,7 @@ tests = tst-typesizes \
        tst-flock1 tst-flock2 \
        tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \
        tst-signal6 tst-signal7 \
-       tst-exec1 tst-exec2 tst-exec3 tst-exec4 \
+       tst-exec1 tst-exec2 tst-exec3 tst-exec4 tst-exec5 \
        tst-exit1 tst-exit2 tst-exit3 \
        tst-stdio1 tst-stdio2 \
        tst-stack1 tst-stack2 tst-stack3 tst-stack4 tst-pthread-getattr \
diff --git a/nptl/tst-exec5.c b/nptl/tst-exec5.c
new file mode 100644 (file)
index 0000000..4327d8d
--- /dev/null
@@ -0,0 +1,196 @@
+/* Check if posix_spawn does not act as a cancellation entrypoint.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <paths.h>
+#include <pthread.h>
+#include <signal.h>
+#include <spawn.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include <test-skeleton.c>
+
+static pthread_barrier_t b;
+
+static pid_t pid;
+static int pipefd[2];
+
+static void *
+tf (void *arg)
+{
+  int r = pthread_barrier_wait (&b);
+  if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
+    {
+      puts ("error: pthread_barrier_wait failed");
+      exit (1);
+    }
+
+  posix_spawn_file_actions_t a;
+  if (posix_spawn_file_actions_init (&a) != 0)
+    {
+      puts ("error: spawn_file_actions_init failed");
+      exit (1);
+    }
+
+  if (posix_spawn_file_actions_adddup2 (&a, pipefd[1], STDOUT_FILENO) != 0)
+    {
+      puts ("error: spawn_file_actions_adddup2 failed");
+      exit (1);
+    }
+
+  if (posix_spawn_file_actions_addclose (&a, pipefd[0]) != 0)
+    {
+      puts ("error: spawn_file_actions_addclose");
+      exit (1);
+    }
+
+  char *argv[] = { (char *) _PATH_BSHELL, (char *) "-c", (char *) "echo $$",
+                  NULL };
+  if (posix_spawn (&pid, _PATH_BSHELL, &a, NULL, argv, NULL) != 0)
+    {
+      puts ("error: spawn failed");
+      exit (1);
+    }
+
+  return NULL;
+}
+
+
+static int
+do_test (void)
+{
+  /* The test basically pipe a 'echo $$' created by a thread with a
+     cancellation pending.  It then checks if the thread is not cancelled,
+     the process is created and if the output is the expected one.  */
+
+  if (pipe (pipefd) != 0)
+    {
+      puts ("error: pipe failed");
+      exit (1);
+    }
+
+  /* Not interested in knowing when the pipe is closed.  */
+  if (sigignore (SIGPIPE) != 0)
+    {
+      puts ("error: sigignore failed");
+      exit (1);
+    }
+
+  /* To synchronize with the thread.  */
+  if (pthread_barrier_init (&b, NULL, 2) != 0)
+    {
+      puts ("error: pthread_barrier_init failed");
+      exit (1);
+    }
+
+  pthread_t th;
+  if (pthread_create (&th, NULL, &tf, NULL) != 0)
+    {
+      puts ("error: pthread_create failed");
+      exit (1);
+    }
+
+  if (pthread_cancel (th) != 0)
+    {
+      puts ("error: pthread_cancel failed");
+      exit (1);
+    }
+
+  int r = pthread_barrier_wait (&b);
+  if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
+    {
+      puts ("error: pthread_barrier_wait");
+      exit (1);
+    }
+
+  void *retval;
+  if (pthread_join (th, &retval) != 0)
+    {
+      puts ("error: pthread_join failed\n");
+    }
+  if (retval == PTHREAD_CANCELED)
+    {
+      puts ("error: thread cancelled");
+      exit (1);
+    }
+
+  close (pipefd[1]);
+
+  /* The global 'pid' should be set by thread posix_spawn calling.  Check
+     below if it was executed correctly and with expected output.  */
+
+  char buf[64];
+  ssize_t n;
+  bool seen_pid = false;
+  while (TEMP_FAILURE_RETRY ((n = read (pipefd[0], buf, sizeof (buf)))) > 0)
+    {
+      /* We only expect to read the PID.  */
+      char *endp;
+      long int rpid = strtol (buf, &endp, 10);
+
+      if (*endp != '\n')
+       {
+         printf ("error: didn't parse whole line: \"%s\"\n", buf);
+         exit (1);
+       }
+      if (endp == buf)
+       {
+         puts ("error: read empty line");
+         exit (1);
+       }
+
+      if (rpid != pid)
+       {
+         printf ("error: found \"%s\", expected PID %ld\n", buf,
+                (long int) pid);
+         exit (1);
+       }
+
+      if (seen_pid)
+       {
+         puts ("error: found more than one PID line");
+         exit (1);
+       }
+
+      seen_pid = true;
+    }
+
+  close (pipefd[0]);
+
+  int status;
+  int err = waitpid (pid, &status, 0);
+  if (err != pid)
+    {
+      puts ("errnor: waitpid failed");
+      exit (1);
+    }
+
+  if (!seen_pid)
+    {
+      puts ("error: didn't get PID");
+      exit (1);
+    }
+
+  return 0;
+}
index 978d8271bdaf888b312561de531b8f30690cc040..513ac53f6f8de8110119e3c6d0232e474d8298b5 100644 (file)
@@ -75,5 +75,7 @@ do_test (void)
   return result;
 }
 
+// The test currently hangs and is XFAILed.  Reduce the timeout.
+#define TIMEOUT 1
 #define TEST_FUNCTION do_test ()
 #include "../test-skeleton.c"
index 1383e8c4a9dfca9ad61e9c817fdec44a18f94f1c..ca14c7e386e66a92c62249ff9f618402ec2233e2 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: GNU libc 2.22-pre1\n"
 "POT-Creation-Date: 2015-07-31 00:10-0400\n"
-"PO-Revision-Date: 2015-08-31 18:30+0200\n"
+"PO-Revision-Date: 2016-04-22 18:44+0200\n"
 "Last-Translator: Jochen Hein <jochen@jochen.org>\n"
 "Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
 "Language: de\n"
@@ -4479,13 +4479,13 @@ msgstr ""
 "%15s  Cache ist dauerhaft\n"
 "%15s  Cache wird gemeinsam verwendet\n"
 "%15Zu  vorgeschlagene Größe\n"
-"%15Zu  Gesamtröße des Data-Pools\n"
+"%15Zu  Gesamtgröße des Data-Pools\n"
 "%15Zu  Benutzter Speicher im Data-Pool\n"
 "%15lu  Time to Live für positive Einträge in Sekunden\n"
 "%15lu  Time to Live für negative Einträge in Sekunden\n"
 "%15<PRIuMAX>  Cache-Hits bei positiven Einträgen\n"
 "%15<PRIuMAX>  Cache-Hits bei positiven Einträgen\n"
-"%15<PRIuMAX>  Cache-Misses bei positiven EintrÃ\83¤gen\n"
+"%15<PRIuMAX>  Cache-Misses bei positiven Einträgen\n"
 "%15<PRIuMAX>  Cache-Misses bei negativen Einträgen\n"
 "%15lu%% Cache-Hit Verhältnis\n"
 "%15zu  aktuelle Anzahl der Werte im Cache\n"
index 17cb3e3e1da2e45241cfa0b936c768442c82d2c1..8a2ab8358c6ee49740d42c44446cb1147991f5d7 100644 (file)
--- a/po/fi.po
+++ b/po/fi.po
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: libc 2.21-pre1\n"
+"Project-Id-Version: libc 2.22-pre1\n"
 "POT-Creation-Date: 2015-07-31 00:10-0400\n"
-"PO-Revision-Date: 2015-07-28 20:29+0300\n"
+"PO-Revision-Date: 2016-05-26 21:14+0300\n"
 "Last-Translator: Lauri Nurmi <lanurmi@iki.fi>\n"
 "Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
 "Language: fi\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 1.8.3\n"
+"X-Generator: Poedit 1.8.7\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
 #: argp/argp-help.c:227
@@ -126,7 +126,7 @@ msgid "%s%s%s:%u: %s%sUnexpected error: %s.\n"
 msgstr "%s%s%s:%u: %s%sOdottamaton virhe: %s.\n"
 
 #: assert/assert.c:101
-#, fuzzy, c-format
+#, c-format
 msgid ""
 "%s%s%s:%u: %s%sAssertion `%s' failed.\n"
 "%n"
@@ -169,12 +169,12 @@ msgstr ""
 #: malloc/memusagestat.c:563 nss/getent.c:973 nss/makedb.c:369
 #: posix/getconf.c:486 sunrpc/rpcinfo.c:691
 #: sysdeps/unix/sysv/linux/lddlibc4.c:61
-#, fuzzy, c-format
+#, c-format
 msgid ""
 "For bug reporting instructions, please see:\n"
 "%s.\n"
 msgstr ""
-"Ohjeet ohjelmistovioista ilmoittamiseen ovat osoitteessa\n"
+"Katso ohjeet vikailmoitusten tekemiseen osoitteesta:\n"
 "%s.\n"
 
 #: catgets/gencat.c:245 debug/pcprofiledump.c:225 debug/xtrace.sh:64
@@ -321,9 +321,8 @@ msgstr "Käyttö: xtrace [VALITSIN]... OHJELMA [OHJELMANVALITSIN]...\\n"
 
 #: debug/xtrace.sh:32 elf/sotruss.sh:56 elf/sotruss.sh:67 elf/sotruss.sh:135
 #: malloc/memusage.sh:26
-#, fuzzy
 msgid "Try \\`%s --help' or \\`%s --usage' for more information.\\n"
-msgstr "Kokeile ”%s --help” tai ”%s --usage” saadaksesi lisää tietoa.\n"
+msgstr "Kokeile ”%s --help” tai ”%s --usage” saadaksesi lisää tietoa.\\n"
 
 #: debug/xtrace.sh:38
 #, fuzzy
@@ -594,9 +593,8 @@ msgid "cannot enable executable stack as shared object requires"
 msgstr "jaettua objektikahvaa ei voi luoda"
 
 #: elf/dl-load.c:1339
-#, fuzzy
 msgid "cannot close file descriptor"
-msgstr "tiedostoa %s ei voi sulkea"
+msgstr "tiedostokahvaa ei voi sulkea"
 
 #: elf/dl-load.c:1568
 msgid "file too short"
@@ -796,9 +794,8 @@ msgid "Format to use: new, old or compat (default)"
 msgstr "Käytettävä muoto: ”new”, ”old” tai ”compat” (oletus)"
 
 #: elf/ldconfig.c:151
-#, fuzzy
 msgid "Ignore auxiliary cache file"
-msgstr "Käytä CACHEa välimuistitiedostona"
+msgstr "Jätä huomiotta apuvälimuistitiedosto"
 
 #: elf/ldconfig.c:159
 msgid "Configure Dynamic Linker Run Time Bindings."
@@ -1087,9 +1084,9 @@ msgid "invalid process ID '%s'"
 msgstr "virheellinen prosessi-ID ”%s”"
 
 #: elf/pldd.c:120
-#, fuzzy, c-format
+#, c-format
 msgid "cannot open %s"
-msgstr "laitetta %s ei voi avata"
+msgstr "tiedostoa %s ei voi avata"
 
 #: elf/pldd.c:152
 #, fuzzy, c-format
@@ -1102,24 +1099,24 @@ msgid "cannot prepare reading %s/task"
 msgstr "ei voi avata laitetta %s lukutilaan"
 
 #: elf/pldd.c:168
-#, fuzzy, c-format
+#, c-format
 msgid "invalid thread ID '%s'"
-msgstr "virheellinen prosessi-ID ”%s”"
+msgstr "virheellinen säie-ID ”%s”"
 
 #: elf/pldd.c:179
-#, fuzzy, c-format
+#, c-format
 msgid "cannot attach to process %lu"
-msgstr "tiedostoa ”%s” ei voi avata"
+msgstr "ei voida kiinnittyä prosessiin %lu"
 
 #: elf/pldd.c:294
 #, c-format
 msgid "cannot get information about process %lu"
-msgstr ""
+msgstr "tietojen saaminen prosessista %lu ei onnistu"
 
 #: elf/pldd.c:307
-#, fuzzy, c-format
+#, c-format
 msgid "process %lu is no ELF program"
-msgstr "ohjelma %lu ei ole käytettävissä\n"
+msgstr "prosessi %lu ei ole ELF-ohjelma"
 
 #: elf/readelflib.c:34
 #, c-format
@@ -1203,7 +1200,7 @@ msgstr "%s kohde ei saa olla hakemisto\n"
 #: elf/sln.c:184
 #, c-format
 msgid "%s: failed to remove the old destination\n"
-msgstr ""
+msgstr "%s: vanhan kohteen poistaminen epäonnistui\n"
 
 #: elf/sln.c:192
 #, c-format
@@ -1237,9 +1234,8 @@ msgid "Mandatory arguments to long options are also mandatory for any correspond
 msgstr "Pakolliset argumentit pitkille valitsimille ovat pakollisia kaikille vastaaville lyhyille valitsimille.\\n"
 
 #: elf/sotruss.sh:55
-#, fuzzy
 msgid "%s: option requires an argument -- '%s'\\n"
-msgstr "%s: valitsin ”%s” vaatii argumentin\n"
+msgstr "%s: valitsin vaatii argumentin -- ”%c”\\n"
 
 #: elf/sotruss.sh:61
 msgid "%s: option is ambiguous; possibilities:"
@@ -1507,7 +1503,6 @@ msgid "unknown iconv() error %d"
 msgstr "tuntematon iconv()-virhe %d"
 
 #: iconv/iconv_prog.c:791
-#, fuzzy
 msgid ""
 "The following list contains all the coded character sets known.  This does\n"
 "not necessarily mean that all combinations of these names can be used for\n"
@@ -1516,9 +1511,9 @@ msgid ""
 "\n"
 "  "
 msgstr ""
-"Seuraavassa listassa ovat kaikki tunnetut koodatut merkistöt. Se ei\n"
+"Seuraavassa listassa ovat kaikki tunnetut koodatut merkistöt. Tämä ei\n"
 "kuitenkaan välttämättä tarkoita sitä, että kaikkia näiden nimien\n"
-"yhdistelmiä voidaan käyttää FROM- ja TO-komentoriviparametreina. Yksi\n"
+"yhdistelmiä voisi käyttää FROM- ja TO-komentoriviparametreina. Yksi\n"
 "koodattu merkistö voi olla listalla useilla eri nimillä (aliaksilla).\n"
 "\n"
 "  "
@@ -2733,14 +2728,12 @@ msgid "locale.alias file to consult when making archive"
 msgstr "Arkistoa luotaessa käytettävä locale.alias-tiedosto"
 
 #: locale/programs/localedef.c:150
-#, fuzzy
 msgid "Generate little-endian output"
-msgstr "Tuota little-endian-koodia"
+msgstr "Tuota little-endian-muotoa"
 
 #: locale/programs/localedef.c:152
-#, fuzzy
 msgid "Generate big-endian output"
-msgstr "Tuota big-endian-koodia"
+msgstr "Tuota big-endian-muotoa"
 
 #: locale/programs/localedef.c:157
 msgid "Compile locale specification"
@@ -4275,10 +4268,9 @@ msgid ""
 msgstr ""
 
 #: nscd/nscd.c:635
-#, fuzzy, c-format
-#| msgid "lstat failed"
+#, c-format
 msgid "'wait' failed\n"
-msgstr "tiedoston tilan luku epäonnistui"
+msgstr "”wait” epäonnistui\n"
 
 #: nscd/nscd.c:642
 #, c-format
@@ -4670,9 +4662,9 @@ msgid "cannot create temporary file"
 msgstr "tilapäistä tiedostoa ei voi luoda"
 
 #: nss/makedb.c:304
-#, fuzzy, c-format
+#, c-format
 msgid "cannot stat newly created file"
-msgstr "tiedoston ”%s” tilaa ei voi lukea: %s"
+msgstr "juuri luodun tiedoston tilaa ei voi lukea"
 
 #: nss/makedb.c:315
 #, c-format
@@ -4680,9 +4672,9 @@ msgid "cannot rename temporary file"
 msgstr "tilapäistä tiedostoa ei voi nimetä uudelleen"
 
 #: nss/makedb.c:531 nss/makedb.c:554
-#, fuzzy, c-format
+#, c-format
 msgid "cannot create search tree"
-msgstr "hakupolulle ei voi luoda välimuistia"
+msgstr "hakupuuta ei voi luoda"
 
 #: nss/makedb.c:560
 msgid "duplicate key"
@@ -4699,9 +4691,9 @@ msgid "failed to write new database file"
 msgstr "uuden tietokantatiedoston kirjoittaminen epäonnistui"
 
 #: nss/makedb.c:812
-#, fuzzy, c-format
+#, c-format
 msgid "cannot stat database file"
-msgstr "tiedoston ”%s” tilaa ei voi lukea: %s"
+msgstr "tietokantatiedoston tilaa ei voi lukea"
 
 #: nss/makedb.c:817
 #, fuzzy, c-format
@@ -4709,9 +4701,9 @@ msgid "cannot map database file"
 msgstr "Karttatietokannassa ei ole enempää tietueita"
 
 #: nss/makedb.c:820
-#, fuzzy, c-format
+#, c-format
 msgid "file not a database file"
-msgstr "luettaessa profilointidatatiedoston tilaa"
+msgstr "tiedosto ei ole tietokantatiedosto"
 
 #: nss/makedb.c:871
 #, fuzzy, c-format
@@ -4726,7 +4718,7 @@ msgstr "Käyttö: %s [-v määrittely] muuttujanimi [polku]\n"
 #: posix/getconf.c:403
 #, c-format
 msgid "       %s -a [pathname]\n"
-msgstr ""
+msgstr "       %s -a [polku]\n"
 
 #: posix/getconf.c:479
 #, c-format
@@ -5094,11 +5086,11 @@ msgstr "Laitetta irrotettu"
 
 #: stdio-common/psiginfo.c:139
 msgid "Signal sent by kill()"
-msgstr ""
+msgstr "Signaalin lähetti kill()"
 
 #: stdio-common/psiginfo.c:142
 msgid "Signal sent by sigqueue()"
-msgstr ""
+msgstr "Signaalin lähetti sigqueue()"
 
 #: stdio-common/psiginfo.c:145
 msgid "Signal generated by the expiration of a timer"
@@ -5114,7 +5106,7 @@ msgstr ""
 
 #: stdio-common/psiginfo.c:157
 msgid "Signal sent by tkill()"
-msgstr ""
+msgstr "Signaalin lähetti tkill()"
 
 #: stdio-common/psiginfo.c:162
 msgid "Signal generated by the completion of an asynchronous name lookup request"
@@ -5296,9 +5288,8 @@ msgid "Failed (unspecified error)"
 msgstr "Epäonnistui (määrittelemätön virhe)"
 
 #: sunrpc/clnt_raw.c:115
-#, fuzzy
 msgid "clnt_raw.c: fatal header serialization error"
-msgstr "clnt_raw.c: vakava otsikon serialisointivirhe"
+msgstr "clnt_raw.c: vakava otsikon sarjallistamisvirhe"
 
 #: sunrpc/pm_getmaps.c:77
 msgid "pmap_getmaps.c: rpc problem"
@@ -6825,9 +6816,8 @@ msgid "Interrupted by a signal"
 msgstr "Signaalin keskeyttämä"
 
 #: sysdeps/posix/gai_strerror-strs.h:17
-#, fuzzy
 msgid "Parameter string not correctly encoded"
-msgstr "Parametrimerkkijono on väärin koodattu"
+msgstr "Parametrimerkkijono ei ole koodattu oikein"
 
 #: sysdeps/unix/sysv/linux/i386/readelflib.c:65
 #, c-format
index 49d1f23904d95560af26f3b91ebe88360f8f24ab..e046577b084766f71f6fef76c42d63a2bfa75994 100644 (file)
--- a/po/sv.po
+++ b/po/sv.po
@@ -1,13 +1,17 @@
 # GNU libc message catalog for Swedish
-# Copyright © 1996, 1998, 2001, 2002, 2003, 2006, 2008, 2009, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc.
+# Copyright © 1996, 1998, 2001, 2002, 2003, 2006, 2008, 2009, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc.
 # This file is distributed under the same license as the glibc package.
-# Jan Djärv <jan.h.d@swipnet.se>, 1996, 1998, 2001, 2002, 2003, 2006, 2007, 2008, 2009, 2011, 2012, 2013, 2014, 2015
+#
+# Jan Djärv <jan.h.d@swipnet.se>, 1996, 1998, 2001, 2002, 2003, 2006, 2007, 2008, 2009, 2011, 2012, 2013, 2014, 2015.
+# Göran Uddeborg <goeran@uddeborg.se>, 2016.
+#
+# $Revision: 1.3 $
 msgid ""
 msgstr ""
-"Project-Id-Version: libc 2.21-pre1\n"
+"Project-Id-Version: libc 2.22-pre1\n"
 "POT-Creation-Date: 2015-07-31 00:10-0400\n"
-"PO-Revision-Date: 2015-01-24 10:35+0100\n"
-"Last-Translator: Jan Djärv <jan.h.d@swipnet.se>\n"
+"PO-Revision-Date: 2016-08-02 17:17+0200\n"
+"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
 "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
 "Language: sv\n"
 "MIME-Version: 1.0\n"
@@ -48,7 +52,7 @@ msgstr " [FLAGGA...]"
 #: argp/argp-help.c:1643
 #, c-format
 msgid "Try `%s --help' or `%s --usage' for more information.\n"
-msgstr "Försök med \"%s --help\" eller \"%s --usage\" för mer information\n"
+msgstr "Försök med ”%s --help” eller ”%s --usage” för mer information.\n"
 
 #: argp/argp-help.c:1671
 #, c-format
@@ -304,11 +308,11 @@ msgstr "Användning: xtrace [FLAGGA]... PROGRAM [PROGRAMFLAGGA}...\\n"
 #: debug/xtrace.sh:32 elf/sotruss.sh:56 elf/sotruss.sh:67 elf/sotruss.sh:135
 #: malloc/memusage.sh:26
 msgid "Try \\`%s --help' or \\`%s --usage' for more information.\\n"
-msgstr "Försök med \\\"%s --help\\\" eller \\\"%s --usage\\\" för mer information\\n"
+msgstr "Försök med ”%s --help” eller ”%s --usage” för mer information\\n"
 
 #: debug/xtrace.sh:38
 msgid "%s: option '%s' requires an argument.\\n"
-msgstr "%s: flaggan \\\"%s\\\" kräver ett argument\\n"
+msgstr "%s: flaggan ”%s” kräver ett argument.\\n"
 
 #: debug/xtrace.sh:45
 msgid ""
@@ -332,19 +336,17 @@ msgstr ""
 "      --usage             Visa en kort hjälptext\n"
 "   -V,--version           Visa versionsinformation och avsluta\n"
 "\n"
-"Obligatoriska argument för långa flaggor är obligatoriska  även för\n"
+"Obligatoriska argument för långa flaggor är obligatoriska även för\n"
 "motsvarande korta.\n"
 
 #: debug/xtrace.sh:57 elf/ldd.bash.in:55 elf/sotruss.sh:49
 #: malloc/memusage.sh:64
 msgid "For bug reporting instructions, please see:\\\\n%s.\\\\n"
-msgstr ""
-"För felrapporteringsinstruktioner, se:\\\\n%s.\\\\n\n"
-"Rapportera fel eller synpunkter på översättningen till <tp-sv@listor.tp-sv.se>.\\\\n"
+msgstr "För felrapporteringsinstruktioner, se:\\\\n%s.\\\\nRapportera fel eller synpunkter på översättningen till:\\\\n<tp-sv@listor.tp-sv.se>.\\\\n"
 
 #: debug/xtrace.sh:125
 msgid "xtrace: unrecognized option \\`$1'\\n"
-msgstr "xtrace: okänd flagga \"$1\"\\n"
+msgstr "xtrace: okänd flagga ”$1”\\n"
 
 #: debug/xtrace.sh:138
 msgid "No program name given\\n"
@@ -353,12 +355,12 @@ msgstr "Inget programnamn givet\\n"
 #: debug/xtrace.sh:146
 #, sh-format
 msgid "executable \\`$program' not found\\n"
-msgstr "program \"$program\" hittades inte\\n"
+msgstr "program ”$program” hittades inte\\n"
 
 #: debug/xtrace.sh:150
 #, sh-format
 msgid "\\`$program' is no executable\\n"
-msgstr "\"$program\" är inte en körbar binär\\n"
+msgstr "”$program” är inte en körbar binär\\n"
 
 #: dlfcn/dlinfo.c:63
 msgid "RTLD_SELF used in code not dynamically loaded"
@@ -396,7 +398,7 @@ msgstr ", OS ABI: %s %d.%d.%d"
 #: elf/cache.c:157 elf/ldconfig.c:1340
 #, c-format
 msgid "Can't open cache file %s\n"
-msgstr "Kan inte öppna cache-fil \"%s\"\n"
+msgstr "Kan inte öppna cache-filen %s\n"
 
 #: elf/cache.c:171
 #, c-format
@@ -416,7 +418,7 @@ msgstr "%d bibliotek hittades i cache \"%s\"\n"
 #: elf/cache.c:426
 #, c-format
 msgid "Can't create temporary cache file %s"
-msgstr "Kan inte skapa temporär cache-fil \"%s\""
+msgstr "Kan inte skapa en temporär cache-fil %s"
 
 #: elf/cache.c:434 elf/cache.c:444 elf/cache.c:448 elf/cache.c:453
 #, c-format
@@ -829,7 +831,7 @@ msgstr "Kan inte ta status (lstat) på %s"
 #: elf/ldconfig.c:609
 #, c-format
 msgid "Ignored file %s since it is not a regular file."
-msgstr "Ignorerar fil %s eftersom den inte är en vanlig fil"
+msgstr "Ignorerar fil %s eftersom den inte är en vanlig fil."
 
 #: elf/ldconfig.c:618
 #, c-format
@@ -951,7 +953,7 @@ msgstr ""
 
 #: elf/ldd.bash.in:80
 msgid "ldd: option \\`$1' is ambiguous"
-msgstr "ldd: flaggan \"$1\" är tvetydig"
+msgstr "ldd: flaggan ”$1” är tvetydig"
 
 #: elf/ldd.bash.in:87
 msgid "unrecognized option"
@@ -959,7 +961,7 @@ msgstr "okänd flagga"
 
 #: elf/ldd.bash.in:88 elf/ldd.bash.in:125
 msgid "Try \\`ldd --help' for more information."
-msgstr "Försök med \"ldd --help\" för mer information"
+msgstr "Försök med \"ldd --help\" för mer information."
 
 #: elf/ldd.bash.in:124
 msgid "missing file arguments"
@@ -1028,10 +1030,9 @@ msgid "cannot read object name"
 msgstr "kan inte läsa objektnamn"
 
 #: elf/pldd-xx.c:219
-#, fuzzy, c-format
-#| msgid "cannot allocate memory for program header"
+#, c-format
 msgid "cannot allocate buffer for object name"
-msgstr "kan inte allokera minne för programhuvud"
+msgstr "kan inte allokera en buffert för objektnamn"
 
 #: elf/pldd.c:64
 msgid "List dynamic shared objects loaded into process."
@@ -1212,11 +1213,11 @@ msgstr ""
 
 #: elf/sotruss.sh:46
 msgid "Mandatory arguments to long options are also mandatory for any corresponding\\nshort options.\\n"
-msgstr "Obligatoriska respektive valfria argument för långa flaggor är obligatoriska respektive\\nvalfria även för korta.\\n"
+msgstr "Obligatoriska respektive valfria argument för långa flaggor är obligatoriska\\nrespektive valfria även för korta.\\n"
 
 #: elf/sotruss.sh:55
 msgid "%s: option requires an argument -- '%s'\\n"
-msgstr "%s: flaggan kräver ett argument -- \\\"%s\\\"\\n"
+msgstr "%s: flaggan kräver ett argument — ”%s”\\n"
 
 #: elf/sotruss.sh:61
 msgid "%s: option is ambiguous; possibilities:"
@@ -1240,7 +1241,7 @@ msgstr ""
 
 #: elf/sotruss.sh:134
 msgid "%s: unrecognized option '%c%s'\\n"
-msgstr "%s: okänd flagga \\\"%c%s\\\"\\n"
+msgstr "%s: okänd flagga ”%c%s”\\n"
 
 #: elf/sprof.c:77
 msgid "Output selection:"
@@ -1260,7 +1261,7 @@ msgstr "generera anropsgraf"
 
 #: elf/sprof.c:89
 msgid "Read and display shared object profiling data."
-msgstr "Läs och visa profildata för delat objekt"
+msgstr "Läs och visa profildata för delat objekt."
 
 #: elf/sprof.c:94
 msgid "SHOBJ [PROFDATA]"
@@ -1622,7 +1623,7 @@ msgstr "Fel: .netrc kan läsas av andra."
 
 #: inet/ruserpass.c:185
 msgid "Remove password or make file unreadable by others."
-msgstr "Ta bort lösenord eller gör filen oläsbar för andra"
+msgstr "Ta bort lösenord eller gör filen oläsbar för andra."
 
 #: inet/ruserpass.c:277
 #, c-format
@@ -2182,12 +2183,12 @@ msgstr "Inget namn definierat i teckenuppsättning"
 #: locale/programs/ld-ctype.c:479
 #, c-format
 msgid "character L'\\u%0*x' in class `%s' must be in class `%s'"
-msgstr "tecken L\"\\u%0*x\" i klass \"%s\" måste vara i klass \"%s\""
+msgstr "tecken L'\\u%0*x' i klassen ”%s” måste vara i klassen ”%s”"
 
 #: locale/programs/ld-ctype.c:494
 #, c-format
 msgid "character L'\\u%0*x' in class `%s' must not be in class `%s'"
-msgstr "tecken L\"\\u%0*x\" i klass \"%s\" får inte vara i klass \"%s\""
+msgstr "tecken L'\\u%0*x' i klassen ”%s” får inte vara i klassen ”%s”"
 
 #: locale/programs/ld-ctype.c:508 locale/programs/ld-ctype.c:566
 #, c-format
@@ -2611,7 +2612,7 @@ msgstr "Skriv mer information"
 
 #: locale/programs/locale.c:85
 msgid "Get locale-specific information."
-msgstr "Hämta lokalspecifik information"
+msgstr "Hämta lokalspecifik information."
 
 #: locale/programs/locale.c:88
 msgid ""
@@ -3022,7 +3023,7 @@ msgstr "felaktig mcheck_status, biblioteket är felaktigt\n"
 
 #: malloc/memusage.sh:32
 msgid "%s: option '%s' requires an argument\\n"
-msgstr "%s: flaggan \\\"%s\\\" kräver ett argument\\n"
+msgstr "%s: flaggan ”%s” kräver ett argument\\n"
 
 #: malloc/memusage.sh:38
 msgid ""
@@ -3091,11 +3092,11 @@ msgstr ""
 
 #: malloc/memusage.sh:191
 msgid "memusage: option \\`${1##*=}' is ambiguous"
-msgstr "memusage: flaggan \"${1##*=}\" är tvetydig"
+msgstr "memusage: flaggan ”${1##*=}” är tvetydig"
 
 #: malloc/memusage.sh:200
 msgid "memusage: unrecognized option \\`$1'"
-msgstr "memusage: okänd flagga \"$1\""
+msgstr "memusage: okänd flagga ”$1”"
 
 #: malloc/memusage.sh:213
 msgid "No program name given"
@@ -3341,7 +3342,7 @@ msgstr "Kan inte skapa process hos server"
 
 #: nis/nis_error.h:48
 msgid "Master server busy, full dump rescheduled."
-msgstr "Huvudserver är upptagen, full dump åter schemalagd"
+msgstr "Huvudserver är upptagen, full dump åter schemalagd."
 
 #: nis/nis_local_names.c:121
 #, c-format
@@ -3511,7 +3512,7 @@ msgstr "\t\tRättigheter   : "
 
 #: nis/nis_print.c:290
 msgid "Linked Object Type : "
-msgstr "Länkad objekttyp: "
+msgstr "Länkad objekttyp   : "
 
 #: nis/nis_print.c:292
 #, c-format
@@ -3802,15 +3803,14 @@ msgid " (first)"
 msgstr " (första)"
 
 #: nscd/cache.c:288
-#, fuzzy, c-format
-#| msgid "cannot stat() file `%s': %s"
+#, c-format
 msgid "checking for monitored file `%s': %s"
-msgstr "kan inte ta status på fil \"%s\": %s"
+msgstr "kontrollerar den övervakade filen ”%s”: %s"
 
 #: nscd/cache.c:298
 #, c-format
 msgid "monitored file `%s` changed (mtime)"
-msgstr ""
+msgstr "den övervakade filen ”%s” ändrades (mtime)"
 
 #: nscd/cache.c:341
 #, c-format
@@ -3906,34 +3906,32 @@ msgstr "kan inte få uttag (socket) att acceptera förbindelser: %s"
 #: nscd/connections.c:973
 #, c-format
 msgid "disabled inotify-based monitoring for file `%s': %s"
-msgstr ""
+msgstr "avaktiverade inotify-baserad övervakning för filen ”%s”: %s"
 
 #: nscd/connections.c:977
 #, c-format
 msgid "monitoring file `%s` (%d)"
-msgstr ""
+msgstr "övervakar filen ”%s” (%d)"
 
 #: nscd/connections.c:990
 #, c-format
 msgid "disabled inotify-based monitoring for directory `%s': %s"
-msgstr ""
+msgstr "avaktiverade inotify-baserad övervakning av katalogen ”%s”: %s"
 
 #: nscd/connections.c:994
-#, fuzzy, c-format
-#| msgid "Can't open directory %s"
+#, c-format
 msgid "monitoring directory `%s` (%d)"
-msgstr "Kan inte öppna katalog %s"
+msgstr "övervakar katalogen ”%s” (%d)"
 
 #: nscd/connections.c:1022
-#, fuzzy, c-format
-#| msgid "register trace file %s for database %s"
+#, c-format
 msgid "monitoring file %s for database %s"
-msgstr "registrera spårningsfil %s för databas %s"
+msgstr "övervakar filen %s för databas %s"
 
 #: nscd/connections.c:1032
 #, c-format
 msgid "stat failed for file `%s'; will try again later: %s"
-msgstr ""
+msgstr "stat misslyckades för filen ”%s”; kommer försöka igen senare: %s"
 
 #: nscd/connections.c:1151
 #, c-format
@@ -4032,44 +4030,42 @@ msgstr "handle_request: begäran mottagen (Version = %d)"
 #: nscd/connections.c:1963
 #, c-format
 msgid "ignored inotify event for `%s` (file exists)"
-msgstr ""
+msgstr "ignorerade inotify-händelse för ”%s” (filen finns)"
 
 #: nscd/connections.c:1968
 #, c-format
 msgid "monitored file `%s` was %s, removing watch"
-msgstr ""
+msgstr "den övervakade filen ”%s” var %s, tar bort vakten"
 
 #: nscd/connections.c:1976 nscd/connections.c:2018
 #, c-format
 msgid "failed to remove file watch `%s`: %s"
-msgstr ""
+msgstr "misslyckades att ta bort filvakt ”%s”: %s"
 
 #: nscd/connections.c:1991
 #, c-format
 msgid "monitored file `%s` was written to"
-msgstr ""
+msgstr "den övervakade filen ”%s” skrevs till"
 
 #: nscd/connections.c:2015
 #, c-format
 msgid "monitored parent directory `%s` was %s, removing watch on `%s`"
-msgstr ""
+msgstr "den övervakade föräldrakatalogen ”%s” var %s, tar bort vakten av ”%s”"
 
 #: nscd/connections.c:2041
 #, c-format
 msgid "monitored file `%s` was %s, adding watch"
-msgstr ""
+msgstr "den övervakade filen ”%s” var %s, lägger till vakt"
 
 #: nscd/connections.c:2053
-#, fuzzy, c-format
-#| msgid "failed to load shared object `%s'"
+#, c-format
 msgid "failed to add file watch `%s`: %s"
-msgstr "misslyckades med att ladda delat objekt \"%s\""
+msgstr "misslyckades med att lägga till filvakt ”%s”: %s"
 
 #: nscd/connections.c:2247 nscd/connections.c:2428
-#, fuzzy, c-format
-#| msgid "disabled inotify after read error %d"
+#, c-format
 msgid "disabled inotify-based monitoring after read error %d"
-msgstr "inaktiverade inotify efter läsfel %d"
+msgstr "avaktiverade inotify-baserad övervakning efter läsfel %d"
 
 #: nscd/connections.c:2543
 msgid "could not initialize conditional variable"
@@ -4199,7 +4195,7 @@ msgstr "Använd separat cache för varje användare"
 
 #: nscd/nscd.c:122
 msgid "Name Service Cache Daemon."
-msgstr "Namntjänst cache-demon"
+msgstr "Cache-demon för namntjänsten."
 
 #: nscd/nscd.c:155 nss/getent.c:1007 nss/makedb.c:206
 #, c-format
@@ -4531,11 +4527,11 @@ msgstr "Access Vector Cache (AVC) startad"
 
 #: nscd/selinux.c:368
 msgid "Error querying policy for undefined object classes or permissions."
-msgstr "Fel när policy för odefinierade objektklasser eller rättigheter hämtades"
+msgstr "Fel när policy för odefinierade objektklasser eller rättigheter hämtades."
 
 #: nscd/selinux.c:375
 msgid "Error getting security class for nscd."
-msgstr "Fel när säkerhetsklass för nscd hämtades"
+msgstr "Fel när säkerhetsklass för nscd hämtades."
 
 #: nscd/selinux.c:380
 #, c-format
@@ -4609,7 +4605,7 @@ msgstr "inaktivera DIN-kodning"
 
 #: nss/getent.c:64
 msgid "Get entries from administrative database."
-msgstr "Hämta poster från den administrativa databasen"
+msgstr "Hämta poster från den administrativa databasen."
 
 #: nss/getent.c:148 nss/getent.c:477 nss/getent.c:522
 #, c-format
@@ -4652,7 +4648,7 @@ msgstr "Genererad rad som inte ingår i iterationen"
 
 #: nss/makedb.c:131
 msgid "Create simple database from textual input."
-msgstr "Skapa en enkel databas från textuell indata"
+msgstr "Skapa en enkel databas från textuell indata."
 
 #: nss/makedb.c:134
 msgid ""
@@ -5412,7 +5408,7 @@ msgstr "Kan inte ange netid-flaggan utan TIRPC!\n"
 #: sunrpc/rpc_main.c:1374
 #, c-format
 msgid "Cannot use table flags with newstyle!\n"
-msgstr "Kan inte ange tabellflaggor med ny stil\n"
+msgstr "Kan inte ange tabellflaggor med ny stil!\n"
 
 #: sunrpc/rpc_main.c:1393
 #, c-format
@@ -7270,18 +7266,9 @@ msgstr "tidszonsförkortning skiljer sig från POSIX-standarden"
 
 #: timezone/zic.c:2789
 msgid "too many, or too long, time zone abbreviations"
-msgstr "för många eller för långa tidszonförkortningar"
+msgstr "för många eller för långa tidszonsförkortningar"
 
 #: timezone/zic.c:2829
 #, c-format
 msgid "%s: Can't create directory %s: %s\n"
 msgstr "%s: Kan inte skapa katalog %s: %s\n"
-
-#~ msgid "cannot load any more object with static TLS"
-#~ msgstr "kan inte ladda fler objekt med statiskt TLS"
-
-#~ msgid "%s: no PLTREL found in object %s\n"
-#~ msgstr "%s: hittade inga PLTREL i objekt %s\n"
-
-#~ msgid "cannot create internal descriptors"
-#~ msgstr "kan inte skapa interna deskriptorer"
index d933f9c92acf58c182af5994b226484dd4519713..7cdb06a6112e365ed3f6967e56e29f5bd1ce51fc 100644 (file)
@@ -48,12 +48,13 @@ maybe_script_execute (const char *file, char *const argv[], char *const envp[])
        }
     }
 
-  /* Construct an argument list for the shell.  */
+  /* Construct an argument list for the shell.  It will contain at minimum 3
+     arguments (current shell, script, and an ending NULL.  */
   char *new_argv[argc + 1];
   new_argv[0] = (char *) _PATH_BSHELL;
   new_argv[1] = (char *) file;
   if (argc > 1)
-    memcpy (new_argv + 2, argv + 1, argc * sizeof(char *));
+    memcpy (new_argv + 2, argv + 1, (argc - 1) * sizeof(char *));
   else
     new_argv[2] = NULL;
 
@@ -91,10 +92,11 @@ __execvpe (const char *file, char *const argv[], char *const envp[])
   /* Although GLIBC does not enforce NAME_MAX, we set it as the maximum
      size to avoid unbounded stack allocation.  Same applies for
      PATH_MAX.  */
-  size_t file_len = __strnlen (file, NAME_MAX + 1);
+  size_t file_len = __strnlen (file, NAME_MAX) + 1;
   size_t path_len = __strnlen (path, PATH_MAX - 1) + 1;
 
-  if ((file_len > NAME_MAX)
+  /* NAME_MAX does not include the terminating null character.  */
+  if (((file_len-1) > NAME_MAX)
       || !__libc_alloca_cutoff (path_len + file_len + 1))
     {
       errno = ENAMETOOLONG;
@@ -103,6 +105,9 @@ __execvpe (const char *file, char *const argv[], char *const envp[])
 
   const char *subp;
   bool got_eacces = false;
+  /* The resulting string maximum size would be potentially a entry
+     in PATH plus '/' (path_len + 1) and then the the resulting file name
+     plus '\0' (file_len since it already accounts for the '\0').  */
   char buffer[path_len + file_len + 1];
   for (const char *p = path; ; p = subp)
     {
@@ -123,7 +128,7 @@ __execvpe (const char *file, char *const argv[], char *const envp[])
          execute.  */
       char *pend = mempcpy (buffer, p, subp - p);
       *pend = '/';
-      memcpy (pend + (p < subp), file, file_len + 1);
+      memcpy (pend + (p < subp), file, file_len);
 
       __execve (buffer, argv, envp);
 
index 8be41d3ae1414ba34db9766251214b77bcf669c3..a4c86b97625739e8e77c1af3f1d62e3816e1b9ae 100644 (file)
@@ -40,6 +40,9 @@ ifeq ($(have-thread-library),yes)
 extra-libs += libanl
 routines += gai_sigqueue
 tests += tst-res_hconf_reorder
+
+# This test sends millions of packets and is rather slow.
+xtests += tst-resolv-qtypes
 endif
 extra-libs-others = $(extra-libs)
 libresolv-routines := gethnamaddr res_comp res_debug   \
@@ -117,3 +120,5 @@ tst-leaks2-ENV = MALLOC_TRACE=$(objpfx)tst-leaks2.mtrace
 $(objpfx)mtrace-tst-leaks2.out: $(objpfx)tst-leaks2.out
        $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks2.mtrace > $@; \
        $(evaluate-test)
+
+$(objpfx)tst-resolv-qtypes: $(objpfx)libresolv.so $(shared-thread-library)
index 5f9e35701b2ad915b96d3579f9c926df2d29edba..d16fa4b8edf6078f78fd698901c25e09166f289f 100644 (file)
@@ -323,7 +323,7 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
 
   int olderr = errno;
   enum nss_status status;
-  int n = __libc_res_nsearch (&_res, name, C_IN, T_UNSPEC,
+  int n = __libc_res_nsearch (&_res, name, C_IN, T_QUERY_A_AND_AAAA,
                              host_buffer.buf->buf, 2048, &host_buffer.ptr,
                              &ans2p, &nans2p, &resplen2, &ans2p_malloced);
   if (n >= 0)
index 12f9730199f81f69eca547da88c626075d5063bd..d80b5318e5e0cffdc2c65c0db280116f25957ec3 100644 (file)
@@ -103,6 +103,10 @@ res_nmkquery(res_state statp,
        int n;
        u_char *dnptrs[20], **dpp, **lastdnptr;
 
+       if (class < 0 || class > 65535
+           || type < 0 || type > 65535)
+         return -1;
+
 #ifdef DEBUG
        if (statp->options & RES_DEBUG)
                printf(";; res_nmkquery(%s, %s, %s, %s)\n",
index 944d1a90f57e4299223a0b1e755c629f8ed95da3..07dc6f658386e5be6744336a5090352033aa9649 100644 (file)
@@ -122,7 +122,7 @@ __libc_res_nquery(res_state statp,
        int n, use_malloc = 0;
        u_int oflags = statp->_flags;
 
-       size_t bufsize = (type == T_UNSPEC ? 2 : 1) * QUERYSIZE;
+       size_t bufsize = (type == T_QUERY_A_AND_AAAA ? 2 : 1) * QUERYSIZE;
        u_char *buf = alloca (bufsize);
        u_char *query1 = buf;
        int nquery1 = -1;
@@ -137,7 +137,7 @@ __libc_res_nquery(res_state statp,
                printf(";; res_query(%s, %d, %d)\n", name, class, type);
 #endif
 
-       if (type == T_UNSPEC)
+       if (type == T_QUERY_A_AND_AAAA)
          {
            n = res_nmkquery(statp, QUERY, name, class, T_A, NULL, 0, NULL,
                             query1, bufsize);
@@ -190,7 +190,7 @@ __libc_res_nquery(res_state statp,
        if (__builtin_expect (n <= 0, 0) && !use_malloc) {
                /* Retry just in case res_nmkquery failed because of too
                   short buffer.  Shouldn't happen.  */
-               bufsize = (type == T_UNSPEC ? 2 : 1) * MAXPACKET;
+               bufsize = (type == T_QUERY_A_AND_AAAA ? 2 : 1) * MAXPACKET;
                buf = malloc (bufsize);
                if (buf != NULL) {
                        query1 = buf;
diff --git a/resolv/tst-resolv-qtypes.c b/resolv/tst-resolv-qtypes.c
new file mode 100644 (file)
index 0000000..b3e60c6
--- /dev/null
@@ -0,0 +1,185 @@
+/* Exercise low-level query functions with different QTYPEs.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <resolv.h>
+#include <string.h>
+#include <support/check.h>
+#include <support/check_nss.h>
+#include <support/resolv_test.h>
+#include <support/support.h>
+#include <support/test-driver.h>
+#include <support/xmemstream.h>
+
+/* If ture, the response function will send the actual response packet
+   over TCP instead of UDP.  */
+static volatile bool force_tcp;
+
+/* Send back a fake resource record matching the QTYPE.  */
+static void
+response (const struct resolv_response_context *ctx,
+          struct resolv_response_builder *b,
+          const char *qname, uint16_t qclass, uint16_t qtype)
+{
+  if (force_tcp && ctx->tcp)
+    {
+      resolv_response_init (b, (struct resolv_response_flags) { .tc = 1 });
+      resolv_response_add_question (b, qname, qclass, qtype);
+      return;
+    }
+
+  resolv_response_init (b, (struct resolv_response_flags) { });
+  resolv_response_add_question (b, qname, qclass, qtype);
+  resolv_response_section (b, ns_s_an);
+  resolv_response_open_record (b, qname, qclass, qtype, 0);
+  resolv_response_add_data (b, &qtype, sizeof (qtype));
+  resolv_response_close_record (b);
+}
+
+static const const char *domain = "www.example.com";
+
+static int
+wrap_res_query (int type, unsigned char *answer, int answer_length)
+{
+  return res_query (domain, C_IN, type, answer, answer_length);
+}
+
+static int
+wrap_res_search (int type, unsigned char *answer, int answer_length)
+{
+  return res_query (domain, C_IN, type, answer, answer_length);
+}
+
+static int
+wrap_res_querydomain (int type, unsigned char *answer, int answer_length)
+{
+  return res_querydomain ("www", "example.com", C_IN, type,
+                           answer, answer_length);
+}
+
+static int
+wrap_res_send (int type, unsigned char *answer, int answer_length)
+{
+  unsigned char buf[512];
+  int ret = res_mkquery (QUERY, domain, C_IN, type,
+                         (const unsigned char *) "", 0, NULL,
+                         buf, sizeof (buf));
+  if (type < 0 || type >= 65536)
+    {
+      /* res_mkquery fails for out-of-range record types.  */
+      TEST_VERIFY_EXIT (ret == -1);
+      return -1;
+    }
+  TEST_VERIFY_EXIT (ret > 12);  /* DNS header length.  */
+  return res_send (buf, ret, answer, answer_length);
+}
+
+static int
+wrap_res_nquery (int type, unsigned char *answer, int answer_length)
+{
+  return res_nquery (&_res, domain, C_IN, type, answer, answer_length);
+}
+
+static int
+wrap_res_nsearch (int type, unsigned char *answer, int answer_length)
+{
+  return res_nquery (&_res, domain, C_IN, type, answer, answer_length);
+}
+
+static int
+wrap_res_nquerydomain (int type, unsigned char *answer, int answer_length)
+{
+  return res_nquerydomain (&_res, "www", "example.com", C_IN, type,
+                           answer, answer_length);
+}
+
+static int
+wrap_res_nsend (int type, unsigned char *answer, int answer_length)
+{
+  unsigned char buf[512];
+  int ret = res_nmkquery (&_res, QUERY, domain, C_IN, type,
+                         (const unsigned char *) "", 0, NULL,
+                         buf, sizeof (buf));
+  if (type < 0 || type >= 65536)
+    {
+      /* res_mkquery fails for out-of-range record types.  */
+      TEST_VERIFY_EXIT (ret == -1);
+      return -1;
+    }
+  TEST_VERIFY_EXIT (ret > 12);  /* DNS header length.  */
+  return res_nsend (&_res, buf, ret, answer, answer_length);
+}
+
+static void
+test_function (const char *fname,
+               int (*func) (int type,
+                            unsigned char *answer, int answer_length))
+{
+  unsigned char buf[512];
+  for (int tcp = 0; tcp < 2; ++tcp)
+    {
+      force_tcp = tcp;
+      for (unsigned int type = 1; type <= 65535; ++type)
+        {
+          if (test_verbose)
+            printf ("info: sending QTYPE %d with %s (tcp=%d)\n",
+                    type, fname, tcp);
+          int ret = func (type, buf, sizeof (buf));
+          if (ret != 47)
+            FAIL_EXIT1 ("%s tcp=%d qtype=%d return value %d",
+                        fname,tcp, type, ret);
+          /* One question, one answer record.  */
+          TEST_VERIFY (memcmp (buf + 4, "\0\1\0\1\0\0\0\0", 8) == 0);
+          /* Question section.  */
+          static const char qname[] = "\3www\7example\3com";
+          size_t qname_length = sizeof (qname);
+          TEST_VERIFY (memcmp (buf + 12, qname, qname_length) == 0);
+          /* RDATA part of answer.  */
+          uint16_t type16 = type;
+          TEST_VERIFY (memcmp (buf + ret - 2, &type16, sizeof (type16)) == 0);
+        }
+    }
+
+  TEST_VERIFY (func (-1, buf, sizeof (buf) == -1));
+  TEST_VERIFY (func (65536, buf, sizeof (buf) == -1));
+}
+
+static int
+do_test (void)
+{
+  struct resolv_redirect_config config =
+    {
+      .response_callback = response,
+    };
+  struct resolv_test *obj = resolv_test_start (config);
+
+  test_function ("res_query", &wrap_res_query);
+  test_function ("res_search", &wrap_res_search);
+  test_function ("res_querydomain", &wrap_res_querydomain);
+  test_function ("res_send", &wrap_res_send);
+
+  test_function ("res_nquery", &wrap_res_nquery);
+  test_function ("res_nsearch", &wrap_res_nsearch);
+  test_function ("res_nquerydomain", &wrap_res_nquerydomain);
+  test_function ("res_nsend", &wrap_res_nsend);
+
+  resolv_test_end (obj);
+  return 0;
+}
+
+#define TIMEOUT 300
+#include <support/test-driver.c>
index c1ff864d4b86976ee509ea39f73bb3a1713ffb1b..e9c350af1cc014f900b4a1f09322fd6d2aca8c42 100644 (file)
 double
 __ceil (double x)
 {
+  if (isnan (x))
+    return x + x;
+
   if (isless (fabs (x), 9007199254740992.0))   /* 1 << DBL_MANT_DIG */
     {
       double tmp1, new_x;
 
       new_x = -x;
       __asm (
-#ifdef _IEEE_FP_INEXACT
-            "cvttq/svim %2,%1\n\t"
-#else
             "cvttq/svm %2,%1\n\t"
-#endif
             "cvtqt/m %1,%0\n\t"
             : "=f"(new_x), "=&f"(tmp1)
             : "f"(new_x));
index 7e63a6fe94e7e416ab20c1f3778904556a336339..77e01a99f743cb5b7547f41a0262ad498e4ebe13 100644 (file)
@@ -25,6 +25,9 @@
 float
 __ceilf (float x)
 {
+  if (isnanf (x))
+    return x + x;
+
   if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
     {
       /* Note that Alpha S_Floating is stored in registers in a
@@ -36,11 +39,7 @@ __ceilf (float x)
 
       new_x = -x;
       __asm ("cvtst/s %3,%2\n\t"
-#ifdef _IEEE_FP_INEXACT
-            "cvttq/svim %2,%1\n\t"
-#else
             "cvttq/svm %2,%1\n\t"
-#endif
             "cvtqt/m %1,%0\n\t"
             : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
             : "f"(new_x));
index 1a6f8c4617567b6394ea979fa2b8afcd4144566f..9930f6be42afe86b69061634d4dd97735c732cdc 100644 (file)
 double
 __floor (double x)
 {
+  if (isnan (x))
+    return x + x;
+
   if (isless (fabs (x), 9007199254740992.0))   /* 1 << DBL_MANT_DIG */
     {
       double tmp1, new_x;
 
       __asm (
-#ifdef _IEEE_FP_INEXACT
-            "cvttq/svim %2,%1\n\t"
-#else
             "cvttq/svm %2,%1\n\t"
-#endif
             "cvtqt/m %1,%0\n\t"
             : "=f"(new_x), "=&f"(tmp1)
             : "f"(x));
index 8cd80e2b42d7e27c60e42f690d90bd5920536fd4..015c04f40d805b57f75f79eb19c86f52c76067c6 100644 (file)
@@ -26,6 +26,9 @@
 float
 __floorf (float x)
 {
+  if (isnanf (x))
+    return x + x;
+
   if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
     {
       /* Note that Alpha S_Floating is stored in registers in a
@@ -36,11 +39,7 @@ __floorf (float x)
       float tmp1, tmp2, new_x;
 
       __asm ("cvtst/s %3,%2\n\t"
-#ifdef _IEEE_FP_INEXACT
-            "cvttq/svim %2,%1\n\t"
-#else
             "cvttq/svm %2,%1\n\t"
-#endif
             "cvtqt/m %1,%0\n\t"
             : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
             : "f"(x));
index f33fe72c116be997625006bd719cd11c9098f75e..259348afc08dd18880c9a44c4c054bb814ec7ba3 100644 (file)
@@ -23,6 +23,9 @@
 double
 __rint (double x)
 {
+  if (isnan (x))
+    return x + x;
+
   if (isless (fabs (x), 9007199254740992.0))   /* 1 << DBL_MANT_DIG */
     {
       double tmp1, new_x;
index 1400dfe8d76b3bff112a8c58d2876a43598a3923..645728ad5b02e1c9b9c47a8cb3806471e9362ba7 100644 (file)
@@ -22,6 +22,9 @@
 float
 __rintf (float x)
 {
+  if (isnanf (x))
+    return x + x;
+
   if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
     {
       /* Note that Alpha S_Floating is stored in registers in a
index 16cb114a72f5f13f780e21bf71d89a39e2986eaa..4b986a6926ebc323e89747dcfe201d13a15634e5 100644 (file)
@@ -28,12 +28,11 @@ __trunc (double x)
   double two52 = copysign (0x1.0p52, x);
   double r, tmp;
 
+  if (isgreaterequal (fabs (x), 0x1.0p52))
+    return x;
+
   __asm (
-#ifdef _IEEE_FP_INEXACT
-        "addt/suic %2, %3, %1\n\tsubt/suic %1, %3, %0"
-#else
         "addt/suc %2, %3, %1\n\tsubt/suc %1, %3, %0"
-#endif
         : "=&f"(r), "=&f"(tmp)
         : "f"(x), "f"(two52));
 
index 2290f282954ddb0fa3bcf5b8aa771c6947075f04..3e933561663bea13423fe335d7c76e32d6e83804 100644 (file)
@@ -27,12 +27,11 @@ __truncf (float x)
   float two23 = copysignf (0x1.0p23, x);
   float r, tmp;
 
+  if (isgreaterequal (fabsf (x), 0x1.0p23))
+    return x;
+
   __asm (
-#ifdef _IEEE_FP_INEXACT
-        "adds/suic %2, %3, %1\n\tsubs/suic %1, %3, %0"
-#else
         "adds/suc %2, %3, %1\n\tsubs/suc %1, %3, %0"
-#endif
         : "=&f"(r), "=&f"(tmp)
         : "f"(x), "f"(two23));
 
index 2f7751d167d18bff01b4cdd0efe9aa38e3f5d2fe..dfa71983066197ae50875a8afc999ea49de181d7 100644 (file)
@@ -1840,4 +1840,5 @@ GLIBC_2.23 fts64_close F
 GLIBC_2.23 fts64_open F
 GLIBC_2.23 fts64_read F
 GLIBC_2.23 fts64_set F
+GLIBC_2.24 GLIBC_2.24 A
 GLIBC_2.24 quick_exit F
index d5b8119c9cb5cf5f1391325282287c5935c86589..3e56538b51c4acefff9aa9fb805ae22c641646f1 100644 (file)
@@ -4,6 +4,7 @@
 #define UNSECURE_ENVVARS \
   "GCONV_PATH\0"                                                             \
   "GETCONF_DIR\0"                                                            \
+  "GLIBC_TUNABLES\0"                                                         \
   "HOSTALIASES\0"                                                            \
   "LD_AUDIT\0"                                                               \
   "LD_DEBUG\0"                                                               \
index 9404211819179eebdb6c8918085517ce30bbf90d..01bd5bf1973b76c3b4ade92c35b17ee9ffc4ee08 100644 (file)
@@ -302,6 +302,10 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 #define ARCH_LA_PLTENTER hppa_gnu_pltenter
 #define ARCH_LA_PLTEXIT hppa_gnu_pltexit
 
+/* Adjust DL_STACK_END to get value we want in __libc_stack_end.  */
+#define DL_STACK_END(cookie) \
+  ((void *) (((long) (cookie)) + 0x160))
+
 /* Initial entry point code for the dynamic linker.
    The C function `_dl_start' is the real entry point;
    its return value is the user program's entry point.  */
@@ -401,11 +405,6 @@ asm (                                                                      \
        /* Save the entry point in %r3. */                              \
 "      copy    %ret0,%r3\n"                                            \
                                                                        \
-       /* Remember the lowest stack address. */                        \
-"      addil   LT'__libc_stack_end,%r19\n"                             \
-"      ldw     RT'__libc_stack_end(%r1),%r20\n"                        \
-"      stw     %sp,0(%r20)\n"                                          \
-                                                                       \
        /* See if we were called as a command with the executable file  \
           name as an extra leading argument. */                        \
 "      addil   LT'_dl_skip_args,%r19\n"                                \
index 48f1327446a04a8098e8d84dcf10599ea20a8941..1e6be8eea86ae3dba1c0ecab645b0328fc70184a 100644 (file)
@@ -21,4 +21,5 @@ endif
 
 ifeq ($(subdir),nptl)
 libpthread-routines += ptw-sysdep ptw-sigblock ptw-sigprocmask
+libpthread-shared-only-routines += ptw-sysdep ptw-sigblock ptw-sigprocmask
 endif
index 3d3552322b335647d59d02ac0cdc5a8c2170a720..7c1d77941ec154b460af9b2581cec7e82141acdf 100644 (file)
@@ -9,6 +9,7 @@ endif
 
 ifeq ($(subdir),rt)
 librt-sysdep_routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
 endif
 
 ifeq ($(subdir),debug)
index 5c0ad7328a8168face4bfbe24c021d48f0d87191..dfbbdc4f8f78b10834b24dd3964126a5892e67b1 100644 (file)
@@ -74,6 +74,7 @@ _init:
        .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
 1:     jalr $25
 .Lno_weak_fn:
+       .insn
 #else
        lw $25,%got(PREINIT_FUNCTION)($28)
        .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
index 00b89f3894ca9b8dd80a8a838412e9e30a7f1c83..afe6d8edaae8db8f0437872a90c6a44a6b09d002 100644 (file)
@@ -74,6 +74,7 @@ _init:
        .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
 1:     jalr $25
 .Lno_weak_fn:
+       .insn
 #else
        lw $25,%got_disp(PREINIT_FUNCTION)($28)
        .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
index f59b20c631510e7685512c51b2bc803ef0133f8d..4049d29290ce1e3f271f48f347bdf7ea10f408c0 100644 (file)
@@ -74,6 +74,7 @@ _init:
        .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
 1:     jalr $25
 .Lno_weak_fn:
+       .insn
 #else
        ld $25,%got_disp(PREINIT_FUNCTION)($28)
        .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
index 117744ffe2ddba63c1ed7c767da25ba8a080706c..dda154d8423867092dc00328ca8eaef030aabf8f 100644 (file)
@@ -21,4 +21,5 @@ endif
 
 ifeq ($(subdir),nptl)
 libpthread-sysdep_routines += nptl-sysdep
+libpthread-shared-only-routines += nptl-sysdep
 endif
index 664ad650c3f60697d53414f997b8c71dd2552ac0..b6fbcfd2dd0a38cd17debd28fd6ca32a7a16cf89 100644 (file)
@@ -24,6 +24,6 @@
 clock_t
 clock (void)
 {
-  nacl_abi_clock_t result;
+  nacl_irt_clock_t result;
   return NACL_CALL (__nacl_irt_basic.clock (&result), result);
 }
index 34a7cd46d47fc02c1276ba530fa13d41241f071b..cbce3f5a5afd921b30cbb5c8f35983e760c86b7d 100644 (file)
@@ -27,4 +27,5 @@ __dup (int fd)
   int result;
   return NACL_CALL (__nacl_irt_fdio.dup (fd, &result), result);
 }
+libc_hidden_def (__dup)
 weak_alias (__dup, dup)
index cf43d973a7b7c71f254276bb8b6ec9bbb41489f4..73722d2be65228c845a19ec5998609d74b3e5799 100644 (file)
@@ -33,7 +33,7 @@ __wait3 (int *stat_loc, int options, struct rusage *usage)
       __set_errno (ENOSYS);
       return (pid_t) -1;
     }
-  return __waitpid (WAIT_ANY, stat_loc.__iptr, options);
+  return __waitpid (WAIT_ANY, stat_loc, options);
 }
 
 weak_alias (__wait3, wait3)
index 7f37c813d02de384efa0666ae7cfd1bacd424ddb..36b700c5204c8a10c051faeebd369d77b3f0d3cf 100644 (file)
@@ -36,8 +36,8 @@ double: 2
 float: 2
 idouble: 2
 ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
 
 Function: "acosh_downward":
 double: 1
@@ -52,8 +52,8 @@ double: 2
 float: 2
 idouble: 2
 ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
 
 Function: "acosh_upward":
 double: 2
@@ -122,8 +122,8 @@ double: 3
 float: 3
 idouble: 3
 ifloat: 3
-ildouble: 4
-ldouble: 4
+ildouble: 7
+ldouble: 7
 
 Function: "atan":
 double: 1
@@ -216,8 +216,8 @@ double: 3
 float: 3
 idouble: 3
 ifloat: 3
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
 
 Function: "cabs":
 double: 1
@@ -272,8 +272,8 @@ double: 5
 float: 3
 idouble: 5
 ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
 
 Function: Real part of "cacos_towardzero":
 double: 2
@@ -288,8 +288,8 @@ double: 5
 float: 3
 idouble: 5
 ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
 
 Function: Real part of "cacos_upward":
 double: 2
@@ -328,8 +328,8 @@ double: 5
 float: 3
 idouble: 5
 ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
 
 Function: Imaginary part of "cacosh_downward":
 double: 2
@@ -344,8 +344,8 @@ double: 5
 float: 3
 idouble: 5
 ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
 
 Function: Imaginary part of "cacosh_towardzero":
 double: 2
@@ -432,8 +432,8 @@ double: 5
 float: 3
 idouble: 5
 ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
 
 Function: Real part of "casin_towardzero":
 double: 3
@@ -448,8 +448,8 @@ double: 5
 float: 3
 idouble: 5
 ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
 
 Function: Real part of "casin_upward":
 double: 2
@@ -488,8 +488,8 @@ double: 5
 float: 3
 idouble: 5
 ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
 
 Function: Imaginary part of "casinh_downward":
 double: 3
@@ -504,8 +504,8 @@ double: 5
 float: 3
 idouble: 5
 ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
 
 Function: Imaginary part of "casinh_towardzero":
 double: 3
@@ -696,8 +696,8 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
 
 Function: Real part of "ccos_downward":
 double: 1
@@ -1132,8 +1132,8 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
 
 Function: Imaginary part of "csin":
 ildouble: 1
@@ -1198,8 +1198,8 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
 
 Function: Real part of "csinh_downward":
 double: 2
@@ -1318,8 +1318,8 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
 
 Function: Imaginary part of "ctan":
 double: 2
@@ -1390,8 +1390,8 @@ double: 2
 float: 1
 idouble: 2
 ifloat: 1
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
 
 Function: Real part of "ctanh_downward":
 double: 4
@@ -1478,8 +1478,8 @@ double: 2
 float: 2
 idouble: 2
 ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
 
 Function: "erfc_downward":
 double: 3
@@ -1564,8 +1564,8 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
 
 Function: "exp2_upward":
 double: 1
@@ -1588,8 +1588,8 @@ ildouble: 2
 ldouble: 2
 
 Function: "exp_upward":
-float: 1
 double: 1
+float: 1
 idouble: 1
 ifloat: 1
 ildouble: 1
@@ -1624,8 +1624,8 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 4
-ldouble: 4
+ildouble: 6
+ldouble: 6
 
 Function: "fma":
 ildouble: 1
@@ -1688,8 +1688,8 @@ double: 4
 float: 5
 idouble: 4
 ifloat: 5
-ildouble: 10
-ldouble: 10
+ildouble: 11
+ldouble: 11
 
 Function: "hypot":
 double: 1
@@ -1752,8 +1752,8 @@ double: 1
 float: 2
 idouble: 1
 ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
 
 Function: "j1_downward":
 double: 3
@@ -1840,8 +1840,8 @@ double: 4
 float: 5
 idouble: 4
 ifloat: 5
-ildouble: 10
-ldouble: 10
+ildouble: 11
+ldouble: 11
 
 Function: "log":
 float: 1
@@ -1910,8 +1910,8 @@ double: 2
 float: 2
 idouble: 2
 ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
 
 Function: "log2":
 double: 1
@@ -2184,16 +2184,16 @@ double: 3
 float: 3
 idouble: 3
 ifloat: 3
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
 
 Function: "tanh_towardzero":
 double: 2
 float: 2
 idouble: 2
 ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
 
 Function: "tanh_upward":
 double: 3
index 526d8ed88b2686bb811f42fc43441a3262ecdc77..ac589bd3c049b7ceed766c9c1697a0d0c2b8e81b 100644 (file)
@@ -17,15 +17,17 @@ ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void))
           "addis %0,11,%2-1b@ha\n\t"
           "addi %0,%0,%2-1b@l\n\t"
           "cmpwi 12,1\n\t"
-          "beqlr\n\t"
+          "beq 2f\n\t"
           "addis %0,11,%3-1b@ha\n\t"
           "addi %0,%0,%3-1b@l\n\t"
           "cmpwi 12,-1\n\t"
-          "beqlr\n\t"
+          "beq 2f\n\t"
           "addis %0,11,%4-1b@ha\n\t"
-          "addi %0,%0,%4-1b@l"
+          "addi %0,%0,%4-1b@l\n\t"
+          "2:"
           : "=r" (ret)
-          : "X" (&global), "X" (f1), "X" (f2), "X" (f3));
+          : "i" (&global), "i" (f1), "i" (f2), "i" (f3)
+          : "11", "12", "cr0");
   return ret;
 }
 
@@ -40,7 +42,8 @@ ifunc_one (int (*f1) (void))
           "addis %0,%0,%1-1b@ha\n\t"
           "addi %0,%0,%1-1b@l"
           : "=r" (ret)
-          : "X" (f1));
+          : "i" (f1)
+          : "12");
   return ret;
 }
 #endif
index b2a222edd22a5c21a3edb6bf010f69f3772f4c8a..d5dbe83af2fd9d46d0e237707901096ddc298e81 100644 (file)
@@ -394,7 +394,7 @@ L(cacheAlignedx):
 /* A simple loop for the longer (>640 bytes) lengths.  This form limits
    the branch miss-predicted to exactly 1 at loop exit.*/
 L(cacheAligned512):
-       cmpl  cr1,rLEN,128
+       cmplwi  cr1,rLEN,128
        blt     cr1,L(cacheAligned1)
        dcbz    0,rMEMP
        addi    rLEN,rLEN,-128
index 4393b5687264d644066c53decfbe2f20c1c96611..1a46ef003586eddea6f0acaa87a507dd902c4973 100644 (file)
@@ -1 +1 @@
-powerpc/powerpc32/power8/fpu/multiarch
+powerpc/powerpc32/power8/multiarch
index c2d1c4e600c810fd967c1331d7fc974070b64384..d445b1e1ef18597635830089d315d9fdeb89bccc 100644 (file)
@@ -251,7 +251,7 @@ L(cacheAlignedx):
 /* A simple loop for the longer (>640 bytes) lengths.  This form limits
    the branch miss-predicted to exactly 1 at loop exit.*/
 L(cacheAligned512):
-       cmpl  cr1,rLEN,128
+       cmpldi  cr1,rLEN,128
        blt     cr1,L(cacheAligned1)
        dcbz    0,rMEMP
        addi    rLEN,rLEN,-128
index fad2505ab9489da02ea9dba5d944718d02aeed22..ae0dbaf857bb6d983a728a0df320c429428c978b 100644 (file)
@@ -1,2 +1 @@
 powerpc/powerpc64/power8/fpu
-powerpc/powerpc64/power8
index 5734b983b0b5ba5ddb13686964afc263d2a96e8f..3a391c82179b9f5a58cedf08214b8696aee8689b 100644 (file)
@@ -21,4 +21,5 @@ endif
 
 ifeq ($(subdir),nptl)
 libpthread-routines += ptw-sysdep
+libpthread-shared-only-routines += ptw-sysdep
 endif
diff --git a/sysdeps/sparc/sparc32/fpu/s_fdim.S b/sysdeps/sparc/sparc32/fpu/s_fdim.S
deleted file mode 100644 (file)
index e93970f..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Compute positive difference, sparc 32-bit.
-   Copyright (C) 2013-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David S. Miller <davem@davemloft.net>.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
-ENTRY(__fdim)
-       std     %o0, [%sp + 72]
-       std     %o2, [%sp + 80]
-       ldd     [%sp + 72], %f0
-       ldd     [%sp + 80], %f2
-       fcmpd   %f0, %f2
-       st      %g0, [%sp + 72]
-       fbug    1f
-        st     %g0, [%sp + 76]
-       ldd     [%sp + 72], %f0
-       fnegs   %f0, %f2
-       fmovs   %f1, %f3
-1:     retl
-        fsubd  %f0, %f2, %f0
-END(__fdim)
-weak_alias (__fdim, fdim)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
diff --git a/sysdeps/sparc/sparc32/fpu/s_fdimf.S b/sysdeps/sparc/sparc32/fpu/s_fdimf.S
deleted file mode 100644 (file)
index c3fe8af..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Compute positive difference, sparc 32-bit.
-   Copyright (C) 2013-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David S. Miller <davem@davemloft.net>.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-
-ENTRY(__fdimf)
-       st      %o0, [%sp + 72]
-       st      %o1, [%sp + 76]
-       ld      [%sp + 72], %f0
-       ld      [%sp + 76], %f1
-       fcmps   %f0, %f1
-       fbug    1f
-        st     %g0, [%sp + 72]
-       ld      [%sp + 72], %f0
-       fnegs   %f0, %f1
-1:     retl
-        fsubs  %f0, %f1, %f0
-END(__fdimf)
-weak_alias (__fdimf, fdimf)
index ebbe28b07f666cae6a07fa7b8d9b70da60d11a1f..13d3c6db513309c38c43b059a9fc259ec803e5ac 100644 (file)
@@ -4,8 +4,8 @@ libm-sysdep_routines += m_copysignf-vis3 m_copysign-vis3 s_fabs-vis3 \
                        s_fabsf-vis3 s_llrintf-vis3 s_llrint-vis3 \
                        s_rintf-vis3 s_rint-vis3 w_sqrt-vis3 w_sqrtf-vis3 \
                        s_fminf-vis3 s_fmin-vis3 s_fmaxf-vis3 s_fmax-vis3 \
-                       s_fmaf-vis3 s_fma-vis3 s_fdimf-vis3 s_fdim-vis3 \
-                       s_nearbyint-vis3 s_nearbyintf-vis3
+                       s_fmaf-vis3 s_fma-vis3 s_nearbyint-vis3 \
+                       s_nearbyintf-vis3
 sysdep_routines += s_copysignf-vis3 s_copysign-vis3
 endif
 endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S
deleted file mode 100644 (file)
index 4a479b1..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Compute positive difference, sparc 32-bit+v9+vis3.
-   Copyright (C) 2013-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David S. Miller <davem@davemloft.net>.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-
-ENTRY(__fdim_vis3)
-       movwtos %o0, %f0
-       movwtos %o1, %f1
-       movwtos %o2, %f2
-       movwtos %o3, %f3
-       fcmpd   %f0, %f2
-       fbug    1f
-        nop
-       fzero   %f0
-       fnegd   %f0, %f2
-1:     retl
-        fsubd  %f0, %f2, %f0
-END(__fdim_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S
deleted file mode 100644 (file)
index 4b13408..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(fdim)
-
-weak_alias (__fdim, fdim)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __fdim __fdim_generic
-
-#include "../s_fdim.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S
deleted file mode 100644 (file)
index 081fc15..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Compute positive difference, sparc 32-bit+v9+vis3.
-   Copyright (C) 2013-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David S. Miller <davem@davemloft.net>.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-
-ENTRY(__fdimf_vis3)
-       movwtos %o0, %f0
-       movwtos %o1, %f1
-       fcmps   %f0, %f1
-       fbug    1f
-        nop
-       fzeros  %f0
-       fnegs   %f0, %f1
-1:     retl
-        fsubs  %f0, %f1, %f0
-END(__fdimf_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S
deleted file mode 100644 (file)
index 30381d6..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fdimf)
-
-weak_alias (__fdimf, fdimf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fdimf __fdimf_generic
-
-#include "../s_fdimf.S"
index d9ff0cc2884d13dcb86f003d0af636df3d6917d3..ff81b0da83208ac4568fbb09cee5084338a518ea 100644 (file)
 #define SIGN_BIT       %f12                    /* -0.0 */
 
 ENTRY (__nearbyint_vis3)
+       sllx    %o0, 32, %o0
+       or      %o0, %o1, %o0
+       movxtod %o0, %f0
        fcmpd   %fcc3, %f0, %f0                 /* Check for sNaN */
        st      %fsr, [%sp + 88]
        sethi   %hi(TWO_FIFTYTWO), %o2
        sethi   %hi(0xf8003e0), %o5
        ld      [%sp + 88], %o4
-       sllx    %o0, 32, %o0
        or      %o5, %lo(0xf8003e0), %o5
-       or      %o0, %o1, %o0
-       movxtod %o0, %f0
        andn    %o4, %o5, %o4
        fzero   ZERO
        st      %o4, [%sp + 80]
index 5cd1eb02db5ab95db9a82f362fb625dcdc66c737..833a0dfc243a681bc7afe5287d38c108f119bb45 100644 (file)
@@ -35,9 +35,9 @@
 #define SIGN_BIT       %f12                    /* -0.0 */
 
 ENTRY (__nearbyintf_vis3)
+       movwtos %o0, %f1
        fcmps   %fcc3, %f1, %f1                 /* Check for sNaN */
        st      %fsr, [%sp + 88]
-       movwtos %o0, %f1
        sethi   %hi(TWO_TWENTYTHREE), %o2
        sethi   %hi(0xf8003e0), %o5
        ld      [%sp + 88], %o4
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S
deleted file mode 100644 (file)
index 37f7f44..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Compute positive difference, sparc 32-bit+v9.
-   Copyright (C) 2013-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David S. Miller <davem@davemloft.net>.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
-ENTRY(__fdim)
-       std     %o0, [%sp + 72]
-       std     %o2, [%sp + 80]
-       ldd     [%sp + 72], %f0
-       ldd     [%sp + 80], %f2
-       fcmpd   %f0, %f2
-       fbug    1f
-        nop
-       fzero   %f0
-       fnegd   %f0, %f2
-1:     retl
-        fsubd  %f0, %f2, %f0
-END(__fdim)
-weak_alias (__fdim, fdim)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S
deleted file mode 100644 (file)
index 9e0e3f2..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Compute positive difference, sparc 32-bit+v9.
-   Copyright (C) 2013-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David S. Miller <davem@davemloft.net>.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-
-ENTRY(__fdimf)
-       st      %o0, [%sp + 72]
-       st      %o1, [%sp + 76]
-       ld      [%sp + 72], %f0
-       ld      [%sp + 76], %f1
-       fcmps   %f0, %f1
-       fbug    1f
-        nop
-       fzeros  %f0
-       fnegs   %f0, %f1
-1:     retl
-        fsubs  %f0, %f1, %f0
-END(__fdimf)
-weak_alias (__fdimf, fdimf)
index 84a10971a4eb1a849b17d30e9a1038e8748142f4..198440a5bc26a58ad10fe9f3692e870c08a2e063 100644 (file)
 #define SIGN_BIT       %f12                    /* -0.0 */
 
 ENTRY (__nearbyint)
+       sllx    %o0, 32, %o0
+       or      %o0, %o1, %o0
+       stx     %o0, [%sp + 72]
+       ldd     [%sp + 72], %f0
        fcmpd   %fcc3, %f0, %f0                 /* Check for sNaN */
        st      %fsr, [%sp + 88]
        sethi   %hi(TWO_FIFTYTWO), %o2
        sethi   %hi(0xf8003e0), %o5
        ld      [%sp + 88], %o4
-       sllx    %o0, 32, %o0
        or      %o5, %lo(0xf8003e0), %o5
-       or      %o0, %o1, %o0
        andn    %o4, %o5, %o4
        fzero   ZERO
        st      %o4, [%sp + 80]
-       stx     %o0, [%sp + 72]
        sllx    %o2, 32, %o2
        fnegd   ZERO, SIGN_BIT
-       ldd     [%sp + 72], %f0
        ld      [%sp + 80], %fsr
        stx     %o2, [%sp + 72]
        fabsd   %f0, %f14
index d5cf5ce815afadbd86b26a5497514279d25d44ce..9be41f6c228debd0352efa3887b5c277e4bf1a11 100644 (file)
 #define SIGN_BIT       %f12                    /* -0.0 */
 
 ENTRY (__nearbyintf)
+       st      %o0, [%sp + 68]
+       ld      [%sp + 68], %f1
        fcmps   %fcc3, %f1, %f1                 /* Check for sNaN */
        st      %fsr, [%sp + 88]
-       st      %o0, [%sp + 68]
        sethi   %hi(TWO_TWENTYTHREE), %o2
        sethi   %hi(0xf8003e0), %o5
        ld      [%sp + 88], %o4
@@ -46,7 +47,6 @@ ENTRY (__nearbyintf)
        fnegs   ZERO, SIGN_BIT
        andn    %o4, %o5, %o4
        st      %o4, [%sp + 80]
-       ld      [%sp + 68], %f1
        ld      [%sp + 80], %fsr
        st      %o2, [%sp + 68]
        fabss   %f1, %f14
diff --git a/sysdeps/sparc/sparc64/fpu/s_fdim.S b/sysdeps/sparc/sparc64/fpu/s_fdim.S
deleted file mode 100644 (file)
index 7fae72a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Compute positive difference, sparc 64-bit.
-   Copyright (C) 2013-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David S. Miller <davem@davemloft.net>.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
-ENTRY(__fdim)
-       fcmpd   %f0, %f2
-       fbug    1f
-        nop
-       fzero   %f0
-       fnegd   %f0, %f2
-1:     retl
-        fsubd  %f0, %f2, %f0
-END(__fdim)
-weak_alias (__fdim, fdim)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fdimf.S b/sysdeps/sparc/sparc64/fpu/s_fdimf.S
deleted file mode 100644 (file)
index 356c23c..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Compute positive difference, sparc 64-bit.
-   Copyright (C) 2013-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David S. Miller <davem@davemloft.net>.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-
-ENTRY(__fdimf)
-       fcmps   %f1, %f3
-       fbug    1f
-        nop
-       fzeros  %f1
-       fnegs   %f1, %f3
-1:     retl
-        fsubs  %f1, %f3, %f0
-END(__fdimf)
-weak_alias (__fdimf, fdimf)
index 441aa02a83800f8b1288e58afd68a4beb1bb12d7..0660847f15aab061b2d4b2edcfe9e4ac6225ec1c 100644 (file)
@@ -1,3 +1,4 @@
 ifeq ($(subdir),rt)
 librt-sysdep_routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
 endif
index c089545e9b84ee65d50a6206741205788ea616cb..3b523b70cfadb003584dbd5fad6548d098ac4863 100644 (file)
@@ -40,4 +40,5 @@ endif   # math
 ifeq ($(subdir),nptl)
 # pull in __syscall_error routine, __sigprocmask, __syscall_rt_sigaction
 libpthread-routines += ptw-sysdep ptw-sigprocmask ptw-rt_sigaction
+libpthread-shared-only-routines += ptw-sysdep ptw-sigprocmask ptw-rt_sigaction
 endif
index 603e508858b491c6973552bd680bf3fc927f4714..d1f168fece80fd55bc79946f849c6fab4ff43e1b 100644 (file)
@@ -86,12 +86,19 @@ weak_alias(__setcontext, setcontext)
 
        /* Called when a makecontext() context returns.  Start the
           context in R4 or fall through to exit().  */
+       /* Unwind descriptors are looked up based on PC - 2, so we have to
+          make sure to mark the instruction preceding the __startcontext
+          label as .cantunwind.  */
+       .fnstart
+       .cantunwind
+       nop
 ENTRY(__startcontext)
        movs    r0, r4
        bne     PLTJMP(__setcontext)
 
        @ New context was 0 - exit
        b       PLTJMP(HIDDEN_JUMPTARGET(exit))
+       .fnend
 END(__startcontext)
 
 #ifdef PIC
index 71ba61e9d75dc2c0d45bac00265f35a56ef27eb4..6073a9fe04f0b51009b190876d4b60e14e74ee15 100644 (file)
@@ -31,6 +31,7 @@ endif
 # libpthread uses six-argument inline syscalls.
 ifeq ($(subdir),nptl)
 libpthread-sysdep_routines += libc-do-syscall
+libpthread-shared-only-routines += libc-do-syscall
 endif
 
 ifeq ($(subdir),resource)
@@ -48,9 +49,11 @@ endif
 ifeq ($(subdir),nptl)
 # pull in __syscall_error routine
 libpthread-routines += sysdep
+libpthread-shared-only-routines += sysdep
 endif
 
 ifeq ($(subdir),rt)
 # pull in __syscall_error routine
 librt-routines += sysdep
+librt-shared-only-routines += sysdep
 endif
index 1de62c528ae28dee817295efa8cb0de1b4b0d2e3..4d6766db5e73dde5f2d6a5fb3d933b9a0975d6b6 100644 (file)
@@ -19,6 +19,7 @@ endif
 
 ifeq ($(subdir),rt)
 librt-routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
 endif
 
 ifeq ($(subdir),nptl)
index 44a838fa110d2a65ced3bc87188ac9d1fe18efe4..d178bc6f34666782e48c96df97750644d3026c02 100644 (file)
@@ -5,4 +5,5 @@ endif
 ifeq ($(subdir),nptl)
 # pull in __syscall_error routine
 libpthread-routines += sysdep
-endif
\ No newline at end of file
+libpthread-shared-only-routines += sysdep
+endif
index 890a74494ae26eb5e396fafe88126eaa45c0c121..26ab6d0b75ff86e76c5b55b992e7902bc75b2b2f 100644 (file)
@@ -4,6 +4,8 @@ mmap            -       mmap            b:aniiii __mmap         mmap __mmap64 mmap64
 
 sync_file_range        -       sync_file_range Ci:iiii sync_file_range
 
+readahead      -       readahead       i:iii   __readahead     readahead
+
 prlimit                EXTRA   prlimit64       i:iipp  prlimit         prlimit64
 
 fanotify_mark  EXTRA   fanotify_mark   i:iiiis fanotify_mark
index c89ed9ec7dfc222e34a525c7c5d0ba62e155369d..2cfb46eca3c2dd7f3a394d5063c23c7a0e4e495e 100644 (file)
@@ -8,6 +8,7 @@ abi-64-v2-condition := __WORDSIZE == 64 && _CALL_ELF == 2
 
 ifeq ($(subdir),rt)
 librt-routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
 endif
 
 ifeq ($(subdir),stdlib)
@@ -34,4 +35,5 @@ ifeq ($(subdir),nptl)
 libpthread-routines += sysdep
 libpthread-sysdep_routines += elision-lock elision-unlock elision-timed \
                              elision-trylock
+libpthread-shared-only-routines += sysdep
 endif
index dd1e4c3b17a362fdc12cc04f9daf9ae4ac2c6204..7dd3d835b6ab80d07e121858daa3ccb9b4da1ded 100644 (file)
@@ -45,7 +45,9 @@
 int
 __lll_lock_elision (int *lock, short *adapt_count, EXTRAARG int pshared)
 {
-  if (*adapt_count > 0)
+  /* adapt_count is accessed concurrently but is just a hint.  Thus,
+     use atomic accesses but relaxed MO is sufficient.  */
+  if (atomic_load_relaxed (adapt_count) > 0)
     {
       goto use_lock;
     }
@@ -67,7 +69,8 @@ __lll_lock_elision (int *lock, short *adapt_count, EXTRAARG int pshared)
          if (_TEXASRU_FAILURE_PERSISTENT (__builtin_get_texasru ()))
            {
              if (aconf.skip_lock_internal_abort > 0)
-               *adapt_count = aconf.skip_lock_internal_abort;
+               atomic_store_relaxed (adapt_count,
+                                     aconf.skip_lock_internal_abort);
              goto use_lock;
            }
        }
@@ -75,7 +78,8 @@ __lll_lock_elision (int *lock, short *adapt_count, EXTRAARG int pshared)
 
   /* Fall back to locks for a bit if retries have been exhausted */
   if (aconf.try_tbegin > 0 && aconf.skip_lock_out_of_tbegin_retries > 0)
-    *adapt_count = aconf.skip_lock_out_of_tbegin_retries;
+    atomic_store_relaxed (adapt_count,
+                         aconf.skip_lock_out_of_tbegin_retries);
 
 use_lock:
   return LLL_LOCK ((*lock), pshared);
index 0807a6a4323b1a52a243e454a9bad25cc54673f0..606185670dc359739bf5a9ca5648ae3802d0314e 100644 (file)
@@ -34,7 +34,7 @@ __lll_trylock_elision (int *futex, short *adapt_count)
   __libc_tabort (_ABORT_NESTED_TRYLOCK);
 
   /* Only try a transaction if it's worth it.  */
-  if (*adapt_count > 0)
+  if (atomic_load_relaxed (adapt_count) > 0)
     {
       goto use_lock;
     }
@@ -49,7 +49,7 @@ __lll_trylock_elision (int *futex, short *adapt_count)
       __libc_tend (0);
 
       if (aconf.skip_lock_busy > 0)
-       *adapt_count = aconf.skip_lock_busy;
+       atomic_store_relaxed (adapt_count, aconf.skip_lock_busy);
     }
   else
     {
@@ -59,7 +59,8 @@ __lll_trylock_elision (int *futex, short *adapt_count)
             result in another failure.  Use normal locking now and
             for the next couple of calls.  */
          if (aconf.skip_trylock_internal_abort > 0)
-           *adapt_count = aconf.skip_trylock_internal_abort;
+           atomic_store_relaxed (adapt_count,
+                               aconf.skip_trylock_internal_abort);
        }
     }
 
index 43c5a67df2a43bbc245650bc6514e93cf6cffb3f..51d7018e4c0aca37eadbfb502cb42004eb6acea7 100644 (file)
@@ -28,13 +28,16 @@ __lll_unlock_elision (int *lock, short *adapt_count, int pshared)
     __libc_tend (0);
   else
     {
-      lll_unlock ((*lock), pshared);
+      /* Update adapt_count in the critical section to prevent a
+        write-after-destroy error as mentioned in BZ 20822.  The
+        following update of adapt_count has to be contained within
+        the critical region of the fall-back lock in order to not violate
+        the mutex destruction requirements.  */
+      short __tmp = atomic_load_relaxed (adapt_count);
+      if (__tmp > 0)
+       atomic_store_relaxed (adapt_count, __tmp - 1);
 
-      /* Update the adapt count AFTER completing the critical section.
-         Doing this here prevents unneeded stalling when entering
-         a critical section.  Saving about 8% runtime on P8.  */
-      if (*adapt_count > 0)
-       (*adapt_count)--;
+      lll_unlock ((*lock), pshared);
     }
   return 0;
 }
index 1bcff64781b2843b080b6fd2c2f5886500358065..46d974d95215c08cc2c32864ebacf592eb2493d1 100644 (file)
@@ -28,8 +28,7 @@
 ssize_t
 __libc_pread (int fd, void *buf, size_t count, off_t offset)
 {
-  return SYSCALL_CANCEL (pread, fd, buf, count,
-                        __ALIGNMENT_ARG SYSCALL_LL (offset));
+  return SYSCALL_CANCEL (pread, fd, buf, count, SYSCALL_LL_PRW (offset));
 }
 
 strong_alias (__libc_pread, __pread)
index 58c6aeb5413ac606ba6cf7d43ae53c00ebc234d6..f51beae77a59449930669277e69e44bd1caf2d28 100644 (file)
@@ -26,8 +26,7 @@
 ssize_t
 __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
 {
-  return SYSCALL_CANCEL (pread64, fd, buf, count,
-                        __ALIGNMENT_ARG SYSCALL_LL64 (offset));
+  return SYSCALL_CANCEL (pread64, fd, buf, count, SYSCALL_LL64_PRW (offset));
 }
 
 weak_alias (__libc_pread64, __pread64)
index 9c502beac163b33fc91cabecb3f242ac3b1e9820..1371df8a60703c39ce80ec54b244d083a139b6d2 100644 (file)
@@ -28,8 +28,7 @@
 ssize_t
 __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
 {
-  return SYSCALL_CANCEL (pwrite, fd, buf, count,
-                        __ALIGNMENT_ARG SYSCALL_LL (offset));
+  return SYSCALL_CANCEL (pwrite, fd, buf, count, SYSCALL_LL_PRW (offset));
 }
 
 strong_alias (__libc_pwrite, __pwrite)
index b49e6bc286cb05dbb48c02384565867355e71458..22f1f05a44d92d537124f9af0ab5943a041498b2 100644 (file)
@@ -26,8 +26,7 @@
 ssize_t
 __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
 {
-  return SYSCALL_CANCEL (pwrite64, fd, buf, count,
-                        __ALIGNMENT_ARG SYSCALL_LL64 (offset));
+  return SYSCALL_CANCEL (pwrite64, fd, buf, count, SYSCALL_LL64_PRW (offset));
 }
 weak_alias (__libc_pwrite64, __pwrite64)
 libc_hidden_weak (__pwrite64)
index 497ffd566cbdb2a3949d03c5c8ea05161bfee1fb..f8ed013e9e2bcf6a4d6042fc59c4297ad64a9e92 100644 (file)
@@ -6,6 +6,7 @@ abi-64-condition := __WORDSIZE == 64
 
 ifeq ($(subdir),rt)
 librt-routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
 endif
 
 ifeq ($(subdir),stdlib)
index ad05fc39e161fde9167589652ca7dba9bd57c568..c5240fafbd5f838f1a7ad1905c10acc99d8010b5 100644 (file)
@@ -44,3 +44,8 @@
 
 /* SH does not have a 64-bit inode field.  */
 #undef __ASSUME_ST_INO_64_BIT
+
+/* SH4 ABI does not really require argument alignment for 64-bits, but
+   the kernel interface for p{read,write}64 adds a dummy long argument
+   before the offset.  */
+#define __ASSUME_PRW_DUMMY_ARG 1
diff --git a/sysdeps/unix/sysv/linux/sh/pread.c b/sysdeps/unix/sysv/linux/sh/pread.c
deleted file mode 100644 (file)
index d3f99f3..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-/* SH4 ABI does not really require argument alignment for 64-bits, but
-   the kernel interface for pread adds a dummy long argument before the
-   offset.  */
-#define __ALIGNMENT_ARG
-#include <sysdeps/unix/sysv/linux/pread.c>
diff --git a/sysdeps/unix/sysv/linux/sh/pread64.c b/sysdeps/unix/sysv/linux/sh/pread64.c
deleted file mode 100644 (file)
index b2e8a25..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-/* SH4 ABI does not really require argument alignment for 64-bits, but
-   the kernel interface for pread adds a dummy long argument before the
-   offset.  */
-#define __ALIGNMENT_ARG
-#include <sysdeps/unix/sysv/linux/pread64.c>
diff --git a/sysdeps/unix/sysv/linux/sh/pwrite.c b/sysdeps/unix/sysv/linux/sh/pwrite.c
deleted file mode 100644 (file)
index 391ed5e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-/* SH4 ABI does not really require argument alignment for 64-bits, but
-   the kernel interface for pwrite adds a dummy long argument before the
-   offset.  */
-#define __ALIGNMENT_ARG
-#include <sysdeps/unix/sysv/linux/pwrite.c>
diff --git a/sysdeps/unix/sysv/linux/sh/pwrite64.c b/sysdeps/unix/sysv/linux/sh/pwrite64.c
deleted file mode 100644 (file)
index 683a5d9..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ralf Baechle <ralf@gnu.org>, 1998.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-/* SH4 ABI does not really require argument alignment for 64-bits, but
-   the kernel interface for pread adds a dummy long argument before the
-   offset.  */
-#define __ALIGNMENT_ARG
-#include <sysdeps/unix/sysv/linux/pwrite64.c>
index e67aecf8f0bc472a5e75213b94340dc20eea8f44..a67d199eb5d7705921691dd88f4ca7ee31aa6fdd 100644 (file)
@@ -6,6 +6,7 @@ abi-64-condition := __WORDSIZE == 64
 
 ifeq ($(subdir),rt)
 librt-routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
 endif
 
 ifeq ($(subdir),sysvipc)
@@ -15,4 +16,5 @@ endif
 ifeq ($(subdir),nptl)
 # pull in __syscall_error routine
 libpthread-routines += sysdep
+libpthread-shared-only-routines += sysdep
 endif
index bb3eecfde1a51fb099c103ff988170e56658c63f..b5f20a710bc580075a4423f271d820f5eb6b1dcd 100644 (file)
    normal program exit with the exit code 127.  */
 #define SPAWN_ERROR    127
 
-/* We need to block both SIGCANCEL and SIGSETXID.  */
-#define SIGALL_SET \
-  ((__sigset_t) { .__val = {[0 ...  _SIGSET_NWORDS-1 ] =  -1 } })
-
 #ifdef __ia64__
-# define CLONE(__fn, __stack, __stacksize, __flags, __args) \
-  __clone2 (__fn, __stack, __stacksize, __flags, __args, 0, 0, 0)
+# define CLONE(__fn, __stackbase, __stacksize, __flags, __args) \
+  __clone2 (__fn, __stackbase, __stacksize, __flags, __args, 0, 0, 0)
 #else
 # define CLONE(__fn, __stack, __stacksize, __flags, __args) \
   __clone (__fn, __stack, __flags, __args)
 #endif
 
-#if _STACK_GROWS_DOWN
-# define STACK(__stack, __stack_size) (__stack + __stack_size)
-#elif _STACK_GROWS_UP
+/* Since ia64 wants the stackbase w/clone2, re-use the grows-up macro.  */
+#if _STACK_GROWS_UP || defined (__ia64__)
 # define STACK(__stack, __stack_size) (__stack)
+#elif _STACK_GROWS_DOWN
+# define STACK(__stack, __stack_size) (__stack + __stack_size)
 #endif
 
 
@@ -329,6 +326,11 @@ __spawnix (pid_t * pid, const char *file,
 
   /* Add a slack area for child's stack.  */
   size_t argv_size = (argc * sizeof (void *)) + 512;
+  /* We need at least a few pages in case the compiler's stack checking is
+     enabled.  In some configs, it is known to use at least 24KiB.  We use
+     32KiB to be "safe" from anything the compiler might do.  Besides, the
+     extra pages won't actually be allocated unless they get used.  */
+  argv_size += (32 * 1024);
   size_t stack_size = ALIGN_UP (argv_size, GLRO(dl_pagesize));
   void *stack = __mmap (NULL, stack_size, prot,
                        MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
@@ -340,7 +342,9 @@ __spawnix (pid_t * pid, const char *file,
     }
 
   /* Disable asynchronous cancellation.  */
-  int cs = LIBC_CANCEL_ASYNC ();
+  int state;
+  __libc_ptf_call (__pthread_setcancelstate,
+                   (PTHREAD_CANCEL_DISABLE, &state), 0);
 
   args.file = file;
   args.exec = exec;
@@ -351,7 +355,7 @@ __spawnix (pid_t * pid, const char *file,
   args.envp = envp;
   args.xflags = xflags;
 
-  __sigprocmask (SIG_BLOCK, &SIGALL_SET, &args.oldmask);
+  __libc_signal_block_all (&args.oldmask);
 
   /* The clone flags used will create a new child that will run in the same
      memory space (CLONE_VM) and the execution of calling thread will be
@@ -384,9 +388,9 @@ __spawnix (pid_t * pid, const char *file,
   if ((ec == 0) && (pid != NULL))
     *pid = new_pid;
 
-  __sigprocmask (SIG_SETMASK, &args.oldmask, 0);
+  __libc_signal_restore_set (&args.oldmask);
 
-  LIBC_CANCEL_RESET (cs);
+  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
 
   return ec;
 }
index a469f57121ffe51d271f91a6ef7386edd58f0399..e3ecd5638e0ac6450ea860b5087f751b3cfa94ac 100644 (file)
   __LONG_LONG_PAIR ((long) ((val) >> 32), (long) ((val) & 0xffffffff))
 #endif
 
+/* Provide a common macro to pass 64-bit value on pread and pwrite
+   syscalls.  */
+#ifdef __ASSUME_PRW_DUMMY_ARG
+# define SYSCALL_LL_PRW(val)   0, SYSCALL_LL (val)
+# define SYSCALL_LL64_PRW(val) 0, SYSCALL_LL64 (val)
+#else
+# define SYSCALL_LL_PRW(val)   __ALIGNMENT_ARG SYSCALL_LL (val)
+# define SYSCALL_LL64_PRW(val) __ALIGNMENT_ARG SYSCALL_LL64 (val)
+#endif
+
 /* Provide a macro to pass the off{64}_t argument on p{readv,writev}{64}.  */
 #define LO_HI_LONG(val) \
  (long) (val), \
index 1c1cfff2800e55d11cfdfc4d884a39ee565f00fb..43acea363350931f7a5cad2ed101861e06ff0078 100644 (file)
@@ -25,4 +25,5 @@ endif
 ifeq ($(subdir),nptl)
 # pull in __syscall_error routine
 libpthread-routines += sysdep
+libpthread-shared-only-routines += sysdep
 endif
index 9ce4b495a5e2129d8cd1890e2d79224b46e71e77..d1ee9222902f81aa5d1cf98d127086ece513009e 100644 (file)
@@ -133,8 +133,6 @@ init_cpu_features (struct cpu_features *cpu_features)
 
            case 0x57:
              /* Knights Landing.  Enable Silvermont optimizations.  */
-             cpu_features->feature[index_arch_Prefer_No_VZEROUPPER]
-               |= bit_arch_Prefer_No_VZEROUPPER;
 
            case 0x5c:
            case 0x5f:
@@ -205,6 +203,30 @@ init_cpu_features (struct cpu_features *cpu_features)
       if (CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable))
        cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load]
          |= bit_arch_AVX_Fast_Unaligned_Load;
+
+      /* Since AVX512ER is unique to Xeon Phi, set Prefer_No_VZEROUPPER
+         if AVX512ER is available.  Don't use AVX512 to avoid lower CPU
+        frequency if AVX512ER isn't available.  */
+      if (CPU_FEATURES_CPU_P (cpu_features, AVX512ER))
+       cpu_features->feature[index_arch_Prefer_No_VZEROUPPER]
+         |= bit_arch_Prefer_No_VZEROUPPER;
+      else
+       cpu_features->feature[index_arch_Prefer_No_AVX512]
+         |= bit_arch_Prefer_No_AVX512;
+
+      /* To avoid SSE transition penalty, use _dl_runtime_resolve_slow.
+         If XGETBV suports ECX == 1, use _dl_runtime_resolve_opt.  */
+      cpu_features->feature[index_arch_Use_dl_runtime_resolve_slow]
+       |= bit_arch_Use_dl_runtime_resolve_slow;
+      if (cpu_features->max_cpuid >= 0xd)
+       {
+         unsigned int eax;
+
+         __cpuid_count (0xd, 1, eax, ebx, ecx, edx);
+         if ((eax & (1 << 2)) != 0)
+           cpu_features->feature[index_arch_Use_dl_runtime_resolve_opt]
+             |= bit_arch_Use_dl_runtime_resolve_opt;
+       }
     }
   /* This spells out "AuthenticAMD".  */
   else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
index 97ffe765f4e021be6b67da750bbbcf22ba41507b..2609ac09996f987f8f83825371dd0b6197413660 100644 (file)
@@ -37,6 +37,9 @@
 #define bit_arch_Prefer_No_VZEROUPPER          (1 << 17)
 #define bit_arch_Fast_Unaligned_Copy           (1 << 18)
 #define bit_arch_Prefer_ERMS                   (1 << 19)
+#define bit_arch_Use_dl_runtime_resolve_opt    (1 << 20)
+#define bit_arch_Use_dl_runtime_resolve_slow   (1 << 21)
+#define bit_arch_Prefer_No_AVX512              (1 << 22)
 
 /* CPUID Feature flags.  */
 
 #define bit_cpu_AVX2           (1 << 5)
 #define bit_cpu_AVX512F                (1 << 16)
 #define bit_cpu_AVX512DQ       (1 << 17)
+#define bit_cpu_AVX512PF       (1 << 26)
+#define bit_cpu_AVX512ER       (1 << 27)
+#define bit_cpu_AVX512CD       (1 << 28)
+#define bit_cpu_AVX512BW       (1 << 30)
+#define bit_cpu_AVX512VL       (1u << 31)
 
 /* XCR0 Feature flags.  */
 #define bit_XMM_state          (1 << 1)
 # define index_arch_Prefer_No_VZEROUPPER FEATURE_INDEX_1*FEATURE_SIZE
 # define index_arch_Fast_Unaligned_Copy        FEATURE_INDEX_1*FEATURE_SIZE
 # define index_arch_Prefer_ERMS                FEATURE_INDEX_1*FEATURE_SIZE
+# define index_arch_Use_dl_runtime_resolve_opt FEATURE_INDEX_1*FEATURE_SIZE
+# define index_arch_Use_dl_runtime_resolve_slow FEATURE_INDEX_1*FEATURE_SIZE
+# define index_arch_Prefer_No_AVX512   FEATURE_INDEX_1*FEATURE_SIZE
 
 
 # if defined (_LIBC) && !IS_IN (nonlib)
@@ -232,6 +243,11 @@ extern const struct cpu_features *__get_cpu_features (void)
 # define index_cpu_AVX2                COMMON_CPUID_INDEX_7
 # define index_cpu_AVX512F     COMMON_CPUID_INDEX_7
 # define index_cpu_AVX512DQ    COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512PF    COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512ER    COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512CD    COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512BW    COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512VL    COMMON_CPUID_INDEX_7
 # define index_cpu_ERMS                COMMON_CPUID_INDEX_7
 # define index_cpu_RTM         COMMON_CPUID_INDEX_7
 # define index_cpu_FMA         COMMON_CPUID_INDEX_1
@@ -250,6 +266,11 @@ extern const struct cpu_features *__get_cpu_features (void)
 # define reg_AVX2              ebx
 # define reg_AVX512F           ebx
 # define reg_AVX512DQ          ebx
+# define reg_AVX512PF          ebx
+# define reg_AVX512ER          ebx
+# define reg_AVX512CD          ebx
+# define reg_AVX512BW          ebx
+# define reg_AVX512VL          ebx
 # define reg_ERMS              ebx
 # define reg_RTM               ebx
 # define reg_FMA               ecx
@@ -277,6 +298,9 @@ extern const struct cpu_features *__get_cpu_features (void)
 # define index_arch_Prefer_No_VZEROUPPER FEATURE_INDEX_1
 # define index_arch_Fast_Unaligned_Copy        FEATURE_INDEX_1
 # define index_arch_Prefer_ERMS                FEATURE_INDEX_1
+# define index_arch_Use_dl_runtime_resolve_opt FEATURE_INDEX_1
+# define index_arch_Use_dl_runtime_resolve_slow FEATURE_INDEX_1
+# define index_arch_Prefer_No_AVX512   FEATURE_INDEX_1
 
 #endif /* !__ASSEMBLER__ */
 
index ed0c1a8efd1b9a1a4a5dfd38f0ce7009576cf05e..c0f0fa16a23b99ecd314d6186409946f72ee319f 100644 (file)
@@ -68,7 +68,10 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
   Elf64_Addr *got;
   extern void _dl_runtime_resolve_sse (ElfW(Word)) attribute_hidden;
   extern void _dl_runtime_resolve_avx (ElfW(Word)) attribute_hidden;
+  extern void _dl_runtime_resolve_avx_slow (ElfW(Word)) attribute_hidden;
+  extern void _dl_runtime_resolve_avx_opt (ElfW(Word)) attribute_hidden;
   extern void _dl_runtime_resolve_avx512 (ElfW(Word)) attribute_hidden;
+  extern void _dl_runtime_resolve_avx512_opt (ElfW(Word)) attribute_hidden;
   extern void _dl_runtime_profile_sse (ElfW(Word)) attribute_hidden;
   extern void _dl_runtime_profile_avx (ElfW(Word)) attribute_hidden;
   extern void _dl_runtime_profile_avx512 (ElfW(Word)) attribute_hidden;
@@ -118,9 +121,26 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
             indicated by the offset on the stack, and then jump to
             the resolved address.  */
          if (HAS_ARCH_FEATURE (AVX512F_Usable))
-           *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_resolve_avx512;
+           {
+             if (HAS_ARCH_FEATURE (Use_dl_runtime_resolve_opt))
+               *(ElfW(Addr) *) (got + 2)
+                 = (ElfW(Addr)) &_dl_runtime_resolve_avx512_opt;
+             else
+               *(ElfW(Addr) *) (got + 2)
+                 = (ElfW(Addr)) &_dl_runtime_resolve_avx512;
+           }
          else if (HAS_ARCH_FEATURE (AVX_Usable))
-           *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_resolve_avx;
+           {
+             if (HAS_ARCH_FEATURE (Use_dl_runtime_resolve_opt))
+               *(ElfW(Addr) *) (got + 2)
+                 = (ElfW(Addr)) &_dl_runtime_resolve_avx_opt;
+             else if (HAS_ARCH_FEATURE (Use_dl_runtime_resolve_slow))
+               *(ElfW(Addr) *) (got + 2)
+                 = (ElfW(Addr)) &_dl_runtime_resolve_avx_slow;
+             else
+               *(ElfW(Addr) *) (got + 2)
+                 = (ElfW(Addr)) &_dl_runtime_resolve_avx;
+           }
          else
            *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_resolve_sse;
        }
index 12f1a5cf8485c99d2cd9182255c2fe571f8fa1bd..50b23633e3bd88d4faf47321c91b38f2d8ae104b 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <config.h>
 #include <sysdep.h>
+#include <cpu-features.h>
 #include <link-defines.h>
 
 #ifndef DL_STACK_ALIGNMENT
 #endif
 #define VEC(i)                 ymm##i
 #define _dl_runtime_resolve    _dl_runtime_resolve_avx
+#define _dl_runtime_resolve_opt        _dl_runtime_resolve_avx_opt
 #define _dl_runtime_profile    _dl_runtime_profile_avx
 #include "dl-trampoline.h"
 #undef _dl_runtime_resolve
+#undef _dl_runtime_resolve_opt
 #undef _dl_runtime_profile
 #undef VEC
 #undef VMOV
 #define _dl_runtime_profile    _dl_runtime_profile_sse
 #undef RESTORE_AVX
 #include "dl-trampoline.h"
+#undef _dl_runtime_resolve
+#undef _dl_runtime_profile
+#undef VMOV
+#undef VMOVA
+
+/* Used by _dl_runtime_resolve_avx_opt/_dl_runtime_resolve_avx512_opt
+   to preserve the full vector registers with zero upper bits.  */
+#define VMOVA                  vmovdqa
+#if DL_RUNTIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
+# define VMOV                  vmovdqa
+#else
+# define VMOV                  vmovdqu
+#endif
+#define _dl_runtime_resolve    _dl_runtime_resolve_sse_vex
+#define _dl_runtime_resolve_opt        _dl_runtime_resolve_avx512_opt
+#include "dl-trampoline.h"
index b90836ab137faf13266c641cf34cbd4f087687bb..32ad3af2027073ed8699b6a91530b2060101da17 100644 (file)
 #endif
 
        .text
+#ifdef _dl_runtime_resolve_opt
+/* Use the smallest vector registers to preserve the full YMM/ZMM
+   registers to avoid SSE transition penalty.  */
+
+# if VEC_SIZE == 32
+/* Check if the upper 128 bits in %ymm0 - %ymm7 registers are non-zero
+   and preserve %xmm0 - %xmm7 registers with the zero upper bits.  Since
+   there is no SSE transition penalty on AVX512 processors which don't
+   support XGETBV with ECX == 1, _dl_runtime_resolve_avx512_slow isn't
+   provided.   */
+       .globl _dl_runtime_resolve_avx_slow
+       .hidden _dl_runtime_resolve_avx_slow
+       .type _dl_runtime_resolve_avx_slow, @function
+       .align 16
+_dl_runtime_resolve_avx_slow:
+       cfi_startproc
+       cfi_adjust_cfa_offset(16) # Incorporate PLT
+       vorpd %ymm0, %ymm1, %ymm8
+       vorpd %ymm2, %ymm3, %ymm9
+       vorpd %ymm4, %ymm5, %ymm10
+       vorpd %ymm6, %ymm7, %ymm11
+       vorpd %ymm8, %ymm9, %ymm9
+       vorpd %ymm10, %ymm11, %ymm10
+       vpcmpeqd %xmm8, %xmm8, %xmm8
+       vorpd %ymm9, %ymm10, %ymm10
+       vptest %ymm10, %ymm8
+       # Preserve %ymm0 - %ymm7 registers if the upper 128 bits of any
+       # %ymm0 - %ymm7 registers aren't zero.
+       PRESERVE_BND_REGS_PREFIX
+       jnc _dl_runtime_resolve_avx
+       # Use vzeroupper to avoid SSE transition penalty.
+       vzeroupper
+       # Preserve %xmm0 - %xmm7 registers with the zero upper 128 bits
+       # when the upper 128 bits of %ymm0 - %ymm7 registers are zero.
+       PRESERVE_BND_REGS_PREFIX
+       jmp _dl_runtime_resolve_sse_vex
+       cfi_adjust_cfa_offset(-16) # Restore PLT adjustment
+       cfi_endproc
+       .size _dl_runtime_resolve_avx_slow, .-_dl_runtime_resolve_avx_slow
+# endif
+
+/* Use XGETBV with ECX == 1 to check which bits in vector registers are
+   non-zero and only preserve the non-zero lower bits with zero upper
+   bits.  */
+       .globl _dl_runtime_resolve_opt
+       .hidden _dl_runtime_resolve_opt
+       .type _dl_runtime_resolve_opt, @function
+       .align 16
+_dl_runtime_resolve_opt:
+       cfi_startproc
+       cfi_adjust_cfa_offset(16) # Incorporate PLT
+       pushq %rax
+       cfi_adjust_cfa_offset(8)
+       cfi_rel_offset(%rax, 0)
+       pushq %rcx
+       cfi_adjust_cfa_offset(8)
+       cfi_rel_offset(%rcx, 0)
+       pushq %rdx
+       cfi_adjust_cfa_offset(8)
+       cfi_rel_offset(%rdx, 0)
+       movl $1, %ecx
+       xgetbv
+       movl %eax, %r11d
+       popq %rdx
+       cfi_adjust_cfa_offset(-8)
+       cfi_restore (%rdx)
+       popq %rcx
+       cfi_adjust_cfa_offset(-8)
+       cfi_restore (%rcx)
+       popq %rax
+       cfi_adjust_cfa_offset(-8)
+       cfi_restore (%rax)
+# if VEC_SIZE == 32
+       # For YMM registers, check if YMM state is in use.
+       andl $bit_YMM_state, %r11d
+       # Preserve %xmm0 - %xmm7 registers with the zero upper 128 bits if
+       # YMM state isn't in use.
+       PRESERVE_BND_REGS_PREFIX
+       jz _dl_runtime_resolve_sse_vex
+# elif VEC_SIZE == 16
+       # For ZMM registers, check if YMM state and ZMM state are in
+       # use.
+       andl $(bit_YMM_state | bit_ZMM0_15_state), %r11d
+       cmpl $bit_YMM_state, %r11d
+       # Preserve %zmm0 - %zmm7 registers if ZMM state is in use.
+       PRESERVE_BND_REGS_PREFIX
+       jg _dl_runtime_resolve_avx512
+       # Preserve %ymm0 - %ymm7 registers with the zero upper 256 bits if
+       # ZMM state isn't in use.
+       PRESERVE_BND_REGS_PREFIX
+       je _dl_runtime_resolve_avx
+       # Preserve %xmm0 - %xmm7 registers with the zero upper 384 bits if
+       # neither YMM state nor ZMM state are in use.
+# else
+#  error Unsupported VEC_SIZE!
+# endif
+       cfi_adjust_cfa_offset(-16) # Restore PLT adjustment
+       cfi_endproc
+       .size _dl_runtime_resolve_opt, .-_dl_runtime_resolve_opt
+#endif
        .globl _dl_runtime_resolve
        .hidden _dl_runtime_resolve
        .type _dl_runtime_resolve, @function
@@ -162,7 +262,10 @@ _dl_runtime_resolve:
        .size _dl_runtime_resolve, .-_dl_runtime_resolve
 
 
-#ifndef PROF
+/* To preserve %xmm0 - %xmm7 registers, dl-trampoline.h is included
+   twice, for _dl_runtime_resolve_sse and _dl_runtime_resolve_sse_vex.
+   But we don't need another _dl_runtime_profile for XMM registers.  */
+#if !defined PROF && defined _dl_runtime_profile
 # if (LR_VECTOR_OFFSET % VEC_SIZE) != 0
 #  error LR_VECTOR_OFFSET must be multples of VEC_SIZE
 # endif
index 2296b55119bcfc7135f117ed08a9293be810d90c..a95b3ad3cff42e5ce0640e62ca660f2901eb321b 100644 (file)
@@ -19,7 +19,7 @@
 #include <sysdep.h>
 #include "asm-syntax.h"
 
-#ifndef PIC
+#ifndef SHARED
        /* For libc.so this is defined in memcpy.S.
           For libc.a, this is a separate source to avoid
           memcpy bringing in __chk_fail and all routines
index b8677596f903b0b3f850152e96f02de45cd33684..ea4ec70d1acf6073b153c5164f345ba3c38fd9d4 100644 (file)
@@ -32,6 +32,8 @@ ENTRY(__new_memcpy)
        lea     __memcpy_erms(%rip), %RAX_LP
        HAS_ARCH_FEATURE (Prefer_ERMS)
        jnz     2f
+       HAS_ARCH_FEATURE (Prefer_No_AVX512)
+       jnz     1f
        HAS_ARCH_FEATURE (AVX512F_Usable)
        jz      1f
        lea     __memcpy_avx512_no_vzeroupper(%rip), %RAX_LP
index 9d92c8a7e30a6f94d558ffcce536d794c8e3cc4a..26b49de6f688beaa72a89886b3abf162aba8ec60 100644 (file)
@@ -30,6 +30,8 @@
 ENTRY(__memcpy_chk)
        .type   __memcpy_chk, @gnu_indirect_function
        LOAD_RTLD_GLOBAL_RO_RDX
+       HAS_ARCH_FEATURE (Prefer_No_AVX512)
+       jnz     1f
        HAS_ARCH_FEATURE (AVX512F_Usable)
        jz      1f
        lea     __memcpy_chk_avx512_no_vzeroupper(%rip), %RAX_LP
index ff5e041420c1716996a7bce34d903f0416931af6..ef92afde5a3a7bc41b3a34ec48309e9cc9b24fcb 100644 (file)
@@ -30,6 +30,8 @@ ENTRY(__libc_memmove)
        lea     __memmove_erms(%rip), %RAX_LP
        HAS_ARCH_FEATURE (Prefer_ERMS)
        jnz     2f
+       HAS_ARCH_FEATURE (Prefer_No_AVX512)
+       jnz     1f
        HAS_ARCH_FEATURE (AVX512F_Usable)
        jz      1f
        lea     __memmove_avx512_no_vzeroupper(%rip), %RAX_LP
index 7f861206df1d2710377d901f556a53868bd303fc..a9129c460acf4f9800a48d5934a40355432b5ede 100644 (file)
@@ -29,6 +29,8 @@
 ENTRY(__memmove_chk)
        .type   __memmove_chk, @gnu_indirect_function
        LOAD_RTLD_GLOBAL_RO_RDX
+       HAS_ARCH_FEATURE (Prefer_No_AVX512)
+       jnz     1f
        HAS_ARCH_FEATURE (AVX512F_Usable)
        jz      1f
        lea     __memmove_chk_avx512_no_vzeroupper(%rip), %RAX_LP
index 51970687cfb20f11cf9b541e0b3df2819117e68b..87c8299fea08708aaa2078c057b0d288f581078d 100644 (file)
@@ -32,6 +32,8 @@ ENTRY(__mempcpy)
        lea     __mempcpy_erms(%rip), %RAX_LP
        HAS_ARCH_FEATURE (Prefer_ERMS)
        jnz     2f
+       HAS_ARCH_FEATURE (Prefer_No_AVX512)
+       jnz     1f
        HAS_ARCH_FEATURE (AVX512F_Usable)
        jz      1f
        lea     __mempcpy_avx512_no_vzeroupper(%rip), %RAX_LP
index 9e49f6f26e19c8f0238503b22564c5a8049218cc..642c67973ba9e1602470d1ad7fcaefabba6182e1 100644 (file)
@@ -30,6 +30,8 @@
 ENTRY(__mempcpy_chk)
        .type   __mempcpy_chk, @gnu_indirect_function
        LOAD_RTLD_GLOBAL_RO_RDX
+       HAS_ARCH_FEATURE (Prefer_No_AVX512)
+       jnz     1f
        HAS_ARCH_FEATURE (AVX512F_Usable)
        jz      1f
        lea     __mempcpy_chk_avx512_no_vzeroupper(%rip), %RAX_LP
index 28e71fd57681a13bb82cdeb871136f08d6818f04..acf448c9a66dcaf0785da97d0460907dca60405e 100644 (file)
@@ -110,6 +110,8 @@ ENTRY (__memset_erms)
 ENTRY (MEMSET_SYMBOL (__memset, erms))
 # endif
 L(stosb):
+       /* Issue vzeroupper before rep stosb.  */
+       VZEROUPPER
        movq    %rdx, %rcx
        movzbl  %sil, %eax
        movq    %rdi, %rdx
index 96e99341aaaa9136a69e423f89b09e8520d293b1..eae39e2ecd569259fcda39720358f38fef86f9a9 100644 (file)
@@ -41,6 +41,8 @@ ENTRY(memset)
        jnz     L(AVX512F)
        lea     __memset_avx2_unaligned(%rip), %RAX_LP
 L(AVX512F):
+       HAS_ARCH_FEATURE (Prefer_No_AVX512)
+       jnz     2f
        HAS_ARCH_FEATURE (AVX512F_Usable)
        jz      2f
        lea     __memset_avx512_no_vzeroupper(%rip), %RAX_LP
index 2efe6ed909c46c95df9082c4c55490b1350487a9..38d7bef6df0768f033bcc0c08942f52d611a82c5 100644 (file)
@@ -38,6 +38,8 @@ ENTRY(__memset_chk)
        jnz     L(AVX512F)
        lea     __memset_chk_avx2_unaligned(%rip), %RAX_LP
 L(AVX512F):
+       HAS_ARCH_FEATURE (Prefer_No_AVX512)
+       jnz     2f
        HAS_ARCH_FEATURE (AVX512F_Usable)
        jz      2f
        lea     __memset_chk_avx512_no_vzeroupper(%rip), %RAX_LP
index 75ac747be8a8e20cc1c8cac9bf0726d36c30036f..4b67fa80c19acd64b78f3baa477cf2a5d3abec6f 100644 (file)
@@ -89,13 +89,14 @@ lose:                                                                             \
   END (name)
 
 #undef JUMPTARGET
-#ifdef PIC
+#ifdef SHARED
 # ifdef BIND_NOW
 #  define JUMPTARGET(name)     *name##@GOTPCREL(%rip)
 # else
 #  define JUMPTARGET(name)     name##@PLT
 # endif
 #else
+/* For static archives, branch to target directly.  */
 # define JUMPTARGET(name)      name
 #endif