Roland McGrath [Mon, 23 Jun 2014 16:23:12 +0000 (09:23 -0700)]
SH: Consolidate nptl/ subdirectories under linux/.....
Joseph Myers [Mon, 23 Jun 2014 15:48:42 +0000 (15:48 +0000)]
Update headers for Linux 3.15.
This patch updates glibc headers for changes / new definitions in
Linux 3.15. In the course of my review I noticed that
IPV6_PMTUDISC_INTERFACE was absent from glibc despite the inclusion of
IP_PMTUDISC_INTERFACE; I added it along with IP_PMTUDISC_OMIT and
IPV6_PMTUDISC_OMIT. I did not add FALLOC_FL_NO_HIDE_STALE given the
kernel header comment that it is reserved.
Tested x86_64.
* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_GNU]
(FALLOC_FL_COLLAPSE_RANGE): New macro.
[__USE_GNU] (FALLOC_FL_ZERO_RANGE): Likewise.
* sysdeps/unix/sysv/linux/bits/in.h (IP_PMTUDISC_OMIT): Likewise.
(IPV6_PMTUDISC_INTERFACE): Likewise.
(IPV6_PMTUDISC_OMIT): Likewise.
Andreas Schwab [Mon, 23 Jun 2014 15:11:24 +0000 (17:11 +0200)]
Remove unused label
Adhemerval Zanella [Mon, 23 Jun 2014 14:38:47 +0000 (09:38 -0500)]
PowerPC: sync hwcap.h capabilities
Linux commit
dd58a092c4202f2bd490adab7285b3ff77f8e467 added the
PPC_FEATURE2_VEC_CRYPTO auvx capability to indicate whether to
hardware supports vector crypto hardware instructions. This patch
adds its definition to powerpc hwcap bits.
Will Newton [Fri, 11 Apr 2014 13:39:56 +0000 (14:39 +0100)]
elf/dl-lookup.c: Use __glibc_likely and __glibc_unlikely
Convert all uses of __builtin_expect to __glibc_likely and
__glibc_unlikely. Most of these are trivial boolean expressions
but a few were not. In particular the use of __builtin_expect in
the switch expression in do_lookup_x has been removed. Verified
that there are no code changes on x86_64 and ARM aside from line
numbers.
ChangeLog:
2014-06-23 Will Newton <will.newton@linaro.org>
* elf/dl-lookup.c: Use __glibc_unlikely and __glibc_likely
rather than __builtin_expect.
Will Newton [Fri, 4 Apr 2014 08:56:42 +0000 (09:56 +0100)]
elf/dl-lookup.c: Remove unnecessary static variable
undefined_msg is only used once contrary to the comment.
ChangeLog:
2014-06-23 Will Newton <will.newton@linaro.org>
* elf/dl-lookup.c (undefined_msg): Remove variable.
(_dl_lookup_symbol_x): Replace undefined_msg with string
literal.
Will Newton [Wed, 2 Apr 2014 15:04:12 +0000 (16:04 +0100)]
elf/dl-lookup.c: Move STB_GNU_UNIQUE handling to a function
Move handling of STB_GNU_UNIQUE symbols to a separate function
from do_lookup_x in order to make the code more readable.
The new function gets inlined with gcc 4.8 on ARM and the
do_lookup_x code becomes a few bytes smaller.
ChangeLog:
2014-06-23 Will Newton <will.newton@linaro.org>
* elf/dl-lookup.c (do_lookup_unique): New function.
(do_lookup_x): Move STB_GNU_UNIQUE handling code
to a separate function.
Andreas Schwab [Mon, 23 Jun 2014 08:24:45 +0000 (10:24 +0200)]
Don't ignore too long lines in nss_files (BZ #17079)
Will Newton [Fri, 11 Apr 2014 14:21:23 +0000 (15:21 +0100)]
test-skeleton.c: Use stdout for error messages
At the moment the test skeleton uses a mixture of stdout and
stderr for error message output. Using stdout for all test output
keeps all output correctly ordered and properly redirected to the
output file. The suggestion to use stdout is also made on the wiki:
https://sourceware.org/glibc/wiki/Testing/Testsuite#Writing_a_test_case
ChangeLog:
2014-06-23 Will Newton <will.newton@linaro.org>
* test-skeleton.c (signal_handler): Use printf and %m
rather than perror. Use printf rather than fprintf to
stderr. Use puts rather than fputs to stderr.
(main): Likewise.
Ludovic Courtès [Sun, 22 Jun 2014 09:55:43 +0000 (11:55 +0200)]
nscd: Remove unused typedef and variable.
The attached patch removed the unused ‘thread_info_t’ typedef and the
‘thread_info’ variable from nscd.c. The former conflicts with a GNU Mach
typedef, and the latter conflicts with a GNU Mach function declaration:
<https://lists.gnu.org/archive/html/bug-hurd/2014-06/msg00101.html>.
Tested on x86_64-linux-gnu.
Allan McRae [Sat, 21 Jun 2014 07:23:55 +0000 (17:23 +1000)]
Mention CVE-2014-4043 in NEWS
Roland McGrath [Sat, 21 Jun 2014 03:22:44 +0000 (20:22 -0700)]
Move generic smp.h to nptl/
Roland McGrath [Sat, 21 Jun 2014 03:17:28 +0000 (20:17 -0700)]
Remove unused file rtld-lowlevel.h.
Roland McGrath [Sat, 21 Jun 2014 03:04:47 +0000 (20:04 -0700)]
Clean up HAVE_CONFIG_H and STDC_HEADERS.
Roland McGrath [Sat, 21 Jun 2014 02:50:16 +0000 (19:50 -0700)]
Clean up stack-coloring macros.
Roland McGrath [Sat, 21 Jun 2014 01:36:49 +0000 (18:36 -0700)]
Move linux bits/ files out of nptl/.
Joseph Myers [Sat, 21 Jun 2014 00:58:56 +0000 (00:58 +0000)]
Remove ARM __ASSUME_SIGFRAME_V2.
This patch removes ARM __ASSUME_SIGFRAME_V2 now that the
2.6.18-and-later signal frame layout can be assumed, renaming the
affected functions accordingly now only one version of them is needed
in glibc. (sigrestorer.S did not in fact include <kernel-features.h>
and it appears that, unlike other such cases, it didn't get the header
indirectly, so the v1 functions would have been compiled in even when
sigaction.c didn't reference them.)
(alpha and hppa also have architecture-specific __ASSUME_* macros that
should now be removed: __ASSUME_FDATASYNC and __ASSUME_LWS_CAS
respectively. I don't have any plans to do anything on that myself.)
Tested on ARM.
* sysdeps/unix/sysv/linux/arm/kernel-features.h
(__ASSUME_SIGFRAME_V2): Remove macro.
* sysdeps/unix/sysv/linux/arm/sigrestorer.S: Update comment.
[!__ASSUME_SIGFRAME_V2]: Remove conditional code.
(__default_sa_restorer_v2): Rename to __default_sa_restorer.
(__default_rt_sa_restorer_v2): Rename to __default_rt_sa_restorer.
* sysdeps/unix/sysv/linux/arm/sigaction.c (__default_sa_restorer):
Declare as function. Remove conditional macro definitions.
(__default_rt_sa_restorer): Likewise.
(__default_sa_restorer_v1): Remove declaration.
(__default_sa_restorer_v2): Likewise.
(__default_rt_sa_restorer_v1): Likewise.
(__default_rt_sa_restorer_v2): Likewise.
* sysdeps/unix/sysv/linux/arm/Versions (GLIBC_PRIVATE): Remove
__default_sa_restorer_v1, __default_rt_sa_restorer_v1,
__default_sa_restorer_v2 and __default_rt_sa_restorer_v2.
Roland McGrath [Sat, 21 Jun 2014 00:27:16 +0000 (17:27 -0700)]
Missing new file from last commit.
Roland McGrath [Sat, 21 Jun 2014 00:13:47 +0000 (17:13 -0700)]
Move remaining SPARC code out of nptl/.
Joseph Myers [Fri, 20 Jun 2014 23:24:00 +0000 (23:24 +0000)]
Include <kernel-features.h> explicitly where required.
This patch makes files using __ASSUME_* macros include
<kernel-features.h> explicitly, rather than relying on some other
header (such as tls.h, lowlevellock.h or pthreadP.h) to include it
implicitly. (I omitted cases where I've already posted or am testing
the patch that stops the file from needing __ASSUME_* at all.) This
accords with the general principle of making source files include the
headers for anything they use, and also helps make it safe to remove
<kernel-features.h> includes from any file that doesn't use
__ASSUME_* (some of those may be stray includes left behind after
increasing the minimum kernel version, others may never have been
needed or may have become obsolete after some other change).
Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.
* nptl/pthread_cond_wait.c: Include <kernel-features.h>.
* nptl/pthread_rwlock_timedrdlock.c: Likewise.
* nptl/pthread_rwlock_timedwrlock.c: Likewise.
* nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
* nscd/nscd.c: Likewise.
* sysdeps/i386/nptl/tcb-offsets.sym: Likewise.
* sysdeps/powerpc/nptl/tcb-offsets.sym: Likewise.
* sysdeps/sh/nptl/tcb-offsets.sym: Likewise.
* sysdeps/x86_64/nptl/tcb-offsets.sym: Likewise.
Joseph Myers [Fri, 20 Jun 2014 23:22:08 +0000 (23:22 +0000)]
Remove __ASSUME_SOCK_CLOEXEC / SOCK_CLOEXEC conditionals in Linux-specific code.
This patch removes conditionals on __ASSUME_SOCK_CLOEXEC, and on
SOCK_CLOEXEC being defined, in Linux-specific code, now that all
supported Linux kernel versions can be assumed to have this
functionality. (The macro is also used in OS-independent code and is
not defined for Hurd.)
Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.
* nptl/sysdeps/unix/sysv/linux/mq_notify.c: Do not include
<kernel-features.h>.
(init_mq_netlink): Remove conditional have_sock_cloexec
definitions. Remove code conditional on have_sock_cloexec < 0.
(init_mq_netlink) [!SOCK_CLOEXEC]: Remove conditional code.
(init_mq_netlink) [!__ASSUME_SOCK_CLOEXEC]: Likewise.
* sysdeps/unix/sysv/linux/opensock.c: Do not include
<kernel-features.h>.
(__opensock) [SOCK_CLOEXEC]: Make code unconditional.
(__opensock) [!__ASSUME_SOCK_CLOEXEC]: Remove conditional code.
H.J. Lu [Fri, 20 Jun 2014 21:52:29 +0000 (14:52 -0700)]
Add ifunc tests for x86_64 memset_chk and memset
This patch adds ifunc tests for x86_64 memset_chk and memset. It also
defines HAS_AVX2 with AVX2_Usable since AVX2 may not be usable even if
processor has AVX2.
* sysdeps/x86_64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list):
Add tests for memset_chk and memset.
* sysdeps/x86_64/multiarch/init-arch.h (HAS_AVX2): Defined
with AVX2_Usable.
Maciej W. Rozycki [Fri, 20 Jun 2014 20:52:53 +0000 (21:52 +0100)]
[BZ #16046] dl_iterate_phdr static executable test
Maciej W. Rozycki [Fri, 20 Jun 2014 20:29:33 +0000 (21:29 +0100)]
stdlib/tst-qsort2.c: Fix off-by-one argc interpretation error
This fixes an off-by-one argc interpretation error (argv[0] is included
in the count) in stdlib/tst-qsort2.c causing a segfault if the program
is called with one command-line argument only (argv[2] is NULL in that
case).
Joseph Myers [Fri, 20 Jun 2014 20:04:33 +0000 (20:04 +0000)]
Remove __ASSUME_F_GETOWN_EX.
This patch removes __ASSUME_F_GETOWN_EX now it can be assumed to be
true unconditionally.
Tested x86_64 that disassembly of installed shared libraries is
unchanged by this patch.
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_F_GETOWN_EX): Remove macro.
* sysdeps/unix/sysv/linux/fcntl.c: Do not include
<kernel-features.h>.
(miss_F_GETOWN_EX): Remove variable or macro.
(do_fcntl): Do not check miss_F_GETOWN_EX.
(do_fcntl) [!__ASSUME_F_GETOWN_EX]: Remove conditional code.
Joseph Myers [Fri, 20 Jun 2014 20:02:34 +0000 (20:02 +0000)]
Remove __ASSUME_AT_RANDOM.
This patch removes __ASSUME_AT_RANDOM now it can be assumed to be true
unconditionally.
Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.
* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_AT_RANDOM):
Remove macro.
* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard)
[!__ASSUME_AT_RANDOM]: Remove conditional code.
(_dl_setup_pointer_guard) [!__ASSUME_AT_RANDOM]: Likewise.
Joseph Myers [Fri, 20 Jun 2014 20:00:51 +0000 (20:00 +0000)]
Remove __ASSUME_ADJ_OFFSET_SS_READ.
This patch removes the __ASSUME_ADJ_OFFSET_SS_READ macro (and
conditionals on whether ADJ_OFFSET_SS_READ is defined), now it can be
unconditionally assumed to be true and ADJ_OFFSET_SS_READ can be
assumed to be defined.
Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_ADJ_OFFSET_SS_READ): Remove macro.
* sysdeps/unix/sysv/linux/adjtime.c (ADJTIME)
[ADJ_OFFSET_SS_READ]: Make code unconditional.
(ADJTIME) [!ADJ_OFFSET_SS_READ]: Remove conditional code.
Maciej W. Rozycki [Fri, 20 Jun 2014 19:08:03 +0000 (20:08 +0100)]
[BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC
This fixes the calculation of R_ARM_TLS_DESC relocations for lazy global
symbol references, i.e. created with `-z lazy' in effect with the static
linker, where immediate resolution is requested with LD_BIND_NOW.
Joseph Myers [Fri, 20 Jun 2014 15:41:35 +0000 (15:41 +0000)]
Remove __ASSUME_ATFCTS conditionals in sysdeps/unix/sysv/linux/.
This patch cleans up for __ASSUME_ATFCTS now always being true for the
supported Linux kernel versions by removing conditional code in
sysdeps/unix/sysv/linux. Several fchownat.c files that were only
present because of differences in the fallback syscalls used
(depending on the architecture-specific names of chown-related
syscalls for 32-bit uids) are removed. Files that looks like they
could be replaced by syscalls.list entries have the standard "Consider
moving to syscalls.list." comment (see bug 14138) added. Conditionals
on the relevant __NR_* syscall numbers being defined are also removed,
since my analysis indicated that the relevant syscalls are always
defined for all relevant kernel versions using any affected file.
Much of the removed fallback code had unbounded stack allocations, so
this reduces the number of cases to consider for anyone reviewing uses
of alloca and VLAs in glibc.
There remain tests of __ASSUME_ATFCTS in io/openat.c (to determine
whether to define __have_atfcts) and sysdeps/posix/getcwd.c (which
also uses __have_atfcts); thus, the definition of __ASSUME_ATFCTS
remains in kernel-features.h. The logical condition relevant there is
whether openat64_not_cancel_3 is known to work. Hurd doesn't use this
version of getcwd at all, so the conditionals in getcwd.c are always
true in glibc. However, this code is also used in gnulib. So the
best way to deal with the conditionals there may be for gnulib people
to deal with merging all relevant changes in both directions between
the glibc and gnulib versions of this file, at the end of which the
openat conditionals should be in whatever form is best for gnulib, and
hardcoded in the _LIBC case to having openat supported.
Tested by comparing before-and-after disassembly of installed
(stripped) shared libraries, on x86_64 and x86. On x86 the patch made
no change to the disassembly; on x86_64, the only changes were in
readlinkat, where formerly the return value from the readlinkat
syscall was stored in an int variable before being converted to
ssize_t for the return, and now the return value is returned directly
without truncation to int. I think it's clearly correct not to
truncate the return value (although I also think the truncation would
not have been a user-visible bug because the kernel would never have
returned a value it could have affected).
* include/fcntl.h (__atfct_seterrno): Remove prototype.
(__atfct_seterrno_2): Likewise.
* sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c: Do not include
<kernel-features.h>.
(__ASSUME_ATFCTS): Do not undefine and redefine.
* sysdeps/unix/sysv/linux/alpha/fxstatat.c [__ASSUME_ATFCTS]
(__have_atfcts): Remove conditional definition.
(__fxstatat([__NR_fstatat64]: Make code unconditional.
(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code and code
unreachable if [__ASSUME_ATFCTS].
* sysdeps/unix/sysv/linux/dl-fxstatat64.c (__ASSUME_ATFCTS): Do
not undefine and redefine.
* sysdeps/unix/sysv/linux/faccessat.c: Do not include
<kernel-features.h>.
(faccessat) [__NR_faccessat]: Make code unconditional.
(faccessat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/fchmodat.c: Do not include
<kernel-features.h>.
(fchmodat) [__NR_fchmodat]: Make code unconditional.
(fchmodat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/fchownat.c: Do not include
<kernel-features.h>.
(fchownat) [__NR_fchownat]: Make code unconditional.
(fchownat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/futimesat.c: Do not include
<kernel-features.h>.
(futimesat) [__NR_futimesat]: Make code unconditional.
(futimesat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/fxstatat.c: Do not include
<kernel-features.h>.
(__fxstatat) [__NR_newfstatat]: Make code unconditional.
(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/fxstatat64.c: Do not include
<kernel-features.h>.
(__fxstatat64) [__NR_fstatat64]: Make code unconditional.
(__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/i386/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/i386/fxstatat.c: Do not include
<kernel-features.h>.
(__fxstatat) [__NR_fstatat64]: Make code unconditional.
(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/linkat.c: Do not include
<kernel-features.h>.
(linkat) [__NR_linkat]: Make code unconditional.
(linkat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/m68k/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c: Do not include
<kernel-features.h>.
(__fxstatat64) [__NR_newfstatat]: Make code unconditional.
(__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/mkdirat.c: Do not include
<kernel-features.h>.
(mkdirat) [__NR_mkdirat]: Make code unconditional.
(mkdirat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/openat.c: Do not include
<kernel-features.h>.
[!__ASSUME_ATFCTS] (__atfct_seterrno): Remove function.
[!__ASSUME_ATFCTS] (__have_atfcts): Remove variable.
(OPENAT_NOT_CANCEL) [__NR_openat]: Make code unconditional.
(OPENAT_NOT_CANCEL) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/powerpc/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/readlinkat.c: Do not include
<kernel-features.h>.
(readlinkat) [__NR_readlinkat]: Make code unconditional.
(readlinkat) [!__ASSUME_ATFCTS]: Remove conditional code. Return
result of INLINE_SYSCALL directly, not via int variable.
* sysdeps/unix/sysv/linux/renameat.c: Do not include
<kernel-features.h>.
[!__ASSUME_ATFCTS] (__atfct_seterrno_2): Remove function.
(renameat) [__NR_renameat]: Make code unconditional.
(renameat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/s390/s390-32/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/sh/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c
(__ASSUME_ATFCTS): Do not undefine and redefine.
* sysdeps/unix/sysv/linux/symlinkat.c: Do not include
<kernel-features.h>.
(symlinkat) [__NR_symlinkat]: Make code unconditional.
(symlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/unlinkat.c: Do not include
<kernel-features.h>.
(unlinkat) [__NR_unlinkat]: Make code unconditional.
(unlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/wordsize-64/dl-fxstatat64.c
(__ASSUME_ATFCTS): Do not undefine and redefine.
* sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: Do not include
<kernel-features.h>.
(__fxstatat) [__NR_newfstatat]: Make code unconditional.
(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/xmknodat.c: Do not include
<kernel-features.h>.
(__xmknodat) [__NR_mknodat]: Make code unconditional.
(__xmknodat) [!__ASSUME_ATFCTS]: Remove conditional code.
H.J. Lu [Fri, 20 Jun 2014 15:10:07 +0000 (08:10 -0700)]
Remove sysdeps/x86_64/multiarch/rtld-strlen.S
Since there is no sysdeps/x86_64/multiarch/strlen.S,
sysdeps/x86_64/rtld-strlen.S will be used.
* sysdeps/x86_64/multiarch/rtld-strlen.S: Removed.
Andreas Schwab [Fri, 20 Jun 2014 10:41:27 +0000 (12:41 +0200)]
Fix another memory leak in regexp compiler (BZ #17069)
Siddhesh Poyarekar [Fri, 20 Jun 2014 11:42:10 +0000 (17:12 +0530)]
Fix ChangeLog and NEWS goof-up
The ChangeLog belonged to localedata and the bug is not completely
fixed, so it didn't deserve to enter the NEWS yet.
Stefan Liebler [Fri, 20 Jun 2014 02:18:20 +0000 (07:48 +0530)]
[BZ #6803] Set errno for scalbln, scalbn
Errno is not set and the testcases will fail.
Now the scalbln-aliases are removed in i386/m68
and the wrappers are used when calling the scalbln-functions.
On ia64 only scalblnf has its own implementation.
For scalbln and scalblnl the ieee754/dbl-64 and ieee754/ldbl-96 are used, thus
the wrappers are needed, too.
Stefan Liebler [Fri, 20 Jun 2014 02:14:42 +0000 (07:44 +0530)]
Generate en_GB.UTF-8 during testing
This patch generates en_GB.UTF-8, which is used in
tst-strcoll-overflow. This solves the issue of failing xtests on
s390/s390x.
H.J. Lu [Thu, 19 Jun 2014 22:22:52 +0000 (15:22 -0700)]
Use 3 bytes for __pad1 in pthread_rwlock_t for x32
Since long is 4 bytes for x32, we should use 3 bytes for __pad1 when
a long __pad1 is replaced by a byte __rwelision and __pad1.
* sysdeps/x86/nptl/bits/pthreadtypes.h (pthread_rwlock_t): Use
3 bytes for __pad1 for x32.
(__PTHREAD_RWLOCK_ELISION_EXTRA): Likewise.
Ling Ma [Thu, 19 Jun 2014 20:00:56 +0000 (13:00 -0700)]
Add x86_64 memset optimized for AVX2
In this patch we take advantage of HSW memory bandwidth, manage to
reduce miss branch prediction by avoiding using branch instructions and
force destination to be aligned with avx & avx2 instruction.
The CPU2006 403.gcc benchmark indicates this patch improves performance
from 26% to 59%.
* sysdeps/x86_64/multiarch/Makefile: Add memset-avx2.
* sysdeps/x86_64/multiarch/memset-avx2.S: New file.
* sysdeps/x86_64/multiarch/memset.S: Likewise.
* sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
* sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.
Andreas Schwab [Thu, 19 Jun 2014 13:38:03 +0000 (15:38 +0200)]
Fix memory leak in regexp compiler (BZ #17069)
Will Newton [Fri, 13 Jun 2014 15:37:12 +0000 (16:37 +0100)]
malloc/malloc.c: Avoid calling sbrk unnecessarily with zero
Due to my bad review suggestion for the fix for BZ #15089 a check
was removed from systrim to prevent sbrk being called with a zero
argument. Add the check back to avoid this useless work.
ChangeLog:
2014-06-19 Will Newton <will.newton@linaro.org>
* malloc/malloc.c (systrim): If extra is zero then return
early.
Siddhesh Poyarekar [Thu, 19 Jun 2014 11:32:48 +0000 (17:02 +0530)]
Remove unnecessary $(.)
The variable is not necessary, especially since it does not exist.
Richard Earnshaw [Thu, 19 Jun 2014 09:40:49 +0000 (10:40 +0100)]
[AArch64] Add optimized strchr.
Implementation of strchr for AArch64. Speedups taken from micro-bench
show the improvements relative to the standard C code.
The use of LD1 means we have identical code for both big- and
little-endian systems.
Joseph Myers [Wed, 18 Jun 2014 12:32:01 +0000 (12:32 +0000)]
Fix __ieee754_logl (-LDBL_MAX) in FE_DOWNWARD mode (bug 17022).
This patch fixes __ieee754_logl (-LDBL_MAX) on x86_64 and x86 not to
subtract 1 from its argument and so cause spurious overflow in
FE_DOWNWARD mode. (For any argument strictly less than -1, it doesn't
matter whether or not 1 is subtracted before computing log1p, as long
as the result doesn't overflow to -Inf.)
Tested x86_64 and x86. (This particular case lacks test coverage,
since the testsuite doesn't cover -lieee, but it will be covered by
tests after the following patch to test pow in all rounding modes,
which was the context in which this bug was found.)
[BZ #17022]
* sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Do not subtract 1
from arguments -2 or below.
* sysdeps/i386/i686/fpu/e_logl.S (__ieee754_logl): Likewise.
* sysdeps/x86_64/fpu/e_logl.S (__ieee754_logl): Likewise.
Andreas Schwab [Wed, 18 Jun 2014 09:58:45 +0000 (11:58 +0200)]
Don't read past end of pattern in fnmatch (BZ #17062)
Joseph Myers [Wed, 18 Jun 2014 10:35:29 +0000 (10:35 +0000)]
Use $(rtld-prefix) more consistently.
The glibc makefiles have a standard variable, $(rtld-prefix), to run
the dynamic linker with a default --library-path option; this is used
as the basis of lots of other variables for running programs compiled
with the newly built library.
A few places however use $(elf-objpfx)ld.so or
$(elf-objpfx)${rtld-installed-name} directly, with such a
--library-path option. This patch makes such places use
$(rtld-prefix) instead. I'm not aware of any significance in these
cases to the choice of ld.so or ${rtld-installed-name} when running
the dynamic linker, or to whether $(patsubst
%,:%,$(sysdep-library-path)) is included in the library-path as it is
in $(rtld-prefix) and just one of the places being changed.
Tested x86_64.
* elf/Makefile ($(objpfx)tst-unused-dep.out): Use $(rtld-prefix).
* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
[$(cross-compiling) = no]: Likewise.
* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
[$(cross-compiling) = no]: Likewise.
localedata/ChangeLog:
* Makefile (LOCALEDEF): Use $(rtld-prefix).
Rajalakshmi Srinivasaraghavan [Tue, 17 Jun 2014 13:46:25 +0000 (08:46 -0500)]
PowerPC: Fix nearbyintl failure for few inputs
This patch fixes few failures in nearbyintl() where the fraction part is
close to 0.5.i The new tests added report few extra failures in
nearbyint_downward and nearbyint_towardzero which is a known issue.
Fixes #17031.
Adhemerval Zanella [Thu, 12 Jun 2014 14:32:53 +0000 (09:32 -0500)]
PowerPC: Move powerpc code out of nptl/ subdirectory
Adhemerval Zanella [Tue, 17 Jun 2014 12:48:41 +0000 (07:48 -0500)]
Fix ChangeLog indentation.
Joseph Myers [Mon, 16 Jun 2014 22:54:46 +0000 (22:54 +0000)]
Add CFI to x86 ceil / floor / trunc (bug 16681).
This patch adds CFI to the sysdeps/i386/fpu/ implementations of ceil,
floor and trunc functions, for consistency with other x86 .S files in
glibc which have CFI for stack adjustments.
Tested x86.
[BZ #16681]
* sysdeps/i386/fpu/s_ceil.S (__ceil): Add CFI.
* sysdeps/i386/fpu/s_ceilf.S (__ceilf): Likewise.
* sysdeps/i386/fpu/s_ceill.S (__ceill): Likewise.
* sysdeps/i386/fpu/s_floor.S (__floor): Likewise.
* sysdeps/i386/fpu/s_floorf.S (__floorf): Likewise.
* sysdeps/i386/fpu/s_floorl.S (__floorl): Likewise.
* sysdeps/i386/fpu/s_trunc.S (__trunc): Likewise.
* sysdeps/i386/fpu/s_truncf.S (__truncf): Likewise.
* sysdeps/i386/fpu/s_truncl.S (__truncl): Likewise.
Andreas Schwab [Mon, 16 Jun 2014 22:21:06 +0000 (00:21 +0200)]
m68k: update libm test ULPs
Andreas Schwab [Mon, 16 Jun 2014 21:43:57 +0000 (23:43 +0200)]
Fix typo in preprocessor conditional
Andreas Schwab [Sat, 14 Jun 2014 20:29:43 +0000 (22:29 +0200)]
Pass $TIMEOUTFACTOR to tests also in cross testing
Florian Weimer [Mon, 16 Jun 2014 16:00:09 +0000 (18:00 +0200)]
Fix tautological comparison in non-executed part of tst-setuid2 (BZ #17058)
This part never runs with the current implementation
because the setresuid call currently aborts (as intended).
Andreas Schwab [Thu, 12 Jun 2014 12:42:57 +0000 (14:42 +0200)]
Update feature guard for strdup/strndup in <bits/string2.h>
David S. Miller [Sat, 14 Jun 2014 20:14:54 +0000 (13:14 -0700)]
Update Sparc ULPs.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
Andreas Schwab [Sat, 14 Jun 2014 13:04:16 +0000 (15:04 +0200)]
m68k: Consolidate NPTL/non versions of clone
Andreas Schwab [Sat, 14 Jun 2014 12:47:09 +0000 (14:47 +0200)]
m68k: Consolidate NPTL/non versions of vfork
Andi Kleen [Fri, 13 Jun 2014 22:50:45 +0000 (15:50 -0700)]
Add fallback file for elide.h
Add the missing fallback file for elide.h to fix non x86 builds.
Sorry about that. This is just a noop macro file that makes
all elision code to be optimized out.
Stefan Liebler [Fri, 13 Jun 2014 23:39:23 +0000 (16:39 -0700)]
Fix pthread.h in installed-headers list.
Roland McGrath [Fri, 13 Jun 2014 23:27:11 +0000 (16:27 -0700)]
S390: Move NPTL public headers to sysdeps/s390/nptl/.
Roland McGrath [Fri, 13 Jun 2014 23:26:56 +0000 (16:26 -0700)]
Move S390 code out of nptl/sysdeps/s390/.
Roland McGrath [Fri, 13 Jun 2014 23:26:38 +0000 (16:26 -0700)]
S390: Convert fork.c to arch-fork.h
David S. Miller [Fri, 13 Jun 2014 21:41:58 +0000 (14:41 -0700)]
Consolidate sparc clone, fork, and vfork implementations.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Delete.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: Delete.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Moved ...
* sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Delete.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Delete.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Moved ...
* sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: ... here.
* sysdeps/unix/sysv/linux/sparc/fork.S: Delete.
* sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (__thread_start):
Remove RESET_PID cpp guards.
* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (__thread_start):
Remove RESET_PID cpp guards.
* sysdeps/unix/sysv/linux/sparc/vfork.S: Delete.
Andreas Schwab [Fri, 13 Jun 2014 21:31:36 +0000 (23:31 +0200)]
m68k: avoid pointer to integer conversion warning
Andreas Schwab [Fri, 13 Jun 2014 21:29:50 +0000 (23:29 +0200)]
ChangeLog fix
Andi Kleen [Mon, 3 Mar 2014 15:06:11 +0000 (07:06 -0800)]
Remove x86 assembler rwlock code
With the recent tuning the C version of rwlocks is basically the same
performance as the x86 assembler version for uncontended locks (with a
a few cycles near the run-to-run variability). For others it should not
matter anyways.
So remove the assembler code and use the C version like other
architectures.
Andi Kleen [Mon, 31 Mar 2014 15:07:46 +0000 (08:07 -0700)]
Add adaptive elision to rwlocks
This patch relies on the C version of the rwlocks posted earlier.
With C rwlocks it is very straight forward to do adaptive elision
using TSX. It is based on the infrastructure added earlier
for mutexes, but uses its own elision macros. The macros
are fairly general purpose and could be used for other
elision purposes too.
This version is much cleaner than the earlier assembler based
version, and in particular implements adaptation which makes
it safer.
I changed the behavior slightly to not require any changes
in the test suite and fully conform to all expected
behaviors (generally at the cost of not eliding in
various situations). In particular this means the timedlock
variants are not elided. Nested trylock aborts.
Andi Kleen [Mon, 17 Mar 2014 12:48:28 +0000 (05:48 -0700)]
Add a fast path for C rd/wrlock v2
One difference of the C versions to the assembler wr/rdlock
is that the C compiler saves some registers which are unnecessary
for the fast path in the prologue of the functions. Split the
uncontended fast path out into a separate function. Only when contention is
detected is the full featured function called. This makes
the fast path code (nearly) identical to the assembler version,
and gives uncontended performance within a few cycles.
v2: Rename some functions and add space.
Meador Inge [Fri, 13 Jun 2014 08:32:04 +0000 (14:02 +0530)]
get_nprocs: Only return explictly set cache values (BZ #16996)
The implementation of __get_nprocs uses a stactic variable to cache
the value of the current number of processors. The caching breaks when
'time (NULL) == 0':
$ cat nproc.c
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
int main(int argc, char *argv[])
{
time_t t;
struct timeval tv = {0, 0};
printf("settimeofday({0, 0}, NULL) = %d\n", settimeofday(&tv, NULL));
t = time(NULL);
printf("Time: %d, CPUs: %d\n", (unsigned int)t, get_nprocs());
return 0;
}
$ gcc -O3 nproc.c
$ ./a.out
settimeofday({0, 0}, NULL) = -1
Time:
1401311578, CPUs: 4
$ sudo ./a.out
settimeofday({0, 0}, NULL) = 0
Time: 0, CPUs: 0
The problem is with the condition used to check whether a cached
value should be returned or not:
static int cached_result;
static time_t timestamp;
time_t now = time (NULL);
time_t prev = timestamp;
atomic_read_barrier ();
if (now == prev)
return cached_result;
This patch fixes the problem by ensuring that 'cached_result' has
been set at least once before returning it.
Roland McGrath [Thu, 12 Jun 2014 22:04:34 +0000 (15:04 -0700)]
Move SPARC public headers out of nptl/
Roland McGrath [Thu, 12 Jun 2014 21:33:59 +0000 (14:33 -0700)]
Move SPARC code out of nptl/sysdeps/sparc/.
Roland McGrath [Thu, 12 Jun 2014 21:33:43 +0000 (14:33 -0700)]
SPARC: Define TLS_DEFINE_INIT_TP
Roland McGrath [Thu, 12 Jun 2014 21:19:50 +0000 (14:19 -0700)]
SPARC: Convert fork.c to arch-fork.h
Roland McGrath [Thu, 12 Jun 2014 21:17:14 +0000 (14:17 -0700)]
Use list.h in posix-timer code.
Roland McGrath [Thu, 12 Jun 2014 20:48:47 +0000 (13:48 -0700)]
Get rid of nptl/sysdeps/pthread/ subdirectory
Roland McGrath [Thu, 12 Jun 2014 17:32:18 +0000 (10:32 -0700)]
Consolidate NPTL sigprocmask.
Roland McGrath [Thu, 12 Jun 2014 17:08:24 +0000 (10:08 -0700)]
Move i386 code out of nptl/ subdirectory.
Roland McGrath [Thu, 12 Jun 2014 16:05:54 +0000 (09:05 -0700)]
Move SH code out of nptl/ subdirectory.
Stefan Liebler [Thu, 12 Jun 2014 12:15:25 +0000 (14:15 +0200)]
posix_spawn_faction_addopen: Add missing string.h include directive
This is needed to avoid a PLT call on s390.
Roland McGrath [Thu, 12 Jun 2014 04:33:32 +0000 (21:33 -0700)]
Move x86_64 code out of nptl/ subdirectory.
Adhemerval Zanella [Thu, 12 Jun 2014 02:22:49 +0000 (21:22 -0500)]
Update powerpc-fpu ULPs.
Joseph Myers [Wed, 11 Jun 2014 23:16:23 +0000 (23:16 +0000)]
conformtest: clean up POSIX expectations for sys/mman.h, sys/stat.h, sys/types.h.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for sys/mman.h, sys/stat.h
and sys/types.h. Tested x86_64; no new XFAILs needed.
* conform/data/sys/mman.h-data [POSIX] (size_t): Do not require
type.
[POSIX] (off_t): Likewise.
* conform/data/sys/stat.h-data (S_IRGRP): Require constant.
[POSIX] (S_ISBLK): Require macro.
[POSIX] (S_ISCHR): Likewise.
[POSIX] (S_ISDIR): Likewise.
[POSIX] (S_ISFIFO): Likewise.
[POSIX] (S_ISREG): Likewise.
[POSIX || XPG3 || XPG4 || UNIX98] (S_TYPEISTMO): Do not list
optional-macro.
* conform/data/sys/types.h-data [POSIX] (blkcnt_t): Do not require
type.
[POSIX] (time_t): Likewise.
[POSIX] (timer_t): Likewise.
Florian Weimer [Wed, 11 Jun 2014 21:12:52 +0000 (23:12 +0200)]
posix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)
POSIX requires that we make a copy, so we allocate a new string
and free it in posix_spawn_file_actions_destroy.
Reported by David Reid, Alex Gaynor, and Glyph Lefkowitz. This bug
may have security implications.
Chris Metcalf [Wed, 11 Jun 2014 19:52:53 +0000 (15:52 -0400)]
tile: Consolidate NPTL/non versions of vfork
Roland McGrath [Mon, 9 Jun 2014 20:45:09 +0000 (13:45 -0700)]
Tile: Define TLS_DEFINE_INIT_TP
Roland McGrath [Wed, 11 Jun 2014 19:23:56 +0000 (12:23 -0700)]
S390: Define TLS_DEFINE_INIT_TP
Roland McGrath [Wed, 11 Jun 2014 19:23:35 +0000 (12:23 -0700)]
Alpha: Define TLS_DEFINE_INIT_TP
Roland McGrath [Wed, 11 Jun 2014 19:23:17 +0000 (12:23 -0700)]
PowerPC: Define TLS_DEFINE_INIT_TP
Roland McGrath [Wed, 11 Jun 2014 19:23:01 +0000 (12:23 -0700)]
AArch64: Define TLS_DEFINE_INIT_TP
Vidya Ranganathan [Fri, 6 Jun 2014 12:56:07 +0000 (07:56 -0500)]
PowerPC: Optimized strcmp for PPC64/POWER7
Optimization is achieved on 8 byte aligned strings with double word
comparison using cmpb instruction. On unaligned strings loop unrolling
is applied for Power7 gain.
Siddhesh Poyarekar [Wed, 11 Jun 2014 08:46:29 +0000 (14:16 +0530)]
Validate bench.out against a JSON schema
This patch adds a JSON schema for the benchmark output file and also
adds a script that validates the generated output against the schema.
Adhemerval Zanella [Tue, 10 Jun 2014 19:13:12 +0000 (14:13 -0500)]
Fix ChangeLog indentation.
Chris Metcalf [Tue, 10 Jun 2014 17:45:36 +0000 (13:45 -0400)]
tile: move sysdeps/unix/sysv/linux/tile nptl files.
Wilco [Tue, 10 Jun 2014 14:50:25 +0000 (15:50 +0100)]
Add FE_NOMASK_ENV return value test.
Joseph Myers [Tue, 10 Jun 2014 12:07:15 +0000 (12:07 +0000)]
Fix log2 (1) in round-downward mode (bug 17042).
As with other issues of this kind, bug 17042 is log2 (1) wrongly
returning -0 instead of +0 in round-downward mode because of
implementations effectively in terms of log1p (x - 1). This patch
fixes the issue in the same way used for log and log10.
Tested x86_64 and x86 and ulps updated accordingly. Also tested for
mips64 to confirm a fix was needed for ldbl-128 and to validate that
fix (also applied to ldbl-128ibm since that version of log2l is
essentially the same as the ldbl-128 one).
[BZ #17042]
* sysdeps/i386/fpu/e_log2.S (__ieee754_log2): Take absolete value
when x - 1 is zero.
* sysdeps/i386/fpu/e_log2f.S (__ieee754_log2f): Likewise.
* sysdeps/i386/fpu/e_log2l.S (__ieee754_log2l): Likewise.
* sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Return
0.0L for an argument of 1.0L.
* sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l):
Likewise.
* sysdeps/x86_64/fpu/e_log2l.S (__ieee754_log2l): Take absolute
value when x - 1 is zero.
* math/libm-test.inc (log2_test): Use ALL_RM_TEST.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
Bernard Ogden [Tue, 10 Jun 2014 03:22:20 +0000 (23:22 -0400)]
hppa: Remove lowlevellock.c.
The hppa port has no need of a custom lowlevellock.c, it should
use the generic version which is updated and correct. This
similarly fixes bug 15119 for hppa.
Roland McGrath [Mon, 9 Jun 2014 20:09:52 +0000 (13:09 -0700)]
SH: Define TLS_DEFINE_INIT_TP
Roland McGrath [Mon, 9 Jun 2014 22:54:19 +0000 (15:54 -0700)]
m68k: Define TLS_DEFINE_INIT_TP
Roland McGrath [Mon, 9 Jun 2014 21:04:45 +0000 (14:04 -0700)]
HPPA: Define TLS_DEFINE_INIT_TP
Roland McGrath [Mon, 9 Jun 2014 20:47:38 +0000 (13:47 -0700)]
MIPS: Define TLS_DEFINE_INIT_TP
Roland McGrath [Mon, 9 Jun 2014 19:53:16 +0000 (12:53 -0700)]
ARM: Define TLS_DEFINE_INIT_TP
Roland McGrath [Mon, 9 Jun 2014 19:52:55 +0000 (12:52 -0700)]
Start cleaning up TLS initial value for pthread_create.