Commit Graph

21264 Commits

Author SHA1 Message Date
Adhemerval Zanella 01b87c656f ia64: Fix thread stack allocation permission set (BZ #21672)
This patch fixes ia64 failures on thread exit by madvise the required
area taking in consideration its disjoing stacks
(NEED_SEPARATE_REGISTER_STACK).  Also the snippet that setup the
madvise call to advertise kernel the area won't be used anymore in
near future is reallocated in allocatestack.c (for consistency to
put all stack management function in one place).

Checked on x86_64-linux-gnu and i686-linux-gnu for sanity (since
it is not expected code changes for architecture that do not
define NEED_SEPARATE_REGISTER_STACK) and also got a report that
it fixes ia64-linux-gnu failures from Sergei Trofimovich
<slyfox@gentoo.org>.

	[BZ #21672]
	* nptl/allocatestack.c [_STACK_GROWS_DOWN] (setup_stack_prot):
	Set to use !NEED_SEPARATE_REGISTER_STACK as well.
	(advise_stack_range): New function.
	* nptl/pthread_create.c (START_THREAD_DEFN): Move logic to mark
	stack non required to advise_stack_range at allocatestack.c
2017-08-29 13:29:19 -03:00
Szabolcs Nagy 16f138a49a [AArch64] Fix procfs.h not to expose stdint.h types
Commit 39e7a5a668 added stdint.h
to sys/procfs.h, but it is included into signal.h by default and
there is code that does not expect stdint.h to be visible there,
so use __uint64_t instead of uint64_t.
2017-08-29 16:54:33 +01:00
Florian Weimer 251bccfa1f iconv_open: Fix heap corruption on gconv_init failure [BZ #22026]
Also mangle the __end_fct function pointer on the error handling
path.
2017-08-29 17:33:58 +02:00
Florian Weimer e7c18b9d0a iconv: Mangle __btowc_fct even without __init_fct [BZ #22025] 2017-08-29 17:16:09 +02:00
Joseph Myers 7daada0319 Fix bits/math-finite.h _MSUF_ expansion namespace (bug 22028).
The current bits/math-finite.h approach to defining functions for
different types, involving math.h defining _MSUF_ and _MSUFTO_ for the
function suffixes involved, is not namespace-clean if one of those
suffixes (f, l, f128) is defined as a macro by the user before math.h
is included; too many levels of macro expansion occur.  Instead, those
suffixes should appear directly in the expansion of the macro using ##
so they don't get expanded even if defined as macros by the user (that
is, math.h should be defining __REDIRFROM_X and __REDIRTO_X directly
to use those suffixes rather than suffixes being passed as an argument
by macro callers).  This patch makes that change.

Tested for x86_64.

	[BZ #22028]
	* math/math.h [__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0]
	(_MSUF_): Remove macro.
	[__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0] (_MSUFTO_):
	Likewise.
	[__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0]
	(__REDIRFROM_X): New macro.
	[__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0] (__REDIRTO_X):
	Likewise.
	* math/bits/math-finite.h (__REDIRFROM_X): Remove macro.
	(__REDIRTO_X): Likewise.
	(__MATH_REDIRCALL): Do not pass _MSUF_ or _MSUFTO_ macro
	arguments.
	(__MATH_REDIRCALL_2): Likewise.
	(__MATH_REDIRCALL_INTERNAL): Likewise.
	(__REDIRFROM (lgamma, , _MSUF_)): Likewise.
	(__REDIRFROM (gamma, , _MSUF_)): Likweise.
	(__REDIRFROM (__gamma, _r_finite, _MSUF_)): Likewise.
	(__REDIRFROM (tgamma, , _MSUF_)): Likewise.
	* math/test-finite-macros.c: New file.
	* math/Makefile (tests): Add test-finite-macros.
	(CFLAGS-test-finite-macros.c): New variable.
2017-08-29 14:15:37 +00:00
Patsy Franklin 1cf1232cd4 gconv: Consistently mangle NULL function pointers [BZ #22025]
Not mangling NULL pointers is not safe because with very low
probability, a non-NULL function pointer can turn into a NULL pointer
after mangling.
2017-08-29 15:53:28 +02:00
Akhilesh Kumar f8de9568d8 Add locale for mfe_MU
Add locale for “Morisyen” which is also called “Mauritian Creole”
and is spoken in Mauritius.

	[BZ #21971]
	* localedata/SUPPORTED: Add mfe_MU/UTF-8.
	* localedata/locales/mfe_MU: New File.

	[BZ #21971]
	* locale/iso-639.def: add Morisyen.
2017-08-29 13:56:41 +02:00
Gabriel F. T. Gomes 42496114ec Provide a C++ version of iszero that does not use __MATH_TG (bug 21930)
When signaling nans are enabled (with -fsignaling-nans), the C++ version
of iszero uses the fpclassify macro, which is defined with __MATH_TG.
However, when support for float128 is available, __MATH_TG uses the
builtin __builtin_types_compatible_p, which is only available in C mode.

This patch refactors the C++ version of iszero so that it uses function
overloading to select between the floating-point types, instead of
relying on fpclassify and __MATH_TG.

Tested for powerpc64le, s390x, x86_64, and with build-many-glibcs.py.

	[BZ #21930]
	* math/math.h [defined __cplusplus && defined __SUPPORT_SNAN__]
	(iszero): New C++ implementation that does not use
	fpclassify/__MATH_TG/__builtin_types_compatible_p, when
	signaling nans are enabled, since __builtin_types_compatible_p
	is a C-only feature.
	* math/test-math-iszero.cc: When __HAVE_DISTINCT_FLOAT128 is
	defined, include ieee754_float128.h for access to the union and
	member ieee854_float128.ieee.
	[__HAVE_DISTINCT_FLOAT128] (do_test): Call check_float128.
	[__HAVE_DISTINCT_FLOAT128] (check_float128): New function.
	* sysdeps/powerpc/powerpc64le/Makefile [subdir == math]
	(CXXFLAGS-test-math-iszero.cc): Add -mfloat128 to the build
	options of test-math-zero on powerpc64le.
2017-08-28 15:22:37 -03:00
H.J. Lu 5e2bc4ff33 x86_64 __redirect_ieee754_expf: Change double to float
__redirect_ieee754_expf has type float, not double.

	* sysdeps/x86_64/fpu/multiarch/e_expf.c (__redirect_ieee754_expf):
	Change double to float.
2017-08-28 08:45:53 -07:00
Joseph Myers a48c0fb4b4 Simplify math-svid-compat code.
Now there are no more assembly wrappers using _LIB_VERSION or
__kernel_standard, the math-svid-compat code can be slighly
simplified.  math-svid-compat.h no longer needs __ASSEMBLER__
conditionals, and the _LIB_VERSION variable no longer needs to be
built for static libm, since all references are now in C code that
includes math-svid-compat.h and so gets the macro definition of
_LIB_VERSION to _POSIX_ outside the compat case.  This patch makes
those cleanups.

Tested for x86_64, and with build-many-glibcs.py.

	* math/math-svid-compat.h [!__ASSEMBLER__]: Make code
	unconditional.
	* sysdeps/ieee754/s_lib_version.c [!defined SHARED]: Remove
	conditional code; define contents only for [LIBM_SVID_COMPAT].
2017-08-28 15:19:52 +00:00
Florian Weimer ee17d4e99a Remove abi-*-options compiler flags
These options are no longer needed since commit
2dba5ce7b8 (<bits/syscall.h>: Use an
arch-independent system call list on Linux).
2017-08-28 17:16:53 +02:00
Samuel Thibault 45a4f49ee5 hurd: Remove duplicate symbol version
* hurd/Versions (GLIBC_2.4): Remove __stack_chk_fail.
* mach/Versions (GLIBC_2.4): Remove __stack_chk_fail.
2017-08-28 14:19:55 +02:00
Florian Weimer 2dba5ce7b8 <bits/syscall.h>: Use an arch-independent system call list on Linux
This commit changes the way the list of SYS_* system call macros is
created on Linux.  glibc now contains a list of all known system
calls, and the generated <bits/syscall.h> file defines the SYS_ macro
only if the correspnding __NR_ macro is defined by the kernel headers.

As a result, glibc does not have to be rebuilt to pick up system calls
if the glibc sources already know about them.  This means that glibc
can be built with older kernel headers, and if the installed kernel
headers are upgraded afterwards, additional SYS_ macros become
available as long as glibc has a record for those system calls.
2017-08-28 11:58:52 +02:00
Paul Pluzhnikov 5f3b183d19 2017-08-27 Paul Pluzhnikov <ppluzhnikov@google.com>
* stdlib/Makefile (tst-atexit, tst-at_quick_exit): New tests.
	(tst-cxa_atexit, tst-on_exit): Likewise.
	* stdlib/Makefile (tests): Add tst-atexit, tst-at_quick_exit,
	tst-cxa_atexit, and tst-on_exit.
	* stdlib/tst-atexit-common.c: New file.
	* stdlib/tst-atexit.c: New file.
	* stdlib/tst-at_quick_exit.c: New file.
	* stdlib/tst-cxa_atexit.c: New file.
	* stdlib/tst-on_exit.c: New file.
2017-08-27 19:10:40 -07:00
Samuel Thibault 99ee4d26dc hurd: Fix static initialization with -fstack-protector-strong
When linked statically, TLS initialization is not achieved before
mach_init and alike, so ssp accesses to tcbhead's stack_guard would
crash.  We can just avoid using ssp in the few functions needed before
TLS is set up.

	* mach/Makefile (CFLAGS-mach_init.o, CFLAGS-RPC_vm_statistics.o,
	CFLAGS-RPC_vm_map.o, CFLAGS-RPC_vm_protect.o,
	CFLAGS-RPC_i386_set_gdt.o, CFLAGS-RPC_i386_set_ldt.o,
	CFLAGS-RPC_task_get_special_port.o): Add $(no-stack-protector).
	* hurd/Makefile (CFLAGS-hurdstartup.o,
	CFLAGS-RPC_exec_startup_get_info.o): Add $(no-stack-protector).
2017-08-27 22:29:43 +02:00
Samuel Thibault 97e02ad233 hurd: fix build with -fstack-protector-strong
libmachuser and libhurduser also need stack_chk_fail_local and they do not
link against libc_nonshared.

       * mach/stack_chk_fail_local.c: New file.
       * hurd/stack_chk_fail_local.c: New file.
       * mach/Machrules ($(interface-library)-routines): Add
       stack_chk_fail_local.
       * mach/Versions (GLIBC_2.4): Add __stack_chk_fail.
       * hurd/Versions (GLIBC_2.4): Add __stack_chk_fail.
2017-08-27 22:10:17 +02:00
Samuel Thibault 2ef8d46913 hurd: Add system-specific sysmacros.h
* sysdeps/mach/hurd/bits/sysmacros.h: New file.
2017-08-27 22:00:23 +02:00
H.J. Lu 7ab70c98e8 x86: Remove assembly versions of index_cpu_*/index_arch_*
Since assembly versions of HAS_CPU_FEATURE and HAS_ARCH_FEATURE have
been removed,  assembly versions of index_cpu_* and index_arch_* can
also be removed.

Tested on i686 and x86-64 with and without --disable-multi-arch.

	* sysdeps/x86/cpu-features.h [__ASSEMBLER__]
	(index_cpu_*, index_arch_*): Removed.
2017-08-25 10:51:04 -07:00
Szabolcs Nagy 39e7a5a668 [AArch64] Fix elf_greg_t on ILP32
Use uint64_t instead of unsigned long.
2017-08-25 18:21:35 +01:00
Joseph Myers a6ccdb0839 Use __HAVE_DISTINCT_FLOAT128 in tgmath.h.
When _Float128 is ABI-equivalent to long double, there is no need for
tgmath.h to have any special _Float128 handling: it's always OK to
call the long double versions of functions for _Float128 arguments in
that case, and the logic to determine return types is generic.  Thus,
this patch changes the use of __HAVE_FLOAT128 to
__HAVE_DISTINCT_FLOAT128, as a minor optimization to reduce the size
of the macro expansions in the ABI-equivalent case.

Tested for x86_64.

	* math/tgmath.h [__HAVE_FLOAT128]: Change conditional to
	[__HAVE_DISTINCT_FLOAT128].
2017-08-25 17:02:33 +00:00
Joseph Myers 23761119fe Clean up bits/math-finite.h for aliasing types.
This patch cleans up how bits/math-finite.h handles types that are
ABI-aliases of other types.

For such types, no __*_finite functions exist; instead,
bits/math-finite.h must redirect calls to a the functions for a
canonical choice of type for each floating-point format.  (For the
actual public interfaces, symbols need exporting for each type, even
those that are ABI-aliases, because of standard requirements that
programs can declare the functions themselves without including
<math.h>, but that does not apply to __*_finite.)

At present, there is a special-case conditional in bits/math-finite.h
on __MATH_DECLARING_LDOUBLE && defined __NO_LONG_DOUBLE_MATH to handle
redirecting long double function calls to double __*_finite.  This
patch replaces this by a more general mechanism.  math.h, before each
inclusion of bits/math-finite.h, defines _MSUFTO_ as the suffix to use
on the target of redirection, in addition to the existing _MSUF_.
This way, __MATH_DECLARING_LDOUBLE can go away, as can the special
conditional in bits/math-finite.h.  With this patch, math.h is now
prepared for the case of supporting float128 functions as aliases of
long double ones on platforms where long double is binary128, with
_MSUFTO_ appropriately defined for that case, and appropriate _MSUFTO_
definitions can easily be included when supporting _Float32 / _Float64
/ _Float32x / _Float64x (which will always be ABI-aliases of another
type when supported).

Tested for x86_64, and did a compilation test for ARM with
build-many-glibcs.py to cover the long double = double case.

	* math/math.h (_MSUFTO_): Define and undefine for each inclusion
	of <bits/math-finite.h>.
	(__MATH_DECLARING_LDOUBLE): Do not define and undefine for each
	inclusion of <bits/math-finite.h>.
	* math/bits/math-finite.h (__REDIRTO_X): Do not define
	conditionally on [__MATH_DECLARING_LDOUBLE && defined
	__NO_LONG_DOUBLE_MATH].
	(__MATH_REDIRCALL): Use _MSUFTO_ in __REDIRTO call.
	(__MATH_REDIRCALL_2): Likewise.
	(__MATH_REDIRCALL_INTERNAL): Likewise.
	(__REDIRFROM (lgamma, , _MSUF_)): Likewise.
	(__REDIRFROM (gamma, , _MSUF_)): Likewise.
	(__REDIRFROM (tgamma, , _MSUF_)): Likewise.
2017-08-25 16:11:13 +00:00
Joseph Myers bba5c93094 Remove powerpc32 sqrt wrappers.
This patch removes the powerpc32-specific wrappers for sqrt and sqrtf.

These wrappers, by adding architecture-specific uses of _LIB_VERSION
and __kernel_standard, unnecessarily complicate cleanups of libm error
handling.  They also do not serve a useful optimization purpose.  GCC
knows about sqrt as a built-in function, and can generate direct calls
to a hardware square root instruction, either on its own, in the
-fno-math-errno case, or together with an inline check for the
argument being negative and a call to the out-of-line sqrt function
for error handling only in that case (and has been able to do so for a
long time).  Thus in practice the wrapper will only be called only in
the case of negative arguments, which is not a case it is useful to
optimize for.

Tested with build-many-glibcs.py for powerpc-linux-gnu-power4.

	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt_compat-power5.S:
	Remove file.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt_compat-ppc32.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt_compat.c:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf_compat-power5.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf_compat-ppc32.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf_compat.c:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt_compat.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt_compat.S: Likewise.
	* sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
	(libm-sysdep-routines): Remove w_sqrt_compat-power5,
	w_sqrt_compat-ppc32, w_sqrtf_compat-power5 and
	w_sqrtf_compat-ppc32.
2017-08-25 11:33:04 +00:00
Gabriel F. T. Gomes 3d7b66f66c Fix the C++ version of issignaling when __NO_LONG_DOUBLE_MATH is defined
When __NO_LONG_DOUBLE_MATH is defined, __issignalingl is not available,
thus issignaling with long double argument should call __issignaling,
instead.

Tested for powerpc64le.

	* math/math.h [defined __cplusplus] (issignaling): In the long
	double case, call __issignalingl only if __NO_LONG_DOUBLE_MATH
	is not defined.  Call __issignaling, otherwise.
2017-08-24 16:06:42 -03:00
Adhemerval Zanella ebd6f0076a Remove cancellation support for syscall generation
This patch removes the cancellation mark from the auto-generation syscall
script.  Now all the cancellable syscalls are done throught C code using
the SYSCALL_CANCEL macro.  It simplifies the assembly required to each
architecture port, since the SYSCALL_CANCEL uses the already defined
INLINE_SYSCALL macros, and allows a more straigh fix on cancellation
machanism (since no more specific assembly fixes will be required).

Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.A
Also with build-many-glibc.py with remaning touched architectures.

	* sysdeps/unix/make-syscalls.sh: Remove cancellable tagging for
	syscall definitions.
	* sysdeps/unix/syscall-template.S (SYSCALL_CANCELLABLE): Remove
	definition.
	* sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (__local_enable_asynccancel): Likewise.
	[IS_IN (libpthread)] (__local_disable_asynccancel): Likewise.
	[IS_IN (libc)] (__local_enable_asynccancel): Likewise.
	[IS_IN (libc)] (__local_enable_asynccancel): Likewise.
	[IS_IN (librt)] (__local_disable_asynccancel): Likewise.
	[IS_IN (librt)] (__local_disable_asynccancel): Likewise.
	(CENABLE): Likewise.
	(CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep-cancel.h (PSEUDO): Remove
	defintion.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h (PSEUDO):
	Remove definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	(SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Remove file.
	* sysdeps/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h: New file.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Remove file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h: New file.
	* sysdeps/unix/sysv/linux/tile/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
2017-08-24 14:58:35 -03:00
Szabolcs Nagy 8aa48656bb Fix CFLAGS override in sysdeps/ieee754/dbl-64
Use += instead of = to avoid overriding target specific CFLAGS settings.
Ideally the settings in target Makefiles would have precedence, but the
Makefile inclusion order does not allow that, with this fix at least the
target settings are not dropped.
2017-08-24 15:56:11 +01:00
H.J. Lu fcaaca412f x86-64: Regenerate libm-test-ulps for AVX512 mathvec tests
Update libm-test-ulps for AVX512 mathvec tests by running
“make regen-ulps” on Intel Xeon processor with AVX512.

	* sysdeps/x86_64/fpu/libm-test-ulps: Regenerated.
2017-08-23 09:11:55 -07:00
H.J. Lu 376b40a27a string/stratcliff.c: Replace int with size_t [BZ #21982]
Fix GCC 7 errors when string/stratcliff.c is compiled with -O3:

stratcliff.c: In function ‘do_test’:
cc1: error: assuming signed overflow does not occur when assuming that (X - c) <= X is always true [-Werror=strict-overflow]

	[BZ #21982]
	* string/stratcliff.c (do_test): Declare size, nchars, inner,
	middle and outer with size_t instead of int.  Repleace %d and
	%Zd with %zu in printf.  Update "MAX (0, nchars - 128)" and
	"MAX (outer, nchars - 64)" to support unsigned outer and
	nchars.  Also exit loop when outer == 0.
2017-08-23 08:23:02 -07:00
Adhemerval Zanella 2b0b9a1c85 Consolidate remaning non cancellable definitions
This patch consolidate the remaning non cancellable syscall definitions
on not-cancel.h header.  They are:

  * __fcntl_nocancel: Moved from fcntl.h to not-cancel.h.
  * __sigsuspend_nocancel: Removed since 988f991b50 it is not used or
    defined anymore.
  * __nanosleep_nocancel: Removed since 6f33fd046b it is defined on
    not-cancel.h.

Now all non-cancellable syscall definition are defined on not-cancel
(the only exceptions is the stdio symbol __fxprintf_nocancel which
uses non cancellable open and it is used on getopt implementation).

Checked on x86_64-linux-gnu and with build-many-glibc.py.

	* include/fcntl.h (__fcntl_nocancel): Remove definition.
	* include/signal.h (__sigsuspend_nocancel): Likewise.
	* include/time.h (__nanosleep_nocancel): Likewise.
	* sysdeps/generic/not-cancel.h (__fcntl_nocancel): New macro.
	* login/utmp_file.c: Include non cancellable syscall header.
	* sysdeps/unix/sysv/linux/not-cancel.h (__fcntl_nocancel): New
	prototype.
2017-08-23 10:47:03 -03:00
H.J. Lu b9eaca8fa0 x86_64: Replace AVX512F .byte sequences with instructions
Since binutils 2.25 or later is required to build glibc, we can replace
AVX512F .byte sequences with AVX512F instructions.

Tested on x86-64 and x32.  There are no code differences in libmvec.so
and libmvec.a.

	* sysdeps/x86_64/fpu/svml_d_sincos8_core.S: Replace AVX512F
	.byte sequences with AVX512F instructions.
	* sysdeps/x86_64/fpu/svml_d_wrapper_impl.h: Likewise.
	* sysdeps/x86_64/fpu/svml_s_sincosf16_core.S: Likewise.
	* sysdeps/x86_64/fpu/svml_s_wrapper_impl.h: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S:
	Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S:
	Likewise.
2017-08-23 06:26:44 -07:00
Steve Ellcey 5a706f649d aarch64: Use PTR_REG macro to fix ILP32 bug and make code consistent
* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic):
	Use PTR_REG macro in cmp instruction.
2017-08-22 16:22:05 -07:00
Gabriel F. T. Gomes b513da7e80 Fix remaining return type of ifunc resolver declaration
Since Martin Sebor's commit

commit ee4e992ebe
Author: Martin Sebor <msebor@redhat.com>
Date:   Tue Aug 22 09:35:23 2017 -0600

    Declare ifunc resolver to return a pointer to the same type as the target
    function to help GCC detect incompatibilities between the two when it's
    enhanced to do so.

builds for powerpc64le fail in the declaration of some ifunc resolvers,
because the ifunc is declared with unmatching return types.  One of the
declarations comes from the __ifunc_resolver macro, which was patched by
the aforementioned commit:

    /* Helper / base  macros for indirect function symbols.  */
    #define __ifunc_resolver(type_name, name, expr, arg, init, classifier) \
      classifier inhibit_stack_protector                                   \
      __typeof (type_name) *name##_ifunc (arg)                             \

whereas the other comes from the unpatched __ifunc macro when
HAVE_GCC_IFUNC is not defined:

    # define __ifunc(type_name, name, expr, arg, init)                     \
      extern __typeof (type_name) name;                                    \
      void *name##_ifunc (arg) __asm__ (#name);                            \

This patch changes the return type of the ifunc resolver in the __ifunc
macro, so that it matches the return type of the target function,
similarly to what the aforementioned commit does.

Tested for powerpc64le and s390x with unpatched GCC.

	* include/libc-symbols.h: [!defined HAVE_GCC_IFUNC] (__ifunc):
	Change the return type of the ifunc resolver to match the return
	type of the target function.
2017-08-22 19:08:27 -03:00
Adhemerval Zanella b70b6026a0 Remove p{read,write}{v} and fallocate from x86 auto-generation list
With {INLINE,INTERNAL}_SYSCALL macros fixed for 64-bits arguments on x32,
we can remove the p{read,write}{v} from auto-generation list.

Tested on x86_64 and x32.

	* sysdeps/unix/sysv/linux/x86_64/syscalls.list (pread64): Remove.
	(preadv64): Likewise.
	(pwrite64(: Likewise.
	(pwritev64): Likewise.
2017-08-22 17:27:18 -03:00
Adhemerval Zanella 78ca091cdd Fix {INLINE,INTERNAL}_SYSCALL macros for x32
The problem for x32 is the {INTERNAL,INLINE}_SYSCALL C macros explicit
cast the arguments to 'long int', thus passing as 32 bits arguments
that should be passed to 64 bits.

Previous x32 implementation uses the auto-generated syscalls from
assembly macros (syscalls.list), so the {INTERNAL,INLINE}_SYSCALL
macros are never used with 64 bit argument in x32 (which are
internally broken for this ILP).

To fix it I used a strategy similar to MIPS64n32 (although both
ABI differs for some syscalls on how top pass 64-bits arguments)
where argument types for kernel call are defined using GCC extension
'typeof' with a arithmetic operation.  This allows 64-bits arguments
to be defined while 32-bits argument will still passed as 32-bits.

I also cleanup the {INLINE,INTERNAL}_SYSCALL definition by defining
'inline_syscallX' instead of constructing the argument passing using
macros (it adds some readability) and removed the ununsed
INTERNAL_SYSCALL_NCS_TYPES define (since the patch idea is exactly to
avoid requiric explicit types passing).

Tested on x86_64 and x32.

	* sysdeps/unix/sysv/linux/x86_64/sysdep.h
	(INTERNAL_SYSCALL_NCS_TYPES): Remove define.
	(LOAD_ARGS_0): Likewise.
	(LOAD_ARGS_1): Likewise.
	(LOAD_ARGS_2): Likewise.
	(LOAD_ARGS_3): Likewise.
	(LOAD_ARGS_4): Likewise.
	(LOAD_ARGS_5): Likewise.
	(LOAD_ARGS_6): Likewise.
	(LOAD_REGS_0): Likewise.
	(LOAD_REGS_1): Likewise.
	(LOAD_REGS_2): Likewise.
	(LOAD_REGS_3): Likewise.
	(LOAD_REGS_4): Likewise.
	(LOAD_REGS_5): Likewise.
	(LOAD_REGS_6): Likewise.
	(ASM_ARGS_0): Likewise.
	(ASM_ARGS_1): Likewise.
	(ASM_ARGS_2): Likewise.
	(ASM_ARGS_3): Likewise.
	(ASM_ARGS_4): Likewise.
	(ASM_ARGS_5): Likewise.
	(ASM_ARGS_6): Likewise.
	(LOAD_ARGS_TYPES_1): Likewise.
	(LOAD_ARGS_TYPES_2): Likewise.
	(LOAD_ARGS_TYPES_3): Likewise.
	(LOAD_ARGS_TYPES_4): Likewise.
	(LOAD_ARGS_TYPES_5): Likewise.
	(LOAD_ARGS_TYPES_6): Likewise.
	(LOAD_REGS_TYPES_1): Likewise.
	(LOAD_REGS_TYPES_2): Likewise.
	(LOAD_REGS_TYPES_3): Likewise.
	(LOAD_REGS_TYPES_4): Likewise.
	(LOAD_REGS_TYPES_5): Likewise.
	(LOAD_REGS_TYPES_6): Likewise.
	(TYPEFY): New define.
	(ARGIFY): Likewise.
	(internal_syscall0): Likewise.
	(internal_syscall1): Likewise.
	(internal_syscall2): Likewise.
	(internal_syscall3): Likewise.
	(internal_syscall4): Likewise.
	(internal_syscall5): Likewise.
	(internal_syscall6): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/times.c
	(INTERNAL_SYSCALL_NCS): Remove define.
	(internal_syscall1): Add define.
2017-08-22 17:27:02 -03:00
Gabriel F. T. Gomes 453a493d2b Remove duplicate inclusion of header math-svid-compat.h
The header math-svid-compat.h has been unintentionally included twice in
the wrappers for the remainder functions.  This patch removes the
duplicate inclusions.

	* math/w_remainder_compat.c: Remove duplicate inclusion of
	math-svid-compat.h.
	* math/w_remainderf_compat.c: Likewise.
	* math/w_remainderl_compat.c: Likewise.
2017-08-22 15:24:37 -03:00
Gabriel F. T. Gomes f2f048a533 powerpc: Shrink ULPs for float128
During the development of float128 on powerpc64le, the ulps have been
generated since early versions of the patches.  On those versions, the
functions gamma and pow10 were mistakenly thought to be part of the API.
After review, the functions were removed, however the ulps for them were
carried in the ulps file.

This patch removes such entries from the ulps file, as well as it
shrinks the ulps for the cpow and lgamma functions.

Tested for powerpc64le.

	* sysdeps/powerpc/fpu/libm-test-ulps: Update.
2017-08-22 15:04:46 -03:00
Joseph Myers d9bef9c0a4 Fix tgmath.h handling of complex integers (bug 21684).
The tgmath.h macros return a real type not a complex type when an
argument is of complex integer type (a GNU extension) and there are no
arguments of complex floating type.  It seems clear that just as real
integers are mapped to double for tgmath.h, so complex integers should
be mapped to _Complex double.

This patch implements such a mapping.  The main complication in fixing
this bug is that the tgmath.h macros expand their arguments a large
number of times, resulting in exponential blowup of the size of the
expansion when calls to tgmath.h macros are used in the arguments of
such macros; it would be unfortunate for fixing a bug with a fairly
obscure extension to make the macros expand their arguments even more
times.  Thus, this patch optimizes the definitions of the relevant
macros.  __tgmath_real_type previously expanded its argument 7 times
and now expands it 3 times.  __tgmath_complex_type, used in place of
__tgmath_real_type only for functions that might return either real or
complex types, not for complex functions that always return real types
or always return complex types, expands its argument 5 times.  So the
sizes of the macro expansions from nested macro calls are
correspondingly reduced (remembering that each tgmath.h macro expands
__tgmath_real_type, or sometimes now __tgmath_complex_type, several
times).

Sometimes the real return type resulted from calling a complex
function and converting the result to a real type; sometimes it
resulted from calling a real function, because the logic for
determining whether arguments were real or complex, based on sizeof,
was confused by integer promotions applying to e.g. short int but not
_Complex short int.  The relevant tests are converted to use a new
macro __expr_is_real, which, by calling __builtin_classify_type rather
than comparing the results of two calls to sizeof, also reduces the
number of times macros expand their arguments.

Although there are reductions in the number of times macros expand
their arguments, I do not consider this to fix bug 21660, since a
proper fix means each macro expanding its arguments only once (via
using new compiler features designed for that purpose).

Tested for x86_64.

	[BZ #21684]
	* math/tgmath.h (__floating_type): Simplify definitions.
	(__real_integer_type): New macro.
	(__complex_integer_type): Likewise.
	(__expr_is_real): Likewise.
	(__tgmath_real_type_sub): Update comment to describe handling of
	complex types.
	(__tgmath_complex_type_sub): New macro.
	(__tgmath_complex_type): Likewise.
	[__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(__TGMATH_CF128): Use __expr_is_real.
	(__TGMATH_UNARY_REAL_IMAG): Use __tgmath_complex_type and
	__expr_is_real.
	(__TGMATH_BINARY_REAL_IMAG): Likewise.
	(__TGMATH_UNARY_REAL_IMAG_RET_REAL): Use __expr_is_real.
	* math/gen-tgmath-tests.py (Type.create_type): Create complex
	integer types.
2017-08-22 17:55:42 +00:00
Adhemerval Zanella 988f991b50 Remove non cancellable sigsuspend definition
There is no current internal usage for non cancellable sigsuspend calls.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* sysdeps/generic/not-cancel.h (sigsuspend_not_cancel): remove
	macro.
	* sysdeps/mach/hurd/sigsuspend.c (sigsuspend_not_cancel): remove
	alias.
	* sysdeps/unix/sysv/linux/not-cancel.h (sigsuspend_not_cancel):
	likewise.
2017-08-22 14:25:08 -03:00
Adhemerval Zanella 6f33fd046b Consolidate non cancellable nanosleep call
This patch consolidates all the non cancellable nanosleep calls to use
the __nanosleep_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* nptl/pthread_mutex_timedlock.c (__pthread_mutex_timedlock): Replace
	nanosleep_not_cancel with __nanosleep_nocancel.
	* sysdeps/generic/not-cancel.h (nanosleep_not_cancel): Remove macro.
	(__nanosleep_nocancel): New macro.
	* sysdeps/unix/sysv/linux/nanosleep.c (__nanosleep_nocancel): New
	function.
	* sysdeps/unix/sysv/linux/not-cancel.h (nanosleep_not_cancel): Remove
	macro.
	(__nanosleep_nocancel): New prototype.
2017-08-22 14:25:08 -03:00
Adhemerval Zanella 08d6eb46ca Consolidate non cancellable pause call
This patch consolidates all the non cancellable pause calls to use
the __pause_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* nptl/pthread_mutex_lock.c (__pthread_mutex_lock_full): Replace
	pause_not_cancel with __pause_nocancel.
	* sysdeps/generic/not-cancel.h (pause_not_cancel): Remove macro.
	(__pause_nocancel): New macro.
	* sysdeps/unix/sysv/linux/not-cancel.h (pause_not_cancel): Remove
	macro.
	(__pause_nocancel): New prototype.
	* sysdeps/unix/sysv/linux/pause.c (__pause_nocancel): New function.
2017-08-22 14:25:03 -03:00
Martin Sebor ee4e992ebe Declare ifunc resolver to return a pointer to the same type as the target
function to help GCC detect incompatibilities between the two when it's
enhanced to do so.
2017-08-22 09:35:23 -06:00
H.J. Lu 20962acbea Hide internal printf functions [BZ #18822/21986]
Hide internal printf functions to allow direct access within libc.so and
libc.a without using GOT nor PLT.

Since __guess_grouping has been changed to take 2 arguments by

commit a1d84548c8
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Feb 11 18:50:36 2000 +0000

the third argument passed to __guess_grouping is removed.

	[BZ #18822]
	[BZ #21986]
	* include/printf.h (__printf_fphex): Add attribute_hidden.
	(__guess_grouping): New prototype.
	* stdio-common/printf_fp.c (__guess_grouping): Removed.
	* stdio-common/reg-printf.c (__register_printf_specifier): Add
	libc_hidden_proto and libc_hidden_def.
	* stdlib/strfmon_l.c (__guess_grouping): Removed.
	(__vstrfmon_l): Remove the third argument passed to
	__guess_grouping.
2017-08-22 07:50:57 -07:00
Gabriel F. T. Gomes a16e8bc08e Provide a C++ version of issignaling that does not use __MATH_TG
The macro __MATH_TG contains the logic to select between long double and
_Float128, when these types are ABI-distinct.  This logic relies on
__builtin_types_compatible_p, which is not available in C++ mode.

On the other hand, C++ function overloading provides the means to
distinguish between the floating-point types.  The overloading
resolution will match the correct parameter regardless of type
qualifiers, i.e.: const and volatile.

Tested for powerpc64le, s390x, and x86_64.

	* math/math.h [defined __cplusplus] (issignaling): Provide a C++
	definition for issignaling that does not rely on __MATH_TG,
	since __MATH_TG uses __builtin_types_compatible_p, which is only
	available in C mode.
	(CFLAGS-test-math-issignaling.cc): New variable.
	* math/Makefile [CXX] (tests): Add test-math-issignaling.
	* math/test-math-issignaling.cc: New test for C++ implementation
	of type-generic issignaling.
	* sysdeps/powerpc/powerpc64le/Makefile [subdir == math]
	(CXXFLAGS-test-math-issignaling.cc): Add -mfloat128 to the build
	options of test-math-issignaling on powerpc64le.
2017-08-22 10:05:41 -03:00
H.J. Lu 8d2ec55329 Add hidden visibility to internal function prototypes
Add hidden visibility to internal function prototypes to allow direct
access to internal functions within libc.a without using GOT when the
compiler defaults to -fPIE.

Size comparison of elf/ldconfig when the compiler defaults to -fPIE:

On x86-64:
        text	   data	    bss	    dec	    hex
Before: 619646	  20132	   5488	 645266	  9d892
After : 619502	  20132	   5488	 645122	  9d802
On i686:
        text	   data	    bss	    dec	    hex
Before: 550333	  10748	   3060	 564141	  89bad
After : 546453	  10732	   3060	 560245	  88c75

	* include/libc-symbols.h (__hidden_proto_hiddenattr): New for
	building libc.a.
	(hidden_proto): Likewise.
	(hidden_tls_proto): Likewise.
	(__hidden_proto): Likewise.

(Reapplied after the revert in df1deda60050cc8a68156cf6c81ad42363647a29.)
2017-08-22 13:50:28 +02:00
Florian Weimer a4d57b7947 math: Statically link tests of internal functionality 2017-08-22 13:50:27 +02:00
Joseph Myers 80f91666fe Fix sparc32 bits/long-double.h (bug 21987).
My refactoring of long double information

commit 0acb8a2a85
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Dec 14 18:27:56 2016 +0000

    Refactor long double information into bits/long-double.h.

resulted in sparc32 configurations installing the ldbl-opt version of
bits/long-double.h instead of the intended
sysdeps/unix/sysv/linux/sparc version.

For sparc32 by itself, this is not a problem, since the ldbl-opt
version is correct for sparc32.  However, both sparc32 and sparc64 are
supposed to install sets of headers that work for both of them, so
that a single sysroot, whichever order the libraries are built and
installed in, works for both.  The effect of having the wrong version
installed is that you end up with a miscompiled sparc64 libstdc++
which fails glibc's configure tests for the C++ compiler.

This patch moves the header from sysdeps/unix/sysv/linux/sparc to
separate copies of the same file for sparc32 and sparc64, to ensure it
comes before ldbl-opt in the sysdeps directory ordering.

Tested with build-many-glibcs.py for sparc64-linux-gnu and
sparcv9-linux-gnu.

	[BZ #21987]
	* sysdeps/unix/sysv/linux/sparc/bits/long-double.h: Remove file
	and copy to ...
	* sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h:
	... here.
	* sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h:
	... and here.
2017-08-22 00:59:43 +00:00
Joseph Myers 75dfe623df Fix position of tests-unsupported definition in assert/Makefile.
tests-unsupported has to be defined before the inclusion of Rules in a
subdirectory Makefile; otherwise it is ineffective.  This patch fixes
the ordering in assert/Makefile, where a recent test addition put
tests-unsupported too late (resulting in build failures when the C++
compiler was missing or broken, and thereby showing up the unrelated
bug 21987).

Incidentally, I don't see why these tests depend on
$(have-cxx-thread_local) rather than just a working C++ compiler.

Tested in such a configuration (broken compiler/libstdc++) with
build-many-glibcs.py.

	* assert/Makefile [$(have-cxx-thread_local)]: Move conditional
	variable definitions above inclusion of ../Rules.
2017-08-22 00:30:51 +00:00
Joseph Myers ea99fcd038 Fix GCC 7 build of k_standard.c.
This patch adds a default case to k_standard.c that calls
__builtin_unreachable, to avoid an uninitialized variable error from
GCC 7 (reported in
<https://sourceware.org/ml/libc-alpha/2017-08/msg01012.html>).

Tested for x86_64 (with GCC 7).

	* sysdeps/ieee754/k_standard.c (__kernel_standard): Add default
	case calling __builtin_unreachable.
2017-08-21 21:43:32 +00:00
Adhemerval Zanella a8410a5fc9 Consolidate non cancellable waitpid call
This patch consolidates all the non cancellable waitpid calls to use
the __waitpid_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* libio/ioopen.c (_IO_waitpid): Replace waitpid_not_cancel with
	__waitpid_nocancel.
	* sysdeps/generic/not-cancel.h (waitpid_not_cancel): Remove macro.
	(__waitpid_nocancel): New macro.
	* sysdeps/unix/sysv/linux/not-cancel.h (waitpid_not_cancel): Remove
	macro.
	(__waitpid_nocancel): Replace macro with a function.
	* sysdeps/unix/sysv/linux/waitpid.c (__waitpid_nocancel): New
	function.
2017-08-21 15:37:45 -03:00
Adhemerval Zanella 7369800c04 Consolidate non cancellable fcntl call
This patch consolidates all the non cancellable fcntl calls to use
the __fcntl_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

Since its prototype is already defined at internal fcntl.h header, it
is removed from not-cancel.h one.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* login/utmp_file.c (timeout_handler): Replace fcntl_not_cancel with
	__fcntl_nocancel.
	* sysdeps/generic/not-cancel.h (fcntl_not_cancel): Remove macro.
	* sysdeps/unix/sysv/linux/not-cancel.h (fcntl_not_cancel): Likewise.
2017-08-21 15:37:45 -03:00
Adhemerval Zanella 19926de954 Consolidate non cancellable writev call
This patch consolidates all the non cancellable writev calls to use
the __writev_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* gmon/gmon.c (write_hist): Replace writev_not_cancel_no_status with
	__writev_nocancel_nostatus.
	(write_call_graph): Likewise.
	(write_bb_counts): Likewise.
	* resolv/herror.c (herror): Likewise.
	* sysdeps/generic/not-cancel.h (writev_not_cancel_no_status): Remove
	macro.
	(__writev_nocancel_nostatus): New macro.
	* sysdeps/unix/sysv/linux/not-cancel.h (writev_not_cancel_no_status):
	Remove macro.
	(__writev_nocancel_nostatus): New function.
2017-08-21 15:37:45 -03:00
Joseph Myers df1deda600 Revert "Add hidden visibility to internal function prototypes".
The commit

commit 568ff4296c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Aug 21 05:50:38 2017 -0700

    Add hidden visibility to internal function prototypes

breaks the build of the testsuite for many platforms:

https://sourceware.org/ml/libc-testresults/2017-q3/msg00300.html

The errors are of the following form, building math/atest-exp:

[...]
/scratch/jmyers/glibc-bot/build/glibcs/aarch64-linux-gnu/glibc/stdlib/rshift.o: In function `__mpn_rshift':
/scratch/jmyers/glibc-bot/build/glibcs/aarch64-linux-gnu/glibc-src/stdlib/rshift.c:45: undefined reference to `__assert_fail'
/scratch/jmyers/glibc-bot/install/compilers/aarch64-linux-gnu/lib/gcc/aarch64-glibc-linux-gnu/7.2.1/../../../../aarch64-glibc-linux-gnu/bin/ld: /scratch/jmyers/glibc-bot/build/glibcs/aarch64-linux-gnu/glibc/math/atest-exp: hidden symbol `__assert_fail' isn't defined
/scratch/jmyers/glibc-bot/install/compilers/aarch64-linux-gnu/lib/gcc/aarch64-glibc-linux-gnu/7.2.1/../../../../aarch64-glibc-linux-gnu/bin/ld: final link failed: Bad value

This test is using various objects from the build of libc.  Some of
those objects contain references to __assert_fail.  Because those
references are hidden, they cannot refer to __assert_fail from
libc.so.  Given the tests using internal objects those symbols in
libc.a can't safely be made hidden, so this patch reverts the problem
commit until any alternative approach that doesn't break the build can
be found.
2017-08-21 17:52:05 +00:00
Joseph Myers 831bbd5527 Remove SPARC sqrt wrappers (bug 21973).
This patch removes the SPARC-specific wrappers for sqrt and sqrtf.

These wrappers, by adding architecture-specific uses of _LIB_VERSION
and __kernel_standard, unnecessarily complicate cleanups of libm error
handling.  They also do not serve a useful optimization purpose.  GCC
knows about sqrt as a built-in function, and can generate direct calls
to a hardware square root instruction, either on its own, in the
-fno-math-errno case, or together with an inline check for the
argument being negative and a call to the out-of-line sqrt function
for error handling only in that case (and has been able to do so for a
long time).  Thus in practice the wrapper will only be called only in
the case of negative arguments, which is not a case it is useful to
optimize for.

The removal of the wrappers also uncovers, and fixes, an old bug.
32-bit SPARC libm used (checked with glibc 2.8 binaries) to have a
sqrtl compat symbol, version GLIBC_2.0, for old binaries when sqrtl
was an alias of sqrt (I don't have pre-glibc-2.4 binaries for SPARC to
hand to check for the sqrtl symbol in those).  This disappeared,
probably with:

commit 8847f03770
Author: David S. Miller <davem@davemloft.net>
Date:   Tue Feb 28 22:37:58 2012 -0800

    Add sparc optimized sqrt{,f}.

Removing the wrappers brings back the generic ldbl-opt logic for
creating such compat symbols, and so restores the compat symbol that
should be there.  This could of course also be fixed in the wrappers -
but as noted above, the wrappers are optimizing a case it's not useful
to optimize, so the bug of the missing compat symbol serves to
illustrate the risks involved with the extra complexity of
architecture-specific function versions where not needed.

Tested with build-many-glibcs.py.

	[BZ #21973]
	* sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S: Remove file.
	* sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat-vis3.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt_compat.S : Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/w_sqrt_compat.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Add
	GLIBC_2.0 sqrtl symbol.
2017-08-21 17:46:34 +00:00
Joseph Myers 813378e9fe Obsolete matherr, _LIB_VERSION, libieee.a.
This patch obsoletes support for SVID libm error handling (the system
where a user-defined function matherr is called on a libm function
error; only enabled if you also set _LIB_VERSION = _SVID_ or
_LIB_VERSION = _XOPEN_) and the use of the _LIB_VERSION global
variable to control libm error handling.  matherr and _LIB_VERSION are
made into compat symbols, not supported for new ports or for static
linking.  The libieee.a object file (which sets _LIB_VERSION = _IEEE_,
so disabling errno setting for some functions) is also removed, and
all the related definitions are removed from math.h.

The manual already recommends against using matherr, and it's already
not supported for _Float128 functions (those use new wrappers that
don't support matherr, only errno) - this patch means that it becomes
possible to e.g. add sinf32 as an alias to sinf without that resulting
in undesired matherr support in sinf32 for existing glibc ports.
matherr support is not part of any standard supported by glibc (it was
removed in XPG4).

Because matherr is a function to be defined by the user, of course
user programs defining such a function will still continue to link; it
just quietly won't be used.  If they try to write to the library's
copy of _LIB_VERSION to enable SVID error handling, however, they will
get a link error (but if they define their own _LIB_VERSION variable,
they won't).

I expect the most likely case of build failures from this patch to be
programs with unconditional cargo-culted uses of -lieee (based on a
notion of "I want IEEE floating point", not any actual requirement for
that library).

Ideally, the new-port-or-static-linking case would use the new
wrappers used for _Float128.  This is not implemented in this patch,
because of the complication of architecture-specific (powerpc32 and
sparc) sqrt wrappers that use _LIB_VERSION and __kernel_standard
directly.  Thus, the old wrappers and __kernel_standard are still
built unconditionally, and _LIB_VERSION still exists in static libm.
But when the old wrappers and __kernel_standard are built in the
non-compat case, _LIB_VERSION and matherr are defined as macros so
code to support those features isn't actually built into static libm
or new ports' shared libm after this patch.

I intend to move to the new wrappers for static libm and new ports in
followup patches.  I believe the sqrt wrappers for powerpc32 and sparc
can reasonably be removed.  GCC already optimizes the normal case of
sqrt by generating code that uses a hardware instruction and only
calls the sqrt function if the argument was negative (if
-fno-math-errno, of course, it just uses the hardware instruction
without any check for negative argument being needed).  Thus those
wrappers will only actually get called in the case of negative
arguments, which is not a case it makes sense to optimize for.  But
even without removing the powerpc32 and sparc wrappers it should still
be possible to move to the new wrappers for static libm and new ports,
just without having those dubious architecture-specific optimizations
in static libm.

Everything said about matherr equally applies to matherrf and matherrl
(IA64-specific, undocumented), except that the structure of IA64 libm
means it won't be converted to using the new wrappers (it doesn't use
the old ones either, but its own error-handling code instead).

As with other tests of compat symbols, I expect test-matherr and
test-matherr-2 to need to become appropriately conditional once we
have a system for disabling such tests for ports too new to have the
relevant symbols.

Tested for x86_64 and x86, and with build-many-glibcs.py.

	* math/math.h [__USE_MISC] (_LIB_VERSION_TYPE): Remove.
	[__USE_MISC] (_LIB_VERSION): Likewise.
	[__USE_MISC] (struct exception): Likewise.
	[__USE_MISC] (matherr): Likewise.
	[__USE_MISC] (DOMAIN): Likewise.
	[__USE_MISC] (SING): Likewise.
	[__USE_MISC] (OVERFLOW): Likewise.
	[__USE_MISC] (UNDERFLOW): Likewise.
	[__USE_MISC] (TLOSS): Likewise.
	[__USE_MISC] (PLOSS): Likewise.
	[__USE_MISC] (HUGE): Likewise.
	[__USE_XOPEN] (MAXFLOAT): Define even if [__USE_MISC].
	* math/math-svid-compat.h: New file.
	* conform/linknamespace.pl (@whitelist): Remove matherr, matherrf
	and matherrl.
	* include/math.h [!_ISOMAC] (__matherr): Remove.
	* manual/arith.texi (FP Exceptions): Do not document matherr.
	* math/Makefile (tests): Change test-matherr to test-matherr-3.
	(tests-internal): New variable.
	(install-lib): Do not add libieee.a.
	(non-lib.a): Likewise.
	(extra-objs): Do not add libieee.a and ieee-math.o.
	(CPPFLAGS-s_lib_version.c): Remove variable.
	($(objpfx)libieee.a): Remove rule.
	($(addprefix $(objpfx), $(tests-internal)): Depend on $(libm).
	* math/ieee-math.c: Remove.
	* math/libm-test-support.c (matherr): Remove.
	* math/test-matherr.c: Use <support/test-driver.c>.  Add copyright
	and license notices.  Include <math-svid-compat.h> and
	<shlib-compat.h>.
	(matherr): Undefine as macro.  Use compat_symbol_reference.
	(_LIB_VERSION): Likewise.
	* math/test-matherr-2.c: New file.
	* math/test-matherr-3.c: Likewise.
	* sysdeps/generic/math_private.h (__kernel_standard): Remove
	declaration.
	(__kernel_standard_f): Likewise.
	(__kernel_standard_l): Likewise.
	* sysdeps/ieee754/s_lib_version.c: Do not include <math.h> or
	<math_private.h>.  Include <math-svid-compat.h>.
	(_LIB_VERSION): Undefine as macro.
	(_LIB_VERSION_INTERNAL): Always initialize to _POSIX_.  Define
	only if [LIBM_SVID_COMPAT || !defined SHARED].  If
	[LIBM_SVID_COMPAT], use compat_symbol.
	* sysdeps/ieee754/s_matherr.c: Do not include <math.h> or
	<math_private.h>.  Include <math-svid-compat.h>.
	(matherr): Undefine as macro.
	(__matherr): Define only if [LIBM_SVID_COMPAT].  Use
	compat_symbol.
	* sysdeps/ia64/fpu/libm_error.c: Include <math-svid-compat.h>.
	[_LIBC && LIBM_SVID_COMPAT] (matherrf): Use
	compat_symbol_reference.
	[_LIBC && LIBM_SVID_COMPAT] (matherrl): Likewise.
	[_LIBC && !LIBM_SVID_COMPAT] (matherrf): Define as macro.
	[_LIBC && !LIBM_SVID_COMPAT] (matherrl): Likewise.
	* sysdeps/ia64/fpu/libm_support.h: Include <math-svid-compat.h>.
	(MATHERR_D): Remove declaration.
	[!_LIBC] (_LIB_VERSION_TYPE): Likewise
	[!LIBM_BUILD] (_LIB_VERSIONIMF): Likewise.
	[LIBM_BUILD] (pmatherrf): Likewise.
	[LIBM_BUILD] (pmatherr): Likewise.
	[LIBM_BUILD] (pmatherrl): Likewise.
	(DOMAIN): Likewise.
	(SING): Likewise.
	(OVERFLOW): Likewise.
	(UNDERFLOW): Likewise.
	(TLOSS): Likewise.
	(PLOSS): Likewise.
	* sysdeps/ia64/fpu/s_matherrf.c: Include <math-svid-compat.h>.
	(__matherrf): Define only if [LIBM_SVID_COMPAT].  Use
	compat_symbol.
	* sysdeps/ia64/fpu/s_matherrl.c: Include <math-svid-compat.h>.
	(__matherrl): Define only if [LIBM_SVID_COMPAT].  Use
	compat_symbol.
	* math/lgamma-compat.h: Include <math-svid-compat.h>.
	* math/w_acos_compat.c: Likewise.
	* math/w_acosf_compat.c: Likewise.
	* math/w_acosh_compat.c: Likewise.
	* math/w_acoshf_compat.c: Likewise.
	* math/w_acoshl_compat.c: Likewise.
	* math/w_acosl_compat.c: Likewise.
	* math/w_asin_compat.c: Likewise.
	* math/w_asinf_compat.c: Likewise.
	* math/w_asinl_compat.c: Likewise.
	* math/w_atan2_compat.c: Likewise.
	* math/w_atan2f_compat.c: Likewise.
	* math/w_atan2l_compat.c: Likewise.
	* math/w_atanh_compat.c: Likewise.
	* math/w_atanhf_compat.c: Likewise.
	* math/w_atanhl_compat.c: Likewise.
	* math/w_cosh_compat.c: Likewise.
	* math/w_coshf_compat.c: Likewise.
	* math/w_coshl_compat.c: Likewise.
	* math/w_exp10_compat.c: Likewise.
	* math/w_exp10f_compat.c: Likewise.
	* math/w_exp10l_compat.c: Likewise.
	* math/w_exp2_compat.c: Likewise.
	* math/w_exp2f_compat.c: Likewise.
	* math/w_exp2l_compat.c: Likewise.
	* math/w_fmod_compat.c: Likewise.
	* math/w_fmodf_compat.c: Likewise.
	* math/w_fmodl_compat.c: Likewise.
	* math/w_hypot_compat.c: Likewise.
	* math/w_hypotf_compat.c: Likewise.
	* math/w_hypotl_compat.c: Likewise.
	* math/w_j0_compat.c: Likewise.
	* math/w_j0f_compat.c: Likewise.
	* math/w_j0l_compat.c: Likewise.
	* math/w_j1_compat.c: Likewise.
	* math/w_j1f_compat.c: Likewise.
	* math/w_j1l_compat.c: Likewise.
	* math/w_jn_compat.c: Likewise.
	* math/w_jnf_compat.c: Likewise.
	* math/w_jnl_compat.c: Likewise.
	* math/w_lgamma_main.c: Likewise.
	* math/w_lgamma_r_compat.c: Likewise.
	* math/w_lgammaf_main.c: Likewise.
	* math/w_lgammaf_r_compat.c: Likewise.
	* math/w_lgammal_main.c: Likewise.
	* math/w_lgammal_r_compat.c: Likewise.
	* math/w_log10_compat.c: Likewise.
	* math/w_log10f_compat.c: Likewise.
	* math/w_log10l_compat.c: Likewise.
	* math/w_log2_compat.c: Likewise.
	* math/w_log2f_compat.c: Likewise.
	* math/w_log2l_compat.c: Likewise.
	* math/w_log_compat.c: Likewise.
	* math/w_logf_compat.c: Likewise.
	* math/w_logl_compat.c: Likewise.
	* math/w_pow_compat.c: Likewise.
	* math/w_powf_compat.c: Likewise.
	* math/w_powl_compat.c: Likewise.
	* math/w_remainder_compat.c: Likewise.
	* math/w_remainderf_compat.c: Likewise.
	* math/w_remainderl_compat.c: Likewise.
	* math/w_scalb_compat.c: Likewise.
	* math/w_scalbf_compat.c: Likewise.
	* math/w_scalbl_compat.c: Likewise.
	* math/w_sinh_compat.c: Likewise.
	* math/w_sinhf_compat.c: Likewise.
	* math/w_sinhl_compat.c: Likewise.
	* math/w_sqrt_compat.c: Likewise.
	* math/w_sqrtf_compat.c: Likewise.
	* math/w_sqrtl_compat.c: Likewise.
	* math/w_tgamma_compat.c: Likewise.
	* math/w_tgammaf_compat.c: Likewise.
	* math/w_tgammal_compat.c: Likewise.
	* sysdeps/ieee754/dbl-64/w_exp_compat.c: Likewise.
	* sysdeps/ieee754/flt-32/w_expf_compat.c: Likewise.
	* sysdeps/ieee754/k_standard.c: Likewise.
	* sysdeps/ieee754/k_standardf.c: Likewise.
	* sysdeps/ieee754/k_standardl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/w_expl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-96/w_expl_compat.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt_compat.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt_compat.S: Likewise.
	* sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S: Likewise.
	* sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat-vis3.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt_compat.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/w_sqrt_compat.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/w_sqrtf_compat.S: Likewise.
2017-08-21 17:45:10 +00:00
Florian Weimer 4504783c0f benchtests: Do not compile benchmark objects as libc modules [BZ #21864]
Otherwise, this will lead to link failures due to hidden symbol
references.
2017-08-21 19:28:54 +02:00
Florian Weimer b5889d25e9 assert: Support types without operator== (int) [BZ #21972] 2017-08-21 15:33:11 +02:00
H.J. Lu 41e673c1e7 x86-64: Mark internal symbols with attribute_hidden [BZ #18822]
Since __syscall_clock_gettime and __start_context are internal symbols
for Linux/x86-64, mark them with attribute_hidden.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/x86_64/init-first.c
	(__syscall_clock_gettime): Add attribute_hidden.
	* sysdeps/unix/sysv/linux/x86_64/makecontext.c
	(__start_context): Likewise.
2017-08-21 05:58:53 -07:00
H.J. Lu 568ff4296c Add hidden visibility to internal function prototypes
Add hidden visibility to internal function prototypes to allow direct
access to internal functions within libc.a without using GOT when the
compiler defaults to -fPIE.

Size comparison of elf/ldconfig when the compiler defaults to -fPIE:

On x86-64:
        text	   data	    bss	    dec	    hex
Before: 619646	  20132	   5488	 645266	  9d892
After : 619502	  20132	   5488	 645122	  9d802
On i686:
        text	   data	    bss	    dec	    hex
Before: 550333	  10748	   3060	 564141	  89bad
After : 546453	  10732	   3060	 560245	  88c75

	* include/libc-symbols.h (__hidden_proto_hiddenattr): New for
	building libc.a.
	(hidden_proto): Likewise.
	(hidden_tls_proto): Likewise.
	(__hidden_proto): Likewise.
2017-08-21 05:50:52 -07:00
H.J. Lu 7c41b4a131 Enable hidden visibility in libc.a compiled with PIE
When building libc.a with PIE, enable hidden visibility to allow direct
access to definitions within libc.a without using GOT.

Size comparison of elf/ldconfig when the compiler defaults to -fPIE:

On x86-64:
        text	   data	    bss	    dec	    hex
Before: 619206	  20132	   5488	 644826	  9d6da
After : 619062	  20132	   5488	 644682	  9d64a
On i686:
        text	   data	    bss	    dec	    hex
Before: 556305	  10816	   3056	 570177	  8b341
After : 553688	  10756	   3056	 567500	  8a8cc

	* include/libc-symbols.h (attribute_hidden): Enable hidden
	visibility in libc.a compiled with PIE.
2017-08-21 05:47:27 -07:00
H.J. Lu 483d706879 x86: Mark VDSO_SYMBOL(getcpu) with attribute_hidden [BZ #18822]
VDSO_SYMBOL(getcpu) is defined as hidden in Linux/x86_64 init-first.c
and unused for Linux/i386.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/x86/libc-vdso.h (VDSO_SYMBOL(getcpu)):
	Add attribute_hidden.
2017-08-21 05:40:45 -07:00
H.J. Lu 54e4b8f215 Mark __libc_multiple_libcs with attribute_hidden [BZ #18822]
Since __libc_multiple_libcs is defined as hidden symbol in init-first.c,
it should be always marked with attribute_hidden.

	[BZ #18822]
	* csu/libc-start.c (__libc_multiple_libcs): Removed.
	* elf/dl-open.c: Include <libc-internal.h>.
	(__libc_multiple_libcs): Removed.
	* elf/dl-sysdep.c: Include <libc-internal.h> instead of
	<hp-timing.h>.
	* include/libc-internal.h (__libc_multiple_libcs): New.
	* misc/sbrk.c: Include <libc-internal.h>.
	(__libc_multiple_libcs): Removed.
2017-08-21 05:32:39 -07:00
H.J. Lu 1dbbb1ec7a Mark internal nss symbols with attribute_hidden [BZ #18822]
Mark internal nss symbols with attribute_hidden to allow direct access
within libc.so and libc.a without using GOT nor PLT.

Tested on x86-64 with and without --disable-nscd.

	[BZ #18822]
	* grp/initgroups.c (__nss_group_database): Removed.
	(__nss_initgroups_database): Likewise.
	* nscd/gai.c (__nss_hosts_database): Likewise.
	* nss/XXX-lookup.c (DATABASE_NAME_SYMBOL): Likewise.
	* posix/tst-rfc3484-2.c (__nss_hosts_database): Likewise.
	* posix/tst-rfc3484-3.c (__nss_hosts_database): Likewise.
	* posix/tst-rfc3484.c (__nss_hosts_database): Likewise.
	* sysdeps/posix/getaddrinfo.c (__nss_hosts_database): Likewise.
	* nss/getXXent.c (INTERNAL (REENTRANT_GETNAME)): Add
	attribute_hidden.
	* nss/nsswitch.c (__nss_database_custom): Define only if
	USE_NSCD is defined.
	(__nss_configure_lookup): Use __nss_database_custom only if
	USE_NSCD is defined.
	* nss/nsswitch.h (__nss_database_custom): Declare only if
	USE_NSCD is defined.  Add attribute_hidden.
	(__nss_setent): Add attribute_hidden.
	(__nss_endent): Likewise.
	(__nss_getent_r): Likewise.
	(__nss_getent): Likewise.
	(DEFINE_DATABASE): Declare __nss_##arg##_database.
2017-08-21 05:31:19 -07:00
H.J. Lu 2585d7b839 i386: Hide __old_glob64 [BZ #18822]
Hide internal __old_glob64 function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/i386/glob64.c (__old_glob64): Add
	libc_hidden_proto and libc_hidden_def.
2017-08-20 10:47:02 -07:00
H.J. Lu c8dfa99c98 i386: Hide __old_readdir64 [BZ #18822]
Hide internal __old_readdir64 function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/i386/olddirent.h (__old_readdir64):
	Add libc_hidden_proto.
	* sysdeps/unix/sysv/linux/i386/readdir64.c (__old_readdir64):
	Add libc_hidden_def.
2017-08-20 10:46:11 -07:00
H.J. Lu 91695eb14c Remove sysdeps/alpha/bb_init_func.S
Since the generic __bb_init_func has been removed by commit 7ed87317c7,
there is no need for sysdeps/alpha/bb_init_func.S.

	[BZ #21974]
	* sysdeps/alpha/bb_init_func.S: Removed.
2017-08-20 06:51:15 -07:00
H.J. Lu 9476b90470 Update ChangeLog 2017-08-20 06:45:25 -07:00
H.J. Lu 7ed87317c7 Remove __bb_init_func and __bb_exit_func [BZ #21974]
__bb_init_func and __bb_exit_func have been removed from GCC 3.3 in
2002 by

https://gcc.gnu.org/ml/gcc-patches/2002-09/msg00499.html

which also recommended that they should also be removed from glibc. These
functions exist only in libc.a and are used for gcov from versions of GCC
older than GCC 3.3.

	[BZ #21974]
	* gmon/Makefile (routines): Remove bb_init_func and
	bb_exit_func.
	(elide-routines.os): Removed.
	* include/sys/gmon.h (__bb): Likewise.
	(__bb_init_func): Likewise.
	(__bb_exit_func): Likewise.
2017-08-20 06:39:31 -07:00
H.J. Lu 94e6ba153b Move ____longjmp_chk prototype to include/setjmp.h
Move ____longjmp_chk prototype to include/setjmp.h and add
attribute_hidden.

	* debug/longjmp_chk.c (____longjmp_chk): Moved to ...
	* include/setjmp.h (____longjmp_chk): Here.  Add
	attribute_hidden.
2017-08-20 06:30:46 -07:00
H.J. Lu 7550717ed7 Mark internal SSE2 functions with attribute_hidden [BZ #18822]
Mark internal SSE2 functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/x86_64/multiarch/strcspn-c.c (STRCSPN_SSE2): Add
	attribute_hidden.
	(__strspn_sse2): Likewise.
2017-08-19 16:46:53 -07:00
Adhemerval Zanella c181840c93 Consolidate non cancellable close call
This patch consolidates all the non cancellable close calls to use
the __close_nocancel{_nostatus} identifier.  For non cancellable targets
it will be just a macro to call the default respective symbol while on Linux
will be a internal one.

Also, since it is used on libcrypto it is also exported in GLIBC_PRIVATE
namespace.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* sysdeps/generic/not-cancel.h (close_not_cancel): Remove macro.
	(close_not_cancel_no_status): Likewise.
	(__close_nocancel): New macro.
	(__close_nocancel_no_status): Likewise.
	* sysdeps/unix/sysv/linux/not-cancel.h (__close_nocancel): Remove
	macro.
	(close_not_cancel): Likewise.
	(close_not_cancel_no_status): Likewise.
	(__close_nocancel): New prototype.
	(__close_nocancel_no_status): New function.
	* sysdeps/unix/sysv/linux/close.c (__close_nocancel): New function.
	* catgets/open_catalog.c (__open_catalog): Replace
	close_not_cancel{_no_status) with __close_nocancel{_nostatus}.
	* gmon/gmon.c (write_gmon): Likewise.
	* iconv/gconv_cache.c (__gconv_load_cache): Likewise.
	* intl/loadmsgcat.c (close): Likewise.
	* io/ftw.c (open_dir_stream): Likewise.
	(ftw_startup): Likewise.
	* libio/fileops.c (_IO_file_open): Likewise.
	(_IO_file_close_mmap): Likewise.
	(_IO_file_close): Likewise.
	* libio/iopopen.c (_IO_dup2): Likewise.
	* locale/loadarchive.c (_nl_load_locale_from_archive): Likewise.
	* locale/loadlocale.c (_nl_load_locale): Likewise.
	* login/utmp_file.c (pututline_file): Likewise.
	(endutent_file): Likewise.
	* misc/daemon.c (daemon): Likewise.
	* nscd/nscd_getai.c (__nscd_getai): Likewise.
	* nscd/nscd_getgr_r.c (nscd_getgr_r): Likewise.
	* nscd/nscd_gethst_r.c (nscd_gethst_r): Likewise.
	* nscd/nscd_getpw_r.c (nscd_getpw_r): Likewise.
	* nscd/nscd_getserv_r.c (nscd_getserv_r): Likewise.
	* nscd/nscd_helper.c (open_socket): Likewise.
	(__nscd_open_socket): Likewise.
	* nscd/nscd_initgroups.c (__nscd_getgrouplist): Likewise.
	* nscd/nscd_netgroup.c (__nscd_setnetgrent): Likewise.
	(__nscd_innetgr): Likewise.
	* nss/nss_db/db-open.c (internal_setent): Likewise.
	* resolv/res-close.c (__res_iclose): Likewise.
	* sunrpc/pm_getmaps.c (pmap_getmaps): Likewise.
	* sysdeps/posix/closedir.c (__closedir): Likewise.
	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Likewise.
	* sysdeps/posix/getcwd.c (__getcwd): Likewise.
	* sysdeps/posix/opendir.c (tryopen_o_directory): Likewise.
	(opendir_tail): Likewise.
	* sysdeps/posix/spawni.c (__spawni_child): Likewise.
	* sysdeps/unix/sysv/linux/check_native.c (__check_native): Likewise.
	* sysdeps/unix/sysv/linux/check_pf.c (__check_pf): Likewise.
	* sysdeps/unix/sysv/linux/fips-private.h (fips_enabled_p): Likewise.
	* sysdeps/unix/sysv/linux/gethostid.c (sethostid): Likewise.
	(gethostid): Likewise.
	* sysdeps/unix/sysv/linux/getloadavg.c (getloadavg): Likewise.
	* sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid):
	Likewise.
	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Likewise.
	* sysdeps/unix/sysv/linux/grantpt.c (close_all_fds): Likewise.
	* sysdeps/unix/sysv/linux/i386/smp.h (is_smp_system): Likewise.
	* sysdeps/unix/sysv/linux/ia64/has_cpuclock.c (has_cpuclock):
	Likewise.
	* sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex): Likewise.
	* sysdeps/unix/sysv/linux/libc_fatal.c (backtrace_and_maps): Likewise.
	* sysdeps/unix/sysv/linux/malloc-sysdep.h (check_may_shrink_heap):
	Likewise.
	* sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Likewise.
	* sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
	Likewise.
	* sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np):
	Likewise.
	* sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Likewise.
	* sysdeps/unix/sysv/linux/sysconf.c (__sysconf): Likewise.
2017-08-18 18:38:55 -03:00
Adhemerval Zanella 0bb2fabcb3 Consolidate non cancellable openat call
This patch consolidates all the non cancellable openat{64} calls to use
the __openat{64}_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* sysdeps/generic/not-cancel.h (openat_not_cancel): Remove macro.
	(openat_not_cancel_3): Likewise.
	(openat64_not_cancel_3): Likewise).
	(openat_not_cancel_3): Likewise).
	* sysdeps/unix/sysv/linux/not-cancel.h (openat_not_cancel): Remove
	macro.
	(openat_not_cancel_3): Likewise.
	(openat64_not_cancel): Likewise.
	(openat64_not_cancel_3): Likewise.
	* sysdeps/unix/sysv/linux/openat.c (__openat_nocancel): New function.
	* sysdeps/unix/sysv/linux/openat64.c (__openat64_nocancel): Likewise.
	* io/ftw.c (open_dir_stream): Replace openat{64}_not_cancel{_3} with
	__open{64}_nocancel.
	* sysdeps/mach/hurd/opendir.c (__opendirat): Likewise.
	* sysdeps/posix/getcwd.c (__getcwd): Likewise.
	* sysdeps/posix/opendir.c (__opendirat): Likewise.
2017-08-18 16:30:05 -03:00
H.J. Lu 65a086db91 Mark internal argz functions with attribute_hidden [BZ #18822]
Move internal argz function prototypes to include/argz.h and mark them
with attribute_hidden to allow direct access within libc.so and libc.a
without using GOT nor PLT.  This also brings string/argz.h closer to the
gnulib version.

	[BZ #18822]
	* include/argz.h (__argz_create_sep): New function prototype.
	(__argz_append): Likewise.
	(__argz_add): Likewise.
	(__argz_add_sep): Likewise.
	(__argz_delete): Likewise.
	(__argz_insert): Likewise.
	(__argz_replace): Likewise.
	* string/argz.h (__argz_create_sep): Removed.
	(__argz_append): Likewise.
	(__argz_add): Likewise.
	(__argz_add_sep): Likewise.
	(__argz_delete): Likewise.
	(__argz_insert): Likewise.
	(__argz_replace): Likewise.
2017-08-18 09:31:33 -07:00
H.J. Lu 62753d2c09 Add NT_GNU_PROPERTY_TYPE_0 macros
Add macros used in GNU .note.gnu.property notes (NT_GNU_PROPERTY_TYPE_0).

	* elf/elf.h (NT_GNU_PROPERTY_TYPE_0): New.
	(NOTE_GNU_PROPERTY_SECTION_NAME): Likewise.
	(GNU_PROPERTY_STACK_SIZE): Likewie.
	(GNU_PROPERTY_NO_COPY_ON_PROTECTED): Likewie.
	(GNU_PROPERTY_LOPROC): Likewise.
	(GNU_PROPERTY_HIPROC): Likewise.
	(GNU_PROPERTY_LOUSER): Likewise.
	(GNU_PROPERTY_HIUSER): Likewise.
	(GNU_PROPERTY_X86_ISA_1_USED): Likwise.
	(GNU_PROPERTY_X86_ISA_1_NEEDED): Likwise.
	(GNU_PROPERTY_X86_FEATURE_1_AND): Likwise.
	(GNU_PROPERTY_X86_ISA_1_486): Likwise.
	(GNU_PROPERTY_X86_ISA_1_586): Likwise.
	(GNU_PROPERTY_X86_ISA_1_686): Likwise.
	(GNU_PROPERTY_X86_ISA_1_SSE): Likwise.
	(GNU_PROPERTY_X86_ISA_1_SSE2): Likwise.
	(GNU_PROPERTY_X86_ISA_1_SSE3): Likwise.
	(GNU_PROPERTY_X86_ISA_1_SSSE3): Likwise.
	(GNU_PROPERTY_X86_ISA_1_SSE4_1): Likwise.
	(GNU_PROPERTY_X86_ISA_1_SSE4_2): Likwise.
	(GNU_PROPERTY_X86_ISA_1_AVX): Likwise.
	(GNU_PROPERTY_X86_ISA_1_AVX2): Likwise.
	(GNU_PROPERTY_X86_ISA_1_AVX512F): Likwise.
	(GNU_PROPERTY_X86_ISA_1_AVX512CD): Likwise.
	(GNU_PROPERTY_X86_ISA_1_AVX512ER): Likwise.
	(GNU_PROPERTY_X86_ISA_1_AVX512PF): Likwise.
	(GNU_PROPERTY_X86_ISA_1_AVX512VL): Likwise.
	(GNU_PROPERTY_X86_ISA_1_AVX512DQ): Likwise.
	(GNU_PROPERTY_X86_ISA_1_AVX512BW): Likwise.
	(GNU_PROPERTY_X86_FEATURE_1_IBT): Likwise.
	(GNU_PROPERTY_X86_FEATURE_1_SHSTK): Likwise.
2017-08-18 08:50:42 -07:00
Gabriel F. T. Gomes 6913ad65e0 Do not use generic selection in C++ mode
The logic to protect the use of generic selection (_Generic) does not
check for C or C++ mode, however, generic selection is a C-only
feature.

Tested for powerpc64le.

	* misc/sys/cdefs.h (__HAVE_GENERIC_SELECTION): Define to 0, if
	in C++ mode.
2017-08-18 12:19:28 -03:00
Gabriel F. T. Gomes 47a67213a9 Do not use __builtin_types_compatible_p in C++ mode (bug 21930)
The logic to define isinf for float128 depends on the availability of
__builtin_types_compatible_p, which is only available in C mode,
however, the conditionals do not check for C or C++ mode.  This lead to
an error in libstdc++ configure, as reported by bug 21930.

This patch adds a conditional for C mode in the definition of isinf for
float128.  No definition is provided in C++ mode, since libstdc++
headers undefine isinf.

Tested for powerpc64le (glibc test suite and libstdc++-v3 configure).

	[BZ #21930]
	* math/math.h (isinf): Check if in C or C++ mode before using
	__builtin_types_compatible_p, since this is a C mode feature.
2017-08-18 12:18:36 -03:00
Adhemerval Zanella c647fb885c Consolidate non cancellable write call
This patch consolidates all the non cancellable write calls to use
the __write_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* sysdeps/generic/not-cancel.h (write_not_cancel): Remove macro.
	(__write_nocancel): New macro.
	* sysdeps/unix/sysv/linux/not-cancel.h (__write_nocancel):
	Rewrite as a function prototype.
	(write_not_cancel): Remove macro.
	* sysdeps/unix/sysv/linux/write.c (__write_nocancel): New function.
	* gmon/gmon.c (ERR): Replace write_not_cancel with __write_nocancel.
	(write_gmon): Likewise.
	* libio/fileops.c (_IO_new_file_write): Likewise.
	* login/utmp_file.c (pututline_file): Likewise.
	(updwtmp_file): Likewise.
	* stdio-common/psiginfo.c (psiginfo): Likewise.
	* sysdeps/posix/spawni.c (__spawni_child): Likewise.
	* sysdeps/unix/sysv/linux/gethostid.c (sethostid): Likewise.
	* sysdeps/unix/sysv/linux/libc_fatal.c (backtrace_and_maps):
	Likewise.
	* sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np):
	Likewise.
2017-08-18 10:53:47 -03:00
Adhemerval Zanella a748eb31c1 Consolidate non cancellable read call
This patch consolidates all the non cancellable read calls to use
the __read_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

Also, since it is used on libcrypto it is also exported in GLIBC_PRIVATE
namespace.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* sysdeps/generic/not-cancel.h (read_not_cancel): Remove macro.
	(__read_nocancel): New macro.
	* sysdeps/unix/sysv/linux/Versions (libc) [GLIBC_PRIVATE]: Add
	__read_nocancel.
	* sysdeps/unix/sysv/linux/not-cancel.h (__read_nocancel): Remove
	macro.
	(__read_nocancel): New prototype.
	* sysdeps/unix/sysv/linux/read.c (__read_nocancel): New function.
	* catgets/open_catalog.c (__open_catalog): Replace read_not_cancel
	with __read_nocancel.
	* intl/loadmsgcat.c (read): Likewise.
	* libio/fileops.c (_IO_file_read): Likewise.
	* locale/loadlocale.c (_nl_load_locale): Likewise.
	* login/utmp_file.c (getutent_r_file): Likewise.
	(internal_getut_r): Likewise.
	(getutline_r_file): Likewise.
	* sysdeps/unix/sysv/linux/fips-private.h (fips_enable_p): Likewise.
	* sysdeps/unix/sysv/linux/gethostid.c (gethostid): Likewise.
	* sysdeps/unix/sysv/linux/getloadavg.c (getloadavg): Likewise.
	* sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid):
	Likewise.
	* sysdeps/unix/sysv/linux/getsysstats.c (next_line): Likewise.
	* sysdeps/unix/sysv/linux/i386/smp.h (is_smp_system): Likewise.
	* sysdeps/unix/sysv/linux/ia64/has_cpuclock.c (has_cpuclock):
	Likewise.
	* sysdeps/unix/sysv/linux/libc_fatal.c (backtrace_and_maps):
	Likewise.
	* sysdeps/unix/sysv/linux/malloc-sysdep.h (check_may_shrink_heap):
	Likewise.
	* sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
	Likewise.
	* sysdeps/unix/sysv/linux/sysconf.c (__sysconf): Likewise.
2017-08-18 10:31:16 -03:00
H.J. Lu 098b9dd468 x86-64: Check FMA_Usable in ifunc-mathvec-avx2.h [BZ #21966]
Since the AVX2 version of mathvec functions uses FMA, it can only be
used when FMA is usable.

	[BZ #21966]
	* sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h
	(IFUNC_SELECTOR): Don't use the AVX2 version if FMA isn't
	usable.
2017-08-18 06:19:07 -07:00
DJ Delorie a3fe6a20bf Update nss tests to new skeleton
* bug17079.c: Update to new test harness.
* test-digits-dots.c: Likewise.
* test-netdb.c: Likewise.
* tst-field.c: Likewise.
* tst-nss-getpwent.c: Likewise.
* tst-nss-static.c: Likewise.
* tst-nss-test1.c: Likewise.
* tst-nss-test2.c: Likewise.
* tst-nss-test3.c: Likewise.
* tst-nss-test4.c: Likewise.
* tst-nss-test5.c: Likewise.
2017-08-17 18:00:51 -04:00
Adhemerval Zanella c22845744c Consolidate non cancellable open call
This patch consolidates all the non cancellable open calls to use
the __open_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

To be consistent with the following non cancellable openat call, a
new __open64_nocancel is also added (although not currently used).

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* sysdeps/generic/not-cancel.h (open_not_cancel): Remove macro.
	(open_not_cancel_2): Likewise.
	(open_nocancel): New macro.
	(open64_nocancel): Likewise.
	* sysdeps/unix/sysv/linux/not-cancel.h (open_not_cancel): Remove macro.
	(open_not_cancel_2): Likewise.
	(__open_nocancel): New prototype.
	(__open64_nocancel): Likewise.
	* sysdeps/unix/sysv/linux/Versions (libc) [GLIBC_PRIVATE]: Add
	__open_nocancel.
	* sysdeps/unix/sysv/linux/open.c (__open_nocancel): New function.
	* sysdeps/unix/sysv/linux/open64.c (__open64_nocancel): Likewise.
	* catgets/open_catalog.c (__open_catalog): Replace open_not_cancel{_2}
	with __open_nocancel.
	* csu/check_fds.c (check_one_fd): Likewise.
	* gmon/gmon.c (write_gmon): Likewise.
	* iconv/gconv_cache.c (__gconv_load_cached): Likewise.
	* intl/loadmsgcat.c (open): Likewise.
	* libio/fileops.c (_IO_file_open): Likewise.
	* locale/loadarchive.c (_nl_load_locale_from_archive): Likewise.
	* locale/loadlocale.c (_nl_load_locale): Likewise.
	* login/utmp_file.c (setutent_file): Likewise.
	* misc/daemon.c (daemon): Likewise.
	* nss/nss_db/db-open.c (internal_setent): Likewise.
	* sysdeps/mach/hurd/opendir.c (__opendirat): Likewise.
	* sysdeps/posix/libc_fatal.c (__libc_message): Likewise.
	* sysdeps/posix/opendir.c (tryopen_o_directory): Likewise.
	(__opendir): Likewise.
	* sysdeps/posix/spawni.c (__spawni_child): Likewise.
	* sysdeps/unix/sysv/linux/fips-private.h (fips_enable_p): Likewise.
	* sysdeps/unix/sysv/linux/gethostid.c (sethostid): Likewise.
	(gethostid): Likewise.
	* sysdeps/unix/sysv/linux/getloadavg.c (getloadavg): Likewise.
	* sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid):
	Likewise.
	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Likewise.
	* sysdeps/unix/sysv/linux/grantpt.c (__close_all_fds): Likewise.
	* sysdeps/unix/sysv/linux/i386/smp.h (is_smp_system): Likewise.
	* sysdeps/unix/sysv/linux/ia64/has_cpuclock.c (has_cpuclock):
	Likewise.
	* sysdeps/unix/sysv/linux/libc_fatal.c (backtrace_and_maps):
	Likewise.
	* sysdeps/unix/sysv/linux/malloc-sysdep.h (check_may_shrink_heap):
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c (__get_clockfreq):
	Likewise.
	* sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
	Likewise.
	* sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np):
	Likewise.
	* sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Likewise.
	* sysdeps/unix/sysv/linux/sysconf.c (__sysconf): Likewise.
2017-08-17 16:50:35 -03:00
Wilco Dijkstra d4505b895f Add math benchmark latency test
This patch further improves math function benchmarking by adding a latency
test in addition to throughput.  This enables more accurate comparisons of the
math functions. The latency test works by creating a dependency on the previous
iteration: func_res = F (func_res * zero + input[i]). The multiply by zero
avoids changing the input.

It reports reciprocal throughput and latency in nanoseconds (depending on the
timing header used) and max/min throughput in iterations per second:

   "workload-spec2006.wrf": {
    "reciprocal-throughput": 100,
    "latency": 200,
    "max-throughput": 1.0e+07,
    "min-throughput": 5.0e+06
   }

	* benchtests/bench-skeleton.c (main): Add support for
	latency benchmarking.
	* benchtests/scripts/bench.py: Add support for latency benchmarking.
2017-08-17 16:27:20 +01:00
H.J. Lu 34d6a3cbf2 Support mcount/gprof test with GCC defaulting to PIE
The mcount/gprof test should be linked with gcrt1.o, not Scrt1.o.

	* Makeconfig (+link-pie-before-libc): Add CRT-* hook to override
	the startup object.
2017-08-17 04:56:01 -07:00
Florian Weimer 038d1cafaf __opensock: Remove internal_function attribute 2017-08-17 10:18:15 +02:00
Joseph Myers 67f0aff0c6 Fix sigval namespace (bug 21944).
XPG4.2 defines the siginfo_t type, but not union sigval or its
contents (which were added in the 1993 edition of POSIX.1), resulting
in namespace violations for sigval, sival_int and sival_ptr for
signal.h and sys/wait.h for that standard because those headers
incorrectly expose those names in that case.

This patch fixes this problem.  The public type in this case is union
sigval, but various places in the headers use the sigval_t name for
it; direct uses of union sigval are already properly guarded or in
headers not in XPG4.2.  Now, sigval_t, although not a standard name,
does seem to be widely used outside glibc.  The approach taken by this
patch is to make installed headers use the name __sigval_t instead.
__sigval_t is then defined to either union sigval or union __sigval
(where union __sigval has __-prefixed member names as well), depending
on whether there are any namespace issues with the union sigval name
and its members.  In the case where union __sigval is used, sigval_t
is not defined at all, to avoid the problem of sigval_t having a C++
mangled name that depends on feature test macros.  sigval_t is still
defined by signal.h if __USE_MISC (reflecting the nonstandard nature
of that name).

Tested for x86_64.

	[BZ #21944]
	* signal/bits/types/__sigval_t.h: New file.
	* signal/Makefile (headers): Add bits/types/__sigval_t.h.
	* signal/bits/types/sigval_t.h: Include <bits/types/__sigval_t.h>
	and define sigval_t using __sigval_t.
	* include/bits/types/__sigval_t.h: New file.
	* bits/types/sigevent_t.h: Include <bits/types/__sigval_t.h>
	instead of <bits/types/__sigval_t.h>.
	(struct sigevent): Use __sigval_t instead of sigval_t.
	* bits/types/siginfo_t.h: Include <bits/types/__sigval_t.h>
	instead of <bits/types/__sigval_t.h>.
	(siginfo_t): Use __sigval_t instead of sigval_t.
	* sysdeps/unix/sysv/linux/bits/types/sigevent_t.h: Include
	<bits/types/__sigval_t.h> instead of <bits/types/__sigval_t.h>.
	(struct sigevent): Use __sigval_t instead of sigval_t.
	* sysdeps/unix/sysv/linux/bits/types/siginfo_t.h: Include
	<bits/types/__sigval_t.h> instead of <bits/types/__sigval_t.h>.
	(siginfo_t): Use __sigval_t instead of sigval_t.
	* signal/signal.h [__USE_MISC]: Include <bits/types/sigval_t.h>.
2017-08-16 20:33:59 +00:00
H.J. Lu 87e7bf4d36 Remove "[Add new features here]" for 2.27
* NEWS: Remove "[Add new features here]" for 2.27.
2017-08-16 11:05:55 -07:00
Joseph Myers 5047057ffa Allow abort PLT references in libc.so for SH.
Given my patch
<https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00965.html> for the
ICEs building a glibc string function test for SH, the testsuite can
build completely for SH with GCC 7 and mainline.  However, there is a
test failure that does not appear for GCC 6: check-localplt fails
because of an abort PLT reference in libc.so.

Given the lack of a trap insn pattern for SH, it seems unavoidable
that the compiler might sometimes generate abort calls, and such abort
calls (generated from __builtin_trap when there is no trap insn
pattern) will be unaffected by the normal mapping to __GI_abort for
calls within glibc.  Thus, this patch allows (but does not require) an
abort PLT reference in libc.so for SH.

Tested for sh4-linux-gnu with build-many-glibcs.py (GCC 7, with my
patch applied).

	* sysdeps/unix/sysv/linux/sh/localplt.data: Allow abort in
	libc.so.
2017-08-16 17:01:27 +00:00
H.J. Lu 20c7b195d0 Mention x86-64 FMA optimization in NEWS
* NEWS: Mention x86-64 FMA optimization.
2017-08-16 09:17:49 -07:00
H.J. Lu 24a2e6588d x86-64: Optimize e_expf with FMA [BZ #21912]
FMA optimized e_expf improves performance by more than 50% on Skylake.

	[BZ #21912]
	* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
	Add e_expf-fma.
	* sysdeps/x86_64/fpu/multiarch/e_expf-fma.S: New file.
	* sysdeps/x86_64/fpu/multiarch/e_expf.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/ifunc-fma.h: Likewise.
2017-08-16 08:43:48 -07:00
Florian Weimer 403143e1df Add ChangeLog reference to bug 16750/CVE-2009-5064 2017-08-16 16:47:20 +02:00
Andreas Schwab eedca9772e ldd: never run file directly 2017-08-16 15:59:55 +02:00
H.J. Lu f59f7adb4a x86-64: Align L(SP_RANGE)/L(SP_INF_0) to 8 bytes [BZ #21955]
sysdeps/x86_64/fpu/e_expf.S has

        lea     L(SP_RANGE)(%rip), %rdx /* load over/underflow bound */
        cmpl    (%rdx,%rax,4), %ecx     /* |x|<under/overflow bound ? */
...
        /* Here if |x| is Inf */
        lea     L(SP_INF_0)(%rip), %rdx /* depending on sign of x: */
        movss   (%rdx,%rax,4), %xmm0    /* return zero or Inf */
        ret
...
         .section .rodata.cst8,"aM",@progbits,8
...
        .p2align 2
L(SP_RANGE): /* single precision overflow/underflow bounds */
        .long   0x42b17217      /* if x>this bound, then result overflows */
        .long   0x42cff1b4      /* if x<this bound, then result underflows */
        .type L(SP_RANGE), @object
        ASM_SIZE_DIRECTIVE(L(SP_RANGE))

        .p2align 2
L(SP_INF_0):
        .long   0x7f800000      /* single precision Inf */
        .long   0               /* single precision zero */
        .type L(SP_INF_0), @object
        ASM_SIZE_DIRECTIVE(L(SP_INF_0))

Since L(SP_RANGE) and L(SP_INF_0) are in .rodata.cst8 section, they must
be aligned to 8 bytes.

	[BZ #21955]
	* sysdeps/x86_64/fpu/e_expf.S (L(SP_RANGE)): Aligned to 8 bytes.
	(L(SP_INF_0)): Likewise.
2017-08-15 14:05:14 -07:00
Florian Weimer 6b11a6ad71 gmon: Run tst-gmon-prof only for run-built-tests=yes 2017-08-15 18:35:42 +02:00
Florian Weimer bbf5c4388a aio: Remove support for BROKEN_THREAD_SIGNALS
This was originally added to support LinuxThreads and is not needed for
NPTL.
2017-08-15 17:54:19 +02:00
Florian Weimer 6014c65de2 gmon: Add test for basic mcount/gprof functionality 2017-08-15 15:49:45 +02:00
Gustavo Romero ee72219a49 powerpc: Add values from Linux 4.8 to <elf.h>
Add powerpc specific note sections available since Linux v4.8.

	* elf/elf.h A (NT_PPC_TAR): New macro.
	(NT_PPC_PPR): Likewise.
	(NT_PPC_DSCR): Likewise.
	(NT_PPC_EBB): Likewise.
	(NT_PPC_PMU): Likewise.
	(NT_PPC_TM_CGPR): Likewise.
	(NT_PPC_TM_CFPR): Likewise.
	(NT_PPC_TM_CVMX): Likewise.
	(NT_PPC_TM_CVSX): Likewise.
	(NT_PPC_TM_SPR): Likewise.
	(NT_PPC_TM_CTAR): Likewise.
	(NT_PPC_TM_CPPR): Likewise.
	(NT_PPC_TM_CDSCR): Likewise.
2017-08-15 10:17:30 -03:00
Florian Weimer 4ebf934e34 i386: Replace internal_function attribute for __mcount_internal
__mcount_internal is called from assembler code.  Use an explicit
regparm attribute to pass both arguments in registers, to match what
used to happen with internal_function before commit
fbdc1e3e8d (i386: Do not set
internal_function).
2017-08-15 14:51:55 +02:00
Stefan Liebler e9f57484aa S390: Add new s390 platform z14.
The new IBM z14 is added to platform string array.
The macro _DL_PLATFORMS_COUNT is incremented.

ChangeLog:

	* sysdeps/s390/dl-procinfo.c (_dl_s390_cap_flags): Add z14.
	* sysdeps/s390/dl-procinfo.h (_DL_PLATFORMS_COUNT): Increased.
2017-08-15 14:00:07 +02:00
Joseph Myers 88ff4d5561 conformtest: Disable si_value expectation for XPG42.
This patch corrects the conform/ expectations for sys/wait.h not to
expect si_value for XPG4.2.

Tested for x86_64.

	* conform/data/sys/wait.h-data (si_value): Do not expect for
	XPG42.
2017-08-14 17:05:55 +00:00
Florian Weimer c88ffc239e NSS: Replace exported NSS lookup functions with stubs [BZ #21962]
Commit 384ca55174 from 2007 added this to
nss/XXX-lookup.c:

+#ifndef NO_COMPAT
+int
+internal_function attribute_compat_text_section
+DB_COMPAT_FCT (service_user **ni, const char *fct_name, void **fctp)
+{
+  return DB_LOOKUP_FCT (ni, fct_name, NULL, fctp);
+}
+#endif

That is, it adds a pseudo-compat function with an internal_function
attribute.  The function it was supposed to replace did not have the
attribute:

 extern int DB_LOOKUP_FCT (service_user **ni, const char *fct_name,
-			  void **fctp) internal_function;
+			  const char *fct2_name, void **fctp)
+  internal_function;

This changed the calling convention on i386 for the following
functions in the public ABI:

  __nss_passwd_lookup
  __nss_group_lookup
  __nss_hosts_lookup

This commit replaces the functions with always-failing stubs,
with true compat symbols.  Due to a happy accident, the calling
convention of the stub is identical for the internal_function
and non-internal_function case on i386.

In addition, this commit auto-generates the __nss_*_lookup2
function declarations as part of <nsswitch.h>.
2017-08-14 18:13:42 +02:00
Adhemerval Zanella 1f14d0c3dd posix: Fix mmap for m68k and ia64 (BZ#21908)
Default semantic for mmap2 syscall is to take the offset in 4096-byte
units.  However m68k and ia64 mmap2 implementation take in the
configured pageunit units and for both architecture it can be
different values.

This patch fixes the m68k runtime discover of mmap2 offset unit
and adds the ia64 definition to find it at runtime.

Checked the basic tst-mmap and tst-mmap-offset on m68k (the system
is configured with 4k, so current code is already passing on this
system) and a sanity check on x86_64-linux-gnu (which should not be
affected by this change).  Sergei also states that ia64 loader now
work correctly with this change.

	Adhemerval Zanella  <adhemerval.zanella@linaro.org>
	Sergei Trofimovich  <slyfox@inbox.ru>

	* sysdeps/unix/sysv/linux/m68k/mmap_internal.h (MMAP2_PAGE_SHIFT):
	Rename to MMAP2_PAGE_UNIT.
	* sysdeps/unix/sysv/linux/mmap.c: Include mmap_internal iff
	__OFF_T_MATCHES_OFF64_T is not defined.
	* sysdeps/unix/sysv/linux/mmap_internal.h (page_unit): Declare as
	uint64_t.
	(MMAP2_PAGE_UNIT) [MMAP2_PAGE_UNIT == -1]: Redefine to page_unit.
	(page_unit) [MMAP2_PAGE_UNIT != -1]: Remove definition.
2017-08-14 10:35:14 -03:00
Florian Weimer fbdc1e3e8d i386: Do not set internal_function
All calls to functions with the internal_function attribute
have been removed from assembler implementations, which means that
the definition of internal_function can be changed at the C level
without causing ABI issues with assembler code.

_dl_fixup still uses a regparm calling convention on i386, but this
is controlled through ARCH_FIXUP_ATTRIBUTE, not internal_function.
2017-08-14 15:08:48 +02:00
Florian Weimer b3f85fd2e4 _dl_init: Remove internal_function attribute
The function is called from the i386 startup code, which needs minor
adjustments due to the changed ABI.
2017-08-14 15:08:48 +02:00
Florian Weimer 630bf4916f _dl_start: Remove internal_function attribute
The i386 startup code needs adjusting because it calls the function
and the ABI has changed.
2017-08-14 15:08:48 +02:00
Florian Weimer 9fa7449b35 _dl_fini: Remove internal_function attribute
Assembler code passes the address of _dl_fini to __libc_start_main,
whose function pointer argument lacks the attribute.  This means
that calls could use the wrong ABI.  Fortunately, for zero-parameter
void-returning functions, internal_function does not change ABI
on i386 (the only architecture which uses internal_function), so
this inconsistency was harmless (which is why it had not been
noticed so far).
2017-08-14 15:08:48 +02:00
H.J. Lu 73322d5ff6 x86: Add IBT/SHSTK bits to cpu-features
Add IBT/SHSTK bits to cpu-features for Shadow Stack in Intel Control-flow
Enforcement Technology (CET) instructions:

https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf

	* sysdeps/x86/cpu-features.h (bit_cpu_BIT): New.
	(bit_cpu_SHSTK): Likewise.
	(index_cpu_IBT): Likewise.
	(index_cpu_SHSTK): Likewise.
	(reg_IBT): Likewise.
	(reg_SHSTK): Likewise.
	* sysdeps/x86/cpu-tunables.c (TUNABLE_CALLBACK (set_hwcaps)):
	Handle index_cpu_IBT and index_cpu_SHSTK.
2017-08-14 05:54:38 -07:00
Mike FABIAN dbc303ef76 Fix spelling mistake in fr.po
[BZ #19982]
	* po/fr.po: Fix spelling mistake.
2017-08-14 09:30:54 +02:00
Florian Weimer 3012cfb0d2 ld.so: Remove internal_function attribute from various functions
These functions are invoked from other DSOs and should therefore
use the standard calling convention.
2017-08-13 21:11:54 +02:00
Florian Weimer 52bcdf267b Remove internal_function attribute from string-to-float functions
These are called across DSO boundaries and should therefore use
the standard calling convention.
2017-08-13 21:11:47 +02:00
Florian Weimer e1d2ae8d21 NPTL: Remove internal_function from stack marking functions
These are called across DSO boundaries and therefore should use
the ABI calling convention.
2017-08-13 21:11:38 +02:00
Florian Weimer c4ce038287 __netlink_assert_response: Remove internal_function attribute
This function is called from nscd and should not use a non-standard
calling convention.
2017-08-13 21:11:28 +02:00
Florian Weimer c4d767f7f3 __libc_rpc_getport: Remove internal_function attribute
This function has a hidden alias and is therefore expected to be
called across DSO boundaries.
2017-08-13 21:11:06 +02:00
Florian Weimer b22974092d NSS: Do not use internal_function for functions with hidden aliases
Such functions are called across DSO boundaries and should not
use a non-standard ABI.
2017-08-13 21:10:56 +02:00
Florian Weimer 1b0bfc6946 __fortify_fail: Remove internal_function attribute
__fortify_fail is called across DSO boundaries, so it should not
use a non-standard calling convention.
2017-08-13 21:10:44 +02:00
Mike FABIAN a6bd872286 Adapt test case data to the changes in the thousands separators
[BZ #20756]
	* localedata/tst-langinfo.sh: Adapt test case data.
	* stdlib/tst-strfmon_l.c: Likewise.
	* stdlib/tst-strtod4.c: Likewise.
	* stdlib/tst-strtod5i.c: Likewise.
2017-08-12 17:20:24 +02:00
Florian Weimer 8b2c63e4e2 assert: Suppress pedantic warning caused by statement expression 2017-08-11 15:36:08 +02:00
Siddhesh Poyarekar 86c6519ee7 benchtests: Print json in memmove benchmark
Make the memmove benchmarks (bench-memmove and bench-memmove-large)
print their output in JSON so that they can be evaluated using the
compare_strings.py script.

	* benchtests/bench-memmove-large.c: Print output in JSON
	format.
	* benchtests/bench-memmove.c: Likewise.
2017-08-11 12:19:27 +05:30
Siddhesh Poyarekar 61c982910d benchtests: Remove verification runs from benchmark tests
The test run is unnecessary and interferes with the benchmark.  The
tests are done during make check, so they're unnecessary here.

	* benchtests/bench-memccpy.c (do_one_test): Remove checks.
	* benchtests/bench-memchr.c (do_one_test): Likewise.
	* benchtests/bench-memcpy-large.c (do_one_test): Likewise.
	* benchtests/bench-memcpy.c (do_one_test): Likewise.
	* benchtests/bench-memmove-large.c (do_one_test): Likewise.
	* benchtests/bench-memmove.c (do_one_test): Likewise.
	* benchtests/bench-memset-large.c (do_one_test): Likewise.
	* benchtests/bench-memset.c (do_one_test): Likewise.
	* benchtests/bench-string.h (test_init): Remove memsets.
2017-08-11 12:19:26 +05:30
Rical Jasan 925733a913 manual: Rewrite the section on widths of integer types.
The manual contradicted itself by saying the number of bits in an
integer type needed to be computed, and then listing a number of
macros that later standards provided for exactly that.  The entire
section has been reworked to provide those macros first, while
preserving the documentation of CHAR_BIT and the associated examples
within that context.

	* manual/lang.texi
	(Computing the Width of an Integer Data Type): Rename section
	to "Width of an Integer Type".  Remove inaccurate statement
	regarding lack of C language facilities for determining width
	of integer types, and reorder content to improve flow and
	context of discussion.
2017-08-10 20:28:28 -07:00
Rical Jasan 4fcdfbfcf9 manual: Update @standards for [__]va_copy.
The ISO version in which va_copy was introduced is made explicit, and
__va_copy is given @standards.  The description is updated to be more
clear about the origins of each macro, and the reader is informed
these macros are now provided by the compiler (information previously
embedded in a Texinfo @comment).

	* lang.texi (va_copy): Change standard from ISO to C99.
	(__va_copy): Add standard and header annotation.
	Update description for clarity of origins and current use.
2017-08-10 19:58:30 -07:00
Gabriel F. T. Gomes 4d98ace9de powerpc: Restrict xssqrtqp operands to Vector Registers (bug 21941)
POWER ISA 3.0 introduces the xssqrtqp instructions, which expects
operands to be in Vector Registers (Altivec/VMX), even though this
instruction belongs to the Vector-Scalar Instruction Set.

In GCC's Extended Assembly for POWER, the 'wq' register constraint is
provided for use with IEEE 754 128-bit floating-point values.  However,
this constraint does not limit the register allocation to Vector
Registers (Altivec/VMX) and could assign a Vector-Scalar Register (VSX)
to the operands of the instruction.

This patch changes the register constraint used in sqrtf128 from 'wq' to
'v', in order to request a Vector Register (Altivec/VMX) for use with
the xssqrtqp instruction.

Tested for powerpc64le and --with-cpu=power9.

	[BZ #21941]
	* sysdeps/powerpc/fpu/math_private.h (__ieee754_sqrtf128): Since
	xssqrtqp requires operands to be in Vector Registers
	(Altivec/VMX), replace the register constraint 'wq' with 'v'.
	* sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
	(__ieee754_sqrtf128): Likewise.
2017-08-10 16:10:21 -03:00
Wilco Dijkstra 922369032c [AArch64] Optimized memcmp.
This is an optimized memcmp for AArch64.  This is a complete rewrite
using a different algorithm.  The previous version split into cases
where both inputs were aligned, the inputs were mutually aligned and
unaligned using a byte loop.  The new version combines all these cases,
while small inputs of less than 8 bytes are handled separately.

This allows the main code to be sped up using unaligned loads since
there are now at least 8 bytes to be compared.  After the first 8 bytes,
align the first input.  This ensures each iteration does at most one
unaligned access and mutually aligned inputs behave as aligned.
After the main loop, process the last 8 bytes using unaligned accesses.

This improves performance of (mutually) aligned cases by 25% and
unaligned by >500% (yes >6 times faster) on large inputs.

	* sysdeps/aarch64/memcmp.S (memcmp):
	Rewrite of optimized memcmp.
2017-08-10 17:00:38 +01:00
Florian Weimer 2449ae7b2d ld.so: Introduce struct dl_exception
This commit separates allocating and raising exceptions.  This
simplifies catching and re-raising them because it is no longer
necessary to make a temporary, on-stack copy of the exception message.
2017-08-10 16:54:57 +02:00
Florian Weimer f87cc2bfba __inet6_scopeid_pton: Remove attribute_hidden, internal_function
The hidden attribute was overridden by libc_hidden_proto on GNU/Linux.
It is incorrect because the function is used from nscd.

internal_function is not supposed to be used across DSO boundaries,
so this commit removes it (again, due to the use in nscd).
2017-08-10 16:06:52 +02:00
Florian Weimer eac43cbb8d malloc: Avoid optimizer warning with GCC 7 and -O3 2017-08-10 15:58:28 +02:00
Mike FABIAN bd80111ed9 Fix stdlib/tst-strfmon_l.c test case to agree with the changes in Indian monetary formatting
The test cases should expose non-standard grouping and the trailing
space after the currency sign. After the changes to the Indian
monetary formatting, the Indian formatting still shows the
non-standard grouping. To test the trailing space after the currency
sign I chose the hr_HR locale.

See:

    commit 82b3124268bec0609b337dd993e771c93e44cbf2
    Author: Akhilesh Kumar <akhilesh.k@samsung.com>

        Remove redundant data for LC_MONETARY for Indian locales
2017-08-10 13:13:22 +02:00
Dmitry V. Levin 68dc02d1dc aarch64/sys/ptrace.h: fix typo in comment
* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h (enum __ptrace_request):
Fix typo in comment.
2017-08-10 01:28:58 +00:00
Dmitry V. Levin 60e2846e26 sys/ptrace.h: remove obsolete Linux PTRACE_SEIZE_DEVEL constant [BZ #21928]
Remove enum __ptrace_flags along with the only constant it contains,
PTRACE_SEIZE_DEVEL, from Linux's sys/ptrace.h files.

This temporary development constant shouldn't have been added to
sys/ptrace.h in the first place.  It was introduced in Linux by commit
v3.1-rc1~308^2~28 as a temporary part of new experimental PTRACE_SEIZE
interface.  Later, as PTRACE_SEIZE stabilized and lost its experimental
status, this flag was removed from Linux by commit v3.4-rc1~109^2~20.

* sysdeps/unix/sysv/linux/sys/ptrace.h (enum __ptrace_flags,
PTRACE_SEIZE_DEVEL): Remove.
* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/s390/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h: Likewise.
2017-08-09 22:58:45 +00:00
Joseph Myers 24d9f53ab0 Remove __qaddr_t.
bits/types.h defines a type __qaddr_t that is not used anywhere in
glibc.  It doesn't appear to be widely used outside glibc either
(judging by codesearch.debian.net, where hits are generally copies of
definitions of this type, not uses), so it seems appropriate to remove
this type, which this patch does.

Tested for x86_64.

	* posix/bits/types.h (__qaddr_t): Remove.
2017-08-09 18:10:52 +00:00
Joseph Myers 3d452dabd1 Fix uc_* namespace (bug 21457).
The standard members of ucontext_t, in all standard versions with that
type, are uc_link, uc_sigmask, uc_stack and uc_mcontext.

The uc_* namespace is mostly reserved for additions to the structure.
However, in XPG4.2, it's only reserved when <ucontext.h> is included,
not when <signal.h> is included, while <signal.h> is required to
define ucontext_t (but not allowed to make visible other symbols from
<ucontext.h>).  Thus, nonstandard members should avoid uc_* names.
Some already do use __uc_*, but others don't; most architectures (all
except ia64, I think) have a member uc_flags and some have additional
members beyond that.

This patch makes nonstandard members have an __ prefix unless
__USE_MISC is defined.  Members whose names indicate they are solely
padding / reserved for future use are renamed unconditionally to use
the __glibc_reserved1 naming convention.

This is part of the preparation for a revised version of the
mcontext_t / sigcontext patch to be able to eliminate all 13 of the
miscellaneous XFAILs in conform/Makefile, rather than only 11 of them
as at present (at least one further fix on top of this one will be
needed for that as well).

Tested for x86_64, and with build-many-glibcs.py.

	[BZ #21457]
	* sysdeps/arm/sys/ucontext.h (__ctx): Move undefine further down.
	(ucontext_t): Use __ctx with uc_flags.  Rename uc_filler to
	__glibc_reserved1.
	* sysdeps/generic/sys/ucontext.h (__ctx): New macro.
	(ucontext_t): Use __ctx with uc_flags.
	* sysdeps/i386/sys/ucontext.h (__ctx): Move undefine further down.
	(__ctxt): Likewise.
	(ucontext_t): Use __ctx with uc_flags.  Rename uc_filler to
	__glibc_reserved1.
	* sysdeps/m68k/sys/ucontext.h (__ctx): Move undefine further down.
	(ucontext_t): Use __ctx with uc_flags.  Rename uc_filler to
	__glibc_reserved1.
	* sysdeps/mips/sys/ucontext.h (__ctx): Move undefine further down.
	(ucontext_t): Use __ctx with uc_flags.  Rename uc_filler to
	__glibc_reserved1.
	* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h (__ctx): New
	macro.
	(ucontext_t): Use __ctx with uc_flags.
	* sysdeps/unix/sysv/linux/alpha/sys/ucontext.h (__ctx): New macro.
	(ucontext_t): Use __ctx with uc_flags.
	* sysdeps/unix/sysv/linux/arm/sys/ucontext.h (__ctx): New macro.
	(ucontext_t): Use __ctx with uc_flags and uc_regspace.
	* sysdeps/unix/sysv/linux/hppa/sys/ucontext.h (__ctx): New macro.
	(ucontext_t): Use __ctx with uc_flags.
	* sysdeps/unix/sysv/linux/m68k/sys/ucontext.h (__ctx): Move
	undefine further down.
	(ucontext_t): Use __ctx with uc_flags.  Rename uc_filler to
	__glibc_reserved1.
	* sysdeps/unix/sysv/linux/mips/sys/ucontext.h (__ctx): Move
	undefine further down.
	(ucontext_t): Use __ctx with uc_flags.
	* sysdeps/unix/sysv/linux/nios2/sys/ucontext.h (__ctx): Move
	undefine further down.
	(ucontext_t): Use __ctx with uc_flags.
	* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h (ucontext_t): Use
	__ctx with uc_flags, uc_regs_ptr, uc_regs and uc_reg_space.
	Rename uc_pad to __glibc_reserved1.
	* sysdeps/unix/sysv/linux/s390/sys/ucontext.h (__ctx): Move
	undefine further down.
	(ucontext_t): Use __ctx with uc_flags.
	* sysdeps/unix/sysv/linux/sh/sys/ucontext.h (__ctx): Move undefine
	further down.
	(ucontext_t): Use __ctx with uc_flags.
	* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h (ucontext_t): Use
	__ctx with uc_flags.
	* sysdeps/unix/sysv/linux/tile/sys/ucontext.h (__ctx): New macro.
	(ucontext_t): Use __ctx with uc_flags.
	* sysdeps/unix/sysv/linux/x86/sys/ucontext.h (ucontext_t): Use
	__ctx with uc_flags.
2017-08-09 17:51:26 +00:00
Florian Weimer 3016149819 nss: Call __resolv_context_put before early return in get*_r [BZ #21932]
This corrects an oversight introduced in commit
352f4ff9a2 (resolv: Introduce struct
resolv_context).
2017-08-09 17:47:11 +02:00
Andreas Schwab 139237a4f9 Add BZ reference 2017-08-09 10:58:58 +02:00
Andreas Schwab 5797b410a8 Fix s390 version of pt-longjmp.c 2017-08-09 10:47:36 +02:00
Andreas Schwab 40c06a3d04 Add test for bug 21041 2017-08-09 10:47:33 +02:00
Siddhesh Poyarekar 0e02b5107e memcpy_falkor: Fix code style in comments 2017-08-09 12:57:59 +05:30
Siddhesh Poyarekar 36ada5f681 aarch64: Optimized memcpy for Qualcomm Falkor processor
This is an optimized implementation of the memcpy routine that gives a
significant gain in performance for all sizes of copies on the
Qualcomm Falkor processor.  A detailed rationale of the implementation
is written in a comment in the patch.

This implementation improves time for copies up to 128 bytes by up to
15% and for larger copies by up to 35% in the glibc
microbenchmark. The memcpy-random benchmark sees improvements in all
sizes in the range of 13%-18%.

Here are the full numbers extracted from the glibc microbenchmark
using the commands:

../benchtests/scripts/compare_strings.py benchtests/bench-memcpy.out \
		../benchtests/scripts/benchout_strings.schema.json \
		-base=__memcpy_generic length align1 align2

../benchtests/scripts/compare_strings.py benchtests/bench-memcpy-large.out \
		../benchtests/scripts/benchout_strings.schema.json \
		-base=__memcpy_generic length align1 align2

../benchtests/scripts/compare_strings.py benchtests/bench-memcpy-random.out \
		../benchtests/scripts/benchout_strings.schema.json \
		-base=__memcpy_generic max-size

Function: memcpy
__memcpy_thunderx       __memcpy_falkor __memcpy_generic
Variant: default
================================================================================
length=1,align1=0,align2=0:     33.59 (-115.00%)        15.62 (0.00%)   15.62
length=1,align1=0,align2=0:     16.41 (-10.53%) 14.06 (5.26%)   14.84
length=1,align1=0,align2=0:     14.84 (0.00%)   14.84 (0.00%)   14.84
length=1,align1=0,align2=0:     15.62 (-5.26%)  14.06 (5.26%)   14.84
length=2,align1=0,align2=0:     15.62 (-5.26%)  14.06 (5.26%)   14.84
length=2,align1=1,align2=0:     15.62 (-5.26%)  14.06 (5.26%)   14.84
length=2,align1=0,align2=1:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=2,align1=1,align2=1:     14.84 (-5.56%)  14.06 (0.00%)   14.06
length=4,align1=0,align2=0:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=4,align1=2,align2=0:     14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=4,align1=0,align2=2:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=4,align1=2,align2=2:     14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=8,align1=0,align2=0:     14.84 (-5.56%)  13.28 (5.56%)   14.06
length=8,align1=3,align2=0:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=8,align1=0,align2=3:     13.28 (0.00%)   13.28 (0.00%)   13.28
length=8,align1=3,align2=3:     13.28 (-6.25%)  13.28 (-6.25%)  12.50
length=16,align1=0,align2=0:    13.28 (0.00%)   13.28 (0.00%)   13.28
length=16,align1=4,align2=0:    13.28 (0.00%)   12.50 (5.88%)   13.28
length=16,align1=0,align2=4:    13.28 (0.00%)   13.28 (0.00%)   13.28
length=16,align1=4,align2=4:    13.28 (-6.25%)  12.50 (0.00%)   12.50
length=32,align1=0,align2=0:    14.06 (0.00%)   12.50 (11.11%)  14.06
length=32,align1=5,align2=0:    13.28 (0.00%)   12.50 (5.88%)   13.28
length=32,align1=0,align2=5:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=32,align1=5,align2=5:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=64,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=64,align1=6,align2=0:    13.28 (0.00%)   13.28 (0.00%)   13.28
length=64,align1=0,align2=6:    14.06 (5.26%)   14.06 (5.26%)   14.84
length=64,align1=6,align2=6:    14.84 (-11.77%) 14.06 (-5.88%)  13.28
length=128,align1=0,align2=0:   17.19 (-4.76%)  14.84 (9.52%)   16.41
length=128,align1=7,align2=0:   16.41 (4.55%)   15.62 (9.09%)   17.19
length=128,align1=0,align2=7:   16.41 (0.00%)   14.06 (14.29%)  16.41
length=128,align1=7,align2=7:   16.41 (4.55%)   15.62 (9.09%)   17.19
length=256,align1=0,align2=0:   21.88 (-3.70%)  21.09 (0.00%)   21.09
length=256,align1=8,align2=0:   21.09 (-3.85%)  21.09 (-3.85%)  20.31
length=256,align1=0,align2=8:   20.31 (-4.00%)  20.31 (-4.00%)  19.53
length=256,align1=8,align2=8:   21.88 (-7.69%)  20.31 (0.00%)   20.31
length=512,align1=0,align2=0:   28.91 (-2.78%)  28.91 (-2.78%)  28.12
length=512,align1=9,align2=0:   30.47 (-2.63%)  30.47 (-2.63%)  29.69
length=512,align1=0,align2=9:   29.69 (0.00%)   29.69 (0.00%)   29.69
length=512,align1=9,align2=9:   28.12 (-2.86%)  28.12 (-2.86%)  27.34
length=1024,align1=0,align2=0:  44.53 (0.00%)   44.53 (0.00%)   44.53
length=1024,align1=10,align2=0:         50.00 (0.00%)   50.00 (0.00%)   50.00
length=1024,align1=0,align2=10:         49.22 (1.56%)   50.78 (-1.56%)  50.00
length=1024,align1=10,align2=10:        44.53 (-1.79%)  43.75 (0.00%)   43.75
length=2048,align1=0,align2=0:  77.34 (-1.02%)  76.56 (0.00%)   76.56
length=2048,align1=11,align2=0:         89.84 (0.00%)   89.84 (0.00%)   89.84
length=2048,align1=0,align2=11:         89.84 (0.00%)   89.84 (0.00%)   89.84
length=2048,align1=11,align2=11:        75.78 (0.00%)   75.78 (0.00%)   75.78
length=4096,align1=0,align2=0:  141.41 (-0.56%) 140.62 (0.00%)  140.62
length=4096,align1=12,align2=0:         171.09 (-0.46%) 170.31 (0.00%)  170.31
length=4096,align1=0,align2=12:         170.31 (0.00%)  170.31 (0.00%)  170.31
length=4096,align1=12,align2=12:        140.62 (0.00%)  140.62 (0.00%)  140.62
length=8192,align1=0,align2=0:  278.91 (-0.28%) 275.78 (0.84%)  278.12
length=8192,align1=13,align2=0:         338.28 (0.23%)  335.94 (0.92%)  339.06
length=8192,align1=0,align2=13:         338.28 (0.00%)  455.47 (-34.64%)        338.28
length=8192,align1=13,align2=13:        278.12 (-0.28%) 275.78 (0.56%)  277.34
length=16384,align1=0,align2=0:         535.94 (-0.15%) 531.25 (0.73%)  535.16
length=16384,align1=14,align2=0:        659.38 (0.12%)  659.38 (0.12%)  660.16
length=16384,align1=0,align2=14:        659.38 (0.00%)  657.03 (0.36%)  659.38
length=16384,align1=14,align2=14:       535.16 (0.44%)  532.81 (0.87%)  537.50
length=32768,align1=0,align2=0:         1260.94 (10.68%)        1121.88 (20.53%)        1411.72
length=32768,align1=15,align2=0:        1368.75 (10.02%)        1376.56 (9.50%) 1521.09
length=32768,align1=0,align2=15:        1333.59 (10.91%)        1373.44 (8.25%) 1496.88
length=32768,align1=15,align2=15:       1256.25 (13.96%)        1125.78 (22.90%)        1460.16
length=65536,align1=0,align2=0:         2853.91 (30.11%)        2589.06 (36.60%)        4083.59
length=65536,align1=16,align2=0:        2850.00 (30.14%)        2589.84 (36.52%)        4079.69
length=65536,align1=0,align2=16:        2853.12 (30.60%)        2589.84 (37.00%)        4110.94
length=65536,align1=16,align2=16:       2850.78 (30.07%)        2589.06 (36.49%)        4076.56
length=0,align1=0,align2=0:     15.62 (-5.26%)  16.41 (-10.53%) 14.84
length=0,align1=0,align2=0:     14.84 (-5.56%)  14.84 (-5.56%)  14.06
length=0,align1=0,align2=0:     14.84 (0.00%)   14.84 (0.00%)   14.84
length=0,align1=0,align2=0:     16.41 (-16.67%) 14.84 (-5.56%)  14.06
length=1,align1=0,align2=0:     15.62 (4.76%)   15.62 (4.76%)   16.41
length=1,align1=1,align2=0:     15.62 (0.00%)   14.84 (5.00%)   15.62
length=1,align1=0,align2=1:     14.84 (0.00%)   14.84 (0.00%)   14.84
length=1,align1=1,align2=1:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=2,align1=0,align2=0:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=2,align1=2,align2=0:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=2,align1=0,align2=2:     14.84 (-5.56%)  14.06 (0.00%)   14.06
length=2,align1=2,align2=2:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=3,align1=0,align2=0:     14.84 (0.00%)   14.84 (0.00%)   14.84
length=3,align1=3,align2=0:     14.84 (-5.56%)  14.06 (0.00%)   14.06
length=3,align1=0,align2=3:     15.62 (-11.11%) 14.06 (0.00%)   14.06
length=3,align1=3,align2=3:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=4,align1=0,align2=0:     17.97 (-27.78%) 14.06 (0.00%)   14.06
length=4,align1=4,align2=0:     13.28 (5.56%)   14.06 (0.00%)   14.06
length=4,align1=0,align2=4:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=4,align1=4,align2=4:     13.28 (5.56%)   13.28 (5.56%)   14.06
length=5,align1=0,align2=0:     13.28 (5.56%)   13.28 (5.56%)   14.06
length=5,align1=5,align2=0:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=5,align1=0,align2=5:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=5,align1=5,align2=5:     14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=6,align1=0,align2=0:     14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=6,align1=6,align2=0:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=6,align1=0,align2=6:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=6,align1=6,align2=6:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=7,align1=0,align2=0:     14.84 (-11.77%) 14.06 (-5.88%)  13.28
length=7,align1=7,align2=0:     13.28 (0.00%)   14.06 (-5.88%)  13.28
length=7,align1=0,align2=7:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=7,align1=7,align2=7:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=8,align1=0,align2=0:     14.06 (-5.88%)  13.28 (0.00%)   13.28
length=8,align1=8,align2=0:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=8,align1=0,align2=8:     13.28 (0.00%)   13.28 (0.00%)   13.28
length=8,align1=8,align2=8:     14.06 (-5.88%)  13.28 (0.00%)   13.28
length=9,align1=0,align2=0:     13.28 (0.00%)   13.28 (0.00%)   13.28
length=9,align1=9,align2=0:     13.28 (0.00%)   13.28 (0.00%)   13.28
length=9,align1=0,align2=9:     13.28 (0.00%)   14.06 (-5.88%)  13.28
length=9,align1=9,align2=9:     14.06 (-5.88%)  13.28 (0.00%)   13.28
length=10,align1=0,align2=0:    14.06 (0.00%)   13.28 (5.56%)   14.06
length=10,align1=10,align2=0:   14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=10,align1=0,align2=10:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=10,align1=10,align2=10:  14.06 (0.00%)   13.28 (5.56%)   14.06
length=11,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=11,align1=11,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=11,align1=0,align2=11:   13.28 (0.00%)   13.28 (0.00%)   13.28
length=11,align1=11,align2=11:  13.28 (0.00%)   13.28 (0.00%)   13.28
length=12,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=12,align1=12,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=12,align1=0,align2=12:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=12,align1=12,align2=12:  14.06 (0.00%)   13.28 (5.56%)   14.06
length=13,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=13,align1=13,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=13,align1=0,align2=13:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=13,align1=13,align2=13:  13.28 (0.00%)   13.28 (0.00%)   13.28
length=14,align1=0,align2=0:    13.28 (0.00%)   13.28 (0.00%)   13.28
length=14,align1=14,align2=0:   13.28 (5.56%)   13.28 (5.56%)   14.06
length=14,align1=0,align2=14:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=14,align1=14,align2=14:  14.06 (-5.88%)  13.28 (0.00%)   13.28
length=15,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=15,align1=15,align2=0:   14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=15,align1=0,align2=15:   13.28 (0.00%)   13.28 (0.00%)   13.28
length=15,align1=15,align2=15:  13.28 (0.00%)   14.06 (-5.88%)  13.28
length=16,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=16,align1=16,align2=0:   13.28 (5.56%)   14.06 (0.00%)   14.06
length=16,align1=0,align2=16:   14.84 (-11.77%) 13.28 (0.00%)   13.28
length=16,align1=16,align2=16:  13.28 (-6.25%)  12.50 (0.00%)   12.50
length=17,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=17,align1=17,align2=0:   14.84 (-11.77%) 12.50 (5.88%)   13.28
length=17,align1=0,align2=17:   14.84 (-5.56%)  12.50 (11.11%)  14.06
length=17,align1=17,align2=17:  14.84 (-11.77%) 12.50 (5.88%)   13.28
length=18,align1=0,align2=0:    14.06 (0.00%)   12.50 (11.11%)  14.06
length=18,align1=18,align2=0:   13.28 (5.56%)   12.50 (11.11%)  14.06
length=18,align1=0,align2=18:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=18,align1=18,align2=18:  14.06 (0.00%)   12.50 (11.11%)  14.06
length=19,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=19,align1=19,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=19,align1=0,align2=19:   14.84 (-5.56%)  12.50 (11.11%)  14.06
length=19,align1=19,align2=19:  14.06 (-5.88%)  12.50 (5.88%)   13.28
length=20,align1=0,align2=0:    14.84 (-11.77%) 12.50 (5.88%)   13.28
length=20,align1=20,align2=0:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=20,align1=0,align2=20:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=20,align1=20,align2=20:  14.06 (0.00%)   13.28 (5.56%)   14.06
length=21,align1=0,align2=0:    14.84 (-5.56%)  12.50 (11.11%)  14.06
length=21,align1=21,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=21,align1=0,align2=21:   14.84 (-11.77%) 12.50 (5.88%)   13.28
length=21,align1=21,align2=21:  13.28 (5.56%)   13.28 (5.56%)   14.06
length=22,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=22,align1=22,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=22,align1=0,align2=22:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=22,align1=22,align2=22:  14.06 (0.00%)   12.50 (11.11%)  14.06
length=23,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=23,align1=23,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=23,align1=0,align2=23:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=23,align1=23,align2=23:  14.06 (-5.88%)  13.28 (0.00%)   13.28
length=24,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=24,align1=24,align2=0:   14.06 (0.00%)   13.28 (5.56%)   14.06
length=24,align1=0,align2=24:   14.84 (-11.77%) 12.50 (5.88%)   13.28
length=24,align1=24,align2=24:  14.06 (-5.88%)  13.28 (0.00%)   13.28
length=25,align1=0,align2=0:    14.06 (0.00%)   12.50 (11.11%)  14.06
length=25,align1=25,align2=0:   14.06 (0.00%)   13.28 (5.56%)   14.06
length=25,align1=0,align2=25:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=25,align1=25,align2=25:  13.28 (0.00%)   13.28 (0.00%)   13.28
length=26,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=26,align1=26,align2=0:   14.06 (0.00%)   13.28 (5.56%)   14.06
length=26,align1=0,align2=26:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=26,align1=26,align2=26:  14.06 (0.00%)   13.28 (5.56%)   14.06
length=27,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=27,align1=27,align2=0:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=27,align1=0,align2=27:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=27,align1=27,align2=27:  14.06 (0.00%)   12.50 (11.11%)  14.06
length=28,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=28,align1=28,align2=0:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=28,align1=0,align2=28:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=28,align1=28,align2=28:  14.84 (-11.77%) 13.28 (0.00%)   13.28
length=29,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=29,align1=29,align2=0:   13.28 (0.00%)   12.50 (5.88%)   13.28
length=29,align1=0,align2=29:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=29,align1=29,align2=29:  13.28 (5.56%)   12.50 (11.11%)  14.06
length=30,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=30,align1=30,align2=0:   13.28 (5.56%)   12.50 (11.11%)  14.06
length=30,align1=0,align2=30:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=30,align1=30,align2=30:  13.28 (0.00%)   12.50 (5.88%)   13.28
length=31,align1=0,align2=0:    13.28 (0.00%)   12.50 (5.88%)   13.28
length=31,align1=31,align2=0:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=31,align1=0,align2=31:   13.28 (0.00%)   12.50 (5.88%)   13.28
length=31,align1=31,align2=31:  14.06 (0.00%)   12.50 (11.11%)  14.06
length=48,align1=0,align2=0:    14.06 (0.00%)   14.06 (0.00%)   14.06
length=48,align1=3,align2=0:    14.06 (0.00%)   14.06 (0.00%)   14.06
length=48,align1=0,align2=3:    14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=48,align1=3,align2=3:    13.28 (5.56%)   14.06 (0.00%)   14.06
length=80,align1=0,align2=0:    15.62 (-11.11%) 14.84 (-5.56%)  14.06
length=80,align1=5,align2=0:    15.62 (-11.11%) 16.41 (-16.67%) 14.06
length=80,align1=0,align2=5:    14.06 (0.00%)   15.62 (-11.11%) 14.06
length=80,align1=5,align2=5:    15.62 (-5.26%)  17.19 (-15.79%) 14.84
length=96,align1=0,align2=0:    14.06 (0.00%)   14.84 (-5.56%)  14.06
length=96,align1=6,align2=0:    14.84 (-5.56%)  16.41 (-16.67%) 14.06
length=96,align1=0,align2=6:    14.06 (0.00%)   14.84 (-5.56%)  14.06
length=96,align1=6,align2=6:    14.84 (-5.56%)  17.19 (-22.22%) 14.06
length=112,align1=0,align2=0:   17.19 (-4.76%)  14.06 (14.29%)  16.41
length=112,align1=7,align2=0:   17.19 (0.00%)   16.41 (4.55%)   17.19
length=112,align1=0,align2=7:   16.41 (0.00%)   14.84 (9.52%)   16.41
length=112,align1=7,align2=7:   17.19 (0.00%)   17.19 (0.00%)   17.19
length=144,align1=0,align2=0:   17.19 (-10.00%) 17.97 (-15.00%) 15.62
length=144,align1=9,align2=0:   17.19 (-4.76%)  18.75 (-14.29%) 16.41
length=144,align1=0,align2=9:   20.31 (-8.33%)  18.75 (0.00%)   18.75
length=144,align1=9,align2=9:   18.75 (-4.35%)  18.75 (-4.35%)  17.97
length=160,align1=0,align2=0:   18.75 (-4.35%)  17.97 (0.00%)   17.97
length=160,align1=10,align2=0:  18.75 (4.00%)   18.75 (4.00%)   19.53
length=160,align1=0,align2=10:  19.53 (-4.17%)  17.97 (4.17%)   18.75
length=160,align1=10,align2=10:         18.75 (-4.35%)  18.75 (-4.35%)  17.97
length=176,align1=0,align2=0:   18.75 (-4.35%)  17.19 (4.35%)   17.97
length=176,align1=11,align2=0:  19.53 (0.00%)   19.53 (0.00%)   19.53
length=176,align1=0,align2=11:  19.53 (-4.17%)  18.75 (0.00%)   18.75
length=176,align1=11,align2=11:         18.75 (0.00%)   17.97 (4.17%)   18.75
length=192,align1=0,align2=0:   18.75 (0.00%)   17.97 (4.17%)   18.75
length=192,align1=12,align2=0:  21.09 (-8.00%)  18.75 (4.00%)   19.53
length=192,align1=0,align2=12:  18.75 (0.00%)   18.75 (0.00%)   18.75
length=192,align1=12,align2=12:         18.75 (0.00%)   17.97 (4.17%)   18.75
length=208,align1=0,align2=0:   17.97 (0.00%)   20.31 (-13.04%) 17.97
length=208,align1=13,align2=0:  19.53 (7.41%)   21.09 (0.00%)   21.09
length=208,align1=0,align2=13:  23.44 (-11.11%) 21.09 (0.00%)   21.09
length=208,align1=13,align2=13:         21.09 (-3.85%)  21.09 (-3.85%)  20.31
length=224,align1=0,align2=0:   21.09 (-8.00%)  20.31 (-4.00%)  19.53
length=224,align1=14,align2=0:  23.44 (-11.11%) 20.31 (3.70%)   21.09
length=224,align1=0,align2=14:  21.09 (3.57%)   20.31 (7.14%)   21.88
length=224,align1=14,align2=14:         20.31 (0.00%)   19.53 (3.85%)   20.31
length=240,align1=0,align2=0:   20.31 (-4.00%)  19.53 (0.00%)   19.53
length=240,align1=15,align2=0:  22.66 (0.00%)   20.31 (10.34%)  22.66
length=240,align1=0,align2=15:  20.31 (-4.00%)  20.31 (-4.00%)  19.53
length=240,align1=15,align2=15:         21.88 (0.00%)   21.09 (3.57%)   21.88
length=272,align1=0,align2=0:   20.31 (0.00%)   28.12 (-38.46%) 20.31
length=272,align1=17,align2=0:  22.66 (0.00%)   27.34 (-20.69%) 22.66
length=272,align1=0,align2=17:  25.78 (-10.00%) 28.12 (-20.00%) 23.44
length=272,align1=17,align2=17:         22.66 (-3.57%)  27.34 (-25.00%) 21.88
length=288,align1=0,align2=0:   23.44 (-7.14%)  27.34 (-25.00%) 21.88
length=288,align1=18,align2=0:  22.66 (0.00%)   27.34 (-20.69%) 22.66
length=288,align1=0,align2=18:  23.44 (-3.45%)  25.00 (-10.35%) 22.66
length=288,align1=18,align2=18:         22.66 (-3.57%)  21.88 (0.00%)   21.88
length=304,align1=0,align2=0:   21.88 (0.00%)   21.88 (0.00%)   21.88
length=304,align1=19,align2=0:  23.44 (-3.45%)  22.66 (0.00%)   22.66
length=304,align1=0,align2=19:  22.66 (0.00%)   22.66 (0.00%)   22.66
length=304,align1=19,align2=19:         22.66 (-3.57%)  21.88 (0.00%)   21.88
length=320,align1=0,align2=0:   22.66 (-3.57%)  21.88 (0.00%)   21.88
length=320,align1=20,align2=0:  22.66 (0.00%)   22.66 (0.00%)   22.66
length=320,align1=0,align2=20:  22.66 (0.00%)   22.66 (0.00%)   22.66
length=320,align1=20,align2=20:         22.66 (-3.57%)  21.88 (0.00%)   21.88
length=336,align1=0,align2=0:   21.88 (0.00%)   24.22 (-10.71%) 21.88
length=336,align1=21,align2=0:  22.66 (0.00%)   25.00 (-10.35%) 22.66
length=336,align1=0,align2=21:  25.78 (0.00%)   25.00 (3.03%)   25.78
length=336,align1=21,align2=21:         25.00 (0.00%)   23.44 (6.25%)   25.00
length=352,align1=0,align2=0:   24.22 (0.00%)   24.22 (0.00%)   24.22
length=352,align1=22,align2=0:  25.00 (0.00%)   25.00 (0.00%)   25.00
length=352,align1=0,align2=22:  25.00 (-3.23%)  25.00 (-3.23%)  24.22
length=352,align1=22,align2=22:         25.00 (-3.23%)  24.22 (0.00%)   24.22
length=368,align1=0,align2=0:   25.00 (-3.23%)  23.44 (3.23%)   24.22
length=368,align1=23,align2=0:  25.00 (0.00%)   24.22 (3.12%)   25.00
length=368,align1=0,align2=23:  25.00 (-3.23%)  25.00 (-3.23%)  24.22
length=368,align1=23,align2=23:         25.00 (-6.67%)  23.44 (0.00%)   23.44
length=384,align1=0,align2=0:   24.22 (0.00%)   24.22 (0.00%)   24.22
length=384,align1=24,align2=0:  25.00 (0.00%)   24.22 (3.12%)   25.00
length=384,align1=0,align2=24:  25.00 (0.00%)   25.78 (-3.12%)  25.00
length=384,align1=24,align2=24:         24.22 (-3.33%)  23.44 (0.00%)   23.44
length=400,align1=0,align2=0:   25.00 (-3.23%)  26.56 (-9.68%)  24.22
length=400,align1=25,align2=0:  25.78 (-3.12%)  27.34 (-9.38%)  25.00
length=400,align1=0,align2=25:  27.34 (0.00%)   27.34 (0.00%)   27.34
length=400,align1=25,align2=25:         26.56 (0.00%)   25.78 (2.94%)   26.56
length=416,align1=0,align2=0:   26.56 (-3.03%)  25.78 (0.00%)   25.78
length=416,align1=26,align2=0:  28.12 (-2.86%)  27.34 (0.00%)   27.34
length=416,align1=0,align2=26:  27.34 (-2.94%)  28.12 (-5.88%)  26.56
length=416,align1=26,align2=26:         25.78 (0.00%)   26.56 (-3.03%)  25.78
length=432,align1=0,align2=0:   27.34 (-2.94%)  25.78 (2.94%)   26.56
length=432,align1=27,align2=0:  28.12 (-2.86%)  27.34 (0.00%)   27.34
length=432,align1=0,align2=27:  27.34 (0.00%)   28.12 (-2.86%)  27.34
length=432,align1=27,align2=27:         25.78 (0.00%)   25.78 (0.00%)   25.78
length=448,align1=0,align2=0:   26.56 (-3.03%)  25.78 (0.00%)   25.78
length=448,align1=28,align2=0:  27.34 (0.00%)   27.34 (0.00%)   27.34
length=448,align1=0,align2=28:  27.34 (0.00%)   28.12 (-2.86%)  27.34
length=448,align1=28,align2=28:         25.78 (0.00%)   25.78 (0.00%)   25.78
length=464,align1=0,align2=0:   25.78 (0.00%)   28.12 (-9.09%)  25.78
length=464,align1=29,align2=0:  28.12 (-2.86%)  29.69 (-8.57%)  27.34
length=464,align1=0,align2=29:  30.47 (0.00%)   30.47 (0.00%)   30.47
length=464,align1=29,align2=29:         28.12 (0.00%)   27.34 (2.78%)   28.12
length=480,align1=0,align2=0:   29.69 (-5.56%)  28.12 (0.00%)   28.12
length=480,align1=30,align2=0:  31.25 (-2.56%)  29.69 (2.56%)   30.47
length=480,align1=0,align2=30:  29.69 (0.00%)   30.47 (-2.63%)  29.69
length=480,align1=30,align2=30:         28.12 (0.00%)   28.12 (0.00%)   28.12
length=496,align1=0,align2=0:   28.12 (0.00%)   27.34 (2.78%)   28.12
length=496,align1=31,align2=0:  30.47 (-2.63%)  29.69 (0.00%)   29.69
length=496,align1=0,align2=31:  29.69 (0.00%)   30.47 (-2.63%)  29.69
length=496,align1=31,align2=31:         28.12 (-2.86%)  28.12 (-2.86%)  27.34
length=1024,align1=0,align2=0:  44.53 (0.00%)   44.53 (0.00%)   44.53
length=1024,align1=32,align2=0:         44.53 (-1.79%)  44.53 (-1.79%)  43.75
length=1024,align1=0,align2=32:         44.53 (-1.79%)  43.75 (0.00%)   43.75
length=1024,align1=32,align2=32:        43.75 (1.75%)   43.75 (1.75%)   44.53
length=1056,align1=0,align2=0:  46.88 (-1.69%)  46.88 (-1.69%)  46.09
length=1056,align1=33,align2=0:         53.12 (0.00%)   52.34 (1.47%)   53.12
length=1056,align1=0,align2=33:         52.34 (0.00%)   53.12 (-1.49%)  52.34
length=1056,align1=33,align2=33:        46.09 (0.00%)   46.88 (-1.69%)  46.09
length=1088,align1=0,align2=0:  46.88 (-1.69%)  46.09 (0.00%)   46.09
length=1088,align1=34,align2=0:         52.34 (0.00%)   52.34 (0.00%)   52.34
length=1088,align1=0,align2=34:         53.12 (-3.03%)  53.12 (-3.03%)  51.56
length=1088,align1=34,align2=34:        46.09 (0.00%)   46.88 (-1.69%)  46.09
length=1120,align1=0,align2=0:  49.22 (-1.61%)  48.44 (0.00%)   48.44
length=1120,align1=35,align2=0:         54.69 (1.41%)   55.47 (0.00%)   55.47
length=1120,align1=0,align2=35:         57.03 (0.00%)   55.47 (2.74%)   57.03
length=1120,align1=35,align2=35:        48.44 (0.00%)   49.22 (-1.61%)  48.44
length=1152,align1=0,align2=0:  47.66 (1.61%)   48.44 (0.00%)   48.44
length=1152,align1=36,align2=0:         55.47 (-1.43%)  55.47 (-1.43%)  54.69
length=1152,align1=0,align2=36:         58.59 (-1.35%)  55.47 (4.05%)   57.81
length=1152,align1=36,align2=36:        48.44 (0.00%)   49.22 (-1.61%)  48.44
length=1184,align1=0,align2=0:  53.12 (-3.03%)  50.78 (1.52%)   51.56
length=1184,align1=37,align2=0:         61.72 (-2.60%)  57.03 (5.19%)   60.16
length=1184,align1=0,align2=37:         62.50 (-1.27%)  57.03 (7.60%)   61.72
length=1184,align1=37,align2=37:        53.12 (-1.49%)  50.78 (2.99%)   52.34
length=1216,align1=0,align2=0:  53.91 (-4.55%)  50.78 (1.52%)   51.56
length=1216,align1=38,align2=0:         60.94 (0.00%)   57.03 (6.41%)   60.94
length=1216,align1=0,align2=38:         60.16 (0.00%)   57.81 (3.90%)   60.16
length=1216,align1=38,align2=38:        52.34 (-1.52%)  50.00 (3.03%)   51.56
length=1248,align1=0,align2=0:  54.69 (-2.94%)  53.12 (0.00%)   53.12
length=1248,align1=39,align2=0:         64.06 (-1.23%)  60.16 (4.94%)   63.28
length=1248,align1=0,align2=39:         60.94 (-2.63%)  60.16 (-1.32%)  59.38
length=1248,align1=39,align2=39:        53.12 (0.00%)   52.34 (1.47%)   53.12
length=1280,align1=0,align2=0:  52.34 (-1.52%)  52.34 (-1.52%)  51.56
length=1280,align1=40,align2=0:         61.72 (3.66%)   59.38 (7.32%)   64.06
length=1280,align1=0,align2=40:         60.94 (-2.63%)  60.16 (-1.32%)  59.38
length=1280,align1=40,align2=40:        52.34 (-1.52%)  52.34 (-1.52%)  51.56
length=1312,align1=0,align2=0:  54.69 (-1.45%)  55.47 (-2.90%)  53.91
length=1312,align1=41,align2=0:         63.28 (0.00%)   62.50 (1.23%)   63.28
length=1312,align1=0,align2=41:         62.50 (0.00%)   62.50 (0.00%)   62.50
length=1312,align1=41,align2=41:        53.91 (0.00%)   54.69 (-1.45%)  53.91
length=1344,align1=0,align2=0:  54.69 (0.00%)   54.69 (0.00%)   54.69
length=1344,align1=42,align2=0:         62.50 (0.00%)   62.50 (0.00%)   62.50
length=1344,align1=0,align2=42:         62.50 (-1.27%)  62.50 (-1.27%)  61.72
length=1344,align1=42,align2=42:        53.91 (0.00%)   53.91 (0.00%)   53.91
length=1376,align1=0,align2=0:  65.62 (-16.67%) 68.75 (-22.22%) 56.25
length=1376,align1=43,align2=0:         71.88 (-9.52%)  73.44 (-11.90%) 65.62
length=1376,align1=0,align2=43:         72.66 (-12.05%) 74.22 (-14.46%) 64.84
length=1376,align1=43,align2=43:        64.06 (-13.89%) 67.97 (-20.83%) 56.25
length=1408,align1=0,align2=0:  57.03 (-1.39%)  68.75 (-22.22%) 56.25
length=1408,align1=44,align2=0:         65.62 (-1.20%)  73.44 (-13.25%) 64.84
length=1408,align1=0,align2=44:         64.84 (0.00%)   74.22 (-14.46%) 64.84
length=1408,align1=44,align2=44:        56.25 (-1.41%)  68.75 (-23.94%) 55.47
length=1440,align1=0,align2=0:  67.97 (-14.47%) 64.84 (-9.21%)  59.38
length=1440,align1=45,align2=0:         74.22 (-10.47%) 68.75 (-2.33%)  67.19
length=1440,align1=0,align2=45:         72.66 (-6.90%)  69.53 (-2.30%)  67.97
length=1440,align1=45,align2=45:        65.62 (-13.51%) 58.59 (-1.35%)  57.81
length=1472,align1=0,align2=0:  66.41 (-14.86%) 58.59 (-1.35%)  57.81
length=1472,align1=46,align2=0:         73.44 (-9.30%)  67.19 (0.00%)   67.19
length=1472,align1=0,align2=46:         70.31 (-4.65%)  67.97 (-1.16%)  67.19
length=1472,align1=46,align2=46:        57.81 (0.00%)   58.59 (-1.35%)  57.81
length=1504,align1=0,align2=0:  60.94 (0.00%)   60.94 (0.00%)   60.94
length=1504,align1=47,align2=0:         71.09 (-1.11%)  70.31 (0.00%)   70.31
length=1504,align1=0,align2=47:         70.31 (-1.12%)  70.31 (-1.12%)  69.53
length=1504,align1=47,align2=47:        60.94 (-1.30%)  60.16 (0.00%)   60.16
length=1536,align1=0,align2=0:  62.50 (-3.90%)  60.16 (0.00%)   60.16
length=1536,align1=48,align2=0:         60.94 (-1.30%)  60.16 (0.00%)   60.16
length=1536,align1=0,align2=48:         61.72 (-3.95%)  60.16 (-1.32%)  59.38
length=1536,align1=48,align2=48:        60.94 (-1.30%)  60.16 (0.00%)   60.16
length=1568,align1=0,align2=0:  80.47 (-27.16%) 63.28 (0.00%)   63.28
length=1568,align1=49,align2=0:         86.72 (-18.09%) 72.66 (1.06%)   73.44
length=1568,align1=0,align2=49:         74.22 (-3.26%)  74.22 (-3.26%)  71.88
length=1568,align1=49,align2=49:        62.50 (0.00%)   61.72 (1.25%)   62.50
length=1600,align1=0,align2=0:  62.50 (-1.27%)  62.50 (-1.27%)  61.72
length=1600,align1=50,align2=0:         73.44 (0.00%)   71.88 (2.13%)   73.44
length=1600,align1=0,align2=50:         72.66 (0.00%)   73.44 (-1.08%)  72.66
length=1600,align1=50,align2=50:        62.50 (-1.27%)  62.50 (-1.27%)  61.72
length=1632,align1=0,align2=0:  64.84 (0.00%)   64.84 (0.00%)   64.84
length=1632,align1=51,align2=0:         75.78 (0.00%)   75.00 (1.03%)   75.78
length=1632,align1=0,align2=51:         78.91 (0.00%)   75.78 (3.96%)   78.91
length=1632,align1=51,align2=51:        64.84 (-2.47%)  64.84 (-2.47%)  63.28
length=1664,align1=0,align2=0:  64.84 (-1.22%)  64.84 (-1.22%)  64.06
length=1664,align1=52,align2=0:         75.78 (0.00%)   75.00 (1.03%)   75.78
length=1664,align1=0,align2=52:         80.47 (-0.98%)  75.78 (4.90%)   79.69
length=1664,align1=52,align2=52:        64.06 (-1.23%)  65.62 (-3.70%)  63.28
length=1696,align1=0,align2=0:  69.53 (-3.49%)  72.66 (-8.14%)  67.19
length=1696,align1=53,align2=0:         80.47 (-0.98%)  82.03 (-2.94%)  79.69
length=1696,align1=0,align2=53:         80.47 (0.96%)   82.03 (-0.96%)  81.25
length=1696,align1=53,align2=53:        68.75 (-2.33%)  72.66 (-8.14%)  67.19
length=1728,align1=0,align2=0:  67.97 (0.00%)   72.66 (-6.90%)  67.97
length=1728,align1=54,align2=0:         80.47 (-0.98%)  82.81 (-3.92%)  79.69
length=1728,align1=0,align2=54:         78.91 (-1.00%)  82.03 (-5.00%)  78.12
length=1728,align1=54,align2=54:        68.75 (0.00%)   72.66 (-5.68%)  68.75
length=1760,align1=0,align2=0:  77.34 (-12.50%) 68.75 (0.00%)   68.75
length=1760,align1=55,align2=0:         91.41 (-8.33%)  79.69 (5.56%)   84.38
length=1760,align1=0,align2=55:         88.28 (-10.78%) 80.47 (-0.98%)  79.69
length=1760,align1=55,align2=55:        77.34 (-11.24%) 68.75 (1.12%)   69.53
length=1792,align1=0,align2=0:  78.12 (-14.94%) 68.75 (-1.15%)  67.97
length=1792,align1=56,align2=0:         88.28 (-4.63%)  79.69 (5.56%)   84.38
length=1792,align1=0,align2=56:         88.28 (-9.71%)  80.47 (0.00%)   80.47
length=1792,align1=56,align2=56:        77.34 (-11.24%) 68.75 (1.12%)   69.53
length=1824,align1=0,align2=0:  72.66 (7.92%)   70.31 (10.89%)  78.91
length=1824,align1=57,align2=0:         85.94 (5.17%)   82.03 (9.48%)   90.62
length=1824,align1=0,align2=57:         82.03 (3.67%)   82.81 (2.75%)   85.16
length=1824,align1=57,align2=57:        70.31 (-1.12%)  70.31 (-1.12%)  69.53
length=1856,align1=0,align2=0:  70.31 (-1.12%)  70.31 (-1.12%)  69.53
length=1856,align1=58,align2=0:         83.59 (-0.94%)  82.03 (0.94%)   82.81
length=1856,align1=0,align2=58:         178.12 (-115.09%)       82.81 (0.00%)   82.81
length=1856,align1=58,align2=58:        70.31 (-1.12%)  70.31 (-1.12%)  69.53
length=1888,align1=0,align2=0:  73.44 (-1.08%)  78.91 (-8.60%)  72.66
length=1888,align1=59,align2=0:         85.94 (0.00%)   89.84 (-4.55%)  85.94
length=1888,align1=0,align2=59:         84.38 (0.00%)   89.06 (-5.56%)  84.38
length=1888,align1=59,align2=59:        72.66 (-1.09%)  78.12 (-8.70%)  71.88
length=1920,align1=0,align2=0:  72.66 (-1.09%)  78.12 (-8.70%)  71.88
length=1920,align1=60,align2=0:         85.94 (0.00%)   89.84 (-4.55%)  85.94
length=1920,align1=0,align2=60:         85.16 (0.00%)   89.06 (-4.59%)  85.16
length=1920,align1=60,align2=60:        72.66 (-1.09%)  78.91 (-9.78%)  71.88
length=1952,align1=0,align2=0:  75.00 (-1.05%)  75.00 (-1.05%)  74.22
length=1952,align1=61,align2=0:         88.28 (0.00%)   87.50 (0.88%)   88.28
length=1952,align1=0,align2=61:         87.50 (0.00%)   88.28 (-0.89%)  87.50
length=1952,align1=61,align2=61:        74.22 (0.00%)   74.22 (0.00%)   74.22
length=1984,align1=0,align2=0:  75.00 (-1.05%)  73.44 (1.05%)   74.22
length=1984,align1=62,align2=0:         89.06 (-0.89%)  87.50 (0.88%)   88.28
length=1984,align1=0,align2=62:         87.50 (0.00%)   88.28 (-0.89%)  87.50
length=1984,align1=62,align2=62:        74.22 (0.00%)   74.22 (0.00%)   74.22
length=2016,align1=0,align2=0:  77.34 (-1.02%)  76.56 (0.00%)   76.56
length=2016,align1=63,align2=0:         91.41 (-0.86%)  90.62 (0.00%)   90.62
length=2016,align1=0,align2=63:         89.84 (0.00%)   90.62 (-0.87%)  89.84
length=2016,align1=63,align2=63:        77.34 (-1.02%)  76.56 (0.00%)   76.56
length=4096,align1=0,align2=0:  141.41 (-0.56%) 146.88 (-4.44%) 140.62

Function: memcpy
__memcpy_thunderx       __memcpy_falkor __memcpy_generic
Variant: large
================================================================================
length=65543,align1=0,align2=0:         4018.75 (3.09%) 2634.38 (36.47%)        4146.88
length=65551,align1=0,align2=3:         4425.00 (-6.47%)        3134.38 (24.59%)        4156.25
length=65567,align1=3,align2=0:         2909.38 (29.95%)        3134.38 (24.53%)        4153.12
length=65599,align1=3,align2=5:         4415.62 (-6.16%)        3134.38 (24.64%)        4159.38
length=131079,align1=0,align2=0:        5765.62 (30.38%)        5240.62 (36.72%)        8281.25
length=131087,align1=0,align2=3:        8831.25 (-6.56%)        6271.88 (24.32%)        8287.50
length=131103,align1=3,align2=0:        5793.75 (29.05%)        6268.75 (23.23%)        8165.62
length=131135,align1=3,align2=5:        5806.25 (29.97%)        6259.38 (24.50%)        8290.62
length=262151,align1=0,align2=0:        11850.00 (28.91%)       10762.50 (35.43%)       16668.80
length=262159,align1=0,align2=3:        12043.80 (27.72%)       12700.00 (23.78%)       16662.50
length=262175,align1=3,align2=0:        12046.90 (27.90%)       12687.50 (24.07%)       16709.40
length=262207,align1=3,align2=5:        11984.40 (28.08%)       12678.10 (23.91%)       16662.50
length=524295,align1=0,align2=0:        24825.00 (25.00%)       24268.80 (27.34%)       33400.00
length=524303,align1=0,align2=3:        35731.20 (-6.53%)       25678.10 (23.44%)       33540.60
length=524319,align1=3,align2=0:        25893.80 (22.71%)       25725.00 (23.22%)       33503.10
length=524351,align1=3,align2=5:        25887.50 (22.86%)       25690.60 (23.45%)       33559.40
length=1048583,align1=0,align2=0:       50621.90 (0.30%)        50600.00 (0.34%)        50771.90
length=1048591,align1=0,align2=3:       53206.20 (0.54%)        51081.20 (4.51%)        53493.80
length=1048607,align1=3,align2=0:       53221.90 (0.32%)        51975.00 (2.66%)        53393.80
length=1048639,align1=3,align2=5:       53240.60 (0.36%)        51953.10 (2.77%)        53431.20
length=2097159,align1=0,align2=0:       103744.00 (-2.00%)      102447.00 (-1.00%)      102425.00
length=2097167,align1=0,align2=3:       108588.00 (-1.00%)      105159.00 (2.00%)       107606.00
length=2097183,align1=3,align2=0:       107678.00 (0.00%)       105250.00 (2.00%)       108125.00
length=2097215,align1=3,align2=5:       107906.00 (1.00%)       105841.00 (3.00%)       109475.00
length=4194311,align1=0,align2=0:       202994.00 (0.00%)       202500.00 (1.00%)       204809.00
length=4194319,align1=0,align2=3:       213350.00 (0.00%)       205997.00 (3.00%)       213384.00
length=4194335,align1=3,align2=0:       212653.00 (0.00%)       206444.00 (3.00%)       212900.00
length=4194367,align1=3,align2=5:       213044.00 (0.00%)       206084.00 (3.00%)       213847.00
length=8388615,align1=0,align2=0:       401294.00 (0.00%)       401231.00 (0.00%)       401944.00
length=8388623,align1=0,align2=3:       480872.00 (-14.00%)     406444.00 (3.00%)       422900.00
length=8388639,align1=3,align2=0:       422147.00 (0.00%)       407750.00 (3.00%)       422803.00
length=8388671,align1=3,align2=5:       442003.00 (-5.00%)      407125.00 (3.00%)       423509.00
length=16777223,align1=0,align2=0:      799809.00 (0.00%)       800000.00 (0.00%)       801756.00
length=16777231,align1=0,align2=3:      841184.00 (0.00%)       808525.00 (4.00%)       843775.00
length=16777247,align1=3,align2=0:      841166.00 (0.00%)       810147.00 (3.00%)       843147.00
length=16777279,align1=3,align2=5:      972569.00 (-16.00%)     808588.00 (4.00%)       843731.00
length=33554439,align1=0,align2=0:      1842240.00 (-0.01%)     1863590.00 (-1.17%)     1841990.00
length=33554447,align1=0,align2=3:      2103470.00 (-2.74%)     1919460.00 (6.25%)      2047440.00
length=33554463,align1=3,align2=0:      2075690.00 (-1.07%)     1930040.00 (6.02%)      2053720.00
length=33554495,align1=3,align2=5:      2110590.00 (-2.82%)     1924440.00 (6.25%)      2052650.00

Function: memcpy
__memcpy_thunderx       __memcpy_falkor __memcpy_generic
Variant: random
================================================================================
max-size=4096:  44061.90 (5.85%)        38568.20 (17.59%)       46799.90
max-size=8192:  42790.90 (5.27%)        38158.90 (15.52%)       45171.50
max-size=16384:         44912.10 (2.25%)        38710.40 (15.75%)       45945.00
max-size=32768:         43577.90 (1.23%)        37975.10 (13.93%)       44120.00
max-size=65536:         44375.50 (1.04%)        38474.20 (14.20%)       44840.60

	* manual/tunables.texi (Tunable glibc.tune.cpu): Add falkor.
	* sysdeps/aarch64/multiarch/Makefile (sysdep_routines): Add
	memcpy_falkor.
	* sysdeps/aarch64/multiarch/ifunc-impl-list.c (MAX_IFUNC):
	Bump.
	(__libc_ifunc_impl_list): Add __memcpy_falkor.
	* sysdeps/aarch64/multiarch/memcpy.c: Likewise.
	* sysdeps/aarch64/multiarch/memcpy_falkor.S: New file.
	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (cpu_list):
	Add falkor.
	* sysdeps/unix/sysv/linux/aarch64/cpu-features.h (IS_FALKOR):
	New macro.
2017-08-09 06:32:17 +05:30
Adhemerval Zanella 9995c839a0 manual: Document getcontext uc_stack value on Linux [BZ #759]
As decribed in BZ#759, Linux getcontext implementation on Linux does
differs from other SysV system about the returned uc_stack.  This is
true not only for i386, but for all the architecture I could actually
check (aarch64, arm, alpha, hppa, m68k, mips, mips64, mips64n32,
powerpc, powerpc64, powerpc64le, s390x, sh, sparc, sparc64, and x86).

And I think we should not change current behavior for some reasons:

1. POSIX 2008 removed this SySV interface for a good reason and changing
   this behavior adds nothing for current portable code.  POSIX 2001
   specification does states that stack should be saved [1] and current
   GLIBC code does in a arch-specific manner (inside the mcontext_t)
   which allows the setcontext to work correctly.

2. Changing this behavior would potentially require compat symbols and
   I see no gain in adding compat symbols for deprecated interfaces.

3. Also, for comment #2 in BZ#759, it is up to kernel do setup the contents
   for ucontext_t and currently it does not provide the stack information
   as well.  Trying to change it is also another fix that does not worth
   the possible gains.

Instead my proposal is to make it clear the current interface may differ
depending of the underlying operational system.

glibc documentation and close this bug as invalid.

	[BZ #759]
	* manual/setjmp.texi (getcontex): Document uc_stack value on Linux.

[1] http://pubs.opengroup.org/onlinepubs/009695399/functions/getcontext.html
2017-08-08 16:16:43 -03:00
Joseph Myers f17a42333f Do not use __ptr_t.
sys/cdefs.h has a macro __ptr_t, which a few places in glibc use
instead of void *.  void * is a well-understood standard type for that
purpose and in a post-C89 context there is no need for a macro for it;
this patch changes those places to use void * directly instead.

Unlike __long_double_t, __ptr_t is widely used outside glibc (or at
least has many hits on codesearch.debian.net).  I don't know how many
of those uses would break if sys/cdefs.h ceased to define the macro,
but there's enough risk that this patch leaves the definition and just
removes the uses within glibc; removal of the definition can be
considered separately if desired.

Tested for x86_64, and with build-many-glibcs.py.

	* malloc/mcheck.c (old_free_hook): Use void * instead of __ptr_t.
	(old_malloc_hook): Likewise.
	(old_memalign_hook): Likewise.
	(old_realloc_hook): Likewise.
	(struct hdr): Likewise.
	(flood): Likewise.
	(freehook): Likewise.
	(mallochook): Likewise.
	(memalignhook): Likewise.
	(reallochook): Likewise.
	(mprobe): Likewise.
	* malloc/mtrace.c (mallwatch): Likewise.
	(tr_old_free_hook): Likewise.
	(tr_old_malloc_hook): Likewise.
	(tr_old_realloc_hook): Likewise.
	(tr_old_memalign_hook): Likewise.
	(tr_where): Likewise.
	(lock_and_info): Likewise.
	(tr_freehook): Likewise.
	(tr_mallochook): Likewise.
	(tr_reallochook): Likewise.
	(tr_memalignhook): Likewise.
	* misc/err.h [!__GNUC_VA_LIST] (__gnuc_va_list): Likewise.
	* misc/mmap.c (__mmap): Likewise.
	* misc/mmap64.c (__mmap64): Likewise.
	* misc/mprotect.c (__mprotect): Likewise.
	* misc/msync.c (msync): Likewise.
	* misc/munmap.c (__munmap): Likewise.
	* posix/posix_madvise.c (posix_madvise): Likewise.
	* socket/send.c (__send): Likewise.
	* socket/sendto.c (__sendto): Likewise.
	* socket/setsockopt.c (__setsockopt): Likewise.
	* string/memcmp.c (__ptr_t): Remove macro.
	(MEMCMP): Use void * instead of ptr_t.
	* string/memrchr.c (__ptr_t): Remove macro.
	(__memrchr): Use void * instead of ptr_t.
	* sysdeps/mach/hurd/dl-sysdep.c (__mmap): Likewise.
	* sysdeps/mach/hurd/mmap.c (__mmap): Likewise.
	* sysdeps/mach/hurd/mmap64.c (__mmap64): Likewise.
	* sysdeps/mach/mprotect.c (__mprotect): Likewise.
	* sysdeps/mach/msync.c (msync): Likewise.
	* sysdeps/mach/munmap.c (__munmap): Likewise.
	* sysdeps/mips/bits/setjmp.h (struct __jmp_buf_internal_tag):
	Likewise.
	* sysdeps/posix/getcwd.c (__getcwd): Likewise.
	* sysdeps/powerpc/powerpc32/memset.S (memset): Likewise.
	* sysdeps/powerpc/powerpc32/power4/memcpy.S (memcpy): Likewise.
	* sysdeps/powerpc/powerpc32/power4/memset.S (memset): Likewise.
	* sysdeps/powerpc/powerpc32/power6/memcpy.S (memcpy): Likewise.
	* sysdeps/powerpc/powerpc32/power6/memset.S (memset): Likewise.
	* sysdeps/powerpc/powerpc32/power7/memcpy.S (memcpy): Likewise.
	* sysdeps/powerpc/powerpc32/power7/mempcpy.S (__mempcpy):
	Likewise.
	* sysdeps/powerpc/powerpc32/power7/memset.S (memset): Likewise.
	* sysdeps/powerpc/powerpc64/memcpy.S (memcpy): Likewise.
	* sysdeps/powerpc/powerpc64/memset.S (memset): Likewise.
	* sysdeps/powerpc/powerpc64/power4/memcpy.S (memcpy): Likewise.
	* sysdeps/powerpc/powerpc64/power4/memset.S (memset): Likewise.
	* sysdeps/powerpc/powerpc64/power6/memcpy.S (memcpy): Likewise.
	* sysdeps/powerpc/powerpc64/power6/memset.S (memset): Likewise.
	* sysdeps/powerpc/powerpc64/power7/memcpy.S (memcpy): Likewise.
	* sysdeps/powerpc/powerpc64/power7/mempcpy.S (__mempcpy):
	Likewise.
	* sysdeps/powerpc/powerpc64/power7/memset.S (memset): Likewise.
	* sysdeps/powerpc/powerpc64/power8/memset.S (memset): Likewise.
	* sysdeps/tile/memcmp.c (__ptr_t): Remove macro.
	(MEMCMP): Use void * instead of ptr_t.
	* sysdeps/unix/sysv/linux/alpha/oldglob.c (old_glob_t): Likewise.
	* sysdeps/unix/sysv/linux/mmap.c (__mmap): Likewise.
2017-08-08 17:14:49 +00:00
Florian Weimer 0df595b23a getaddrinfo: Remove unreachable return statement from gaih_inet 2017-08-08 18:48:05 +02:00
H.J. Lu 086df229ee i386: Add <startup.h> [BZ #21913]
On Linux/i386, there are 3 ways to make a system call:

1. call *%gs:SYSINFO_OFFSET.  This requires TLS initialization.
2. call *_dl_sysinfo.  This requires relocation of _dl_sysinfo.
3. int $0x80.  This is slower than #2 and #3, but works everywhere.

When an object file is compiled with PIC, #1 is prefered since it is
faster than #3 and doesn't require relocation of _dl_sysinfo.  For
dynamic executables, ld.so initializes TLS.  However, for static
executables, before TLS is initialized by __libc_setup_tls, #3 should
be used for system calls.

This patch adds <startup.h> which defines _startup_fatal and defaults
it to __libc_fatal.  It replaces __libc_fatal with _startup_fatal in
static executables where it is called before __libc_setup_tls is called.
This header file is included in all files containing functions which are
called before __libc_setup_tls is called.  On Linux/i386, when PIE is
enabled by default, _startup_fatal is turned into ABORT_INSTRUCTION and
I386_USE_SYSENTER is defined to 0 so that "int $0x80" is used for system
calls before __libc_setup_tls is called.

Tested on i686 and x86-64.  Without this patch, all statically-linked
tests will fail on i686 when the compiler defaults to -fPIE.

	[BZ #21913]
	* csu/libc-tls.c: Include <startup.h> first.
	(__libc_setup_tls): Call _startup_fatal instead of __libc_fatal.
	* elf/dl-tunables.c: Include <startup.h> first.
	* include/libc-symbols.h (BUILD_PIE_DEFAULT): New.
	* sysdeps/generic/startup.h: New file.
	* sysdeps/unix/sysv/linux/i386/startup.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/brk.c [BUILD_PIE_DEFAULT != 0]
	(I386_USE_SYSENTER): New.  Defined to 0.
2017-08-08 08:43:15 -07:00
Andreas Schwab fc5ad7024c Don't use IFUNC resolver for longjmp or system in libpthread (bug 21041)
Unlike the vfork forwarder and like the fork forwarder as in bug 19861,
there won't be a problem when the compiler does not turn this into a tail
call.
2017-08-08 17:01:25 +02:00
Adhemerval Zanella 852d631207 posix: Set p{read,write}v2 to return ENOTSUP (BZ#21780)
Different than other architectures hppa-linux-gnu define different values
for ENOTSUP and EOPNOTSUPP, where the later is a Linux specific one.
This leads to tst-preadwritev{64}v2 tests failures:

$ ./testrun.sh misc/tst-preadvwritev2
error: tst-preadvwritev2-common.c:35: preadv2 failure did not set errno to ENOTSUP (223)
error: 1 test failures

The straightforward fix is to return the POSIX defined ENOTSUP on all
p{read,write}v{64}v2 implementations instead of Linux specific one.

Checked on x86_64-linux-gnu and the tst-preadwritev{64}v2 on
hppa-linux-gnu (although due the installed kernel on my testing system
the pwritev{64}v2 with an invalid flag still fails due a known kernel
issue [1]).

	[BZ #21780]
	* sysdeps/posix/preadv2.c (preadv2): Use ENOTSUP instead of
	EOPNOTSUPP.
	* sysdeps/posix/preadv64v2.c (preadv64v2): Likewise.
	* sysdeps/posix/pwritev2.c (pwritev2): Likewise.
	* sysdeps/posix/pwritev64v2.c (pwritev64v2): Likewise.
	* sysdeps/unix/sysv/linux/preadv2.c (preadv2): Likewise.
	* sysdeps/unix/sysv/linux/preadv64v2.c (preadv64v2): Likewise.
	* sysdeps/unix/sysv/linux/pwritev2.c (pwritev2): Likewise.
	* sysdeps/unix/sysv/linux/pwritev64v2.c (pwritev64v2): Likewise.

[1] https://sourceware.org/ml/libc-alpha/2017-06/msg00726.html
2017-08-08 09:59:46 -03:00
Joseph Myers cd65836b5f Fix XPG4.2 bits/sigaction.h namespace (bug 21899).
For XPG4.2, sa_sigaction, SA_ONSTACK, SA_RESETHAND, SA_RESTART and
SA_NODEFER should be defined in signal.h, but they are only defined
for other standards at present.

This patch fixes the various bits/sigaction.h headers accordingly.
All the fixes are essentially the same, except those for SPARC and
Tile.

For SPARC, the header (a) spuriously defined various nonstandard
macros for __USE_UNIX98 || defined __USE_XOPEN2K8 and (b) defined some
standard macros as aliases of nonstandard ones instead of the other
way round.  This patch fixes the SPARC header to handle these macros
the same way and with the same conditions as those for other
architectures, so the standard macros are the primary ones and the
other ones are defined only for __USE_MISC and are aliases of the
standard ones where applicable.

For Tile, the header spuriously defined the nonstandard macro
SA_NOPTRACE for __USE_UNIX98 || defined __USE_XOPEN2K8; this is moved
to __USE_MISC.

(Those nonstandard macros are in a reserved namespace, but it seems
desirable to be consistent between architectures as far as possible,
and so not define them in standard modes anywhere.)

Tested for x86_64, and with build-many-glibcs.py.

	[BZ #21899]
	* bits/sigaction.h (struct sigaction): Define sa_handler and
	sa_sigaction using union also for [__USE_XOPEN_EXTENDED].
	(SA_ONSTACK): Change [__USE_UNIX98] condition to
	[__USE_XOPEN_EXTENDED].
	(SA_RESTART): Likewise.
	(SA_NODEFER): Likewise.
	(SA_RESETHAND): Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
	(struct sigaction): Define sa_handler and sa_sigaction using union
	also for [__USE_XOPEN_EXTENDED].
	(SA_ONSTACK): Change [__USE_UNIX98] condition to
	[__USE_XOPEN_EXTENDED].
	(SA_RESTART): Likewise.
	(SA_NODEFER): Likewise.
	(SA_RESETHAND): Likewise.
	* sysdeps/unix/sysv/linux/bits/sigaction.h
	(struct sigaction): Define sa_handler and sa_sigaction using union
	also for [__USE_XOPEN_EXTENDED].
	(SA_ONSTACK): Change [__USE_UNIX98] condition to
	[__USE_XOPEN_EXTENDED].
	(SA_RESTART): Likewise.
	(SA_NODEFER): Likewise.
	(SA_RESETHAND): Likewise.
	* sysdeps/unix/sysv/linux/hppa/bits/sigaction.h
	(struct sigaction): Define sa_handler and sa_sigaction using union
	also for [__USE_XOPEN_EXTENDED].
	(SA_ONSTACK): Change [__USE_UNIX98] condition to
	[__USE_XOPEN_EXTENDED].
	(SA_RESTART): Likewise.
	(SA_NODEFER): Likewise.
	(SA_RESETHAND): Likewise.
	* sysdeps/unix/sysv/linux/ia64/bits/sigaction.h
	(struct sigaction): Define sa_handler and sa_sigaction using union
	also for [__USE_XOPEN_EXTENDED].
	(SA_ONSTACK): Change [__USE_UNIX98] condition to
	[__USE_XOPEN_EXTENDED].
	(SA_RESTART): Likewise.
	(SA_NODEFER): Likewise.
	(SA_RESETHAND): Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/sigaction.h
	(struct sigaction): Define sa_handler and sa_sigaction using union
	also for [__USE_XOPEN_EXTENDED].
	(SA_ONSTACK): Change [__USE_UNIX98] condition to
	[__USE_XOPEN_EXTENDED].
	(SA_RESTART): Likewise.
	(SA_NODEFER): Likewise.
	(SA_RESETHAND): Likewise.
	* sysdeps/unix/sysv/linux/s390/bits/sigaction.h
	(struct sigaction): Define sa_handler and sa_sigaction using union
	also for [__USE_XOPEN_EXTENDED].
	(SA_ONSTACK): Change [__USE_UNIX98] condition to
	[__USE_XOPEN_EXTENDED].
	(SA_RESTART): Likewise.
	(SA_NODEFER): Likewise.
	(SA_RESETHAND): Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
	(struct sigaction): Define sa_handler and sa_sigaction using union
	also for [__USE_XOPEN_EXTENDED].
	(SA_ONSTACK): Change [__USE_UNIX98] condition to
	[__USE_XOPEN_EXTENDED].
	(SA_RESTART): Likewise.
	(SA_NODEFER): Likewise.  Define directly rather than as alias.
	(SA_RESETHAND): Likewise.
	(SA_INTERRUPT): Define only for [__USE_MISC].
	(SA_NOMASK): Define as alias of SA_NODEFER, only for [__USE_MISC].
	(SA_ONESHOT): Define as alias of SA_RESETHAND, only for
	[__USE_MISC].
	(SA_STACK): Define only for [__USE_MISC].
	* sysdeps/unix/sysv/linux/tile/bits/sigaction.h
	(struct sigaction): Define sa_handler and sa_sigaction using union
	also for [__USE_XOPEN_EXTENDED].
	(SA_ONSTACK): Change [__USE_UNIX98] condition to
	[__USE_XOPEN_EXTENDED].
	(SA_RESTART): Likewise.
	(SA_NODEFER): Likewise.
	(SA_RESETHAND): Likewise.
	(SA_NOPTRACE): Define only for [__USE_MISC].
2017-08-07 23:41:32 +00:00
Joseph Myers d9fee042e2 Consistently use uintN_t not u_intN_t everywhere.
This patch changes the remaining uses of the old nonstandard u_intN_t
types in glibc to use the C99 uintN_t instead, except for the
definitions of those typedefs and the tests of them in the c++-types
test.  This follows the previous such fix for libm, and being
consistent in using uintN_t makes sense as a global cleanup.

Tested for x86_64, and with build-many-glibcs.py.

	* catgets/catgets.c (catgets): Use uintN_t instead of u_intN_t.
	* catgets/catgetsinfo.h (struct catalog_obj): Likewise.
	(struct catalog_info): Likewise.
	* inet/htontest.c (lo): Likewise.
	(foo): Likewise.
	* inet/inet_lnaof.c (inet_lnaof): Likewise.
	* inet/inet_net.c (inet_network): Likewise.
	* inet/inet_netof.c (inet_netof): Likewise.
	* inet/rcmd.c (__ivaliduser): Likewise.
	(iruserok): Likewise.
	* locale/loadlocale.c (_nl_intern_locale_data): Likewise.
	* locale/programs/locale-spec.c (locale_special): Likewise.
	* nis/nis_findserv.c (struct findserv_req): Likewise.
	(__nis_findfastest_with_timeout): Likewise.
	* nss/test-netdb.c (test_network): Likewise.
	* resolv/inet_neta.c (inet_neta): Likewise.
	* resolv/ns_date.c (ns_datetosecs): Likewise.
	(SECS_PER_DAY): Likewise.
	* resolv/nss_dns/dns-network.c (_nss_dns_getnetbyaddr_r):
	Likewise.
	* resolv/res_comp.c (__putlong): Likewise.
	(__putshort): Likewise.
	(_getlong): Likewise.
	(_getshort): Likewise.
	* resolv/res_debug.c (p_time): Likewise.
	(precsize_ntoa): Likewise.
	(precsize_aton): Likewise.
	(latlon2ul): Likewise.
	(loc_aton): Likewise.
	(loc_ntoa): Likewise.
	* resolv/res_hconf.c (struct netaddr): Likewise.
	(_res_hconf_reorder_addrs): Likewise.
	* sunrpc/clnt_tcp.c (clnttcp_call): Likewise.
	(clnttcp_control): Likewise.
	* sunrpc/clnt_udp.c (clntudp_call): Likewise.
	(clntudp_control): Likewise.
	* sunrpc/clnt_unix.c (clntunix_call): Likewise.
	(clntunix_control): Likewise.
	* sunrpc/pmap_rmt.c (clnt_broadcast): Likewise.
	* sunrpc/rpc/auth.h (union des_block): Likewise.
	* sunrpc/tst-udp-nonblocking.c (do_test): Likewise.
	* sunrpc/xdr_rec.c (struct rec_strm): Likewise.
	(xdrrec_create): Likewise.
	(xdrrec_endofrecord): Likewise.
	(flush_out): Likewise.
	* sunrpc/xdr_stdio.c (xdrstdio_getlong): Likewise.
	(xdrstdio_putlong): Likewise.
	* sysdeps/unix/sysv/linux/errqueue.h (struct sock_extended_err):
	Likewise.
2017-08-07 19:55:34 +00:00
Joseph Myers 8b1647877c Remove __long_double_t.
sys/cdefs.h has a macro __long_double_t used in two places in glibc.
long double is a standard part of C since C89; there is no need for
such an alias for it.  This patch removes that macro and uses long
double directly everywhere.  As an implementation-namespace,
undocumented symbol, it should not be considered part of the API for
users, and codesearch.debian.net shows no sign of it being used
outside glibc in a way that would break with this patch.

Tested for x86_64.

	* misc/sys/cdefs.h (__long_double_t): Remove.
	* stdio-common/printf_fp.c (__printf_fp_l): Use long double
	instead of __long_double_t,
	* stdlib/strfmon_l.c (__vstrfmon_l): Likewise.
2017-08-07 19:53:17 +00:00
Siddhesh Poyarekar dd3e86ad7c benchtests: Avoid a display error when running in text terminal
The compare_strings.py script generates a graph for the benchmarks it
performs a comparison on and that fails if X is not available.  Avoid
the error and ensure that only the graph is generated and saved as a
PNG file.

	* benchtests/scripts/compare_strings.py: Avoid display error
	when generating graph.
2017-08-08 00:56:10 +05:30
Siddhesh Poyarekar b115e819af benchtests: Allow selecting baseline for compare_string.py
This patch allows one to provide the function name using an optional
-base option to compare all other functions against.  This is useful
when pitching one implementation of a string function against
alternatives.  In the absence of this option, comparisons are done
against the first ifunc in the list.

	* benchtests/scripts/compare_strings.py (main): Add an
	optional -base option.
	(process_results): New argument base_func.
2017-08-08 00:55:12 +05:30
Siddhesh Poyarekar 7ee38e6040 benchtests: Use TEST_NAME instead of hardcoding memcpy
The hardcoded 'memcpy' name turns up in other derived tests like
mempcpy.

       * benchtests/bench-memcpy.c (test_main): Use TEST_NAME instead of
       hardcoding memcpy.
       * benchtests/bench-memcpy-large.c (test_name): Likewise.
       * benchtests/bench-memcpy-random.c (test_name): Likewise.
2017-08-08 00:44:00 +05:30
Andreas Schwab d5afb38503 Fix missing redirects in testsuite targets 2017-08-07 18:13:36 +02:00
H.J. Lu 57a72fa350 x86-64: Add FMA multiarch functions to libm
This patch adds multiarch functions optimized with -mfma -mavx2 to libm.
e_pow-fma.c is compiled with $(config-cflags-nofma) due to PR 19003.

	* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
	Add e_exp-fma, e_log-fma, e_pow-fma, s_atan-fma, e_asin-fma,
	e_atan2-fma, s_sin-fma, s_tan-fma, mplog-fma, mpa-fma,
	slowexp-fma, slowpow-fma, sincos32-fma, doasin-fma, dosincos-fma,
	halfulp-fma, mpexp-fma, mpatan2-fma, mpatan-fma, mpsqrt-fma,
	and mptan-fma.
	(CFLAGS-doasin-fma.c): New.
	(CFLAGS-dosincos-fma.c): Likewise.
	(CFLAGS-e_asin-fma.c): Likewise.
	(CFLAGS-e_atan2-fma.c): Likewise.
	(CFLAGS-e_exp-fma.c): Likewise.
	(CFLAGS-e_log-fma.c): Likewise.
	(CFLAGS-e_pow-fma.c): Likewise.
	(CFLAGS-halfulp-fma.c): Likewise.
	(CFLAGS-mpa-fma.c): Likewise.
	(CFLAGS-mpatan-fma.c): Likewise.
	(CFLAGS-mpatan2-fma.c): Likewise.
	(CFLAGS-mpexp-fma.c): Likewise.
	(CFLAGS-mplog-fma.c): Likewise.
	(CFLAGS-mpsqrt-fma.c): Likewise.
	(CFLAGS-mptan-fma.c): Likewise.
	(CFLAGS-s_atan-fma.c): Likewise.
	(CFLAGS-sincos32-fma.c): Likewise.
	(CFLAGS-slowexp-fma.c): Likewise.
	(CFLAGS-slowpow-fma.c): Likewise.
	(CFLAGS-s_sin-fma.c): Likewise.
	(CFLAGS-s_tan-fma.c): Likewise.
	* sysdeps/x86_64/fpu/multiarch/doasin-fma.c: New file.
	* sysdeps/x86_64/fpu/multiarch/dosincos-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_asin-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_atan2-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_exp-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_log-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_pow-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/halfulp-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h: Likewise.
	* sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h: Likewise.
	* sysdeps/x86_64/fpu/multiarch/mpa-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/mpatan-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/mpatan2-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/mpexp-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/mplog-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/mpsqrt-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/mptan-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_atan-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_sin-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_tan-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/sincos32-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/slowexp-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/slowpow-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_asin.c: Rewrite.
	* sysdeps/x86_64/fpu/multiarch/e_atan2.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_exp.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_log.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_pow.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_atan.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_sin.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_tan.c: Likewise.
2017-08-07 08:20:56 -07:00
Joseph Myers 219dd320d6 Reimplement min_of_type using __MATH_TG.
This patch reimplements the libm-internal min_of_type macro to use
__MATH_TG instead of its own local type-generic implementation, so
simplifying the code and reducing the number of different type-generic
implementation variants in use in glibc.

Tested for x86_64.

	* sysdeps/generic/math_private.h (__EXPR_FLT128): Remove macro.
	(min_of_type_f): New macro.
	(min_of_type_): Likewise.
	(min_of_type_l): Likewise.
	(min_of_type_f128): Likewise.
	(min_of_type): Define using __MATH_TG and taking an expression
	argument.
	(math_check_force_underflow): Pass expression instead of type to
	min_of_type.
	(math_check_force_underflow_nonneg): Likewise.
2017-08-04 21:32:57 +00:00
H.J. Lu 64d4dea6cd x86: Remove assembly versions of HAS_CPU_FEATURE/HAS_ARCH_FEATURE
Since all x86 IFUNC selectors are implemented in C, assembly versions of
HAS_CPU_FEATURE and HAS_ARCH_FEATURE can be removed.

	* sysdeps/x86/cpu-features.h [__ASSEMBLER__]
	(LOAD_RTLD_GLOBAL_RO_RDX, HAS_FEATURE, LOAD_FUNC_GOT_EAX,
	HAS_CPU_FEATURE, HAS_ARCH_FEATURE): Removed.
2017-08-04 13:38:20 -07:00
H.J. Lu 973da22a35 i686: Implement IFUNC selectors in C
* sysdeps/i386/i686/multiarch/Makefile (sysdep_routines): Add
	bcopy-ia32, bzero-ia32, rawmemchr-ia32 memchr-ia32,
	memcmp-ia32, memcpy-ia32, memmove-ia32, mempcpy-ia32,
	memset-ia32, strcat-ia32, strchr-ia32, strrchr-ia32,
	strcpy-ia32, strcmp-ia32, strcspn-ia32, strpbrk-ia32,
	strspn-ia32, strlen-ia32, stpcpy-ia32, stpncpy-ia32,
	memcpy_chk-nonshared, mempcpy_chk-nonshared,
	memmove_chk-nonshared and memset_chk-nonshared
	* sysdeps/i386/i686/multiarch/bcopy-ia32.S: New file.
	* sysdeps/i386/i686/multiarch/bcopy.c: Likewise.
	* sysdeps/i386/i686/multiarch/bzero-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/bzero.c: Likewise.
	* sysdeps/i386/i686/multiarch/ifunc-memmove.h: Likewise.
	* sysdeps/i386/i686/multiarch/ifunc-memset.h: Likewise.
	* sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h: Likewise.
	* sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h: Likewise.
	* sysdeps/i386/i686/multiarch/ifunc-sse2.h: Likewise.
	* sysdeps/i386/i686/multiarch/ifunc-sse4_2.h: Likewise.
	* sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h: Likewise.
	* sysdeps/i386/i686/multiarch/memchr-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/memchr.c: Likewise.
	* sysdeps/i386/i686/multiarch/memcmp-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcmp.c: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy.c: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy_chk.c: Likewise.
	* sysdeps/i386/i686/multiarch/memmove-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/memmove.c: Likewise.
	* sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S: Likewise.
	* sysdeps/i386/i686/multiarch/memmove_chk.c: Likewise.
	* sysdeps/i386/i686/multiarch/mempcpy-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/mempcpy.c: Likewise.
	* sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S: Likewise.
	* sysdeps/i386/i686/multiarch/mempcpy_chk.c: Likewise.
	* sysdeps/i386/i686/multiarch/memrchr.c: Likewise.
	* sysdeps/i386/i686/multiarch/memset-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset.c: Likewise.
	* sysdeps/i386/i686/multiarch/memset_chk-nonshared.S: Likewise.
	* sysdeps/i386/i686/multiarch/rawmemchr-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/rawmemchr.c: Likewise.
	* sysdeps/i386/i686/multiarch/stpcpy-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/stpcpy-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/stpcpy.c: Likewise.
	* sysdeps/i386/i686/multiarch/stpncpy-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/stpncpy.c: Likewise.
	* sysdeps/i386/i686/multiarch/strcasecmp.c: Likewise.
	* sysdeps/i386/i686/multiarch/strcasecmp_l.c: Likewise.
	* sysdeps/i386/i686/multiarch/strcat-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcat.c: Likewise.
	* sysdeps/i386/i686/multiarch/strchr-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/strchr.c: Likewise.
	* sysdeps/i386/i686/multiarch/strcmp-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcmp.c: Likewise.
	* sysdeps/i386/i686/multiarch/strcpy-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcpy.c: Likewise.
	* sysdeps/i386/i686/multiarch/strcspn-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcspn.c: Likewise.
	* sysdeps/i386/i686/multiarch/strlen-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/strlen.c: Likewise.
	* sysdeps/i386/i686/multiarch/strncase.c: Likewise.
	* sysdeps/i386/i686/multiarch/strncase_l.c: Likewise.
	* sysdeps/i386/i686/multiarch/strncat.c: Likewise.
	* sysdeps/i386/i686/multiarch/strncmp.c: Likewise.
	* sysdeps/i386/i686/multiarch/strncpy.c: Likewise.
	* sysdeps/i386/i686/multiarch/strnlen.c: Likewise.
	* sysdeps/i386/i686/multiarch/strpbrk-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/strpbrk.c: Likewise.
	* sysdeps/i386/i686/multiarch/strrchr-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/strrchr.c: Likewise.
	* sysdeps/i386/i686/multiarch/strspn-ia32.S: Likewise.
	* sysdeps/i386/i686/multiarch/strspn.c: Likewise.
	* sysdeps/i386/i686/multiarch/wcschr.c: Likewise.
	* sysdeps/i386/i686/multiarch/wcscmp.c: Likewise.
	* sysdeps/i386/i686/multiarch/wcscpy.c: Likewise.
	* sysdeps/i386/i686/multiarch/wcslen.c: Likewise.
	* sysdeps/i386/i686/multiarch/wcsrchr.c: Likewise.
	* sysdeps/i386/i686/multiarch/wmemcmp.c: Likewise.
	* sysdeps/i386/i686/multiarch/bcopy.S: Removed.
	* sysdeps/i386/i686/multiarch/bzero.S: Likewise.
	* sysdeps/i386/i686/multiarch/memchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/memmove.S: Likewise.
	* sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/stpcpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/stpncpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcasecmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcasecmp_l.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcat.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
	* sysdeps/i386/i686/multiarch/strlen.S: Likewise.
	* sysdeps/i386/i686/multiarch/strncase.S: Likewise.
	* sysdeps/i386/i686/multiarch/strncase_l.S: Likewise.
	* sysdeps/i386/i686/multiarch/strncat.S: Likewise.
	* sysdeps/i386/i686/multiarch/strncmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/strncpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
	* sysdeps/i386/i686/multiarch/strpbrk.S: Likewise.
	* sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/strspn.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.
2017-08-04 13:29:38 -07:00
H.J. Lu 8537e0f6cf x86-64: Implement libmathvec IFUNC selectors in C
* sysdeps/x86_64/fpu/multiarch/Makefile (libmvec-sysdep_routines)
	Add svml_d_cos2_core-sse2, svml_d_cos4_core-sse,
	svml_d_cos8_core-avx2, svml_d_exp2_core-sse2,
	svml_d_exp4_core-sse, svml_d_exp8_core-avx2,
	svml_d_log2_core-sse2, svml_d_log4_core-sse,
	svml_d_log8_core-avx2, svml_d_pow2_core-sse2,
	svml_d_pow4_core-sse, svml_d_pow8_core-avx2
	svml_d_sin2_core-sse2, svml_d_sin4_core-sse,
	svml_d_sin8_core-avx2, svml_d_sincos2_core-sse2,
	svml_d_sincos4_core-sse, svml_d_sincos8_core-avx2,
	svml_s_cosf16_core-avx2, svml_s_cosf4_core-sse2,
	svml_s_cosf8_core-sse, svml_s_expf16_core-avx2,
	svml_s_expf4_core-sse2, svml_s_expf8_core-sse,
	svml_s_logf16_core-avx2, svml_s_logf4_core-sse2,
	svml_s_logf8_core-sse, svml_s_powf16_core-avx2,
	svml_s_powf4_core-sse2, svml_s_powf8_core-sse,
	svml_s_sincosf16_core-avx2, svml_s_sincosf4_core-sse2,
	svml_s_sincosf8_core-sse, svml_s_sinf16_core-avx2,
	svml_s_sinf4_core-sse2 and svml_s_sinf8_core-sse.
	* sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h: New file.
	* sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h: Likewise.
	* sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-sse4_1.h: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_log2_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_log4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_log8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cosf16_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cosf4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cosf8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_expf16_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_expf4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_expf8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_logf16_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_logf4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_logf8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_powf16_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_powf4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_powf8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincosf16_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincosf4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincosf8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sinf16_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sinf4_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sinf8_core.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN2v_cos): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVdN4v_cos): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVeN8v_cos): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN2v_exp): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVdN4v_exp): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVeN8v_exp): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_log2_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_log2_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN2v_log): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_log4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_log4_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVdN4v_log): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_log8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_log8_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVeN8v_log): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN2vv_pow): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVdN4vv_pow): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVeN8vv_pow): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN2v_sin): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN4v_sin): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN8v_sin): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN2vvv_sincos): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVdN4vvv_sincos): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVeN8vvv_sincos): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cosf16_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_cosf16_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVeN16v_cosf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cosf4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_cosf4_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN4v_cosf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_cosf8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_cosf8_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVdN8v_cosf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_expf16_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_expf16_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVeN16v_expf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_expf4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_expf4_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN4v_expf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_expf8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_expf8_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVdN8v_expf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_logf16_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_logf16_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVeN16v_logf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_logf4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_logf4_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN4v_logf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_logf8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_logf8_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVdN8v_logf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_powf16_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_powf16_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVeN16vv_powf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_powf4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_powf4_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN4vv_powf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_powf8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_powf8_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVdN8vv_powf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincosf16_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincosf16_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVeN16vvv_sincosf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincosf4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincosf4_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN4vvv_sincosf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincosf8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sincosf8_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVdN8vvv_sincosf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sinf16_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sinf16_core-avx2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVeN16v_sinf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sinf4_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sinf4_core-sse2.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVbN4v_sinf): Removed.
	* sysdeps/x86_64/fpu/multiarch/svml_d_sinf8_core.S:  Renamed to
	...
	* sysdeps/x86_64/fpu/multiarch/svml_d_sinf8_core-sse.S: This.
	Don't include <sysdep.h> nor <init-arch.h>.
	(_ZGVdN8v_sinf): Removed.
2017-08-04 13:03:58 -07:00
H.J. Lu 10a87ca476 x86-64: Implement libm IFUNC selectors in C
* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
	Add s_ceil-sse4_1, s_ceilf-sse4_1, s_floor-sse4_1,
	s_floorf-sse4_1, s_nearbyint-sse4_1, s_nearbyintf-sse4_1,
	s_rint-sse4_1 and s_rintf-sse4_1.
	* sysdeps/x86_64/fpu/multiarch/ifunc-sse4_1.h: New file.
	* sysdeps/x86_64/fpu/multiarch/s_ceil.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_ceilf.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_floor.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_floorf.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_nearbyint.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_rint.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_rintf.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_ceil.S: Renamed to ...
	* sysdeps/x86_64/fpu/multiarch/s_ceil-sse4_1.S: This.  Don't
	include <machine/asm.h> nor <init-arch.h>.  Include <sysdep.h>.
	(__ceil): Removed.
	* sysdeps/x86_64/fpu/multiarch/s_ceilf.S: Renamed to ...
	* sysdeps/x86_64/fpu/multiarch/s_ceilf-sse4_1.S: This.  Don't
	include <machine/asm.h> nor <init-arch.h>.  Include <sysdep.h>.
	(__ceilf): Removed.
	* sysdeps/x86_64/fpu/multiarch/s_floor.S: Renamed to ...
	* sysdeps/x86_64/fpu/multiarch/s_floor-sse4_1.S: This.  Don't
	include <machine/asm.h> nor <init-arch.h>.  Include <sysdep.h>.
	(__floor): Removed.
	* sysdeps/x86_64/fpu/multiarch/s_floorf.S: Renamed to ...
	* sysdeps/x86_64/fpu/multiarch/s_floorf-sse4_1.S: This.  Don't
	include <machine/asm.h> nor <init-arch.h>.  Include <sysdep.h>.
	(__floorf): Removed.
	* sysdeps/x86_64/fpu/multiarch/s_nearbyint.S: Renamed to ...
	* sysdeps/x86_64/fpu/multiarch/s_nearbyint-sse4_1.S: This.  Don't
	include <machine/asm.h> nor <init-arch.h>.  Include <sysdep.h>.
	(__nearbyint): Removed.
	* sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S: Renamed to ...
	* sysdeps/x86_64/fpu/multiarch/s_nearbyintf-sse4_1.S: This.  Don't
	include <machine/asm.h> nor <init-arch.h>.  Include <sysdep.h>.
	(__nearbyintf): Removed.
	* sysdeps/x86_64/fpu/multiarch/s_rint.S: Renamed to ...
	* sysdeps/x86_64/fpu/multiarch/s_rint-sse4_1.S: This.  Don't
	include <machine/asm.h> nor <init-arch.h>.  Include <sysdep.h>.
	(__rint): Removed.
	* sysdeps/x86_64/fpu/multiarch/s_rintf.S: Renamed to ...
	* sysdeps/x86_64/fpu/multiarch/s_rintf-sse4_1.S: This.  Don't
	include <machine/asm.h> nor <init-arch.h>.  Include <sysdep.h>.
	(__rintf): Removed.
2017-08-04 13:02:13 -07:00
H.J. Lu 1e8e527dd9 i386: Support static PIE in start.S
Since start.o may be compiled as PIC, we should check PIC instead of
SHARED.  Also avoid dynamic relocation against main in static PIE since
_start is the entry point before the executable is relocated.

	* sysdeps/i386/start.S (_start): Check Check PIC instead of
	SHARED.  Avoid dynamic relocation against main in static PIE.
2017-08-04 12:59:51 -07:00
H.J. Lu e13daad7ac Compile tst-prelink.c without PIE [BZ #21815]
tst-prelink.c checks for conflict with GLOB_DAT relocation against stdio.
On i386, there is no GLOB_DAT relocation against stdio with PIE.  We
should compile tst-prelink.c without PIE.

	[BZ #21815]
	* elf/Makefile (CFLAGS-tst-prelink.c): New.
	(LDFLAGS-tst-prelink): Likewise.
2017-08-04 12:58:13 -07:00
H.J. Lu 627c69c838 i386: Update I386_USE_SYSENTER for early PIC syscall
Define I386_USE_SYSENTER to 0 or 1 so that special versions of syscalls
with "int $0x80" can be provided for static PIE during self relocation.
Also check PIC instead SHARED for PIC version of syscall macros.

	* sysdeps/unix/sysv/linux/i386/sysdep.h (I386_USE_SYSENTER):
	Define to I386_USE_SYSENTER to 0 or 1 if not defined.
	(ENTER_KERNEL): Check if I386_USE_SYSENTER is 1 and check PIC.
	(INTERNAL_SYSCALL_MAIN_INLINE): Likewise.
	(INTERNAL_SYSCALL_NCS): Likewise.
	(LOADARGS_1): Likewise.
	(LOADARGS_5): Likewise.
	(RESTOREARGS_1): Likewise.
	(RESTOREARGS_5): Likewise.
2017-08-04 12:30:38 -07:00
H.J. Lu fc11ff8d0a x86-64: Use IFUNC memcpy and mempcpy in libc.a
Since apply_irel is called before memcpy and mempcpy are called, we
can use IFUNC memcpy and mempcpy in libc.a.

	* sysdeps/x86_64/memmove.S (MEMCPY_SYMBOL): Don't check SHARED.
	(MEMPCPY_SYMBOL): Likewise.
	* sysdeps/x86_64/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Test memcpy and mempcpy in libc.a.
	* sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: Also include
	in libc.a.
	* sysdeps/x86_64/multiarch/memcpy-ssse3.S: Likewise.
	* sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S:
	Likewise.
	* sysdeps/x86_64/multiarch/memcpy.c: Also include in libc.a.
	(__hidden_ver1): Don't use in libc.a.
	* sysdeps/x86_64/multiarch/memmove-sse2-unaligned-erms.S
	(__mempcpy): Don't create a weak alias in libc.a.
	* sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: Support
	libc.a.
	* sysdeps/x86_64/multiarch/mempcpy.c: Also include in libc.a.
	(__hidden_ver1): Don't use in libc.a.
2017-08-04 12:27:18 -07:00
H.J. Lu 19f1a11e7e Check linker support for INSERT in linker script
Since gold doesn't support INSERT in linker script:

https://sourceware.org/bugzilla/show_bug.cgi?id=21676

tst-split-dynreloc fails to link with gold.  Check if linker supports
INSERT in linker script before using it.

	* config.make.in (have-insert): New.
	* configure.ac (libc_cv_insert): New.  Set to yes if linker
	supports INSERT in linker script.
	(AC_SUBST(libc_cv_insert): New.
	* configure: Regenerated.
	* sysdeps/x86_64/Makefile (tests): Add tst-split-dynreloc only
	if $(have-insert) == yes.
2017-08-04 12:17:30 -07:00
H.J. Lu 3093fd5e5d Run vismain only if linker supports protected data symbol
Gold doesn't support protected data symbol:

configure:5672: checking linker support for protected data symbol
configure:5682: gcc -fuse-ld=gold -nostdlib -nostartfiles -fno-stack-protector -fPIC -shared conftest.c -o conftest.so
configure:5685: $? = 0
configure:5692: gcc -fuse-ld=gold -nostdlib -nostartfiles -fno-stack-protector conftest.c -o conftest conftest.so
/usr/local/bin/ld.gold: error: /tmp/ccXWoofs.o: cannot make copy relocation for protected symbol 'bar', defined in conftest.so
collect2: error: ld returned 1 exit status

Run vismain only if linker supports protected data symbol.

	* elf/Makefile (tests): Add vismain only if
	$(have-protected-data) == yes.
	(tests-pie): Likewise.
2017-08-04 11:47:23 -07:00
H.J. Lu d2cf37c0a2 x86-64: Use _dl_runtime_resolve_opt only with AVX512F [BZ #21871]
On AVX machines with XGETBV (ECX == 1) like Skylake processors,

(gdb) disass _dl_runtime_resolve_avx_opt
Dump of assembler code for function _dl_runtime_resolve_avx_opt:
   0x0000000000015890 <+0>:	push   %rax
   0x0000000000015891 <+1>:	push   %rcx
   0x0000000000015892 <+2>:	push   %rdx
   0x0000000000015893 <+3>:	mov    $0x1,%ecx
   0x0000000000015898 <+8>:	xgetbv
   0x000000000001589b <+11>:	mov    %eax,%r11d
   0x000000000001589e <+14>:	pop    %rdx
   0x000000000001589f <+15>:	pop    %rcx
   0x00000000000158a0 <+16>:	pop    %rax
   0x00000000000158a1 <+17>:	and    $0x4,%r11d
   0x00000000000158a5 <+21>:	bnd je 0x16200 <_dl_runtime_resolve_sse_vex>
End of assembler dump.

is slower than:

(gdb) disass _dl_runtime_resolve_avx_slow
Dump of assembler code for function _dl_runtime_resolve_avx_slow:
   0x0000000000015850 <+0>:	vorpd  %ymm0,%ymm1,%ymm8
   0x0000000000015854 <+4>:	vorpd  %ymm2,%ymm3,%ymm9
   0x0000000000015858 <+8>:	vorpd  %ymm4,%ymm5,%ymm10
   0x000000000001585c <+12>:	vorpd  %ymm6,%ymm7,%ymm11
   0x0000000000015860 <+16>:	vorpd  %ymm8,%ymm9,%ymm9
   0x0000000000015865 <+21>:	vorpd  %ymm10,%ymm11,%ymm10
   0x000000000001586a <+26>:	vpcmpeqd %xmm8,%xmm8,%xmm8
   0x000000000001586f <+31>:	vorpd  %ymm9,%ymm10,%ymm10
   0x0000000000015874 <+36>:	vptest %ymm10,%ymm8
   0x0000000000015879 <+41>:	bnd jae 0x158b0 <_dl_runtime_resolve_avx>
   0x000000000001587c <+44>:	vzeroupper
   0x000000000001587f <+47>:	bnd jmpq 0x16200 <_dl_runtime_resolve_sse_vex>
End of assembler dump.
(gdb)

since xgetbv takes much more cycles than single cycle operations like
vpord/vvpcmpeq/ptest.  _dl_runtime_resolve_opt should be used only with
AVX512 where AVX512 instructions lead to lower CPU frequency on Skylake
server.

	[BZ #21871]
	* sysdeps/x86/cpu-features.c (init_cpu_features): Set
	bit_arch_Use_dl_runtime_resolve_opt only with AVX512F.
2017-08-04 11:14:33 -07:00
H.J. Lu c8a0e6ec03 x86: Remove __memset_zero_constant_len_parameter [BZ #21790]
__memset_zero_constant_len_parameter should be removed by

commit 61062f5630
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Tue Mar 1 00:35:23 2005 +0000

    2005-02-24  Roland McGrath  <roland@redhat.com>

            * debug/Versions (libc: GLIBC_2.4): Remove
            __memset_zero_constant_len_parameter.
            * sysdeps/generic/memset_chk.c: Remove alias and warning.
            * misc/sys/cdefs.h (__warndecl): New macro.
            * debug/warning-nop.c: New file.
            * string/bits/string3.h (memset): Call __warn_memset_zero_len with no
            arguments, instead of calling __memset_zero_constant_len_parameter.
            Use __warndecl for __warn_memset_zero_len.
            * debug/Makefile (routines): Add $(static-only-routines).
            (static-only-routines): New variable.

This patch removes the last emaining pieces of it.  Tested it on i586,
i686 and x86-64.

	[BZ #21790]
	* sysdeps/i386/i586/memset.S
	(__memset_zero_constant_len_parameter): Removed.
	* sysdeps/i386/i686/memset.S
	(__memset_zero_constant_len_parameter): Likewise.
	* sysdeps/i386/i686/multiarch/memset_chk.S
	(__memset_zero_constant_len_parameter): Likewise.
	* sysdeps/x86_64/memset.S (__memset_zero_constant_len_parameter):
	Likewise.
2017-08-04 10:56:51 -07:00
Aurelien Jarno 2b34e2716f Fix the return type of the getentropy stub
The return type of the getentropy stub is wrongly defined as ssize_t,
while both the <sys/random.h> header and the Linux implementation
define it as int. This patch fixes that.

Changelog:
	* stdlib/getentropy.c (getentropy): Change return type to int.
2017-08-03 22:35:48 +00:00
Aurelien Jarno 144bdab050 i686/multiarch: Regenerate ulps
This comes from running “make regen-ulps” on an AMD Opteron 2378 CPU.

Changelog:
	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Regenerated.
2017-08-03 22:33:19 +00:00
Joseph Myers 24ab7723b8 Consistently use uintN_t not u_intN_t in libm.
This patch changes libm code to make consistent use of C99 uintN_t
types instead of sometimes using those and sometimes using the older
nonstandard u_intN_t names.  This makes sense as a cleanup in its own
right, and also facilitates merges to GCC's libquadmath (which gets
the types from stdint.h and so may not have u_intN_t available at
all).

Tested for x86_64, and with build-many-glibcs.py.

	* math/s_nextafter.c (__nextafter): Use uintN_t instead of
	u_intN_t.
	* math/s_nexttowardf.c (__nexttowardf): Likewise.
	* sysdeps/generic/math_private.h (ieee_double_shape_type):
	Likewise.
	(ieee_float_shape_type): Likewise.
	* sysdeps/i386/fpu/s_fpclassifyl.c (__fpclassifyl): Likewise.
	* sysdeps/i386/fpu/s_isnanl.c (__isnanl): Likewise.
	* sysdeps/i386/fpu/s_nextafterl.c (__nextafterl): Likewise.
	* sysdeps/i386/fpu/s_nexttoward.c (__nexttoward): Likewise.
	* sysdeps/i386/fpu/s_nexttowardf.c (__nexttowardf): Likewise.
	* sysdeps/ieee754/dbl-64/e_acosh.c (__ieee754_acosh): Likewise.
	* sysdeps/ieee754/dbl-64/e_cosh.c (__ieee754_cosh): Likewise.
	* sysdeps/ieee754/dbl-64/e_fmod.c (__ieee754_fmod): Likewise.
	* sysdeps/ieee754/dbl-64/e_gamma_r.c (__ieee754_gamma_r):
	Likewise.
	* sysdeps/ieee754/dbl-64/e_hypot.c (__ieee754_hypot): Likewise.
	* sysdeps/ieee754/dbl-64/e_jn.c (__ieee754_jn): Likewise.
	(__ieee754_yn): Likewise.
	* sysdeps/ieee754/dbl-64/e_log10.c (__ieee754_log10): Likewise.
	* sysdeps/ieee754/dbl-64/e_log2.c (__ieee754_log2): Likewise.
	* sysdeps/ieee754/dbl-64/e_rem_pio2.c (__ieee754_rem_pio2):
	Likewise.
	* sysdeps/ieee754/dbl-64/e_sinh.c (__ieee754_sinh): Likewise.
	* sysdeps/ieee754/dbl-64/s_ceil.c (__ceil): Likewise.
	* sysdeps/ieee754/dbl-64/s_copysign.c (__copysign): Likewise.
	* sysdeps/ieee754/dbl-64/s_erf.c (__erf): Likewise.
	(__erfc): Likewise.
	* sysdeps/ieee754/dbl-64/s_expm1.c (__expm1): Likewise.
	* sysdeps/ieee754/dbl-64/s_finite.c (FINITE): Likewise.
	* sysdeps/ieee754/dbl-64/s_floor.c (__floor): Likewise.
	* sysdeps/ieee754/dbl-64/s_fpclassify.c (__fpclassify): Likewise.
	* sysdeps/ieee754/dbl-64/s_isnan.c (__isnan): Likewise.
	* sysdeps/ieee754/dbl-64/s_issignaling.c (__issignaling):
	Likewise.
	* sysdeps/ieee754/dbl-64/s_llrint.c (__llrint): Likewise.
	* sysdeps/ieee754/dbl-64/s_llround.c (__llround): Likewise.
	* sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Likewise.
	* sysdeps/ieee754/dbl-64/s_lround.c (__lround): Likewise.
	* sysdeps/ieee754/dbl-64/s_modf.c (__modf): Likewise.
	* sysdeps/ieee754/dbl-64/s_nextup.c (__nextup): Likewise.
	* sysdeps/ieee754/dbl-64/s_remquo.c (__remquo): Likewise.
	* sysdeps/ieee754/dbl-64/s_round.c (__round): Likewise.
	* sysdeps/ieee754/dbl-64/s_trunc.c (__trunc): Likewise.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c
	(__issignaling): Likewise.
	* sysdeps/ieee754/flt-32/e_atan2f.c (__ieee754_atan2f): Likewise.
	* sysdeps/ieee754/flt-32/e_fmodf.c (__ieee754_fmodf): Likewise.
	* sysdeps/ieee754/flt-32/e_gammaf_r.c (__ieee754_gammaf_r):
	Likewise.
	* sysdeps/ieee754/flt-32/e_jnf.c (__ieee754_ynf): Likewise.
	* sysdeps/ieee754/flt-32/e_log10f.c (__ieee754_log10f): Likewise.
	* sysdeps/ieee754/flt-32/e_powf.c (__ieee754_powf): Likewise.
	* sysdeps/ieee754/flt-32/e_rem_pio2f.c (__ieee754_rem_pio2f):
	Likewise.
	* sysdeps/ieee754/flt-32/e_remainderf.c (__ieee754_remainderf):
	Likewise.
	* sysdeps/ieee754/flt-32/e_sqrtf.c (__ieee754_sqrtf): Likewise.
	* sysdeps/ieee754/flt-32/s_ceilf.c (__ceilf): Likewise.
	* sysdeps/ieee754/flt-32/s_copysignf.c (__copysignf): Likewise.
	* sysdeps/ieee754/flt-32/s_erff.c (__erff): Likewise.
	(__erfcf): Likewise.
	* sysdeps/ieee754/flt-32/s_expm1f.c (__expm1f): Likewise.
	* sysdeps/ieee754/flt-32/s_finitef.c (FINITEF): Likewise.
	* sysdeps/ieee754/flt-32/s_floorf.c (__floorf): Likewise.
	* sysdeps/ieee754/flt-32/s_fpclassifyf.c (__fpclassifyf):
	Likewise.
	* sysdeps/ieee754/flt-32/s_isnanf.c (__isnanf): Likewise.
	* sysdeps/ieee754/flt-32/s_issignalingf.c (__issignalingf):
	Likewise.
	* sysdeps/ieee754/flt-32/s_llrintf.c (__llrintf): Likewise.
	* sysdeps/ieee754/flt-32/s_llroundf.c (__llroundf): Likewise.
	* sysdeps/ieee754/flt-32/s_lrintf.c (__lrintf): Likewise.
	* sysdeps/ieee754/flt-32/s_lroundf.c (__lroundf): Likewise.
	* sysdeps/ieee754/flt-32/s_modff.c (__modff): Likewise.
	* sysdeps/ieee754/flt-32/s_remquof.c (__remquof): Likewise.
	* sysdeps/ieee754/flt-32/s_roundf.c (__roundf): Likewise.
	* sysdeps/ieee754/ldbl-128/e_acoshl.c (__ieee754_acoshl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/e_atan2l.c (__ieee754_atan2l):
	Likewise.
	* sysdeps/ieee754/ldbl-128/e_atanhl.c (__ieee754_atanhl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/e_fmodl.c (__ieee754_fmodl): Likewise.
	* sysdeps/ieee754/ldbl-128/e_gammal_r.c (__ieee754_gammal_r):
	Likewise.
	* sysdeps/ieee754/ldbl-128/e_hypotl.c (__ieee754_hypotl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/e_jnl.c (__ieee754_jnl): Likewise.
	(__ieee754_ynl): Likewise.
	* sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Likewise.
	* sysdeps/ieee754/ldbl-128/e_rem_pio2l.c (__ieee754_rem_pio2l):
	Likewise.
	* sysdeps/ieee754/ldbl-128/e_remainderl.c (__ieee754_remainderl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/e_sinhl.c (__ieee754_sinhl): Likewise.
	* sysdeps/ieee754/ldbl-128/k_cosl.c (__kernel_cosl): Likewise.
	* sysdeps/ieee754/ldbl-128/k_sincosl.c (__kernel_sincosl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/k_sinl.c (__kernel_sinl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_ceill.c (__ceill): Likewise.
	* sysdeps/ieee754/ldbl-128/s_copysignl.c (__copysignl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_erfl.c (__erfcl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_fabsl.c (__fabsl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_finitel.c (__finitel): Likewise.
	* sysdeps/ieee754/ldbl-128/s_floorl.c (__floorl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_fpclassifyl.c (__fpclassifyl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_frexpl.c (__frexpl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_isnanl.c (__isnanl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_issignalingl.c (__issignalingl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_llrintl.c (__llrintl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_llroundl.c (__llroundl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_lrintl.c (__lrintl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_lroundl.c (__lroundl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_modfl.c (__modfl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_nearbyintl.c (__nearbyintl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_nextafterl.c (__nextafterl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_nexttoward.c (__nexttoward):
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_nexttowardf.c (__nexttowardf):
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_nextupl.c (__nextupl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_remquol.c (__remquol): Likewise.
	* sysdeps/ieee754/ldbl-128/s_rintl.c (__rintl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_roundl.c (__roundl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_tanhl.c (__tanhl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_truncl.c (__truncl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_fmodl.c (__ieee754_fmodl):
	Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c (__ieee754_gammal_r):
	Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c (__ieee754_rem_pio2l):
	Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
	(__ieee754_remainderl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/k_cosl.c (__kernel_cosl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/k_sinl.c (__kernel_sinl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fabsl.c (__fabsl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c (___fpclassifyl):
	Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_modfl.c (__modfl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c (__nexttowardf):
	Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_remquol.c (__remquol): Likewise.
	* sysdeps/ieee754/ldbl-96/e_acoshl.c (__ieee754_acoshl): Likewise.
	* sysdeps/ieee754/ldbl-96/e_asinl.c (__ieee754_asinl): Likewise.
	* sysdeps/ieee754/ldbl-96/e_atanhl.c (__ieee754_atanhl): Likewise.
	* sysdeps/ieee754/ldbl-96/e_coshl.c (__ieee754_coshl): Likewise.
	* sysdeps/ieee754/ldbl-96/e_gammal_r.c (__ieee754_gammal_r):
	Likewise.
	* sysdeps/ieee754/ldbl-96/e_hypotl.c (__ieee754_hypotl): Likewise.
	* sysdeps/ieee754/ldbl-96/e_j0l.c (__ieee754_j0l): Likewise.
	(__ieee754_y0l): Likewise.
	(pzero): Likewise.
	(qzero): Likewise.
	* sysdeps/ieee754/ldbl-96/e_j1l.c (__ieee754_j1l): Likewise.
	(__ieee754_y1l): Likewise.
	(pone): Likewise.
	(qone): Likewise.
	* sysdeps/ieee754/ldbl-96/e_jnl.c (__ieee754_jnl): Likewise.
	(__ieee754_ynl): Likewise.
	* sysdeps/ieee754/ldbl-96/e_lgammal_r.c (sin_pi): Likewise.
	(__ieee754_lgammal_r): Likewise.
	* sysdeps/ieee754/ldbl-96/e_rem_pio2l.c (__ieee754_rem_pio2l):
	Likewise.
	* sysdeps/ieee754/ldbl-96/e_sinhl.c (__ieee754_sinhl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_copysignl.c (__copysignl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_erfl.c (__erfl): Likewise.
	(__erfcl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_frexpl.c (__frexpl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_issignalingl.c (__issignalingl):
	Likewise.
	* sysdeps/ieee754/ldbl-96/s_llrintl.c (__llrintl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_llroundl.c (__llroundl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_lrintl.c (__lrintl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_lroundl.c (__lroundl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_modfl.c (__modfl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_nexttoward.c (__nexttoward): Likewise.
	* sysdeps/ieee754/ldbl-96/s_nexttowardf.c (__nexttowardf):
	Likewise.
	* sysdeps/ieee754/ldbl-96/s_nextupl.c (__nextupl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_remquol.c (__remquol): Likewise.
	* sysdeps/ieee754/ldbl-96/s_roundl.c (__roundl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_tanhl.c (__tanhl): Likewise.
	* sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c (__nldbl_nexttowardf):
	Likewise.
	* sysdeps/m68k/m680x0/fpu/e_pow.c (s(__ieee754_pow)): Likewise.
	* sysdeps/m68k/m680x0/fpu/s_fpclassifyl.c (__fpclassifyl):
	Likewise.
	* sysdeps/m68k/m680x0/fpu/s_llrint.c (__llrint): Likewise.
	* sysdeps/m68k/m680x0/fpu/s_llrintf.c (__llrintf): Likewise.
	* sysdeps/m68k/m680x0/fpu/s_llrintl.c (__llrintl): Likewise.
	* sysdeps/m68k/m680x0/fpu/s_nextafterl.c (__nextafterl): Likewise.
	* sysdeps/x86/fpu/powl_helper.c (__powl_helper): Likewise.
2017-08-03 19:55:04 +00:00
Florian Weimer 964263bb8d getaddrinfo: Release resolver context on error in gethosts [BZ #21885] 2017-08-03 12:33:00 +02:00
Alan Modra e98c925fa4 tst-tlsopt-powerpc as a shared lib
This makes the __tls_get_addr_opt test run as a shared library, and so
actually test that DTPMOD64/DTPREL64 pairs are processed by ld.so to
support the __tls_get_adfr_opt call stub fast return.  After a
2017-01-24 patch (binutils f0158f4416) ld.bfd no longer emitted
unnecessary dynamic relocations against local thread variables,
instead setting up the __tls_index GOT entries for the call stub fast
return.  This meant tst-tlsopt-powerpc passed but did not check ld.so
relocation support.  After a 2017-07-16 patch (binutils 676ee2b5fa)
ld.bfd no longer set up the __tls_index GOT entries for the call stub
fast return, and tst-tlsopt-powerpc failed.

Compiling mod-tlsopt-powerpc.c with -DSHARED exposed a bug in
powerpc64/tls-macros.h, which defines a __TLS_GET_ADDR macro that
clashes with one defined in dl-tls.h.  The tls-macros.h version is
only used in that file, so delete it and expand.

	* sysdeps/powerpc/mod-tlsopt-powerpc.c: Extract from
	tst-tlsopt-powerpc.c with function name change and no test harness.
	* sysdeps/powerpc/tst-tlsopt-powerpc.c: Remove body of test.
	Call tls_get_addr_opt_test.
	* sysdeps/powerpc/Makefile (LDFLAGS-tst-tlsopt-powerpc): Don't define.
	(modules-names): Add mod-tlsopt-powerpc.
	(mod-tlsopt-powerpc.so-no-z-defs): Define.
	(tst-tlsopt-powerpc): Depend on .so.
	* sysdeps/powerpc/powerpc64/tls-macros.h (__TLS_GET_ADDR): Don't
	define.  Expand use in TLS_GD and TLS_LD.
2017-08-03 15:39:21 +09:30
Samuel Thibault 3da5756ee8 Add missing include for pthread_setcancelstate
* sysdeps/posix/shm_open.c: Include <pthread.h>.
2017-08-03 00:30:22 +02:00
Samuel Thibault 8ee1abdb4b [hurd]: Add __libc_init_secure stub
csu/libc-start.c now insists on calling __libc_init_secure, while the Hurd
port already implements it "very early" in dl-sysdep.c and init-first.c

	* sysdeps/mach/hurd/enbl-secure.c (__libc_init_secure): Define
	function.
2017-08-02 23:29:57 +02:00
Joseph Myers 42df8d5921 Fix tgmath.h for __int128 (bug 21686).
When a tgmath.h macro is passed a double argument and an argument of
type __int128, it generates a call to a long double function (although
the result still gets converted to type double).  __int128 is similar
enough to integer types that it should be handled consistently like
them, so always like double for these macros rather than sometimes
like double and sometimes like long double.  This patch fixes the
logic accordingly and makes gen-tgmath-tests.py generate tests for
__int128.

Tested for x86_64 and x86.

	[BZ #21686]
	* math/tgmath.h (__TGMATH_BINARY_REAL_ONLY): Add arguments before
	comparing size with that of double.
	(__TGMATH_BINARY_REAL_STD_ONLY): Likewise.
	(__TGMATH_BINARY_REAL_RET_ONLY): Likewise.
	(__TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY): Likewise.
	(__TGMATH_TERNARY_REAL_ONLY): Likewise.
	(__TGMATH_BINARY_REAL_IMAG): Likewise.
	* math/gen-tgmath-tests.py (Type.init_types): Create __int128 and
	unsigned __int128 types.
2017-08-02 20:16:05 +00:00
Steve Ellcey b7f95f493b Remove CFLAG settings that turn off warning (no longer needed).
2017-08-02  Steve Ellcey  <sellcey@cavium.com>

	* localedata/Makefile (CFLAGS-tst_iswalnum.c, CFLAGS-tst_iswalpha.c
	CFLAGS-tst_iswcntrl.c, CFLAGS-tst_iswdigit.c, CFLAGS-tst_iswgraph.c,
	CFLAGS-tst_iswlower.c, CFLAGS-tst_iswprint.c, CFLAGS-tst_iswpunct.c,
	CFLAGS-tst_iswspace.c, CFLAGS-tst_iswupper.c, CFLAGS-tst_iswxdigit.c,
	CFLAGS-tst_towlower.c, CFLAGS-tst_towupper.c): Remove.
2017-08-02 12:57:58 -07:00
H.J. Lu 5b736bc9b5 x86-64: Check PIC instead of SHARED in start.S
Since start.o may be compiled as PIC, we should check PIC instead of
SHARED.

	* sysdeps/x86_64/start.S (_start): Check PIC instead of SHARED.
2017-08-02 10:27:34 -07:00
H.J. Lu dfc93c41ee i386: Check PIC to enable PIC setups in multiarch functions
Check PIC, instead of SHARED, to enable PIC setups.

	* sysdeps/i386/i686/multiarch/memcmp-sse4.S: Check PIC instead
	of SHARED.
	* sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy-ssse3.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset-sse2-rep.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcat-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcpy-sse2.S: Likewise.
2017-08-02 10:25:25 -07:00
Joseph Myers 2fee621de0 Fix tgmath.h for bit-fields (bug 21685).
The tgmath.h macros produce errors for bit-field arguments, because
they apply sizeof and typeof to the arguments.  This patch fixes them
to use unary + systematically before using sizeof or typeof on
arguments that might be bit-fields (note that __real__ of a bit-field
is still a bit-field for this purpose, since it's an lvalue).
gen-tgmath-tests.py is extended to add tests for this case.

Tested for x86_64.

	[BZ #21685]
	* math/tgmath.h (__tgmath_real_type): Use unary + on potentially
	bit-field expressions passed to sizeof or typeof.
	[__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(__TGMATH_F128): Likewise.
	[__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(__TGMATH_CF128): Likewise.
	(__TGMATH_UNARY_REAL_ONLY): Likewise.
	(__TGMATH_UNARY_REAL_RET_ONLY): Likewise.
	(__TGMATH_BINARY_FIRST_REAL_ONLY): Likewise.
	(__TGMATH_BINARY_FIRST_REAL_STD_ONLY): Likewise.
	(__TGMATH_BINARY_REAL_ONLY): Likewise.
	(__TGMATH_BINARY_REAL_STD_ONLY): Likewise.
	(__TGMATH_BINARY_REAL_RET_ONLY): Likewise.
	(__TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY): Likewise.
	(__TGMATH_TERNARY_REAL_ONLY): Likewise.
	(__TGMATH_TERNARY_FIRST_REAL_RET_ONLY): Likewise.
	(__TGMATH_UNARY_REAL_IMAG): Likewise.
	(__TGMATH_UNARY_IMAG): Likewise.
	(__TGMATH_UNARY_REAL_IMAG_RET_REAL): Likewise.
	(__TGMATH_BINARY_REAL_IMAG): Likewise.
	* math/gen-tgmath-tests.py (Type.init_types): Create bit_field
	type.
	(define_vars_for_type): Handle bit_field type specially.
	(Tests.__init__): Declare structure with bit-field element.
2017-08-02 16:09:01 +00:00
H.J. Lu b358255f95 i386: Don't define multiarch __memmove_chk in libc.a [BZ #21791]
There is no need to define multiarch __memmove_chk in libc.a since they
aren't used at all.

	[BZ #21791]
	* sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
	(MEMCPY_CHK): Define only if SHARED is defined.
	* sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S (MEMCPY_CHK):
	Likewise.
	* sysdeps/i386/i686/multiarch/memcpy-ssse3.S (MEMCPY_CHK):
	Likewise.
2017-08-02 08:34:34 -07:00
Siddhesh Poyarekar edf66db113 Rotate ChangeLog correctly
I incorrectly assumed that the ChangeLog numbers (.1, .2, etc.) are in
order.  They're not and the latest non-current ChangeLog is the one
with the highest number.  Fixed.
2017-08-02 20:57:34 +05:30
Siddhesh Poyarekar 92c3af3c14 Rotate ChangeLog 2017-08-02 20:45:20 +05:30
Siddhesh Poyarekar 00cdcf5a41 Open master for development 2017-08-02 19:23:16 +05:30
Siddhesh Poyarekar 1c9a5c270d Update for 2.26 release 2017-08-02 18:27:16 +05:30
Siddhesh Poyarekar 15192aaa25 Update contributors and latest gcc and binutils versions 2017-08-02 18:22:58 +05:30
Siddhesh Poyarekar 4d9a5c60e1 Fix up ChangeLog formatting 2017-08-02 13:34:13 +05:30
Siddhesh Poyarekar e061bd1771 Add list of bugs fixed in 2.26 2017-08-02 08:26:45 +05:30
Siddhesh Poyarekar 9938cc545d Update translations 2017-08-02 08:07:58 +05:30
Siddhesh Poyarekar e1113af30d Update NEWS 2017-08-02 08:07:16 +05:30
Siddhesh Poyarekar 930324b356 Update translations 2017-07-31 00:13:08 +05:30
Carlos O'Donell 5920a4a624 mutex: Fix robust mutex lock acquire (Bug 21778)
65810f0ef0 fixed a robust mutex bug but
introduced BZ 21778: if the CAS used to try to acquire a lock fails, the
expected value is not updated, which breaks other cases in the loce
acquisition loop.  The fix is to simply update the expected value with
the value returned by the CAS, which ensures that behavior is as if the
first case with the CAS never happened (if the CAS fails).

This is a regression introduced in the last release.

Tested on x86_64, i686, ppc64, ppc64le, s390x, aarch64, armv7hl.
2017-07-29 00:02:03 -04:00
Nathan Rossi d95fcb2df4 microblaze: Resolve non-relocatable branch in pt-vfork.S (BZ#21779)
The relative branch directly to __libc_vfork results in an relocation
that cannot be resolved. Specifically a R_MICROBLAZE_64_PCREL relocation
is created for this branch, however for MicroBlaze R_MICROBLAZE_64_PCREL
type relocations symbols are not resolved. Additionally due to the
branch being located in the .text section the instruction cannot be
rewritten as the section is not writable, and causes a segfault at
runtime when loading libpthread.

To resolve this issue, ensure the branch is done using PLT. This removes
the need to modify the instruction and trades the R_MICROBLAZE_64_PCREL
for a more common R_MICROBLAZE_JUMP via the PLT.

	[BZ #21779]
	* sysdeps/unix/sysv/linux/microblaze/pt-vfork.S: Branch using PLT.
2017-07-28 09:21:14 -03:00
Nathan Rossi 0aab054a92 Update Microblaze libm-test-ulps
* sysdeps/microblaze/libm-test-ulps: Update.
2017-07-28 09:19:40 -03:00
Chung-Lin Tang d4550bd002 Update Nios II ULPs file. 2017-07-28 03:54:35 -07:00
Carlos O'Donell faf8c066df rwlock: Fix explicit hand-over (bug 21298)
Without this fix, the rwlock can fail to execute the explicit hand-over
in certain cases (e.g., empty critical sections that switch quickly between
read and write phases).  This can then lead to errors in how __wrphase_futex
is accessed, which in turn can lead to deadlocks.
2017-07-28 00:23:58 -04:00
Adhemerval Zanella 2557ae38f3 Update Alpha libm-test-ulps
* sysdeps/alpha/fpu/libm-test-ulps: Update.
2017-07-27 14:21:28 -03:00
Mike FABIAN c5527d7ddc Minor improvements to new az_IR locale
* locales/az_IR (LC_MESSAGES): Improve yesexpr and noexpr.
	* locales/az_IR (LC_ADDRESS): Fix typo in comment  and
	use the individual iso-639-3 code for South Azerbaijani
	"azb" in lang_term.
	* locales/az_IR (LC_NAME): Improve readability of name_fmt in source.
2017-07-27 16:11:04 +02:00
Rical Jasan d3675d957b manual: Refactor documentation of CHAR_BIT.
This single-@item @table is better defined with @deftypevr, since the
CHAR_BIT macro has @standards (being declared in a header), and @items
in @tables are not considered annotatable.  Using @deftypevr
automatically includes the macro in the Variable and Constant Macro
Index and ensures its inclusion the Summary of Library Facilities.
@deftypevr is used to record the type of the macro so that it also
appears in the Summary.

The description is updated to mention a later POSIX requirement that
this macro have the value 8.

	* manual/lang.texi (CHAR_BIT): Convert from an @table to an
	@deftypevr.  Change standard from ISO to C90.  Mention the
	POSIX.1-2001 requirement of the value 8.
2017-07-27 04:47:42 -07:00
Rical Jasan 88f9e73943 manual: Complete @standards in creature.texi.
* manual/creature.texi (_REENTRANT): Annotate as obsolete.
	(_THREAD_SAFE): Likewise.
2017-07-27 03:21:56 -07:00
Siddhesh Poyarekar a352570d6b Update translations
* po/bg.po: Update translations.
       * po/cs.po: Likewise.
       * po/de.po: Likewise.
       * po/pl.po: Likewise.
       * po/uk.po: Likewise.
       * po/vi.po: Likewise.
2017-07-26 18:27:41 +05:30
Mike FABIAN 0aa573a44d Add [BZ #21828] to ChangeLog 2017-07-26 08:20:20 +02:00
Mike FABIAN a0e5259830 Mention in NEWS that the Unicode 10.0.0 update causes user visible changes 2017-07-26 08:17:23 +02:00
Siddhesh Poyarekar f4ecd7ddc7 sv: Update translation 2017-07-26 07:09:50 +05:30
Siddhesh Poyarekar 94955362dd zic: Use PRIdMAX to print line numbers
The PRIdLINENUM abstraction is unnecessary and breaks libc.pot
generation.

	* timezone.zic (PRIdLINENO): Remove.
	(verror): Use PRIdMAX.
	* po/libc.pot: Regenerate.
2017-07-25 12:34:14 +05:30
Adhemerval Zanella 95a7339258 tunables: Use direct syscall for access (BZ#21744)
The function maybe_enable_malloc_check, which is called by
__tunables_init, calls __access_noerrno.  It isn't problem when
symbol is is in ld.so, which has a special version of __access_noerrno
without stack protector.  But when glibc is built with stack protector,
maybe_enable_malloc_check in libc.a can't call the regular version of
__access_noerrno with stack protector.

This patch changes how Linux defines the __access_noerrno to be an
inline call instead and thus preventing defining different build
rules for ld/static and shared.

	H.J. Lu  <hongjiu.lu@intel.com>
	Adhemerval Zanella  <adhemerval.zanella@linaro.org>

	[BZ #21744]
	* elf/dl-tunables.c: Include not-errno.h header.
	* include/unistd.h (__access_noerrno): Remove definition.
	* sysdeps/unix/sysv/linux/access.c (__access_noerrno): Likewise.
	* sysdeps/generic/not-errno.h: New file.
	* sysdeps/unix/sysv/linux/not-errno.h: Likewise.
2017-07-24 11:21:07 -03:00
H.J. Lu 422ff87c24 Avoid accessing corrupted stack from __stack_chk_fail [BZ #21752]
__libc_argv[0] points to address on stack and __libc_secure_getenv
accesses environment variables which are on stack.  We should avoid
accessing stack when stack is corrupted.

This patch also renames function argument in __fortify_fail_abort
from do_backtrace to need_backtrace to avoid confusion with do_backtrace
from enum __libc_message_action.

	[BZ #21752]
	* debug/fortify_fail.c (__fortify_fail_abort): Don't pass down
	__libc_argv[0] if we aren't doing backtrace.  Rename do_backtrace
	to need_backtrace.
	* sysdeps/posix/libc_fatal.c (__libc_message): Don't call
	__libc_secure_getenv if we aren't doing backtrace.
2017-07-24 06:06:24 -07:00
Andreas Schwab 55703fcace Remove extra semicolons in struct pthread_mutex (bug 21804) 2017-07-24 12:22:05 +02:00
Dmitry V. Levin cab91f947a S390: fix sys/ptrace.h to make it includible again after asm/ptrace.h
sys/ptrace.h on S390 used to be includible both before and after
asm/ptrace.h, until commit b08a6a0dea
among other changes introduced PTRACE_SINGLEBLOCK enum constant which
is also defined in asm/ptrace.h as a macro, making sys/ptrace.h fail
to compile when included after asm/ptrace.h.

* sysdeps/unix/sysv/linux/s390/sys/ptrace.h [_LINUX_PTRACE_H ||
_S390_PTRACE_H]: Undefine all PTRACE_* macro constants defined
later as enum constants, except PTRACE_PEEKUSER, PTRACE_POKEUSER,
and PTRACE_SEIZE_DEVEL that are not defined by Linux headers.
2017-07-23 23:22:53 +00:00
John David Anglin 64a1daed18 [BZ 19170]
Revise comment in sysdeps/hppa/dl-trampoline.S
2017-07-23 12:50:44 -04:00
DJ Delorie 1740441b49 Correct nss/tst-nss-test5 configuration
The configuration was cloned from test4, but test5 does not
have data for a second module.
2017-07-21 19:50:21 -04:00
Steve Ellcey 6259e62c02 Fix localedata test builds with latest GCC
* localedata/Makefile (CFLAGS-tst_iswalnum.c, CFLAGS-tst_iswalpha.c
	CFLAGS-tst_iswcntrl.c, CFLAGS-tst_iswdigit.c, CFLAGS-tst_iswgraph.c,
	CFLAGS-tst_iswlower.c, CFLAGS-tst_iswprint.c, CFLAGS-tst_iswpunct.c,
	CFLAGS-tst_iswspace.c, CFLAGS-tst_iswupper.c, CFLAGS-tst_iswxdigit.c,
	CFLAGS-tst_towlower.c, CFLAGS-tst_towupper.c): New macros.
2017-07-21 10:33:30 -07:00
Steve Ellcey cb62108e74 Fix nss/nss_test1.c compile with latest GCC.
* nss/nss_test1.c (default_npwd_data): Fix definition.
2017-07-21 09:56:13 -07:00
Steve Ellcey a4c9be1b8b Fix cexpl when compiled with latest GCC
* sysdeps/ieee754/ldbl-128/e_expl.c (__ieee754_expl): Call
	math_force_eval.
2017-07-21 09:47:57 -07:00
Adhemerval Zanella ee8c6cc5f9 Update sparc ulps
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2017-07-19 15:56:02 -03:00
Adhemerval Zanella d500130f31 alpha: Fix clone exit syscall argument passing (BZ#21512)
This patch fixes the argument passing for exit syscall after
the clone function returns on hppa.  This fixes misc/tst-clone2
on alpha-linux-gnu.

Checked misc/tst-clone2 on alpha-linux-gnu.

	[BZ #21512]
	* sysdeps/unix/sysv/linux/alpha/clone.S (__clone): Fix argument
	passing to syscall exit.
2017-07-19 14:24:43 -03:00
DJ Delorie f8cef4d07d Fix cast-after-dereference
Original code was dereferencing a char*, then casting the value
to size_t.  Should cast the pointer to size_t* then deference.
2017-07-19 13:17:03 -04:00
H.J. Lu 47f2739659 i386: Test memmove_chk and memset_chk only in libc.so [BZ #21741]
Since there are no multiarch versions of memmove_chk and memset_chk,
test multiarch versions of memmove_chk and memset_chk only in libc.so.

	[BZ #21741]
	* sysdeps/i386/i686/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Test memmove_chk and memset_chk only
	in libc.so.
2017-07-19 08:39:18 -07:00
H.J. Lu 2b4fca86d7 Don't add stack_chk_fail_local.o to libc.a [BZ #21740]
commit 524a8ef2ad
Author: Nick Alcock <nick.alcock@oracle.com>
Date:   Mon Dec 26 10:08:57 2016 +0100

    PLT avoidance for __stack_chk_fail [BZ #7065]

    Add a hidden __stack_chk_fail_local alias to libc.so,
    and make sure that on targets which use __stack_chk_fail,
    this does not introduce a local PLT reference into libc.so.

which unconditionally added

strong_alias (__stack_chk_fail, __stack_chk_fail_local)

defines __stack_chk_fail_local as an alias of __stack_chk_fail in libc.a.
There is no need to add stack_chk_fail_local.o to libc.a.  We only need
to add stack_chk_fail_local.oS to libc_nonshared.a.

Tested on x86-64:

[hjl@gnu-skl-1 build-x86_64-linux]$ nm libc.a | grep __stack_chk_fail
0000000000000000 T __stack_chk_fail
0000000000000000 T __stack_chk_fail_local
[hjl@gnu-skl-1 build-x86_64-linux]$ nm libc_nonshared.a | grep __stack_chk_fail_local
0000000000000000 T __stack_chk_fail_local
[hjl@gnu-skl-1 build-x86_64-linux]$

	[BZ #21740]
	* debug/Makefile (elide-routines.o): New.
2017-07-19 08:21:46 -07:00
Szabolcs Nagy 82e0660050 [AArch64] Update dl-procinfo for new HWCAP flags in Linux 4.12
Follow up to commit 512d245bc3.

	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c:
	(_dl_aarch64_cap_flags): Update.
	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
	(_DL_HWCAP_COUNT, _DL_HWCAP_LAST): Update.
2017-07-19 13:50:23 +01:00
Szabolcs Nagy 00d7a37773 [AArch64] Fix out of bound array access regression
Partially revert ea01a4da21
"aarch64: Add hwcap string routines" because _dl_procinfo cannot
be future proof and avoid oob access in _dl_hwcap_string.
2017-07-18 10:34:20 +01:00
Tulio Magno Quites Machado Filho 91ac3a7d84 powerpc: Fix float128 IFUNC relocations [BZ #21707]
The patch proposed by Peter Bergner [1] to libgcc in order to fix
[BZ #21707] adds a dependency on a symbol provided by the loader,
forcing the loader to be linked to tests after libgcc was linked.

It also requires to read the thread pointer during IRELA relocations.

Tested on powerpc, powerpc64, powerpc64le, s390x and x86_64.

[1] https://sourceware.org/ml/libc-alpha/2017-06/msg01383.html

	[BZ #21707]
	* csu/libc-start.c (LIBC_START_MAIN): Perform IREL{,A}
	relocations before or after initializing the TCB on statically
	linked executables.  That's a per-architecture definition.
	* elf/rtld.c (dl_main): Add a comment about thread-local
	variables initialization.
	* sysdeps/generic/libc-start.h: New file.  Define
	ARCH_APPLY_IREL and ARCH_SETUP_IREL.
	* sysdeps/powerpc/Makefile:
	[$(subdir) = elf && $(multi-arch) != no] (tests-static-internal): Add tst-tlsifunc-static.
	[$(subdir) = elf && $(multi-arch) != no && $(build-shared) == yes]
	(tests-internal): Add tst-tlsifunc.
	* sysdeps/powerpc/tst-tlsifunc.c: New file.
	* sysdeps/powerpc/tst-tlsifunc-static.c: Likewise.
	* sysdeps/powerpc/powerpc64le/Makefile (f128-loader-link): New
	variable.
	[$(subdir) = math] (test-float128% test-ifloat128%): Force
	linking to the loader after linking to libgcc.
	[$(subdir) = wcsmbs || $(subdir) = stdlib] (bug-strtod bug-strtod2)
	(bug-strtod2 tst-strtod-round tst-wcstod-round tst-strtod6 tst-strrom)
	(tst-strfrom-locale strfrom-skeleton): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/libc-start.h: New file.  Define
	ARCH_APPLY_IREL and ARCH_SETUP_IREL.
2017-07-17 17:49:26 -03:00
DJ Delorie ae5c498d93 Extend NSS test suite
* nss/nss_test.h: New.
* nss/nss_test1.h: Rewrite to use test-provided data.  Add group
tests.  Parameterize to allow multiple instances.
* nss/nss_test2.h: New.  Second instance.
* nss/nss_test.ver: New.
* nss/nss_test1.c: Update to use new framework.
* nss/nss_test2.c: New.
* nss/nss_test3.c: New.
* nss/nss_test4.c: New.
* nss/nss_test5.c: New.
* nss/Makefile: Build new tests.
* shlib-versions: Add libnss_test2.
2017-07-17 15:52:44 -04:00
Adhemerval Zanella 48145e1c7d hppa: Fix clone exit syscall argument passing (BZ#21512)
This patch fixes the argument passing for exit syscall after
the clone function returns on hppa.  This fixes misc/tst-clone2
on hppa-linux-gnu.

Checked misc/tst-clone2 on hppa-linux-gnu.

	[BZ #21512]
	* sysdeps/unix/sysv/linux/hppa/clone.S (__clone): Fix argument
	passing to syscall exit.
2017-07-17 14:25:40 -03:00
Szabolcs Nagy 512d245bc3 Add HWCAP_ macros from Linux 4.12 to AArch64 bits/hwcap.h.
This patch adds the HWCAP_JSCVT, HWCAP_FCMA and HWCAP_LRCPC macros
from Linux 4.12 to the AArch64 bits/hwcap.h.

	* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_FCMA): New macro.
	(HWCAP_JSCVT, HWCAP_LRCPC): Likewise.
2017-07-17 09:24:08 +01:00
John David Anglin 1903b38c65 Return to caller if dl_fixup fails to resolve callee on hppa. 2017-07-16 12:59:00 -04:00
John David Anglin ce1917d0bf Add CFI annotation. 2017-07-16 12:46:50 -04:00
John David Anglin cc407f4e81 Fix stack offset for r19 load in __getcontext. 2017-07-16 12:24:30 -04:00
John David Anglin 07f94b7a96 Fix __setcontext return value on hppa. 2017-07-16 12:13:14 -04:00
John David Anglin d71400dca6 Fix syscall cancellation on hppa. 2017-07-16 11:58:01 -04:00
John David Anglin a363f70336 Remove _exit entry from sysdeps/unix/sysv/linux/hppa/localplt.data. 2017-07-16 11:28:02 -04:00
John David Anglin 4d42d18029 Remove extra braces from sysdeps/hppa/__longjmp.c. 2017-07-16 11:11:31 -04:00
John David Anglin df3d455b23 Fix [BZ 20098]. 2017-07-16 10:51:13 -04:00
Siddhesh Poyarekar 66cd050f26 Regenerate libc.pot 2017-07-16 15:30:27 +05:30
John David Anglin 32d9b0e7a6 Fix [BZ locale/19838]. 2017-07-15 12:54:14 -04:00
John David Anglin 075385f98a Fix guard alignment in allocate_stack when stack grows up. 2017-07-15 12:40:13 -04:00
John David Anglin 2759a2c1d8 Fix failing sNaN tests on hppa. 2017-07-15 12:18:03 -04:00
DJ Delorie 4fa8ae49aa Fix BZ #21654 - grp-merge.c alignment
* grp/grp_merge.c (__copy_grp): Align char** to minimum pointer
alignment not char alignment.
(__merge_grp): Likewise.
2017-07-14 21:46:42 -04:00
Szabolcs Nagy de895ddcd7 Disable single thread optimization for open_memstream
Single thread optimization is valid if at thread creation time the
optimization can be disabled.  This is in principle true for all
stream objects that user code can access (and thus needs locking),
using the same internal list as fflush(0) uses.  However in glibc
open_memstream is not on that list (BZ 21735) so the optimization
has to be disabled.

	* libio/memstream.c (__open_memstream): Set _IO_FLAGS2_NEED_LOCK.
	* libio/wmemstream.c (open_wmemstream): Likewise.
	* nptl/tst-memstream.c: New.
2017-07-14 16:09:56 +01:00
Jiong Wang 5ba6405338 [ARM] Fix ld.so crash when built using Binutils 2.29
There is bug report that ld.so in GLIBC 2.24 built by Binutils 2.29 will crash
on arm-linux-gnueabihf.  This is confirmed, and the details is at:

   https://sourceware.org/bugzilla/show_bug.cgi?id=21725.

As analyzed in the PR, the old code was with the assumption that assembler
won't set bit0 of thumb function address if it comes from PC-relative
instructions and the calculation can be finished during assembling.  This
assumption however does not hold after PR gas/21458.

	* sysdeps/arm/dl-machine.h (elf_machine_load_address):  Also strip bit 0
	of pcrel_address under Thumb mode.
2017-07-13 15:48:41 +01:00
Akhilesh Kumar 64bdd005b2 Added Fiji Hindi language locale for Fiji
[BZ #21207]
	* locales/hif_FJ: New file.
	* SUPPORTED: Add hif_FJ/UTF-8.
	* locale/iso-639.def: Add Fiji Hindi (hif).
2017-07-13 09:46:44 +02:00
John David Anglin 27f29b2dad Fix type in sysdeps/hppa/dl-machine.h. 2017-07-12 20:02:45 -04:00
H.J. Lu 06164c6773 Compile tst-ssp-1.c with -fstack-protector-all
Compile tst-ssp-1.c with -fstack-protector-all in case the the stack
protector heuristics do not instrument a thirty-byte array.

	* debug/Makefile (CFLAGS-tst-ssp-1.c): Set to
	-fstack-protector-all.
2017-07-12 07:53:09 -07:00
Chris Leonard 30200427a9 New locale for agr_PE.
[BZ #20496]
	* locale/iso-639.def: Add Awajún / Aguaruna (agr).

	[BZ #20496]
	* SUPPORTED: Add agr_PE.
	* locales/agr_PE: New file, Awajún / Aguaruna locale for Peru.
2017-07-12 09:08:44 +02:00
Gabriel F. T. Gomes 4de0cb2e9a powerpc64le: Iterate over all object suffixes when appending -mfloat128
On powerpc64le, the compilation of the files related to float128 support
requires the option -mfloat128 to be passed to gcc.  However, not all
possible object suffixes were covered in the Makefile.  This patch uses
$(all-object-suffixes) in all remaining rules.

Tested for powerpc64le.

	* sysdeps/powerpc/powerpc64le/Makefile: Use $(all-object-suffixes)
	to iterate over all possible object suffixes.  Add a comment
	explaining the use of sysdep-CFLAGS instead of CFLAGS.
2017-07-11 14:02:10 -03:00
H.J. Lu ed421fca42 Avoid backtrace from __stack_chk_fail [BZ #12189]
__stack_chk_fail is called on corrupted stack.  Stack backtrace is very
unreliable against corrupted stack.  __libc_message is changed to accept
enum __libc_message_action and call BEFORE_ABORT only if action includes
do_backtrace.  __fortify_fail_abort is added to avoid backtrace from
__stack_chk_fail.

	[BZ #12189]
	* debug/Makefile (CFLAGS-tst-ssp-1.c): New.
	(tests): Add tst-ssp-1 if -fstack-protector works.
	* debug/fortify_fail.c: Include <stdbool.h>.
	(_fortify_fail_abort): New function.
	(__fortify_fail): Call _fortify_fail_abort.
	(__fortify_fail_abort): Add a hidden definition.
	* debug/stack_chk_fail.c: Include <stdbool.h>.
	(__stack_chk_fail): Call __fortify_fail_abort, instead of
	__fortify_fail.
	* debug/tst-ssp-1.c: New file.
	* include/stdio.h (__libc_message_action): New enum.
	(__libc_message): Replace int with enum __libc_message_action.
	(__fortify_fail_abort): New hidden prototype.
	* malloc/malloc.c (malloc_printerr): Update __libc_message calls.
	* sysdeps/posix/libc_fatal.c (__libc_message): Replace int
	with enum __libc_message_action.  Call BEFORE_ABORT only if
	action includes do_backtrace.
	(__libc_fatal): Update __libc_message call.
2017-07-11 07:44:14 -07:00
Adhemerval Zanella 94070f86c0 posix: Add p{read,write}v2 RWF_NOWAIT flag (BZ#21738)
Linux 4.12 (b745fafaf70c0a98a2e1e7ac8cb14542889ceb0e) adds a new
p{read,write}v2 flag RWF_NOWAIT.  This patch adds it for linux
uio-ext.h header.

Checked on x86_64-linux-gnu (on a 4.10 kernel).

	[BZ #21738]
	* manual/llio.texi (RWF_NOWAIT): New item.
	* misc/tst-preadvwritev2-common.c (do_test_with_invalid_flags):
	Add RWF_NOWAIT check.
	* sysdeps/unix/sysv/linux/bits/uio-ext.h (RWF_NOWAIT): New flag.
2017-07-11 11:06:44 -03:00
Stefan Liebler 2c80445787 S390: Fix tst-ptrace-singleblock if kernel does not support PTRACE_SINGLEBLOCK.
The request PTRACE_SINGLEBLOCK was introduced in Linux 3.15.  Thus the ptrace call
will fail on older kernels.
Thus the test is now testing PTRACE_SINGLEBLOCK with data argument pointing to a
buffer on stack which is assumed to fail.  If the request would be interpreted as
PTRACE_GETREGS, then the ptrace call will not fail and the regs are written to buf.

If we run with a kernel with support for PTRACE_SINGLEBLOCK a ptrace call with
data=NULL, returns zero with no error.  If we run with a kernel without support for
PTRACE_SINGLEBLOCK a ptrace call with data=NULL reports an error.
In the latter case, the test is just continuing with PTRACE_CONT.

ChangeLog:

	* sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c:
	Support running on kernels without PTRACE_SINGLEBLOCK.
2017-07-11 10:38:44 +02:00
H.J. Lu eb73083e5e Don't include _dl_resolve_conflicts in libc.a [BZ #21742]
Since _dl_resolve_conflicts is only used in elf/rtld.c, don't include
it in libc.a.

	[BZ #21742]
	* elf/Makefile (dl-routines): Move dl-conflict to ...
	(rtld-routines): Here.
2017-07-10 05:16:40 -07:00
H.J. Lu 7a499756ab x86-64: Test memmove_chk and memset_chk only in libc.so [BZ #21741]
Since there are no multiarch versions of memmove_chk and memset_chk,
test multiarch versions of memmove_chk and memset_chk only in libc.so.

	[BZ #21741]
	* sysdeps/x86_64/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Test memmove_chk and memset_chk only
	in libc.so.
2017-07-10 04:44:38 -07:00
John David Anglin 2e783eb905 Update hppa ulps. 2017-07-09 15:22:41 -04:00
John David Anglin c5f70682a5 Use generic pthread support on hppa. 2017-07-09 15:01:11 -04:00
H.J. Lu 58d021c836 x86-64: Update comments in IFUNC selectors
* sysdeps/x86_64/multiarch/memcmp.c: Update comments.
	* sysdeps/x86_64/multiarch/memmove.c: Likewise.
	* sysdeps/x86_64/multiarch/memrchr.c: Likewise.
	* sysdeps/x86_64/multiarch/memset.c: Likewise.
	* sysdeps/x86_64/multiarch/rawmemchr.c: Likewise.
	* sysdeps/x86_64/multiarch/strchrnul.c: Likewise.
	* sysdeps/x86_64/multiarch/strlen.c: Likewise.
	* sysdeps/x86_64/multiarch/strnlen.c: Likewise.
	* sysdeps/x86_64/multiarch/wcschr.c: Likewise.
	* sysdeps/x86_64/multiarch/wcscpy.c: Likewise.
	* sysdeps/x86_64/multiarch/wcslen.c: Likewise.
	* sysdeps/x86_64/multiarch/wcsnlen.c: Likewise.
	* sysdeps/x86_64/multiarch/wmemchr.c: Likewise.
	* sysdeps/x86_64/multiarch/wmemcmp.c: Likewise.
	* sysdeps/x86_64/multiarch/wmemset.c: Likewise.
	* sysdeps/x86_64/multiarch/wmemset_chk.c: Likewise.
2017-07-09 11:43:20 -07:00
H.J. Lu 4df54c89bb x86-64: Update comments in ifunc-impl-list.c
All x86-64 IFUNC selectors are written in C now.  Update comments to
reflect it.

	* sysdeps/x86_64/multiarch/ifunc-impl-list.c: Update comments.
2017-07-09 11:38:37 -07:00
John David Anglin 7023e6db99 Fix BZ #21049. 2017-07-09 13:48:04 -04:00
Andreas Schwab 218bb835cd build-many-glibcs.py: also build profiled objects 2017-07-08 21:09:03 +02:00
DJ Delorie be8aa923a7 * manual/tunables.texi: Add missing @end deftp. 2017-07-06 19:54:13 -04:00
Florian Weimer 9f5a127131 resolv: Deal with non-deterministic address order in tst-resolv-basic 2017-07-06 22:55:53 +02:00
DJ Delorie d5c3fafc43 Add per-thread cache to malloc
* config.make.in: Enable experimental malloc option.
* configure.ac: Likewise.
* configure: Regenerate.
* manual/install.texi: Document it.
* INSTALL: Regenerate.
* malloc/Makefile: Likewise.
* malloc/malloc.c: Add per-thread cache (tcache).
(tcache_put): New.
(tcache_get): New.
(tcache_thread_freeres): New.
(tcache_init): New.
(__libc_malloc): Use cached chunks if available.
(__libc_free): Initialize tcache if needed.
(__libc_realloc): Likewise.
(__libc_calloc): Likewise.
(_int_malloc): Prefill tcache when appropriate.
(_int_free): Likewise.
(do_set_tcache_max): New.
(do_set_tcache_count): New.
(do_set_tcache_unsorted_limit): New.
* manual/probes.texi: Document new probes.
* malloc/arena.c: Add new tcache tunables.
* elf/dl-tunables.list: Likewise.
* manual/tunables.texi: Document them.
* NEWS: Mention the per-thread cache.
2017-07-06 13:37:30 -04:00
Joseph Myers 3cefdd7310 Increase some test timeouts.
This patch increases the timeouts for some tests that I've seen timing
out on slow systems in my 2.26 release testing.  (In the case of
tst-tsearch.c, increasing the timeout means removing a setting of 10
that was put there before the default timeout was increased to 20
seconds, so putting the default into effect.)

	* iconvdata/tst-loading.c (TIMEOUT): Define to 30.
	* misc/tst-tsearch.c (TIMEOUT): Remove.
	* nptl/tst-create-detached.c (TIMEOUT): Define to 100.
	* nptl/tst-robust-fork.c (TIMEOUT): Likewise.
	* nptl/tst-rwlock19.c (TIMEOUT): Likewise.
	* string/tst-cmp.c (TIMEOUT): Define to 600.
2017-07-06 17:01:03 +00:00
Matthew Krupcale 3adfef7eaa nptl: Fix typo on __have_pthread_attr_t (BZ#21715)
This patch fixes some build issues when including types/sigevent_t.h
along with bits/pthreadtypes.h.

Checked on x86_64-linux-gnu and on a build on supported major ABIs.

	[BZ #21715]
	* sysdeps/nptl/bits/pthreadtypes.h (__have_pthread_attr_t): Fix typo
	on definition.
2017-07-06 10:27:24 -03:00
H.J. Lu 031e519c95 x86-64: Align the stack in __tls_get_addr [BZ #21609]
This change forces realignment of the stack pointer in __tls_get_addr, so
that binaries compiled by GCCs older than GCC 4.9:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066

continue to work even if vector instructions are used in glibc which
require the ABI stack realignment.

__tls_get_addr_slow is added to handle the slow paths in the default
implementation of__tls_get_addr in elf/dl-tls.c.  The new __tls_get_addr
calls __tls_get_addr_slow after realigning the stack.  Internal calls
within ld.so go directly to the default implementation of __tls_get_addr
because they do not need stack realignment.

	[BZ #21609]
	* sysdeps/x86_64/Makefile (sysdep-dl-routines): Add tls_get_addr.
	(gen-as-const-headers): Add rtld-offsets.sym.
	* sysdeps/x86_64/dl-tls.c: New file.
	* sysdeps/x86_64/rtld-offsets.sym: Likwise.
	* sysdeps/x86_64/tls_get_addr.S: Likewise.
	* sysdeps/x86_64/dl-tls.h: Add multiple inclusion guards.
	* sysdeps/x86_64/tlsdesc.sym (TI_MODULE_OFFSET): New.
	(TI_OFFSET_OFFSET): Likwise.
2017-07-06 04:43:20 -07:00
Adhemerval Zanella db6b2f2522 posix: Fix default posix_spawn return value
This patch fix the return value for error conditions for default
posix_spawn (where the errno is expected).  It also avoid clobber
errno on fork call.

Checked on x86_64 (with Linux implementation removed).

	[BZ# 21697]
	* sysdeps/posix/spawni.c (__spawni_child): Fix return value.
	(__spawnix): Do not clober errno.
2017-07-05 15:58:31 -03:00
Florian Weimer cb3c27e87b support: Add resolver testing mode which does not patch _res 2017-07-05 19:04:40 +02:00
Florian Weimer d4165eedf5 support: Add support_chroot_create and support_chroot_free 2017-07-05 19:04:40 +02:00
Florian Weimer 76637a921f support: Check isolation of loopback addresses in tst-support-namespace 2017-07-05 19:04:39 +02:00
Szabolcs Nagy d2e0491883 Single threaded stdio optimization
Locking overhead can be significant in some stdio operations
that are common in single threaded applications.

This patch adds the _IO_FLAGS2_NEED_LOCK flag to indicate if
an _IO_FILE object needs to be locked and some of the stdio
functions just jump to their _unlocked variant when not.  The
flag is set on all _IO_FILE objects when the first thread is
created.  A new GLIBC_PRIVATE libc symbol, _IO_enable_locks,
was added to do this from libpthread.

The optimization can be applied to more stdio functions,
currently it is only applied to single flag check or single
non-wide-char standard operations.  The flag should probably
be never set for files with _IO_USER_LOCK, but that's just a
further optimization, not a correctness requirement.

The optimization is valid in a single thread because stdio
operations are non-as-safe (so lock state is not observable
from a signal handler) and stdio locks are recursive (so lock
state is not observable via deadlock).  The optimization is not
valid if a thread may be created while an stdio lock is taken
and thus it should be disabled if any user code may run during
an stdio operation (interposed malloc, printf hooks, etc).
This makes the optimization more complicated for some stdio
operations (e.g. printf), but those are bigger and thus less
important to optimize so this patch does not try to do that.

	* libio/libio.h (_IO_FLAGS2_NEED_LOCK, _IO_need_lock): Define.
	* libio/libioP.h (_IO_enable_locks): Declare.
	* libio/Versions (_IO_enable_locks): New symbol.
	* libio/genops.c (_IO_enable_locks): Define.
	(_IO_old_init): Initialize flags2.
	* libio/feof.c.c (_IO_feof): Avoid locking when not needed.
	* libio/ferror.c (_IO_ferror): Likewise.
	* libio/fputc.c (fputc): Likewise.
	* libio/putc.c (_IO_putc): Likewise.
	* libio/getc.c (_IO_getc): Likewise.
	* libio/getchar.c (getchar): Likewise.
	* libio/ioungetc.c (_IO_ungetc): Likewise.
	* nptl/pthread_create.c (__pthread_create_2_1): Enable stdio locks.
	* libio/iofopncook.c (_IO_fopencookie): Enable locking for the file.
	* sysdeps/pthread/flockfile.c (__flockfile): Likewise.
2017-07-04 16:05:12 +01:00
Florian Weimer 1ff6c67a25 sysconf: Use conservative default for _SC_NPROCESSORS_ONLN [BZ #21542] 2017-07-04 16:12:46 +02:00
Florian Weimer 4446a885f3 resolv: Fix resolv_conf _res matching
A dot-less host name without an /etc/resolv.conf file caused an
assertion failure in update_from_conf because the function would not
deal correctly with the empty search list case.

Thanks to Andreas Schwab for debugging assistence.
2017-07-04 15:26:05 +02:00
Joseph Myers f0107724c9 Update versions in build-many-glibcs.py.
This patch updates build-many-glibcs.py to use the current release
branch of binutils and current releases of GMP and the Linux kernel.

	* scripts/build-many-glibcs.py (Context.checkout): Default
	binutils version to 2.29 branch, GMP version to 6.1.2 and Linux
	kernel version to 4.12.
2017-07-04 10:32:54 +00:00
Florian Weimer 89f6307c5d resolv: Fix improper assert in __resolv_conf_attach 2017-07-04 11:18:34 +02:00
Florian Weimer e237357a5a resolv: Introduce free list for resolv_conf index slosts 2017-07-03 21:07:11 +02:00
Florian Weimer aef16cc8a4 resolv: Automatically reload a changed /etc/resolv.conf file [BZ #984]
This commit enhances the stub resolver to reload the configuration
in the per-thread _res object if the /etc/resolv.conf file has
changed.  The resolver checks whether the application has modified
_res and will not overwrite the _res object in that case.

The struct resolv_context mechanism is used to check the
configuration file only once per name lookup.
2017-07-03 21:06:23 +02:00
Florian Weimer a1c4eb8794 resolv: Mirror the entire resolver configuration in struct resolv_conf
This commit adds the remaining unchanging members (which are loaded
from /etc/resolv.conf) to struct resolv_conf.

The extended name server list is currently not used by the stub
resolver.  The switch depends on a cleanup: The _u._ext.nssocks
array stores just a single socket, and needs to be replaced with
a single socket value.

(The compatibility gethostname implementation does not use the
extended addres sort list, either.  Updating the compat code is
not worthwhile.)
2017-07-03 21:03:21 +02:00
Florian Weimer 3f853f22c8 resolv: Lift domain search list limits [BZ #19569] [BZ #21475]
This change uses the extended resolver state in struct resolv_conf to
store the search list.  If applications have not patched the _res
object directly, this extended search list will be used by the stub
resolver during name resolution.
2017-07-03 21:01:42 +02:00
Florian Weimer f30a54b21b resolv: Introduce struct resolv_conf with extended resolver state
This change provides additional resolver configuration state which
is not exposed through the _res ABI.  It reuses the existing
initstamp field in the supposedly-private part of _res.  Some effort
is undertaken to avoid memory safety issues introduced by applications
which directly patch the _res object.

With this commit, only the initstamp field is moved into struct
resolv_conf.  Additional members will be added later, eventually
migrating the entire resolver configuration.
2017-07-03 20:57:28 +02:00
Florian Weimer 352f4ff9a2 resolv: Introduce struct resolv_context [BZ #21668]
struct resolv_context objects provide a temporary resolver context
which does not change during a name lookup operation.  Only when the
outmost context is created, the stub resolver configuration is
verified to be current (at present, only against previous res_init
calls).  Subsequent attempts to obtain the context will reuse the
result of the initial verification operation.

struct resolv_context can also be extended in the future to store
data which needs to be deallocated during thread cancellation.
2017-07-03 20:52:59 +02:00
Florian Weimer 4e45d83c92 resolv: Add preinit tests to resolv/tst-resolv-res_init-skeleton.c 2017-07-03 17:54:48 +02:00
Rajalakshmi Srinivasaraghavan 2572f356b1 powerpc: Clean up strlen and strnlen for power8
To align a quadword aligned address to 64 bytes, maximum of three
16 bytes load is needed for worst case instead of loading four times.
2017-07-03 10:46:13 +05:30
H.J. Lu 8dc6133eff Use __builtin_popcount in __sched_cpucount [BZ #21696]
posix/sched_cpucount.c assumes that size of __cpu_mask == size of long,
which is incorrect for x32.  This patch uses __builtin_popcount, which
is availabe in GCC 4.9, in posix/sched_cpucount.c.

Tested on i686, x86-64 and x32 with multi-arch disabled.

	[BZ #21696]
	* posix/sched_cpucount.c: Don't include <limits.h>.
	(__sched_cpucount): Use __builtin_popcount.
2017-07-01 07:29:32 -07:00
Siddhesh Poyarekar 47ea614b9a Fix typo in glibc.tune.cpu name 2017-07-01 19:51:44 +05:30
Gabriel F. T. Gomes 8466ee1cb7 float128: Add signbit alternative for old compilers
In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*,
e.g.: __builtin_signbitf128, before GCC 6.  However, there has never
been a __builtin_signbitf128 in GCC and the type-generic builtin is
only available since GCC 6.  For older GCC, this patch defines
__builtin_signbitf128 to __signbitf128, so that the internal function
is used instead of the non-existent builtin.

This patch also changes the implementation of __signbitf128, because
it was reusing the implementation of __signbitl from ldbl-128, which
calls __builtin_signbitl.  Using the long double version of the
builtin is not correct on machines where _Float128 is ABI-distinct
from long double (i.e.: ia64, powerpc64le, x86, x86_84).  The new
implementation does not rely on builtins when being built with GCC
versions older than 6.0.

The new code does not currently affect powerpc64le builds, because
only GCC 6.2 fulfills the requirements from configure.  It might
affect powerpc64le builds if those requirements are backported to
older versions of the compiler.  The new code affects x86_64 builds,
since glibc is supposed to build correctly with older versions of GCC.

Tested for powerpc64le and x86_64.

	* include/math.h (__signbitf128): Define as hidden.
	* sysdeps/ieee754/float128/s_signbitf128.c (__signbitf128):
	Reimplement without builtins.
	* sysdeps/ia64/bits/floatn.h [!__GNUC_PREREQ (6, 0)]
	(__builtin_signbitf128): Define to __signbitf128.
	* sysdeps/powerpc/bits/floatn.h: Likewise.
	* sysdeps/x86/bits/floatn.h: Likewise.
2017-06-30 18:34:29 -03:00
Adhemerval Zanella 9b8f8593e5 Consolidate Linux fcntl implementation
This patch consolidates the fcntl Linux syscall generation on
sysdeps/unix/sysv/linux/fcntl.c.  It basically removes all the
architecture specific implementations.

Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.

	* sysdeps/unix/sysv/linux/arm/fcntl.c: Remove file.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/hppa/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/fcntl.c: New file.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c: Refactor to
	use default implementation.
2017-06-30 15:17:26 -03:00
Siddhesh Poyarekar 28cfa3a48e tunables, aarch64: New tunable to override cpu
Add a new tunable (glibc.tune.cpu) to override CPU identification on
aarch64.  This is useful in two cases: one where it is desirable to
pretend to be another CPU for purposes of testing or because routines
written for that CPU are beneficial for specific workloads and second
where the underlying kernel does not support emulation of MRS to get
the MIDR of the CPU.

	* elf/dl-tunables.h (tunable_is_name): Move from...
	* elf/dl-tunables.c (is_name): ... here.
	(parse_tunables, __tunables_init): Adjust.
	* manual/tunables.texi: Document glibc.tune.cpu.
	* sysdeps/aarch64/dl-tunables.list: New file.
	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (struct
	cpu_list): New type.
	(cpu_list): New list of CPU names and their MIDR.
	(get_midr_from_mcpu): New function.
	(init_cpu_features): Override MIDR if necessary.
2017-06-30 22:58:39 +05:30
Siddhesh Poyarekar ab85da1530 aarch64: Call all string function implementations in tests
The string function implementations implemented so far do not use any
instructions that may deviate from standard aarch64, so it is possible
for all routines to run on all armv8 hardware.  Select all
implementations in the benchmarks and tests.

	* sysdeps/aarch64/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Unconditionally select thunderx
	routine for testing.
2017-06-30 22:57:12 +05:30
H.J. Lu 4e61a6be44 i386: Increase MALLOC_ALIGNMENT to 16 [BZ #21120]
GCC 7 changed the definition of max_align_t on i386:

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9b5c49ef97e63cc63f1ffa13baf771368105ebe2

As a result, glibc malloc no longer returns memory blocks which are as
aligned as max_align_t requires.

This causes malloc/tst-malloc-thread-fail to fail with an error like this
one:

error: allocation function 0, size 144 not aligned to 16

This patch moves the MALLOC_ALIGNMENT definition to <malloc-alignment.h>
and increases the malloc alignment to 16 for i386.

	[BZ #21120]
	* malloc/malloc-internal.h (MALLOC_ALIGNMENT): Moved to ...
	* sysdeps/generic/malloc-alignment.h: Here.  New file.
	* sysdeps/i386/malloc-alignment.h: Likewise.
	* sysdeps/generic/malloc-machine.h: Include <malloc-alignment.h>.
2017-06-30 09:11:24 -07:00
Florian Weimer a9270e673d resolv: Improve debugging output from tst-resolv-res_init 2017-06-30 18:02:11 +02:00
Florian Weimer b606c6ce66 resolv: Remove source argument fron res_options 2017-06-30 11:32:19 +02:00
Florian Weimer 3f8f1eb6b0 resolv: Remove DEBUG from resolv/res_query.c 2017-06-30 11:32:12 +02:00
Florian Weimer 6da48ca0b2 resolv: Reformat resolv/res_data.c to GNU style 2017-06-30 11:32:04 +02:00
Florian Weimer 0377511799 resolv: Move res_query, res_search res_querydomain, hostalias
From res_data.c to query.c
2017-06-30 11:31:55 +02:00
Florian Weimer ded603542a resolv: Move res_isourserver, res_send from res_data.c to res_send.c 2017-06-30 11:31:48 +02:00
Florian Weimer 6781d8e693 resolv: Turn _res_opcodes into a compatibility symbol 2017-06-30 11:31:41 +02:00
Florian Weimer d85f99679d resolv: Move fp_nquery, fp_query, p_query, _res_opcodes
From res_data.c to res_debug.c.

Also drop the unnecessary _res initialization from fp_nquery.
2017-06-30 11:31:35 +02:00
Florian Weimer 4d4ce84924 resolv: Remove unused resolv/res_debug.h header file 2017-06-30 11:31:29 +02:00
Florian Weimer 09fbb56ad6 resolv: Remove DEBUG from resolv/res_send.c 2017-06-30 11:31:24 +02:00
Florian Weimer 5ca4aaea18 resolv: Move the res_mkquery function to the resolv/mk_query.c file 2017-06-30 11:31:18 +02:00
Florian Weimer 74084febc4 resolv: Reformat resolv/res_mkquery.c to GNU style 2017-06-30 11:31:12 +02:00
Florian Weimer 7ab27b76d2 resolv: Remove DEBUG macro from resolv/res_mkquery.c 2017-06-30 11:31:02 +02:00
Florian Weimer 5f17245d3e support: Report actual exit status in support_capture_subprocess_check 2017-06-30 11:30:48 +02:00
Florian Weimer 5b757a51b5 resolv: Make RES_ROTATE start with a random name server [BZ #19570]
Do not copy the actual name server addresses to rotate them.  Use a
global rotation offset instead.
2017-06-30 10:43:33 +02:00
Joseph Myers e78dc67889 SPARC sys/ucontext.h namespace fixes (bug 21457).
This patch fixes various miscellaneous namespace issues in the SPARC
sys/ucontext.h header.  These are similar to changes made previous to
other sys/ucontext.h headers, where the SPARC header was excluded from
those previous patches because of its complexity.

Tested for SPARC with build-many-glibcs.py.

	[BZ #21457]
	* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h (__ctx): New macro.
	[__WORDSIZE == 64] (MC_TSTATE): Define only for [__USE_MISC].
	[__WORDSIZE == 64] (MC_PC): Likewise.
	[__WORDSIZE == 64] (MC_NPC): Likewise.
	[__WORDSIZE == 64] (MC_Y): Likewise.
	[__WORDSIZE == 64] (MC_G1): Likewise.
	[__WORDSIZE == 64] (MC_G2): Likewise.
	[__WORDSIZE == 64] (MC_G3): Likewise.
	[__WORDSIZE == 64] (MC_G4): Likewise.
	[__WORDSIZE == 64] (MC_G5): Likewise.
	[__WORDSIZE == 64] (MC_G6): Likewise.
	[__WORDSIZE == 64] (MC_G7): Likewise.
	[__WORDSIZE == 64] (MC_O0): Likewise.
	[__WORDSIZE == 64] (MC_O1): Likewise.
	[__WORDSIZE == 64] (MC_O2): Likewise.
	[__WORDSIZE == 64] (MC_O3): Likewise.
	[__WORDSIZE == 64] (MC_O4): Likewise.
	[__WORDSIZE == 64] (MC_O5): Likewise.
	[__WORDSIZE == 64] (MC_O6): Likewise.
	[__WORDSIZE == 64] (MC_O7): Likewise.
	[__WORDSIZE == 64] (MC_NGREG): Rename to __MC_NGREG and define to
	__MC_NGREG if [__USE_MISC].
	[__WORDSIZE == 64] (MC_MAXFPQ): Define only for [__USE_MISC].
	[__WORDSIZE == 64] (mc_gregset_t): Define using __MC_NGREG.
	[__WORDSIZE == 64] (struct mc_fq): Rename to struct __mc_fq.
	Define fields using __ctx.
	[__WORDSIZE == 64] (mc_fpu_t): Remove struct tag.  Define fields
	using __ctx.
	[__WORDSIZE == 64] (mcontext_t): Define fields using __ctx.
	(REG_PSR): Define only for [__USE_MISC].
	(REG_PC): Likewise.
	(REG_nPC): Likewise.
	(REG_Y): Likewise.
	(REG_G1): Likewise.
	(REG_G2): Likewise.
	(REG_G3): Likewise.
	(REG_G4): Likewise.
	(REG_G5): Likewise.
	(REG_G6): Likewise.
	(REG_G7): Likewise.
	(REG_O0): Likewise.
	(REG_O1): Likewise.
	(REG_O2): Likewise.
	(REG_O3): Likewise.
	(REG_O4): Likewise.
	(REG_O5): Likewise.
	(REG_O6): Likewise.
	(REG_O7): Likewise.
	[__WORDSIZE == 64] (REG_ASI): Define only for [__USE_MISC].
	[__WORDSIZE == 64] (REG_FPRS): Likewise.
	(NGREG): Rename to __NGREG and define to __NGREG if [__USE_MISC].
	(gregset_t): Define using __NGREG.
	(SPARC_MAXREGWINDOW): Rename to __SPARC_MAXREGWINDOW and define to
	__SPARC_MAXREGWINDOW if [__USE_MISC].
	(struct rwindow): Rename to struct __rwindow.  Define fields using
	__ctx.
	(rw_fp): Define only for [__USE_MISC].
	(rw_rtn): Likewise.
	(gwindows_t): Remove struct tag.  Define fields using __ctx and
	__SPARC_MAXREGWINDOW.
	(MAXFPQ): Define only for [__USE_MISC].
	(struct fpq): Rename to struct __fpq.  Define fields using __ctx.
	(struct fq): Rename to struct __fq.  Define fields using __ctx.
	(FPU_REGS_TYPE): Define only for [__USE_MISC].
	(FPU_DREGS_TYPE): Likewise.
	(V7_FPU_FSR_TYPE): Likewise.
	(V9_FPU_FSR_TYPE): Likewise.
	(V9_FPU_FPRS_TYPE): Likewise.
	[__WORDSIZE == 64] (fpregset_t): Remove struct tag.  Define fields
	using __ctx.
	[__WORDSIZE != 64] (fpregset_t): Likewise.
	[__WORDSIZE != 64] (xrs_t): Define fields using __ctx.
	[__WORDSIZE != 64] (XRS_ID): Define only for [__USE_MISC].
	[__WORDSIZE != 64] (mcontext_t): Define fields using __ctx.
	Rename field filler to __glibc_reserved1.
	* sysdeps/unix/sysv/linux/sparc/sparc32/ucontext_i.sym
	(MC_FILLER): Remove.
2017-06-29 19:44:43 +00:00
Florian Weimer 84d8c5bc8b vfprintf: Fix tst-vfprintf-mbs-prec and tst-vfprintf-user-type 2017-06-29 16:46:03 +02:00
Adhemerval Zanella ccfb296472 posix: Improve default posix_spawn implementation
This patch improves the default posix implementation of posix_spawn{p}
and align with Linux one.  The main idea is to fix some issues already
fixed in Linux code, and deprecated vfork internal usage (source of
various bug reports).  In a short:

   - It moves POSIX_SPAWN_USEVFORK usage and sets it a no-op.  Since
     the process that actually spawn the new process do not share
     memory with parent (with vfork), it fixes BZ#14750 for this
     implementation.

   - It uses a pipe to correctly obtain the return upon failure
     of execution (BZ#18433).

   - It correctly enable/disable asynchronous cancellation (checked
     on ptl/tst-exec5.c).

   - It correctly disable/enable signal handling.

Using this version instead of Linux shows only one regression,
posix/tst-spawn3, because of pipe2 usage which increase total
number of file descriptor.

	* sysdeps/posix/spawni.c (__spawni_child): New function.
	(__spawni): Rename to __spawnix.
2017-06-29 10:59:07 -03:00
Florian Weimer edc1686af0 vfprintf: Reuse work_buffer in group_number 2017-06-29 09:37:13 +02:00
Florian Weimer 12d5853e22 vfprintf: Use struct scratch_buffer for positional arguments allocation 2017-06-29 09:37:04 +02:00
Florian Weimer cd00e12d31 _i18n_number_rewrite: Use struct scratch_buffer 2017-06-29 09:34:45 +02:00