Roland McGrath [Tue, 13 May 2014 17:22:21 +0000 (10:22 -0700)]
Move NPTL public ABI headers for ARM to sysdeps/arm/nptl/.
Ondřej Bílka [Tue, 13 May 2014 17:40:15 +0000 (19:40 +0200)]
fix changelog.
Sami Kerola [Tue, 13 May 2014 17:38:32 +0000 (19:38 +0200)]
tzselect: use zonedir instead of current working directory
Roland McGrath [Tue, 13 May 2014 17:04:20 +0000 (10:04 -0700)]
Verbatim NPTL file moves for ARM/Linux.
Roland McGrath [Tue, 13 May 2014 17:04:05 +0000 (10:04 -0700)]
Consolidate NPTL configury for ARM/Linux.
Roland McGrath [Tue, 13 May 2014 17:03:45 +0000 (10:03 -0700)]
Consolidate NPTL vs non clone.S for ARM.
Roland McGrath [Tue, 13 May 2014 16:49:20 +0000 (09:49 -0700)]
Clean up __exit_thread.
Andreas Schwab [Tue, 13 May 2014 15:06:58 +0000 (17:06 +0200)]
Fix typo in assertion
Joseph Myers [Mon, 12 May 2014 22:48:25 +0000 (22:48 +0000)]
Clean up kernel version conditionals for pre-2.6.32 kernels.
This patch does some initial cleanup, following the move to 2.6.32
minimum kernel version, by removing __LINUX_KERNEL_VERSION
conditionals that are now always-true or always-false. In the case of
__ASSUME_ARG_MAX_STACK_BASED, where the conditional used a kernel
version that was itself in a macro, the associated sysconf.c code is
also cleaned up and __ASSUME_ARG_MAX_STACK_BASED removed completely.
Tested x86_64 that disassembly of installed shared libraries is
unchanged by the patch.
* sysdeps/unix/sysv/linux/kernel-features.h [__s390__]
(__ASSUME_UTIMES): Do not condition on kernel version.
(__ASSUME_PSELECT): Define unconditionally.
(__ASSUME_PPOLL): Likewise.
(__ASSUME_ATFCTS): Likewise.
(__ASSUME_SET_ROBUST_LIST): Do not condition on kernel version.
(__ASSUME_COMPLETE_READV_WRITEV): Define unconditionally.
(__ASSUME_FUTEX_LOCK_PI): Do not condition on kernel version.
(__ASSUME_UTIMENSAT): Define unconditionally.
(__ASSUME_PRIVATE_FUTEX): Likewise.
(__ASSUME_FALLOCATE): Likewise.
(__ASSUME_O_CLOEXEC): Likewise.
(__LINUX_ARG_MAX_STACK_BASED_MIN_KERNEL): Remove.
(__ASSUME_ARG_MAX_STACK_BASED): Likewise.
(__ASSUME_ADJ_OFFSET_SS_READ): Define unconditionally.
(__ASSUME_SOCK_CLOEXEC): Do not condition on kernel version.
(__ASSUME_IN_NONBLOCK): Likewise.
(__ASSUME_PIPE2): Likewise.
(__ASSUME_EVENTFD2): Likewise.
(__ASSUME_SIGNALFD4): Likewise.
(__ASSUME_DUP3): Likewise.
[__x86_64__ || __sparc__] (__ASSUME_ACCEPT4_SYSCALL): Likewise.
(__ASSUME_FUTEX_CLOCK_REALTIME): Define unconditionally.
(__ASSUME_AT_RANDOM): Likewise.
(__ASSUME_PREADV): Likewise.
(__ASSUME_PWRITEV): Likewise.
(__ASSUME_REQUEUE_PI): Do not condition on kernel version.
(__ASSUME_F_GETOWN_EX): Define unconditionally.
(__ASSUME_XFS_RESTRICTED_CHOWN): Likewise.
* sysdeps/unix/sysv/linux/sysconf.c (__sysconf)
[!__ASSUME_ARG_MAX_STACK_BASED]: Remove conditional code.
* sysdeps/unix/sysv/linux/alpha/kernel-features.h
(__ASSUME_O_CLOEXEC): Define unconditionally.
(__ASSUME_PSELECT): Do not undefine conditionally.
(__ASSUME_PPOLL): Likewise.
(__ASSUME_ATFCTS): Likewise.
(__ASSUME_SET_ROBUST_LIST): Likewise.
(__ASSUME_UTIMENSAT): Likewise.
(__ASSUME_FDATASYNC): Define unconditionally.
* sysdeps/unix/sysv/linux/arm/kernel-features.h
(__ASSUME_SIGFRAME_V2): Likewise.
)__ASSUME_EVENTFD2): Likewise.
(__ASSUME_SIGNALFD4): Likewise.
(__ASSUME_PSELECT): Do not undefine conditionally.
(__ASSUME_PPOLL): Likewise.
* sysdeps/unix/sysv/linux/ia64/kernel-features.h
(__ASSUME_PSELECT): Define unconditionally.
(__ASSUME_PPOLL): Likewise.
(__ASSUME_O_CLOEXEC): Likewise.
(__ASSUME_SOCK_CLOEXEC): Likewise.
(__ASSUME_IN_NONBLOCK): Likewise.
(__ASSUME_PIPE2): Likewise.
(__ASSUME_EVENTFD2): Likewise.
(__ASSUME_SIGNALFD4): Likewise.
(__ASSUME_DUP3): Likewise.
* sysdeps/unix/sysv/linux/m68k/kernel-features.h
(__ASSUME_O_CLOEXEC): Likewise.
(__ASSUME_SOCK_CLOEXEC): Likewise.
(__ASSUME_IN_NONBLOCK): Likewise.
(__ASSUME_PIPE2): Likewise.
(__ASSUME_EVENTFD2): Likewise.
(__ASSUME_SIGNALFD4): Likewise.
(__ASSUME_DUP3): Likewise.
* sysdeps/unix/sysv/linux/mips/kernel-features.h
(__ASSUME_EVENTFD2): Likewise.
(__ASSUME_SIGNALFD4): Likewise.
(__ASSUME_ACCEPT4_SYSCALL): Likewise.
Andreas Schwab [Thu, 8 May 2014 14:53:01 +0000 (16:53 +0200)]
Fix unbound stack use in NIS NSS module
Will Newton [Mon, 19 Aug 2013 10:39:55 +0000 (11:39 +0100)]
malloc: Add mallopt test.
ChangeLog:
2014-05-12 Will Newton <will.newton@linaro.org>
* malloc/Makefile (tests): Add tst-mallopt.
* malloc/tst-mallopt.c: New file.
Roland McGrath [Fri, 9 May 2014 18:08:39 +0000 (11:08 -0700)]
Make armv7 strcmp assembly compatible with ARM mode and SFI.
Adhemerval Zanella [Fri, 9 May 2014 18:35:28 +0000 (15:35 -0300)]
Fix elf/tst-tls9-static build
This patch fixes the tst-tlsmod[5/6].so build in system that uses
-Wl,--as-needed as default in linker option. Without this option
the testing shared library that does not have libc.so in DT_NEEDED
and the tst-tls9-static fails in architecture that use the
./sysdeps/unix/sysv/linux/<arch>/dl-static.c trick.
Roland McGrath [Fri, 9 May 2014 17:05:29 +0000 (10:05 -0700)]
Silence a missing-noreturn warning for _Unwind_Resume.
Joseph Myers [Fri, 9 May 2014 16:59:56 +0000 (16:59 +0000)]
Include SSE state in i386 fenv_t (bug 16064).
This patch fixes bug 16064, i386 fenv_t not including SSE state, using
the technique suggested there of storing the state in the existing
__eip field of fenv_t to avoid needing to increase the size of fenv_t
and add new symbol versions. The included testcase, which previously
failed for i386 (but passed for x86_64), illustrates how the previous
state was buggy.
This patch causes the SSE state to be included *to the extent it is on
x86_64*. Where some state should logically be included but isn't for
x86_64 (see bug 16068), this patch does not cause it to be included
for i386 either. The idea is that any patch fixing that bug should
fix it for both x86_64 and i386 at once.
Tested i386 and x86_64. (I haven't tested the case of a CPU without
SSE2 disabling the test.)
[BZ #16064]
* sysdeps/i386/fpu/fegetenv.c: Include <unistd.h>, <ldsodefs.h>
and <dl-procinfo.h>.
(__fegetenv): Save SSE state in envp->__eip if supported.
* sysdeps/i386/fpu/feholdexcpt.c (feholdexcept): Save SSE state in
envp->__eip if supported.
* sysdeps/i386/fpu/fesetenv.c: Include <unistd.h>, <ldsodefs.h>
and <dl-procinfo.h>.
(__fesetenv): Always set __eip, __cs_selector, __opcode,
__data_offset and __data_selector in environment to 0. Set SSE
state if supported.
* sysdeps/x86/fpu/Makefile [$(subdir) = math] (tests): Add
test-fenv-sse.
[$(subdir) = math] (CFLAGS-test-fenv-sse.c): Add -msse2
-mfpmath=sse.
* sysdeps/x86/fpu/test-fenv-sse.c: New file.
Will Newton [Fri, 9 May 2014 12:53:56 +0000 (13:53 +0100)]
ARM: Allow auto-detection of linker relro feature
Set values for libc_commonpagesize and libc_relro_required for the
ARM port to enable relro by default and suppress a warning at
configure time.
ChangeLog:
2014-05-09 Will Newton <will.newton@linaro.org>
* sysdeps/arm/preconfigure.ac: Set libc_commonpagesize
and libc_relro_required for ARM.
* sysdeps/arm/preconfigure: Regenerate.
Dominik Vogt [Fri, 9 May 2014 14:58:46 +0000 (16:58 +0200)]
S/390: Port of lock elision to System/z
Added support for TX lock elision of pthread mutexes on s390 and
s390x. This may improve lock scaling of existing programs on TX
capable systems. The lock elision code is only built with
--enable-lock-elision=yes and then requires a GCC version supporting
the TX builtins. With lock elision default mutexes are elided via
__builtin_tbegin, if the cpu supports transactions. By default lock
elision is not enabled and the elision code is not built.
Will Newton [Wed, 23 Apr 2014 12:21:47 +0000 (13:21 +0100)]
ARM: Add optimized ARMv7 strcmp implementation
Add an optimized implementation of strcmp for ARMv7-A cores. This
implementation is significantly faster than the current generic C
implementation, particularly for strings of 16 bytes and longer.
Tested with the glibc string tests for arm-linux-gnueabihf and
armeb-linux-gnueabihf.
The code was written by ARM, who have agreed to assign the copyright
to the FSF for integration into glibc.
ChangeLog:
2014-05-09 Will Newton <will.newton@linaro.org>
* sysdeps/arm/armv7/strcmp.S: New file.
* NEWS: Mention addition of ARMv7 optimized strcmp.
Roland McGrath [Thu, 8 May 2014 18:27:14 +0000 (11:27 -0700)]
Some configure-related decrufting.
Roland McGrath [Thu, 8 May 2014 17:47:35 +0000 (10:47 -0700)]
Fix -Wundef for _UTSNAME_DOMAIN_LENGTH.
Steve Ellcey [Wed, 7 May 2014 20:15:52 +0000 (13:15 -0700)]
Add 16922 to list of bugs fixed.
Steve Ellcey [Wed, 7 May 2014 20:10:48 +0000 (13:10 -0700)]
2014-05-07 Steve Ellcey <sellcey@mips.com>
[BZ# 16922]
* sysdeps/mips/sys/asm.h (INT_SUB): Fix definition.
(LONG_SUB): Ditto.
(PTR_SUB): Ditto.
Andreas Schwab [Wed, 7 May 2014 09:47:20 +0000 (11:47 +0200)]
Fix parsing of getai result from nscd for IPv6-only request
Ondřej Bílka [Wed, 7 May 2014 12:08:57 +0000 (14:08 +0200)]
Fix typo in nscd/selinux.c
Ondřej Bílka [Wed, 7 May 2014 11:58:23 +0000 (13:58 +0200)]
Fix typo in nptl/sockperf.c
Roland McGrath [Tue, 6 May 2014 22:55:20 +0000 (15:55 -0700)]
Move ARM internal unwind.h header to the right sysdeps directory.
Aurelien Jarno [Tue, 6 May 2014 21:31:44 +0000 (23:31 +0200)]
SPARC: add EFD_SEMAPHORE in <bits/eventfd.h> (BZ #16916)
EFD_SEMAPHORE has been added in the main <bits/eventfd.h>, but not in
the SPARC specific version. Fix that.
Vidya Ranganathan [Tue, 6 May 2014 00:10:45 +0000 (19:10 -0500)]
PowerPC: strncpy/stpncpy optimization for PPC64/POWER7
The optimization is achieved by following techniques:
> data alignment [gain from aligned memory access on read/write]
> POWER7 gains performance with loop unrolling/unwinding
[gain by reduction of branch penalty].
> zero padding done by calling optimized memset
Andreas Schwab [Tue, 6 May 2014 09:55:24 +0000 (11:55 +0200)]
Don't use catomic functions in mcount (BZ #16912)
mcount cannot use catomic functions since it is called by
__libc_start_main before TLS is set up. This reverts the change made by
commit 8099361.
Roland McGrath [Mon, 5 May 2014 20:16:08 +0000 (13:16 -0700)]
Move rules for Linux-specific pldd program to Linux-specific Makefile.
Roland McGrath [Mon, 5 May 2014 20:06:18 +0000 (13:06 -0700)]
Fix -Wundef issues in generated errlist.c.
Adhemerval Zanella [Fri, 2 May 2014 17:00:36 +0000 (12:00 -0500)]
PowerPC: ifunc improvement for internal calls
This patch changes de default symbol redirection for internal call of
memcpy, memset, memchr, and strlen to the IFUNC resolved ones. The
performance improvement is noticeable in algorithms that uses these
symbols extensible, like the regex functions.
Adam Conrad [Sun, 4 May 2014 05:45:15 +0000 (23:45 -0600)]
Revert incorrect removal of the XDR currency from locale/iso-4217.def
In
7447ccd98ee3944a95247ae23284dfac1de6c2aa, the XDR currency was
removed from locale/iso-4217.def, despite the fact that it's both
still a part of the standard, according to the official table:
http://www.currency-iso.org/dam/downloads/table_a1.xml
... and, more importantly, is referenced from localedata/i18n, so
any quick-and-dirty locale definition that uses "copy i18n" for
LC_MONETARY wouldn't work anymore.
Allan McRae [Sun, 4 May 2014 03:35:16 +0000 (13:35 +1000)]
Update Esperanto translations
Carlos O'Donell [Sat, 3 May 2014 04:25:21 +0000 (00:25 -0400)]
Fix -Wundef warning for FEATURE_INDEX_1.
Define FEATURE_INDEX_1 and FEATURE_INDEX_MAX as macros
for use by both assembly and C code. This fixes the
-Wundef error for cases where FEATURE_INDEX_1 was not
defined but used the correct value of 0 for an undefined
macro.
Steve Ellcey [Thu, 1 May 2014 20:42:40 +0000 (13:42 -0700)]
2014-05-01 Steve Ellcey <sellcey@mips.com>
* iconvdata/ansi_x3.110.c (ONE_DIRECTION): Define.
* iconvdata/armscii-8.c (ONE_DIRECTION): Define.
* iconvdata/big5.c (ONE_DIRECTION): Define.
* iconvdata/big5hkscs.c (ONE_DIRECTION): Define.
* iconvdata/cp1255.c (ONE_DIRECTION): Define.
* iconvdata/cp1258.c (ONE_DIRECTION): Define.
* iconvdata/cp932.c (ONE_DIRECTION): Define.
* iconvdata/euc-cn.c (ONE_DIRECTION): Define.
* iconvdata/euc-jisx0213.c (ONE_DIRECTION): Define.
* iconvdata/euc-jp-ms.c (ONE_DIRECTION): Define.
* iconvdata/euc-jp.c (ONE_DIRECTION): Define.
* iconvdata/euc-kr.c (ONE_DIRECTION): Define.
* iconvdata/euc-tw.c (ONE_DIRECTION): Define.
* iconvdata/gb18030.c (ONE_DIRECTION): Define.
* iconvdata/gbbig5.c (ONE_DIRECTION): Define.
* iconvdata/gbgbk.c (ONE_DIRECTION): Define.
* iconvdata/gbk.c (ONE_DIRECTION): Define.
* iconvdata/ibm1364.c (ONE_DIRECTION): Define.
* iconvdata/ibm930.c (ONE_DIRECTION): Define.
* iconvdata/ibm932.c (ONE_DIRECTION): Define.
* iconvdata/ibm933.c (ONE_DIRECTION): Define.
* iconvdata/ibm935.c (ONE_DIRECTION): Define.
* iconvdata/ibm937.c (ONE_DIRECTION): Define.
* iconvdata/ibm939.c (ONE_DIRECTION): Define.
* iconvdata/ibm943.c (ONE_DIRECTION): Define.
* iconvdata/iso-2022-cn-ext.c (ONE_DIRECTION): Define.
* iconvdata/iso-2022-cn.c (ONE_DIRECTION): Define.
* iconvdata/iso-2022-jp-3.c (ONE_DIRECTION): Define.
* iconvdata/iso-2022-jp.c (ONE_DIRECTION): Define.
* iconvdata/iso-2022-kr.c (ONE_DIRECTION): Define.
* iconvdata/iso646.c (ONE_DIRECTION): Define.
* iconvdata/iso8859-1.c (ONE_DIRECTION): Define.
* iconvdata/iso_11548-1.c (ONE_DIRECTION): Define.
* iconvdata/iso_6937-2.c (ONE_DIRECTION): Define.
* iconvdata/iso_6937.c (ONE_DIRECTION): Define.
* iconvdata/johab.c (ONE_DIRECTION): Define.
* iconvdata/shift_jisx0213.c (ONE_DIRECTION): Define.
* iconvdata/sjis.c (ONE_DIRECTION): Define.
* iconvdata/t.61.c (ONE_DIRECTION): Define.
* iconvdata/tcvn5712-1.c (ONE_DIRECTION): Define.
* iconvdata/tscii.c (ONE_DIRECTION): Define.
* iconvdata/uhc.c (ONE_DIRECTION): Define.
* iconvdata/unicode.c (ONE_DIRECTION): Define.
* iconvdata/utf-16.c (ONE_DIRECTION): Define.
* iconvdata/utf-32.c (ONE_DIRECTION): Define.
* iconvdata/utf-7.c (ONE_DIRECTION): Define.
David S. Miller [Thu, 1 May 2014 20:35:59 +0000 (16:35 -0400)]
NEWS: Add 16885 to fixed bug list.
Roland McGrath [Thu, 1 May 2014 20:33:13 +0000 (13:33 -0700)]
Fix -Wundef warnings for _IO_JUMPS_OFFSET.
Roland McGrath [Thu, 1 May 2014 20:08:30 +0000 (13:08 -0700)]
Deconditionalize use of LLL_LOCK_INITIALIZER in bits/libc-lock.h.
Andreas Schwab [Thu, 1 May 2014 20:00:34 +0000 (22:00 +0200)]
Fix implicit declaration
David S. Miller [Wed, 30 Apr 2014 19:57:51 +0000 (12:57 -0700)]
Fix v9/64-bit strcmp when string ends in multiple zero bytes.
[BZ #16885]
* sysdeps/sparc/sparc64/strcmp.S: Fix end comparison handling when
multiple zero bytes exist at the end of a string.
Reported by Aurelien Jarno <aurelien@aurel32.net>
* string/test-strcmp.c (check): Add explicit test for situations where
there are multiple zero bytes after the first.
Andreas Schwab [Thu, 1 May 2014 13:50:27 +0000 (15:50 +0200)]
Correctly handle %p in wprintf (BZ #16890)
Steve Ellcey [Thu, 1 May 2014 17:22:35 +0000 (10:22 -0700)]
2014-05-01 Steve Ellcey <sellcey@mips.com>
* intl/iconv/skeleton.c (ONE_DIRECTION): Remove define.
* iconv/gconv_simple.c (ONE_DIRECTION): Define.
* iconvdata/8bit-gap.c (ONE_DIRECTION): Ditto.
* iconvdata/8bit-generic.c (ONE_DIRECTION): Ditto.
Steve Ellcey [Thu, 1 May 2014 17:09:04 +0000 (10:09 -0700)]
2014-05-01 Steve Ellcey <sellcey@mips.com>
* stdlib/longlong.h: Updated from GCC.
Will Newton [Thu, 1 May 2014 15:26:35 +0000 (16:26 +0100)]
NEWS: Add 15119 to fixed bug list
Will Newton [Thu, 1 May 2014 13:25:44 +0000 (14:25 +0100)]
ARM: Remove lowlevellock.c
lowlevellock.c for arm differs from the generic lowlevellock.c only in
insignificant ways, so can be removed. Happily, this fixes BZ 15119
(unnecessary busy loop in __lll_timedlock_wait on arm).
The notable differences between the arm and generic implementations are:
1) arm __lll_timedlock_wait has a fast path out if futex has been set
to 0 between since the function was called. This seems unlikely to
happen very often, so it seems at worst harmless to lose this fast
path.
2) Some function in arm's lowlevellock.c set futex to 2 if it was 1.
The generic version always sets the futex to 2. As futex can only be
0, 1 or 2 on entry into these functions, the behaviour is equivalent.
(If the futex manages to be 0 on entry then we've just lost another
unlikely fast path out.)
There are no test suite regressions.
Note that hppa and sparc also have their own lowlevellock.c. I believe
hppa can also be removed, so I'll send a separate patch for that
shortly. sparc's seems to be genuinely needed as it uses a different
locking structure.
Also note that the analysis at
https://sourceware.org/ml/libc-ports/2013-02/msg00021.html indicates a
further locking performance bug to fix - I've got a partial patch for
that which I can submit once I've finished testing.
2014-05-01 Bernard Ogden <bernie.ogden@linaro.org>
[BZ #15119]
* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c: Remove file.
David S. Miller [Wed, 30 Apr 2014 22:14:58 +0000 (15:14 -0700)]
Add round-mode context support to sparc.
* sysdeps/sparc/fpu/fenv_private.h (HAVE_RM_CTX): Define.
(libc_feholdexcept_setround_sparc_ctx): New function.
(libc_fesetenv_sparc_ctx): Likewise.
(libc_feupdateenv_sparc_ctx): Likewise.
(libc_feholdsetround_sparc_ctx): Likewise.
(libc_feholdexcept_setround_ctx): Define.
(libc_feholdexcept_setroundf_ctx): Likewise.
(libc_feholdexcept_setroundl_ctx): Likewise.
(libc_fesetenv_ctx): Likewise.
(libc_fesetenvf_ctx): Likewise.
(libc_fesetenvl_ctx): Likewise.
(libc_feupdateenv_ctx): Likewise.
(libc_feupdateenvf_ctx): Likewise.
(libc_feupdateenvl_ctx): Likewise.
(libc_feresetround_ctx): Likewise.
(libc_feresetroundf_ctx): Likewise.
(libc_feresetroundl_ctx): Likewise.
(libc_feholdsetround_ctx): Likewise.
(libc_feholdsetroundf_ctx): Likewise.
(libc_feholdsetroundl_ctx): Likewise.
David S. Miller [Wed, 30 Apr 2014 20:37:04 +0000 (13:37 -0700)]
Correct sparc CPP guards for EMT_TAGOVF.
* sysdeps/unix/sysv/linux/sparc/bits/siginfo.h (EMT_TAGOVF): Protect
with __USE_GNU instead of XOPEN cpp guards.
David S. Miller [Wed, 30 Apr 2014 18:39:47 +0000 (11:39 -0700)]
Fix some sparc -Wundef build warnings.
* sysdeps/sparc/bits/string.h (_STRING_ARCH_unaligned): Define to
0.
David S. Miller [Wed, 30 Apr 2014 18:37:41 +0000 (11:37 -0700)]
Fix some sparc conform test failures in siginfo.h
* sysdeps/unix/sysv/linux/sparc/bits/siginfo.h (EMT_TAGOVF): Protect
with XOPEN cpp guards.
Roland McGrath [Wed, 30 Apr 2014 17:40:29 +0000 (10:40 -0700)]
Move ports/ChangeLog* files to ChangeLog.old-ports*, remove ports/ directory.
Roland McGrath [Wed, 30 Apr 2014 17:39:28 +0000 (10:39 -0700)]
Add deprecation header text to remaining ports/ChangeLog* files.
Julian Brown [Wed, 30 Apr 2014 16:17:59 +0000 (16:17 +0000)]
ARM: Fix R_ARM_IRELATIVE RELA relocations.
This patch fixes what I believe to be a bug in the handling of
R_ARM_IRELATIVE RELA relocations. At present, these are handled the
same as REL relocations: i.e. the addend is loaded from the relocation
address. Most of the time this isn't a problem because RELA relocations
aren't used on ARM (GNU/Linux at least) anyway, but it causes problems
with prelink, which uses RELA on all targets for its conflict table.
(Support for ifunc prelinking requires a prelink patch, not yet posted.)
Anyway, this patch works, though I'm not 100% sure if it is correct: I
notice that this code path received attention last year:
https://sourceware.org/ml/libc-ports/2013-07/msg00000.html
I'm not sure under what circumstances that patch would have had an
effect, nor if my patch conflicts with that case.
No regressions using Mentor's usual glibc cross-testing infrastructure.
[BZ #16888]
* sysdeps/arm/dl-machine.h (elf_machine_rela): Fix R_ARM_IRELATIVE
handling.
Joseph Myers [Wed, 30 Apr 2014 15:39:30 +0000 (15:39 +0000)]
Increase minimum Linux kernel version to 2.6.32.
This patch increases the minimum Linux kernel version for glibc to
2.6.32, as discussed in the thread starting at
<https://sourceware.org/ml/libc-alpha/2014-01/msg00511.html>.
This patch just does the minimal change to arch_minimum_kernel
settings (and LIBC_LINUX_VERSION, which determines the minimum kernel
headers version, as it doesn't make sense for that to be older than
the minimum kernel that can be used at runtime). Followups would be
expected to do, roughly and not necessarily precisely in this order:
* Remove __LINUX_KERNEL_VERSION checks in kernel-features.h files
where those checks are always true / always false for kernels 2.6.32
and above.
* Otherwise simplify/improve conditionals in those files (for example,
where defining once in the main file then undefining in
architecture-specific files makes things clearer than having lots of
separate definitions of the same macro), possibly fixing in the
process cases where a macro should optimally have been defined for a
given architecture but wasn't. (In the review in preparation for
this version increase I checked what the right conditions should be
for all macros in the main kernel-features.h whose definitions there
would have been affected by the increase - but I only fixed that
subset of the issues found where --enable-kernel=2.6.32 would have
caused a kernel feature to be wrongly assumed to be present, not any
cases where a feature is not assumed but could be assumed.)
* Remove conditionals on __ASSUME_* where they can now be taken to be
always-true, and the definitions when the macros are only used in
Linux-specific files.
* Split more architectures out of the main kernel-features.h (like
ex-ports architectures), once various of the architecture
conditionals there have been eliminated so the new
architecture-specific files are no larger than actually necessary.
Tested x86_64.
2014-03-27 Joseph Myers <joseph@codesourcery.com>
[BZ #9894]
* sysdeps/unix/sysv/linux/configure.ac (LIBC_LINUX_VERSION):
Change to 2.6.32.
(arch_minimum_kernel): Change all 2.6.16 settings to 2.6.32.
* sysdeps/unix/sysv/linux/configure: Regenerated.
* sysdeps/unix/sysv/linux/microblaze/configure.ac: Remove file.
* sysdeps/unix/sysv/linux/microblaze/configure: Likewise.
* sysdeps/unix/sysv/linux/tile/configure.ac: Likewise.
* sysdeps/unix/sysv/linux/tile/configure: Likewise.
* README: Update reference to required Linux kernel version.
* manual/install.texi (Linux): Update reference to required Linux
kernel headers version.
* INSTALL: Regenerated.
Joseph Myers [Wed, 30 Apr 2014 15:35:18 +0000 (15:35 +0000)]
conformtest: clean up POSIX expectations for stdlib.h, string.h.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for stdlib.h and
string.h. Tested x86_64; no new XFAILs needed.
* conform/data/stdlib.h-data [POSIX] (stddef.h): Do not allow
header inclusion.
[POSIX] (limits.h): Likewise.
[POSIX] (math.h): Likewise.
[POSIX] (sys/wait.h): Likewise.
* conform/data/string.h-data [POSIX || UNIX98] (strtok_r): Require
function.
[POSIX] (stddef.h): Do not allow header inclusion.
Andreas Schwab [Wed, 30 Apr 2014 14:23:50 +0000 (16:23 +0200)]
ChangeLog cleanup
Adhemerval Zanella [Tue, 29 Apr 2014 19:15:45 +0000 (14:15 -0500)]
More fixes for unsafe compiler optimization
GCC 4.9 -ftree-loop-distribute-patterns now may transform loops in
memcpy. Add the alias to internal GLIBC symbol to avoid PLT creation.
Yang Yingliang [Wed, 30 Apr 2014 10:16:18 +0000 (15:46 +0530)]
Fix lll_unlock twice in pthread_cond_broadcast
lll_unlock() will be called again if it goes to "wake_all" in
pthread_cond_broadcast(). This may make another thread which is
waiting for lock in pthread_cond_timedwait() unlock. So there are
more than one threads get the lock, it will break the shared data.
It's introduced by commit
8313cb997d2d("FUTEX_*_REQUEUE_PI support for
non-x86 code")
Siddhesh Poyarekar [Wed, 30 Apr 2014 06:30:39 +0000 (12:00 +0530)]
Initialize all of datahead structure in nscd (BZ #16791)
The datahead structure has an unused padding field that remains
uninitialized. Valgrind prints out a warning for it on querying a
netgroups entry. This is harmless, but is a potential data leak since
it would result in writing out an uninitialized byte to the cache
file. Besides, this happens only when there is a cache miss, so we're
not adding computation to any fast path.
Siddhesh Poyarekar [Wed, 30 Apr 2014 06:27:09 +0000 (11:57 +0530)]
Consolidate code to initialize nscd dataset header
This patch consolidates the code to initialize the header of a dataset
into a single set of functions (one for positive and another for
negative datasets) primarily to reduce repetition of code. The
secondary reason is to simplify Patch 2/2 which fixes the problem of
an uninitialized byte in the header by initializing an unused field in
the structure and hence preventing a possible data leak into the cache
file.
Siddhesh Poyarekar [Wed, 30 Apr 2014 06:18:43 +0000 (11:48 +0530)]
Do not fail if one of the two responses to AF_UNSPEC fails (BZ #14308)
[Fixes BZ #14308, #12994, #13651]
AF_UNSPEC results in sending two queries in parallel, one for the A
record and the other for the AAAA record. If one of these is a
referral, then the query fails, which is wrong. It should return at
least the one successful response.
The fix has two parts. The first part makes the referral fall back to
the SERVFAIL path, which results in using the successful response.
There is a bug in that path however, due to which the second part is
necessary. The bug here is that if the first response is a failure
and the second succeeds, __libc_res_nsearch does not detect that and
assumes a failure. The case where the first response is a success and
the second fails, works correctly.
This condition is produced by buggy routers, so here's a crude
interposable library that can simulate such a condition. The library
overrides the recvfrom syscall and modifies the header of the packet
received to reproduce this scenario. It has two key variables:
mod_packet and first_error.
The mod_packet variable when set to 0, results in odd packets being
modified to be a referral. When set to 1, even packets are modified
to be a referral.
The first_error causes the first response to be a failure so that a
domain-appended search is performed to test the second part of the
__libc_nsearch fix.
The driver for this fix is a simple getaddrinfo program that does an
AF_UNSPEC query. I have omitted this since it should be easy to
implement.
I have tested this on x86_64.
The interceptor library source:
/* Override recvfrom and modify the header of the first DNS response to make it
a referral and reproduce bz #845218. We have to resort to this ugly hack
because we cannot make bind return the buggy response of a referral for the
AAAA record and an authoritative response for the A record. */
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdbool.h>
#include <endian.h>
#include <dlfcn.h>
#include <stdlib.h>
/* Lifted from resolv/arpa/nameser_compat.h. */
typedef struct {
unsigned id :16; /*%< query identification number */
#if BYTE_ORDER == BIG_ENDIAN
/* fields in third byte */
unsigned qr: 1; /*%< response flag */
unsigned opcode: 4; /*%< purpose of message */
unsigned aa: 1; /*%< authoritive answer */
unsigned tc: 1; /*%< truncated message */
unsigned rd: 1; /*%< recursion desired */
/* fields
* in
* fourth
* byte
* */
unsigned ra: 1; /*%< recursion available */
unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */
unsigned ad: 1; /*%< authentic data from named */
unsigned cd: 1; /*%< checking disabled by resolver */
unsigned rcode :4; /*%< response code */
#endif
#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
/* fields
* in
* third
* byte
* */
unsigned rd :1; /*%< recursion desired */
unsigned tc :1; /*%< truncated message */
unsigned aa :1; /*%< authoritive answer */
unsigned opcode :4; /*%< purpose of message */
unsigned qr :1; /*%< response flag */
/* fields
* in
* fourth
* byte
* */
unsigned rcode :4; /*%< response code */
unsigned cd: 1; /*%< checking disabled by resolver */
unsigned ad: 1; /*%< authentic data from named */
unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */
unsigned ra :1; /*%< recursion available */
#endif
/* remaining
* bytes
* */
unsigned qdcount :16; /*%< number of question entries */
unsigned ancount :16; /*%< number of answer entries */
unsigned nscount :16; /*%< number of authority entries */
unsigned arcount :16; /*%< number of resource entries */
} HEADER;
static int done = 0;
/* Packets to modify. 0 for the odd packets and 1 for even packets. */
static const int mod_packet = 0;
/* Set to true if the first request should result in an error, resulting in a
search query. */
static bool first_error = true;
static ssize_t (*real_recvfrom) (int sockfd, void *buf, size_t len, int flags,
struct sockaddr *src_addr, socklen_t *addrlen);
void
__attribute__ ((constructor))
init (void)
{
real_recvfrom = dlsym (RTLD_NEXT, "recvfrom");
if (real_recvfrom == NULL)
{
printf ("Failed to get reference to recvfrom: %s\n", dlerror ());
printf ("Cannot simulate test\n");
abort ();
}
}
/* Modify the second packet that we receive to set the header in a manner as to
reproduce BZ #845218. */
static void
mod_buf (HEADER *h, int port)
{
if (done % 2 == mod_packet || (first_error && done == 1))
{
printf ("(Modifying header)");
if (first_error && done == 1)
h->rcode = 3;
else
h->rcode = 0; /* NOERROR == 0. */
h->ancount = 0;
h->aa = 0;
h->ra = 0;
h->arcount = 0;
}
done++;
}
ssize_t
recvfrom (int sockfd, void *buf, size_t len, int flags,
struct sockaddr *src_addr, socklen_t *addrlen)
{
ssize_t ret = real_recvfrom (sockfd, buf, len, flags, src_addr, addrlen);
int port = htons (((struct sockaddr_in *) src_addr)->sin_port);
struct in_addr addr = ((struct sockaddr_in *) src_addr)->sin_addr;
const char *host = inet_ntoa (addr);
printf ("\n*** From %s:%d: ", host, port);
mod_buf (buf, port);
printf ("returned %zd\n", ret);
return ret;
}
Carlos O'Donell [Tue, 29 Apr 2014 17:33:08 +0000 (13:33 -0400)]
Final update to ports ChangeLog.
Indicate the removal of the README and carry out the
final update to the ports/ChangeLog.
Carlos O'Donell [Tue, 29 Apr 2014 17:31:05 +0000 (13:31 -0400)]
Remove ports README and update machine ChangeLogs.
This patch removes the ports/README now that ports is no longer
being used. It also adds a header to all ChangeLogs for all machines
that were moved to the main libc tree. The header indicates that the
ChangeLog is no longer used.
Steve Ellcey [Tue, 29 Apr 2014 17:19:30 +0000 (10:19 -0700)]
2014-04-29 Steve Ellcey <sellcey@mips.com>
* iconf/skeleton.c (ONE_DIRECTION): Set default value if not set.
Stefan Liebler [Tue, 29 Apr 2014 13:45:11 +0000 (15:45 +0200)]
Mention BZ16823 in NEWS
Stefan Liebler [Tue, 29 Apr 2014 13:43:36 +0000 (15:43 +0200)]
[BZ #16823] Fix log1pl returning wrong infinity sign
Adhemerval Zanella [Tue, 29 Apr 2014 12:45:05 +0000 (07:45 -0500)]
Fix
Adhemerval Zanella [Mon, 28 Apr 2014 19:38:24 +0000 (14:38 -0500)]
PowerPC: Suppress unnecessary FPSCR write
This patch optimizes the FPSCR update on exception and rounding change
functions by just updating its value if new value if different from
current one. It also optimizes fedisableexcept and feenableexcept by
removing an unecessary FPSCR read.
Carlos O'Donell [Tue, 29 Apr 2014 07:08:48 +0000 (03:08 -0400)]
Relocate hppa from ports to libc.
Carlos O'Donell [Tue, 29 Apr 2014 06:48:16 +0000 (02:48 -0400)]
hppa: Update lowlevellock.h.
Cleanup and remove old lll_private_futex_wake macro and add
generic support for PI-aware futexes.
Carlos O'Donell [Tue, 29 Apr 2014 06:38:50 +0000 (02:38 -0400)]
hppa: Use lll_futex_wake.
The lll_private_futex_wake function no longer exists. Instead use
lll_futex_make with LLL_PRIVATE as the last argument.
Carlos O'Donell [Tue, 29 Apr 2014 06:35:06 +0000 (02:35 -0400)]
hppa: Use r25 as second input to __longjmp.
The generated assembly is simplified if we use r25,
the expected second argument to the function given the
calling convention.
Ondřej Bílka [Mon, 28 Apr 2014 16:50:22 +0000 (18:50 +0200)]
Fix types of stream hook functions in manual.
Ondřej Bílka [Mon, 28 Apr 2014 16:08:32 +0000 (18:08 +0200)]
Fix recvmmsg comment.
Wilco Dijkstra [Mon, 28 Apr 2014 09:53:04 +0000 (10:53 +0100)]
[ARM] Add support for fenv_private on ARM.
H.J. Lu [Fri, 25 Apr 2014 16:33:41 +0000 (09:33 -0700)]
Replace __int128 with __int128_t in bits/link.h
__int128 was added in GCC 4.6 and __int128_t was added before x86-64
was supported. This patch replaces __int128 with __int128_t so that
the installed bits/link.h can be used with older GCC.
* sysdeps/x86/bits/link.h (La_x86_64_regs): Replace __int128
with __int128_t.
(La_x86_64_retval): Likewise.
Ian Bolton [Thu, 24 Apr 2014 06:15:33 +0000 (07:15 +0100)]
[AArch64] Suppress unnecessary FPSR and FPCR writes.
Siddhesh Poyarekar [Wed, 23 Apr 2014 06:51:00 +0000 (12:21 +0530)]
Use test-skeleton.c in tst-sem3 and tst-sem4
David S. Miller [Wed, 23 Apr 2014 00:47:12 +0000 (17:47 -0700)]
Fix sigaction conform test failures on sparc.
* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
(struct sigaction): New struct member __glibc_reserved0, change
type of sa_flags to int.
Yufeng Zhang [Tue, 22 Apr 2014 16:26:59 +0000 (17:26 +0100)]
[AArch64] Use GCC builtins to count leading/tailing zeros.
Siddhesh Poyarekar [Tue, 22 Apr 2014 11:27:49 +0000 (16:57 +0530)]
Include atomic.h in sem_wait.c and sem_trywait.c
Venkataramanan Kumar [Tue, 8 Apr 2014 13:11:44 +0000 (14:11 +0100)]
aarch64: Add setjmp and longjmp SystemTap probes
Add setjmp, longjmp and longjmp_target SystemTap probes.
ChangeLog:
2014-04-22 Will Newton <will.newton@linaro.org>
Venkataramanan Kumar <venkataramanan.kumar@linaro.org>
* sysdeps/aarch64/__longjmp.S: Include stap-probe.h.
(__longjmp): Add longjmp and longjmp_target SystemTap
probes.
* sysdeps/aarch64/setjmp.S: Include stap-probe.h.
(__sigsetjmp): Add setjmp SystemTap probe.
Carlos O'Donell [Thu, 17 Apr 2014 23:41:09 +0000 (19:41 -0400)]
manual: Sort overview listing by manual order.
In the glibc manual we have a "Roadmap to the manual" section at
the end of the "Introduction" chapter.
The introductory text says "Here is an overview of the contents
of the remaining chapters of this manual.", but then proceeds to
list chapters out of order and some chapter are never referenced.
This commit reorders the overview to correctly match the manual
order.
See:
https://sourceware.org/ml/libc-alpha/2014-02/msg00823.html
Adhemerval Zanella [Sun, 13 Apr 2014 23:13:42 +0000 (18:13 -0500)]
PowerPC: Sync pthread_once with default implementation
This patch removes the arch specific powerpc implementation and instead
uses the linux default one. Although the current powerpc implementation
already constains the required memory barriers for correct
initialization, the default implementation shows a better performance on
newer chips.
Adhemerval Zanella [Thu, 17 Apr 2014 18:39:01 +0000 (15:39 -0300)]
PowerPC: Add fenv macros for long double
This patch add the missing libc_<function>l_ctx macros for long
double. Similar for float, they point to default double versions.
Ian Bolton [Thu, 17 Apr 2014 15:31:01 +0000 (15:31 +0000)]
Add fenv test support for AArch64.
Sihai Yao [Thu, 17 Apr 2014 15:00:21 +0000 (08:00 -0700)]
Detect if AVX2 is usable
This patch checks and sets bit_AVX2_Usable in __cpu_features.feature.
* sysdeps/x86_64/multiarch/ifunc-defines.sym (COMMON_CPUID_INDEX_7):
New.
* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):
Check and set bit_AVX2_Usable.
* sysdeps/x86_64/multiarch/init-arch.h (bit_AVX2_Usable): New
macro.
(bit_AVX2): Likewise.
(index_AVX2_Usable): Likewise.
(CPUID_AVX2): Likewise.
(HAS_AVX2): Likewise.
Will Newton [Thu, 13 Mar 2014 09:45:29 +0000 (09:45 +0000)]
manual/setjmp.texi: Clarify setcontext and signal handlers text
Calling setcontext from a signal handler can be done safely so
it is sufficient to note that it is not recommended.
Also mention in setcontext documentation that the behaviour of
setcontext when restoring a context created by a call to a signal
handler is unspecified.
2014-04-17 Will Newton <will.newton@linaro.org>
* manual/setjmp.texi (System V contexts): Add note that
calling setcontext on a context created by a call to a
signal handler is undefined. Update text to note that
setcontext from a signal handler is possible but not
recommended.
Will Newton [Tue, 25 Feb 2014 14:29:32 +0000 (14:29 +0000)]
stdlib/tst-setcontext.c: Check for clobbering of signal stack
On aarch64 calling swapcontext clobbers the state of the signal
stack (BZ #16629). Check that the address and size of the signal
stack before and after the call to swapcontext remains the same.
ChangeLog:
2014-04-17 Will Newton <will.newton@linaro.org>
[BZ #16629]
* stdlib/tst-setcontext.c: Include signal.h.
(main): Check that the signal stack before and
after swapcontext is the same.
Will Newton [Wed, 12 Mar 2014 16:14:51 +0000 (16:14 +0000)]
aarch64: Re-implement setcontext without rt_sigreturn syscall
The current implementation of setcontext uses rt_sigreturn to restore
the contents of registers. This contrasts with the way most other
architectures implement setcontext:
powerpc64, mips, tile:
Call rt_sigreturn if context was created by a call to a signal handler,
otherwise restore in user code.
powerpc32:
Call swapcontext system call and don't call sigreturn or rt_sigreturn.
x86_64, sparc, hppa, sh, ia64, m68k, s390, arm:
Only support restoring "synchronous" contexts, that is contexts
created by getcontext, and restoring in user code and don't call
sigreturn or rt_sigreturn.
alpha:
Call sigreturn (but not rt_sigreturn) in all cases to do the restore.
The text of the setcontext manpage suggests that the requirement to be
able to restore a signal handler created context has been dropped from
SUSv2:
If the context was obtained by a call to a signal handler, then old
standard text says that "program execution continues with the program
instruction following the instruction interrupted by the signal".
However, this sentence was removed in SUSv2, and the present verdict
is "the result is unspecified".
Implementing setcontext by calling rt_sigreturn unconditionally causes
problems when used with sigaltstack as in BZ #16629. On this basis it
seems that aarch64 is broken and that new ports should only support
restoring contexts created with getcontext and do not need to call
rt_sigreturn at all.
This patch re-implements the aarch64 setcontext function to restore
the context in user code in a similar manner to x86_64 and other ports.
ChangeLog:
2014-04-17 Will Newton <will.newton@linaro.org>
[BZ #16629]
* sysdeps/unix/sysv/linux/aarch64/setcontext.S (__setcontext):
Re-implement to restore registers in user code and avoid
rt_sigreturn system call.
Wilco [Thu, 17 Apr 2014 08:39:27 +0000 (09:39 +0100)]
Add fenv test support for targets which don't have FP traps.
Ian Bolton [Wed, 16 Apr 2014 22:41:04 +0000 (23:41 +0100)]
[AArch64] Define HAVE_RM_CTX and related hooks.
Ian Bolton [Wed, 16 Apr 2014 14:41:52 +0000 (14:41 +0000)]
[AArch64] Provide initial implementation of math_private.h.
Richard Henderson [Thu, 17 Apr 2014 04:36:33 +0000 (21:36 -0700)]
alpha: Remove alpha-linux pthread_once.c
Richard Henderson [Thu, 17 Apr 2014 04:32:27 +0000 (21:32 -0700)]
alpha: Enable unwind tables for backtrace.c
Richard Henderson [Thu, 17 Apr 2014 04:28:50 +0000 (21:28 -0700)]
alpha: Fix __pointer_chk_guard definition for the testsuite
Richard Henderson [Thu, 17 Apr 2014 04:25:35 +0000 (21:25 -0700)]
alpha: Regenerate sysdeps/alpha/libm-test-ulps
Marcus Shawcroft [Wed, 16 Apr 2014 21:37:32 +0000 (21:37 +0000)]
[AArch64] Regenerate libm-test-ulps.
Igor Zamyatin [Wed, 16 Apr 2014 21:43:16 +0000 (14:43 -0700)]
Save/restore bound registers for _dl_runtime_profile
This patch saves and restores bound registers in x86-64 PLT for
ld.so profile and LD_AUDIT:
* sysdeps/x86_64/bits/link.h (La_x86_64_regs): Add lr_bnd.
(La_x86_64_retval): Add lrv_bnd0 and lrv_bnd1.
* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Save
Intel MPX bound registers before _dl_profile_fixup.
* sysdeps/x86_64/dl-trampoline.h: Restore Intel MPX bound
registers after _dl_profile_fixup. Save and restore bound
registers bnd0/bnd1 when calling _dl_call_pltexit.
* sysdeps/x86_64/link-defines.sym (BND_SIZE): New.
(LR_BND_OFFSET): Likewise.
(LRV_BND0_OFFSET): Likewise.
(LRV_BND1_OFFSET): Likewise.
Samuel Thibault [Wed, 16 Apr 2014 21:45:36 +0000 (23:45 +0200)]
hurd: Add i386 fields to TLS structure
* sysdeps/mach/hurd/i386/tls.h (tcbhead_t): Add multiple_threads,
sysinfo, stack_guard, pointer_guard, gscope_flag, private_futex,
__private_tm, __private_ss fields.