Commit Graph

29335 Commits

Author SHA1 Message Date
Rajalakshmi Srinivasaraghavan fe7faec3e5 powerpc: Handle worstcase behavior in strstr() for POWER7
Instead of checking needle length, constant 'n' number of comparisons
is checked to fall back to default implementation.  This patch is tested
on powerpc64 and powerpc64le.

2015-08-25  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>

	* sysdeps/powerpc/powerpc64/power7/strstr.S: Handle worst case.
2015-08-25 13:45:56 -03:00
H.J. Lu 2194737e77 Replace %xmm[8-12] with %xmm[0-4]
Since ld.so preserves vector registers now, we can use %xmm[0-4] to
avoid the REX prefix.

	* sysdeps/x86_64/strlen.S: Replace %xmm[8-12] with %xmm[0-4].
2015-08-25 08:51:23 -07:00
H.J. Lu 2339c6f4bd Remove x86-64 rtld-xxx.c and rtld-xxx.S
Since ld.so preserves vector registers now, we can use the regular,
non-ifunc string and memory functions in ld.so.

	* sysdeps/x86_64/rtld-memcmp.c: Removed.
	* sysdeps/x86_64/rtld-memset.S: Likewise.
	* sysdeps/x86_64/rtld-strchr.S: Likewise.
	* sysdeps/x86_64/rtld-strlen.S: Likewise.
	* sysdeps/x86_64/multiarch/rtld-memcmp.c: Likewise.
	* sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.
2015-08-25 08:50:06 -07:00
H.J. Lu 5f92ec52e7 Replace %xmm8 with %xmm0
Since ld.so preserves vector registers now, we can use %xmm0 to avoid
the REX prefix.

	* sysdeps/x86_64/memset.S: Replace %xmm8 with %xmm0.
2015-08-25 08:48:34 -07:00
Ondřej Bílka 4bd228c8a6 add bug 18240 to news. 2015-08-25 16:05:13 +02:00
Ondřej Bílka 2f5c175055 Handle overflow in __hcreate_r
Hi,

As in bugzilla entry there is overflow in hsearch when looking for prime
number as SIZE_MAX - 1 is divisible by 5. We fix that by rejecting large
inputs before looking for prime.

	* misc/hsearch_r.c (__hcreate_r): Handle overflow.
2015-08-25 15:08:23 +02:00
Ondřej Bílka 0d0325ed4b Fix strcpy_chk and stpcpy_chk performance.
Hi, as I wrote in previous patches a performance of checked strcpy and
stpcpy is terrible as these don't use sse2 and are around four times
slower that strcpy and stpcpy now.

As this bug shows that these functions are not performance sensitive I
decided just to improve generic implementation instead for easier
maintainance.

        * debug/strcpy_chk.c: Improve performance.
        * debug/stpcpy_chk.c: Likewise.
        * sysdeps/x86_64/strcpy_chk.S: Remove.
        * sysdeps/x86_64/stpcpy_chk.S: Remove.
2015-08-25 15:06:33 +02:00
H.J. Lu f3dcae82d5 Save and restore vector registers in x86-64 ld.so
This patch adds SSE, AVX and AVX512 versions of _dl_runtime_resolve
and _dl_runtime_profile, which save and restore the first 8 vector
registers used for parameter passing.  elf_machine_runtime_setup
selects the proper _dl_runtime_resolve or _dl_runtime_profile based
on _dl_x86_cpu_features.  It avoids race condition caused by
FOREIGN_CALL macros, which are only used for x86-64.

Performance impact of saving and restoring 8 vector registers are
negligible on Nehalem, Sandy Bridge, Ivy Bridge and Haswell when
ld.so is optimized with SSE2.

	[BZ #15128]
	* sysdeps/x86_64/Makefile [$(subdir) == elf] (tests): Add
	ifuncmain8.
	(modules-names): Add ifuncmod8.
	($(objpfx)ifuncmain8): New rule.
	* sysdeps/x86_64/dl-machine.h: Include <dl-procinfo.h> and
	<cpuid.h>.
	(elf_machine_runtime_setup): Use _dl_runtime_resolve_sse,
	_dl_runtime_resolve_avx, or _dl_runtime_resolve_avx512,
	_dl_runtime_profile_sse, _dl_runtime_profile_avx, or
	_dl_runtime_profile_avx512, based on HAS_ARCH_FEATURE.
	* sysdeps/x86_64/dl-trampoline.S: Rewrite.
	* sysdeps/x86_64/dl-trampoline.h: Likewise.
	* sysdeps/x86_64/ifuncmain8.c: New file.
	* sysdeps/x86_64/ifuncmod8.c: Likewise.
	* sysdeps/x86_64/nptl/tcb-offsets.sym (RTLD_SAVESPACE_SSE):
	Removed.
	* sysdeps/x86_64/nptl/tls.h (__128bits): Removed.
	(tcbhead_t): Change rtld_must_xmm_save to __glibc_unused1.
	Change rtld_savespace_sse to __glibc_unused2.
	(RTLD_CHECK_FOREIGN_CALL): Removed.
	(RTLD_ENABLE_FOREIGN_CALL): Likewise.
	(RTLD_PREPARE_FOREIGN_CALL): Likewise.
	(RTLD_FINALIZE_FOREIGN_CALL): Likewise.
2015-08-25 04:34:13 -07:00
Joseph Myers 2d02fd0737 Note bug 10882 as having been fixed in 2.16. 2015-08-24 14:45:32 +00:00
Wilco Dijkstra edbbc86c3a 2015-08-24 Wilco Dijkstra <wdijkstr@arm.com>
* sysdeps/aarch64/bzero.S (__bzero): Remove.
2015-08-24 14:49:46 +01:00
Wilco Dijkstra f008c71455 2015-08-24 Wilco Dijkstra <wdijkstr@arm.com>
* sysdeps/aarch64/fpu/math_private.h (libc_feholdsetround_aarch64_ctx):
	Unconditionally set __fpcr to avoid uninialized warning.
	(libc_feholdsetround_noex_aarch64_ctx): Likewise.
2015-08-24 14:42:28 +01:00
Siddhesh Poyarekar c3b9ef8dfc Don't use the main arena in retry path if it is corrupt
If allocation on a non-main arena fails, the main arena is used
without checking to see if it is corrupt.  Add a check that avoids the
main arena if it is corrupt.

	* malloc/arena.c (arena_get_retry): Don't use main_arena if it is
	corrupt.
2015-08-24 14:33:07 +05:30
Siddhesh Poyarekar 92a9b22d70 Drop unused first argument from arena_get2
The arena pointer in the first argument to arena_get2 was used in the
old days before per-thread arenas.  They're unused now and hence can
be dropped.

ChangeLog:

	* malloc/arena.c (arena_get2): Drop unused argument.
	(arena_lock): Adjust.
	(arena_get_retry): Likewise.
2015-08-24 14:32:07 +05:30
Andreas Schwab be481652f2 Remove __ASSUME_IPC64
PowerPC has always used __IPC_64 like most other architectures, which
means that __ASSUME_IPC64 can be always true.  Also, all other
architecture implementations that use the ipc syscall are effectively
identical to the generic version and can be removed.
2015-08-24 10:53:49 +02:00
Mike Frysinger 1695cdae06 manual: skip build when perl is unavailable
Do not try to generate the manual when perl is unavailable.  This
matches the behavior when makeinfo is unavailable.  Otherwise the
install step fails when trying to generate the libm section since
it runs a perl script.
2015-08-21 17:10:59 -04:00
Carlos Eduardo Seo 854e0055b3 powerpc: Fix memchr for powerpc32.
Fix a wrong #undef in memchr.c.

	* sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c: Replace
	'#undef memcpy' by '#undef memchr'.
2015-08-21 17:06:06 -03:00
Carlos Eduardo Seo 502b91de14 powerpc: make memchr use memchr-power7.
In powerpc64, memchr was always pointing to the internal __GI_memchr
implementation.  This patch fixes that and makes it use the
optimized POWER7 version when adequate.

	* sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c: Make
	memchr not point to the internal __GI_memchr implementation.
2015-08-21 17:05:40 -03:00
H.J. Lu e5dee2c896 Revert "Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN"
This reverts commit 0c5b8b5941.
2015-08-21 09:57:15 -07:00
H.J. Lu 8c7c251746 Revert "Fix a typo in linux lxstat.c"
This reverts commit e4ad5e722c.
2015-08-21 09:57:02 -07:00
H.J. Lu e4ad5e722c Fix a typo in linux lxstat.c
* sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Fix a typo.
2015-08-21 08:32:36 -07:00
H.J. Lu 0c5b8b5941 Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN
For ia32 PIC, the first thing of many syscalls does is to call
__x86.get_pc_thunk.reg to load PC into reg in case there is an error,
which is required for setting errno.  In most cases, there are no
errors.  But we still call __x86.get_pc_thunk.reg.  This patch adds
INLINE_SYSCALL_RETURN and INLINE_SYSCALL_ERROR_RETURN so that i386
can optimize setting errno by branching to the internal __syscall_error
without PLT.

INLINE_SYSCALL_ERROR_RETURN is designed to take the negative error
number returned from the majority of Linux kernels for which negating
is a no-op with INTERNAL_SYSCALL_ERRNO.

With i386 INLINE_SYSCALL_RETURN, INLINE_SYSCALL_ERROR_RETURN and
i386 syscall inlining optimization for GCC 5, for
sysdeps/unix/sysv/linux/fchmodat.c with -O2 -march=i686
-mtune=generic, GCC 5.2 now generates:

<fchmodat>:
   0:	push   %ebx
   1:	mov    0x14(%esp),%eax
   5:	mov    0x8(%esp),%ebx
   9:	mov    0xc(%esp),%ecx
   d:	mov    0x10(%esp),%edx
  11:	test   $0xfffffeff,%eax
  16:	jne    38 <fchmodat+0x38>
  18:	test   $0x1,%ah
  1b:	jne    48 <fchmodat+0x48>
  1d:	mov    $0x132,%eax
  22:	call   *%gs:0x10
  29:	cmp    $0xfffff000,%eax
  2e:	ja     58 <fchmodat+0x58>
  30:	pop    %ebx
  31:	ret
  32:	lea    0x0(%esi),%esi
  38:	pop    %ebx
  39:	mov    $0xffffffea,%eax
  3e:	jmp    3f <fchmodat+0x3f>	3f: R_386_PC32	__syscall_error
  43:	nop
  44:	lea    0x0(%esi,%eiz,1),%esi
  48:	pop    %ebx
  49:	mov    $0xffffffa1,%eax
  4e:	jmp    4f <fchmodat+0x4f>	4f: R_386_PC32	__syscall_error
  53:	nop
  54:	lea    0x0(%esi,%eiz,1),%esi
  58:	pop    %ebx
  59:	jmp    5a <fchmodat+0x5a>	5a: R_386_PC32	__syscall_error

instead of

<fchmodat>:
   0:	sub    $0x8,%esp
   3:	mov    0x18(%esp),%eax
   7:	mov    %ebx,(%esp)
   a:	call   b <fchmodat+0xb>	b: R_386_PC32	__x86.get_pc_thunk.bx
   f:	add    $0x2,%ebx	11: R_386_GOTPC	_GLOBAL_OFFSET_TABLE_
  15:	mov    %edi,0x4(%esp)
  19:	test   $0xfffffeff,%eax
  1e:	jne    70 <fchmodat+0x70>
  20:	test   $0x1,%ah
  23:	jne    88 <fchmodat+0x88>
  25:	mov    0x14(%esp),%edx
  29:	mov    0x10(%esp),%ecx
  2d:	mov    0xc(%esp),%edi
  31:	xchg   %ebx,%edi
  33:	mov    $0x132,%eax
  38:	call   *%gs:0x10
  3f:	xchg   %edi,%ebx
  41:	cmp    $0xfffff000,%eax
  46:	ja     58 <fchmodat+0x58>
  48:	mov    (%esp),%ebx
  4b:	mov    0x4(%esp),%edi
  4f:	add    $0x8,%esp
  52:	ret
  53:	nop
  54:	lea    0x0(%esi,%eiz,1),%esi
  58:	mov    0x0(%ebx),%edx	5a: R_386_TLS_GOTIE	__libc_errno
  5e:	neg    %eax
  60:	mov    %eax,%gs:(%edx)
  63:	mov    $0xffffffff,%eax
  68:	jmp    48 <fchmodat+0x48>
  6a:	lea    0x0(%esi),%esi
  70:	mov    0x0(%ebx),%eax	72: R_386_TLS_GOTIE	__libc_errno
  76:	movl   $0x16,%gs:(%eax)
  7d:	mov    $0xffffffff,%eax
  82:	jmp    48 <fchmodat+0x48>
  84:	lea    0x0(%esi,%eiz,1),%esi
  88:	mov    0x0(%ebx),%eax	8a: R_386_TLS_GOTIE	__libc_errno
  8e:	movl   $0x5f,%gs:(%eax)
  95:	mov    $0xffffffff,%eax
  9a:	jmp    48 <fchmodat+0x48>

	* sysdeps/unix/sysdep.h (INLINE_SYSCALL_RETURN): New.
	(INLINE_SYSCALL_ERROR_RETURN): Likewise.
	* sysdeps/unix/sysv/linux/adjtime.c (ADJTIME): Use
	INLINE_SYSCALL_RETURN and INLINE_SYSCALL_ERROR_RETURN.
	* sysdeps/unix/sysv/linux/aio_sigqueue.c (__aio_sigqueue):
	Likewise.
	* sysdeps/unix/sysv/linux/dl-openat64.c (openat64): Likewise.
	* sysdeps/unix/sysv/linux/eventfd.c (eventfd): Likewise.
	* sysdeps/unix/sysv/linux/faccessat.c (faccessat): Likewise.
	* sysdeps/unix/sysv/linux/fchmodat.c (fchmodat): Likewise.
	* sysdeps/unix/sysv/linux/fcntl.c (do_fcntl): Likewise.
	* sysdeps/unix/sysv/linux/fstatfs64.c (__fstatfs64): Likewise.
	* sysdeps/unix/sysv/linux/ftruncate64.c (__ftruncate64): Likewise.
	* sysdeps/unix/sysv/linux/futimens.c (futimens): Likewise.
	* sysdeps/unix/sysv/linux/futimes.c (__futimes): Likewise.
	* sysdeps/unix/sysv/linux/futimesat.c (futimesat): Likewise.
	* sysdeps/unix/sysv/linux/fxstat.c (__fxstat): Likewise.
	* sysdeps/unix/sysv/linux/fxstat64.c (___fxstat64): Likewise.
	* sysdeps/unix/sysv/linux/fxstatat.c (__fxstatat): Likewise.
	* sysdeps/unix/sysv/linux/fxstatat64.c (__fxstatat64): Likewise.
	* sysdeps/unix/sysv/linux/gai_sigqueue.c (__gai_sigqueue):
	Likewise.
	* sysdeps/unix/sysv/linux/getpriority.c (__getpriority): Likewise.
	* sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Likewise.
	* sysdeps/unix/sysv/linux/llseek.c (__llseek): Likewise.
	* sysdeps/unix/sysv/linux/lutimes.c (lutimes): Likewise.
	* sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Likewise.
	* sysdeps/unix/sysv/linux/lxstat64.c (___lxstat64): Likewise.
	* sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Likewise.
	* sysdeps/unix/sysv/linux/mq_close.c (mq_close): Likewise.
	* sysdeps/unix/sysv/linux/mq_open.c (__mq_open): Likewise.
	* sysdeps/unix/sysv/linux/mq_unlink.c (mq_unlink): Likewise.
	* sysdeps/unix/sysv/linux/msgget.c (msgget): Likewise.
	* sysdeps/unix/sysv/linux/prlimit.c (prlimit): Likewise.
	* sysdeps/unix/sysv/linux/pt-raise.c (raise): Likewise.
	* sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
	* sysdeps/unix/sysv/linux/readahead.c (__readahead): Likewise.
	* sysdeps/unix/sysv/linux/reboot.c (reboot): Likewise.
	* sysdeps/unix/sysv/linux/semget.c (semget): Likewise.
	* sysdeps/unix/sysv/linux/semop.c (semop): Likewise.
	* sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Likewise.
	* sysdeps/unix/sysv/linux/setrlimit64.c (setrlimit64): Likewise.
	* sysdeps/unix/sysv/linux/shmat.c (shmat): Likewise.
	* sysdeps/unix/sysv/linux/shmdt.c (shmdt): Likewise.
	* sysdeps/unix/sysv/linux/shmget.c (shmget): Likewise.
	* sysdeps/unix/sysv/linux/signalfd.c (signalfd): Likewise.
	* sysdeps/unix/sysv/linux/sigpending.c (sigpending): Likewise.
	* sysdeps/unix/sysv/linux/sigprocmask.c ( __sigprocmask): Likewise.
	* sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Likewise.
	* sysdeps/unix/sysv/linux/speed.c (cfsetospeed): Likewise.
	* sysdeps/unix/sysv/linux/statfs64.c (__statfs64): Likewise.
	* sysdeps/unix/sysv/linux/sysctl.c (__sysctl): Likewise.
	* sysdeps/unix/sysv/linux/tcsendbrk.c (tcsendbreak): Likewise.
	* sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise.
	* sysdeps/unix/sysv/linux/timer_getoverr.c (timer_getoverrun):
	Likewise.
	* sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime):
	Likewise.
	* sysdeps/unix/sysv/linux/timer_settime.c (timer_settime):
	Likewise.
	* sysdeps/unix/sysv/linux/truncate64.c (truncate64): Likewise.
	* sysdeps/unix/sysv/linux/ustat.c (ustat): Likewise.
	* sysdeps/unix/sysv/linux/utimensat.c (utimensat): Likewise.
	* sysdeps/unix/sysv/linux/utimes.c (__utimes): Likewise.
	* sysdeps/unix/sysv/linux/xmknod.c (__xmknod): Likewise.
	* sysdeps/unix/sysv/linux/xmknodat.c (__xmknodat): Likewise.
	* sysdeps/unix/sysv/linux/xstat.c (__xstat): Likewise.
	* sysdeps/unix/sysv/linux/xstat64.c (___xstat64): Likewise.
	* sysdeps/unix/sysv/linux/xstatconv.c (__xstat_conv): Likewise.
	(__xstat64_conv): Likewise.
	(__xstat32_conv): Likewise.
	* sysdeps/unix/sysv/linux/sched_getaffinity.c
	(__sched_getaffinity_new): Add libc_hidden_proto and
	libc_hidden_def.  Use INLINE_SYSCALL_ERROR_RETURN.
2015-08-21 04:46:53 -07:00
Joseph Myers 8d9e08981e Don't use -Wno-strict-prototypes in timezone/.
The current timezone/ code from tzcode doesn't need
-Wno-strict-prototypes.  This patch removes it from the CFLAGS
settings in timezone/Makefile.

Tested for x86_64 that glibc still builds OK with the patch applied.

	* timezone/Makefile (CFLAGS-zdump.c): Remove
	-Wno-strict-prototypes.
	(CFLAGS-zic.c): Likewise.
	(CFLAGS-ialloc.c): Likewise.
	(CFLAGS-scheck.c): Likewise.
2015-08-20 20:51:22 +00:00
Joseph Myers 48bb14bdbb Don't use -Wno-error=undef.
This patch removes the use of -Wno-error=undef, so that -Wundef
warnings become errors.

Tested for x86_64, x86, mips64 (all three ABIs) and arm.

	* Makeconfig [$(enable-werror) = yes] (+gccwarn): Do not add
	-Wno-error=undef.
2015-08-20 20:50:05 +00:00
H.J. Lu 3a2a9a9066 Add missing ChangeLog entry for the last commit 2015-08-20 12:56:52 -07:00
H.J. Lu daa4db69fc Remove the unused IFUNC files
sysdeps/i386/i686/multiarch/strcasestr-c.c became unused after

commit 1818483b15
Author: Andreas Schwab <schwab@suse.de>
Date:   Wed Dec 18 11:53:27 2013 +1000

    Remove use of SSE4.2 functions for strstr on i686

which contains

-sysdep_routines += strcspn-c strpbrk-c strspn-c strstr-c strcasestr-c
+sysdep_routines += strcspn-c strpbrk-c strspn-c

sysdeps/x86_64/multiarch/strcasestr.c became useless after

t 584b18eb4d
Author: Ondřej Bílka <neleai@seznam.cz>
Date:   Sat Dec 14 19:33:56 2013 +0100

    Add strstr with unaligned loads. Fixes bug 12100.

which changes sysdeps/x86_64/multiarch/strcasestr.c to

libc_ifunc (__strcasestr, __strcasestr_sse2);

This patch removes these file.

	* i386/i686/multiarch/strcasestr-c.c: Removed.
	* x86_64/multiarch/strcasestr.c: Likewise.
	* x86_64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list):
	Remove strcasestr.
2015-08-20 12:47:20 -07:00
Joseph Myers 772e741ba5 Don't use -Wno-uninitialized in math/.
The uninitialized variable warnings in math/ having been fixed for all
the supported floating-point formats, this patch removes the use of
-Wno-uninitialized there, continuing with the goal of avoiding -Wno-
options in makefiles as far as possible..

Tested for x86_64 and x86 (full build and testsuite runs), and for
powerpc and mips64 (verified that glibc builds without errors).

	* math/Makefile (CFLAGS): Don't add -Wno-uninitialized.
2015-08-20 18:00:09 +00:00
Joseph Myers 9173e3c0b4 Fix uninitialized variable use in ldbl-128ibm nearbyintl.
Removing the use of -Wno-uninitialized for math/ shows errors for
ldbl-128ibm:

../sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c: In function '__nearbyintl':
../sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c:119:34: error: 'low' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       u.d[1].d = high - u.d[0].d + low;
                                  ^
../sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c:119:23: error: 'high' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       u.d[1].d = high - u.d[0].d + low;
                       ^

These errors are correct: if the high part of the argument is a NaN,
and the low part is nonzero but has absolute value less than 2^52,
those variables can be used uninitialized.  This patch rearranges the
code so that the variables are always initialized with the natural
values, and then possibly modified later, to avoid this uninitialized
use.  (Note that there are still other issues with this code and NaNs
that are not fixed by this patch.)  No bug filed in Bugzilla or
testcase added for the uninitialized use since it wasn't user-visible
with the compiler I tried (that is, I still got a NaN result).

Tested for powerpc.

	* sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c: Always initialize
	variables for high and low parts before possibly modifying them.
2015-08-20 17:28:09 +00:00
H.J. Lu 1ae6c72dc1 Move x86_64 init-arch.h to sysdeps/x86/init-arch.h
Move sysdeps/x86_64/multiarch/init-arch.h to sysdeps/x86/init-arch.h
which can be used for both i386 and x86_64.

	* sysdeps/i386/i686/multiarch/init-arch.h: Removed.
	* sysdeps/unix/sysv/linux/x86/init-arch.h: Likewise.
	* sysdeps/x86_64/cacheinfo.c: Include <init-arch.h> instead
	of "multiarch/init-arch.h".
	* sysdeps/x86_64/multiarch/init-arch.h: Renamed to ...
	* sysdeps/x86/init-arch.h: This.
2015-08-20 04:29:23 -07:00
H.J. Lu a452ef24d5 Remove x86 init-arch.c
Both files include sysdeps/x86_64/multiarch/init-arch.c which has been
removed.

	* sysdeps/i386/i686/multiarch/init-arch.c: Removed.
	* sysdeps/unix/sysv/linux/x86/init-arch.c: Likewise.
2015-08-20 04:19:59 -07:00
Ondřej Bílka 9ceeb27931 Fix exponents in manual.
* manual/macros.texi: Add twoexp macro.
	* manual/filesys.texi: Fix exponents.
	* manual/llio.texi: Likewise.
	* manual/stdio.texi: Likewise.
2015-08-20 09:43:50 +02:00
Florian Weimer cd4e69ed3e nptl: Document crash due to incorrect use of locks 2015-08-20 08:44:37 +02:00
Joseph Myers 948e12a238 Fix csqrt missing underflows (bug 18370).
The csqrt implementations in glibc can miss underflow exceptions when
the real or imaginary part of the result becomes tiny in the course of
scaling down (in particular, multiplication by 0.5) and that scaling
is exact although the relevant part of the mathematical result isn't.
This patch forces the exception in a similar way to previous fixes.

Tested for x86_64 and x86.

	[BZ #18370]
	* math/s_csqrt.c (__csqrt): Force underflow exception for results
	whose real or imaginary part has small absolute value.
	* math/s_csqrtf.c (__csqrtf): Likewise.
	* math/s_csqrtl.c (__csqrtl): Likewise.
	* math/auto-libm-test-in: Add more tests of csqrt.
	* math/auto-libm-test-out: Regenerated.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
2015-08-19 22:42:01 +00:00
Mike Frysinger b75d1cfce6 relocate localedata ChangeLog entries 2015-08-19 17:55:06 -04:00
Gabriel F. T. Gomes 1747fcda49 PowerPC: Extend Program Priority Register support
This patch adds extra inline functions to change the Program Priority
Register from ISA 2.07.

2015-08-19  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>

	* sysdeps/powerpc/sys/platform/ppc.h (__ppc_set_ppr_med_high,
	__ppc_set_ppr_very_low): New functions.
	* manual/platform.texi: Add documentation about
	__ppc_set_ppr_med_high and __ppc_set_ppr_very_low.
2015-08-19 17:43:26 -03:00
Andrew Senkevich 1f3be1988b Mention BZ #18796 fix in NEWS. 2015-08-19 19:48:52 +03:00
Wilco Dijkstra 48497aba8e Improve stpncpy performance by using __strnlen/memcpy/memset rather than a
byte loop. Performance on bench-stpncpy is ~2x faster on average.
2015-08-19 16:32:12 +01:00
Andrew Senkevich a08e80d114 [BZ #18796]
* scripts/test-installation.pl: Don't add -lmvec to build options if
    libmvec wasn't built.
2015-08-19 16:54:28 +03:00
H.J. Lu 9b9d20faf6 Add BZ #14341 to NEWS 2015-08-19 06:01:58 -07:00
Petar Jovanovic fa19d5c48a Fix dynamic linker issue with bind-now
Fix the bind-now case when DT_REL and DT_JMPREL sections are separate
and there is a gap between them.

	[BZ #14341]
	* elf/dynamic-link.h (elf_machine_lazy_rel): Properly handle the
	case when there is a gap between DT_REL and DT_JMPREL sections.
	* sysdeps/x86_64/Makefile (tests): Add tst-split-dynreloc.
	(LDFLAGS-tst-split-dynreloc): New.
	(tst-split-dynreloc-ENV): Likewise.
	* sysdeps/x86_64/tst-split-dynreloc.c: New file.
	* sysdeps/x86_64/tst-split-dynreloc.lds: Likewise.
2015-08-19 05:37:01 -07:00
H.J. Lu 33c898d160 Mark __xstatXX_conv as hidden
__xstat_conv, __xstat64_conv and __xstat32_conv are internal to glibc.
They should be marked as hidden so that they can't be called without
PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/xstatconv.h (__xstat_conv): Add
	attribute_hidden.
	(__xstat64_conv): Likewise.
	(__xstat32_conv): Likewise.
2015-08-19 04:41:06 -07:00
H.J. Lu 7e58ab243d Call __setcontext with HIDDEN_JUMPTARGET
i386 __makecontext should call __setcontext with HIDDEN_JUMPTARGET.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/i386/makecontext.S (__makecontext):
	Don't load %ebx when calling __setcontext.  Call __setcontext
	with HIDDEN_JUMPTARGET.
	* sysdeps/unix/sysv/linux/i386/setcontext.S (__setcontext): Add
	libc_hidden_def.
2015-08-19 04:41:01 -07:00
H.J. Lu 3552daa7ac Use x86-64 cacheinfo.c and sysconf.c for x86
Since _dl_x86_cpu_features is always available, we can use x86-64
cacheinfo.c and sysconf.c for both i386 and x86-64.

	* sysdeps/i386/i686/Makefile
	[$(subdir) == string] (sysdep_routines): Moved to ...
	* sysdeps/i386/Makefile: Here.
	* sysdeps/i386/i686/cacheinfo.c: Moved to ...
	* sysdeps/i386/cacheinfo.c: Here.
	* sysdeps/unix/sysv/linux/i386/sysconf.c: Removed.
	* sysdeps/unix/sysv/linux/i386/i686/sysconf.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysconf.c: Moved to ...
	* sysdeps/unix/sysv/linux/x86/sysconf.c: Here.
2015-08-19 04:27:04 -07:00
H.J. Lu 477fa2c843 Also check __i586__/__i686__ for HAS_I586/HAS_I686
* sysdeps/x86/cpu-features.h (HAS_I586): Defined to 1 if
	__i586__ is defined.
	(HAS_I686): Defined to 1 if __i686__ is defined.
2015-08-19 04:19:58 -07:00
Joseph Myers 9536661c6e Fix -Wundef warnings in elf/tst-execstack.c.
To remove -Wno-error=undef, we need to fix the remaining cases where
there are -Wundef warnings in the testsuite.  One of those places is
in elf/tst-execstack.c.

tst-execstack.c tests USE_PTHREADS with #if.  nptl/tst-execstack.c
defines USE_PTHREADS to 1 before including ../elf/tst-execstack.c,
while elf/tst-execstack.c, when compiled directly, leaves it
undefined.

This patch adds a setting of CPPFLAGS-tst-execstack.c to
elf/Makefile.  An alternative approach would be to rename
tst-execstack.c to tst-execstack-main.c and have two different
tst-execstack.c files include it, each with an appropriate
USE_PTHREADS #define.

Tested for x86_64.

	* elf/Makefile [$(have-z-execstack) = yes]
	(CPPFLAGS-tst-execstack.c): New variable.
2015-08-19 00:51:07 +00:00
Joseph Myers ccb729df47 Fix -Wundef warnings in login/tst-utmp.c.
To remove -Wno-error=undef, we need to fix the remaining cases where
there are -Wundef warnings in the testsuite.  One of those places is
in login/tst-utmp.c.

When included from tst-utmpx.c, <utmpx.h> is included instead of
<utmp.h>, meaning the _HAVE_UT_* macros are not defined.  The test is
prepared for them not being defined, in that all the relevant
conditionals also include "defined UTMPX".  However, they test the
_HAVE_UT_* macros first, so resulting in -Wundef warnings.

This patch does the minimal fix of swapping the || operands.  This is
logically correct - avoiding checking a macro we know will not be
defined in the case where it is not defined.  It won't fix such
warnings for the case where the toplevel bits/utmp.h is used and most
_HAVE_UT_* aren't defined at all even when <utmp.h> is included, but
that case doesn't apply to any current glibc configuration.  Fixing it
would also be tricky in that, while glibc itself consistently uses
_HAVE_UT_* in ways that would work with 0 instead of undefined,
external packages that use the macros expect defined / undefined
instead of 1 / 0 (codesearch.debian.net shows uses by util-linux,
python-utmp, libsys-utmp-perl).

Tested for x86_64.

	* login/tst-utmp.c [_HAVE_UT_TYPE || defined UTMPX]: Change
	conditional to [defined UTMPX || _HAVE_UT_TYPE].
	[_HAVE_UT_TV || defined UTMPX]: Change conditional to [defined
	UTMPX || _HAVE_UT_TV].
	[_HAVE_UT_TV - 0 || defined UTMPX]: Change conditional to [defined
	UTMPX || _HAVE_UT_TV - 0].
2015-08-19 00:50:17 +00:00
Joseph Myers 87336caeb5 Fix MIPS -Wundef warnings for __mips_isa_rev.
This patch fixes -Wundef warnings relating to __mips_isa_rev being
undefined.

Tested for mips64 (all three ABIs) that there is a clean build and
testsuite run with -Wno-error=undef removed (and my other -Wundef
patches applied).

	* sysdeps/mips/dl-machine.h [__mips_isa_rev < 6]: Change
	conditionals to [!defined __mips_isa_rev || __mips_isa_rev < 6].
	* sysdeps/mips/machine-gmon.h [__mips_isa_rev < 6]: Likewise.
2015-08-18 21:52:22 +00:00
Carlos Eduardo Seo 94ec7e007f powerpc: Add missing hwcap strings.
Some features in hwcap.h do not have matching string descriptors
to be displayed when LD_SHOW_AUXV=1.  This patch fixes the problem.

2015-08-13  Carlos Eduardo Seo  <cseo@linux.vnet.ibm.com>

	* sysdeps/powerpc/dl-procinfo.c:
	(_dl_powerpc_cap_flags): Added missing strings for some
	hwcap features.
	* sysdeps/powerpc/dl-procinfo.h: Updated hwcap bit count.
2015-08-18 15:48:43 -03:00
Paul Eggert 5542236837 Port the 0x7efe...feff pattern to GCC 6.
See Steve Ellcey's bug report in:
https://sourceware.org/ml/libc-alpha/2015-07/msg00673.html
* string/memrchr.c (MEMRCHR):
* string/rawmemchr.c (RAWMEMCHR):
* string/strchr.c (strchr):
* string/strchrnul.c (STRCHRNUL):
Rewrite code to avoid issues with signed shift overflow.
2015-08-18 10:00:57 -07:00
H.J. Lu 1814df5b02 Define HAS_CPUID/HAS_I586/HAS_I686 from -march=
cpuid, i586 and i686 instructions are available if the processor
specified by -march= supports them.  We can use this information
to determine whether those instructions can be used safely.

	* sysdeps/x86/cpu-features.c (init_cpu_features): Check
	whether cpuid is available only if HAS_CPUID is 0.
	* sysdeps/x86/cpu-features.h (HAS_CPUID): New.
	(HAS_I586): Likewise.
	(HAS_I686): Likewise.
2015-08-18 08:00:00 -07:00
Marko Myllynen 441c3b59d1 Fix lang_lib/lang_term as per ISO 639-2 [BZ #16973]
lang_lib (which reflects ISO 639-2/B (bibliographic) codes) and
lang_term (which reflects ISO 639-2/T (terminology) codes) should be
identical except for those languages for which ISO 639-2 specifies
separate bibliographic/terminology values.

I used this Library of Congress page as the source:
	http://www.loc.gov/standards/iso639-2/php/code_list.php
2015-08-18 10:15:04 -04:00