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.
Fix another memory leak in regexp compiler (BZ #17069)
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.
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.
[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.
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.
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.
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.
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).
[BZ #16046] dl_iterate_phdr static executable test
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.
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.
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.
Move remaining SPARC code out of nptl/.
Missing new file from last commit.
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.
Move linux bits/ files out of nptl/.
Clean up stack-coloring macros.
Clean up HAVE_CONFIG_H and STDC_HEADERS.
Remove unused file rtld-lowlevel.h.