]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
9 years agoOpen development for 2.22. glibc-2.21.90
Carlos O'Donell [Fri, 6 Feb 2015 07:03:41 +0000 (02:03 -0500)] 
Open development for 2.22.

9 years agoUpdate version.h and include/features.h for 2.21 release glibc-2.21
Carlos O'Donell [Fri, 6 Feb 2015 06:19:42 +0000 (01:19 -0500)] 
Update version.h and include/features.h for 2.21 release

9 years agohppa: Sync with pthread.h.
Carlos O'Donell [Fri, 6 Feb 2015 06:56:35 +0000 (01:56 -0500)] 
hppa: Sync with pthread.h.

This reverts part of the previous commit to refactor pthread.h.
The refactoring must be done by having pthread.h include arch
bits headers, not the other way around. Then hppa provides the
arch bits header. For now we synchronzie again with pthread.h
and include the entire contents in the hppa copy.

9 years agoCVE-2015-1472: wscanf allocates too little memory
Paul Pluzhnikov [Fri, 6 Feb 2015 05:30:42 +0000 (00:30 -0500)] 
CVE-2015-1472: wscanf allocates too little memory

BZ #16618

Under certain conditions wscanf can allocate too little memory for the
to-be-scanned arguments and overflow the allocated buffer.  The
implementation now correctly computes the required buffer size when
using malloc.

A regression test was added to tst-sscanf.

9 years agoglibc 2.21 pre-release update.
Carlos O'Donell [Fri, 6 Feb 2015 03:56:00 +0000 (22:56 -0500)] 
glibc 2.21 pre-release update.

Update all translations.

Update contributions in the manual.

Update installation notes with information about newest working tools.

Reconfigure using exactly autoconf 2.69.

Regenerate INSTALL.

9 years agohppa: Remove warnings and fix conformance errors.
Carlos O'Donell [Fri, 6 Feb 2015 02:33:03 +0000 (21:33 -0500)] 
hppa: Remove warnings and fix conformance errors.

(1) Fix warnings.

This is a bulk update to fix all the warnings that were causing
build failures with -Werror on hppa.

The most egregious problems are in dl-fptr.c which needs to be
entirely rewritten, thus I've used -Wno-error for that.

(2) Fix conformance errors.

The sysdep.c file had __syscall_error and syscall in one file
which caused conformance issues by including syscall when
__syscall_error was linked to. The fix is obviously to split
the file and use syscall.c to implement syscall.

9 years agoFunction name typo error in non-PIC case, fixed in this patch.
Chung-Lin Tang [Thu, 5 Feb 2015 14:19:36 +0000 (06:19 -0800)] 
Function name typo error in non-PIC case, fixed in this patch.

9 years agoFix two bugs in sparc atomics.
David S. Miller [Sun, 1 Feb 2015 03:07:28 +0000 (19:07 -0800)] 
Fix two bugs in sparc atomics.

* sysdeps/sparc/sparc32/bits/atomic.h
(__sparc32_atomic_do_unlock24): Put the memory barrier before the
unlock not after it.
(__v9_compare_and_exchange_val_32_acq): Use unions to avoid getting
volatile register usage warnings from the compiler.

9 years agoFix sparc semaphore implementation after recent changes.
David S. Miller [Sun, 1 Feb 2015 02:59:40 +0000 (18:59 -0800)] 
Fix sparc semaphore implementation after recent changes.

* sysdeps/sparc/nptl/sem_init.c: Delete.
* sysdeps/sparc/nptl/sem_post.c: Delete.
* sysdeps/sparc/nptl/sem_timedwait.c: Delete.
* sysdeps/sparc/nptl/sem_wait.c: Delete.
* sysdeps/sparc/sparc32/sem_init.c: New file.
* sysdeps/sparc/sparc32/sem_waitcommon.c: New file.
* sysdeps/sparc/sparc32/sem_open.c: Generic nptl version with
padding explicitly initialized.
* sysdeps/sparc/sparc32/sem_post.c: Generic nptl version using
padding for in-semaphore spinlock.
* sysdeps/sparc/sparc32/sem_wait.c: Likewise.
* sysdeps/sparc/sparc32/sem_trywait.c: Delete.
* sysdeps/sparc/sparc32/sem_timedwait.c: Delete.
* sysdeps/sparc/sparc32/sparcv9/sem_init.c: New file.
* sysdeps/sparc/sparc32/sparcv9/sem_open.c: New file.
* sysdeps/sparc/sparc32/sparcv9/sem_post.c: New file.
* sysdeps/sparc/sparc32/sparcv9/sem_waitcommon.c: New file.
* sysdeps/sparc/sparc32/sparcv9/sem_wait.c: Redirect to nptl
version.
* sysdeps/sparc/sparc32/sparcv9/sem_timedwait.c: Delete.
* sysdeps/sparc/sparc32/sparcv9/sem_trywait.c: Delete.

9 years agoUse AVX unaligned memcpy only if AVX2 is available
H.J. Lu [Fri, 30 Jan 2015 14:50:20 +0000 (06:50 -0800)] 
Use AVX unaligned memcpy only if AVX2 is available

memcpy with unaligned 256-bit AVX register loads/stores are slow on older
processorsl like Sandy Bridge.  This patch adds bit_AVX_Fast_Unaligned_Load
and sets it only when AVX2 is available.

[BZ #17801]
* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):
Set the bit_AVX_Fast_Unaligned_Load bit for AVX2.
* sysdeps/x86_64/multiarch/init-arch.h (bit_AVX_Fast_Unaligned_Load):
New.
(index_AVX_Fast_Unaligned_Load): Likewise.
(HAS_AVX_FAST_UNALIGNED_LOAD): Likewise.
* sysdeps/x86_64/multiarch/memcpy.S (__new_memcpy): Check the
bit_AVX_Fast_Unaligned_Load bit instead of the bit_AVX_Usable bit.
* sysdeps/x86_64/multiarch/memcpy_chk.S (__memcpy_chk): Likewise.
* sysdeps/x86_64/multiarch/mempcpy.S (__mempcpy): Likewise.
* sysdeps/x86_64/multiarch/mempcpy_chk.S (__mempcpy_chk): Likewise.
* sysdeps/x86_64/multiarch/memmove.c (__libc_memmove): Replace
HAS_AVX with HAS_AVX_FAST_UNALIGNED_LOAD.
* sysdeps/x86_64/multiarch/memmove_chk.c (__memmove_chk): Likewise.

9 years agoInclude <signal.h> in sysdeps/nptl/allocrtsig.c
Andreas Schwab [Sun, 25 Jan 2015 10:05:53 +0000 (11:05 +0100)] 
Include <signal.h> in sysdeps/nptl/allocrtsig.c

Architectures which don't use hp-timing-common.h don't include <signal.h>
via <sys/param.h>.

9 years agoFix up ChangeLog formatting
Siddhesh Poyarekar [Thu, 29 Jan 2015 05:01:10 +0000 (10:31 +0530)] 
Fix up ChangeLog formatting

9 years agoInitialize nscd stats data [BZ #17892]
Siddhesh Poyarekar [Thu, 29 Jan 2015 05:00:09 +0000 (10:30 +0530)] 
Initialize nscd stats data [BZ #17892]

The padding bytes in the statsdata struct are not initialized, due to
which valgrind throws a warning:

==11384== Memcheck, a memory error detector
==11384== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==11384== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==11384== Command: nscd -d
==11384==
Fri 25 Apr 2014 10:34:53 AM CEST - 11384: handle_request: request received (Version = 2) from PID 11396
Fri 25 Apr 2014 10:34:53 AM CEST - 11384:       GETSTAT
==11384== Thread 6:
==11384== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
==11384==    at 0x4E4ACDC: send (in /lib64/libpthread-2.12.so)
==11384==    by 0x11AF6B: send_stats (in /usr/sbin/nscd)
==11384==    by 0x112F75: nscd_run_worker (in /usr/sbin/nscd)
==11384==    by 0x4E439D0: start_thread (in /lib64/libpthread-2.12.so)
==11384==    by 0x599AB6C: clone (in /lib64/libc-2.12.so)
==11384==  Address 0x15708395 is on thread 6's stack

Fix the warning by initializing the structure.

9 years agoClarify math/README.libm-test. Add "How to read the test output."
Martin Sebor [Thu, 29 Jan 2015 04:07:01 +0000 (21:07 -0700)] 
Clarify math/README.libm-test. Add "How to read the test output."

9 years agotilegx32: set __HAVE_64B_ATOMICS to 0
Chris Metcalf [Wed, 28 Jan 2015 19:51:21 +0000 (14:51 -0500)] 
tilegx32: set __HAVE_64B_ATOMICS to 0

This is because of alignment issues in the sem_t support.
tilegx32 does in fact support 64-bit atomics and we will need
to revisit this after the 2.21 freeze.

9 years agoDisable 64-bit atomics for MIPS n32.
Joseph Myers [Wed, 28 Jan 2015 18:40:35 +0000 (18:40 +0000)] 
Disable 64-bit atomics for MIPS n32.

This patch disables use of 64-bit atomics for MIPS n32 to fix the
problems with unaligned semaphores.

Before 64-bit atomics are used for anything for which such alignment
issues do not arise, and before the addition of any new ILP32 ports
with 64-bit semaphores for which the ABI can be set to have the
greater alignment (AARCH64?), a better approach will need to be
established that allows architectures to declare their 64-bit atomics
availability accurately, without doing so causing inappropriate use of
such atomics on unaligned semaphores.

Tested for MIPS n32 that this fixes the nptl/tst-sem3 failure.

* sysdeps/mips/bits/atomic.h [_MIPS_SIM == _ABIN32]
(__HAVE_64B_ATOMICS): Define to 0.

9 years agopowerpc: Fix fesetexceptflag [BZ#17885]
Adhemerval Zanella [Tue, 27 Jan 2015 12:37:10 +0000 (06:37 -0600)] 
powerpc: Fix fesetexceptflag [BZ#17885]

This patch fixes a bug introduced by 18f2945ae9216cfc, where it optimizes
the FPSCR set by just issuing a mtfs instruction if new flag is different
from older one.  The issue is a typo, where the new flag should the the
new value, instead of the old one.

It fixes BZ#17885.

9 years agopowerpc: Fix fsqrt build in libm [BZ#16576]
Adhemerval Zanella [Tue, 27 Jan 2015 18:16:39 +0000 (13:16 -0500)] 
powerpc: Fix fsqrt build in libm [BZ#16576]

Some powerpc64 processors (e5500 core for instance) does not provide the
fsqrt instruction, however current check to use in math_private.h is
__WORDSIZE and _ARCH_PWR4 (ISA 2.02).  This is patch change it to use
the compiler flag _ARCH_PPCSQ (which is the same condition GCC uses to
decide whether to generate fsqrt instruction).

It fixes BZ#16576.

9 years agoiconv: Suppress array out of bounds warning.
Andreas Krebbel [Tue, 27 Jan 2015 08:37:04 +0000 (09:37 +0100)] 
iconv: Suppress array out of bounds warning.

9 years agoia64: avoid set-but-not-used warning
Andreas Schwab [Sun, 25 Jan 2015 21:31:29 +0000 (22:31 +0100)] 
ia64: avoid set-but-not-used warning

9 years agom68k/coldfire: avoid warning about volatile register variables
Andreas Schwab [Sun, 25 Jan 2015 21:09:05 +0000 (22:09 +0100)] 
m68k/coldfire: avoid warning about volatile register variables

9 years agom68k: fix missing definition of __feraiseexcept
Andreas Schwab [Sun, 25 Jan 2015 10:49:50 +0000 (11:49 +0100)] 
m68k: fix missing definition of __feraiseexcept

9 years agom68k: force inlining bswap functions
Andreas Schwab [Sun, 25 Jan 2015 09:08:04 +0000 (10:08 +0100)] 
m68k: force inlining bswap functions

9 years agoFix segmentation fault when LD_LIBRARY_PATH contains only non-existings paths
Bram [Thu, 18 Apr 2013 14:50:49 +0000 (16:50 +0200)] 
Fix segmentation fault when LD_LIBRARY_PATH contains only non-existings paths

9 years agopowerpc: Fix powerpc64 build failure with binutils 2.22
Adhemerval Zanella [Fri, 23 Jan 2015 16:31:49 +0000 (11:31 -0500)] 
powerpc: Fix powerpc64 build failure with binutils 2.22

GLIBC memset optimization for POWER8 uses the '.machine power8'
directive, which is only supported officially on binutils 2.24+.  This
causes a build failure on older binutils.

Since the requirement of .machine power8 is to correctly assembly the
'mtvsrd' instruction and it is already handled by the MTVSRD_V1_R4
macro, there is no really needed of using it.

The patch replaces the power8 with power7 for .machine directive.

It fixes BZ#17869.

9 years agopowerpc: Fix ifuncmain6pie failure with GCC 4.9
Adhemerval Zanella [Fri, 23 Jan 2015 16:16:49 +0000 (11:16 -0500)] 
powerpc: Fix ifuncmain6pie failure with GCC 4.9

This patch fix the elf/ifuncmain6pie failure when building with GCC
4.9+.  For some reason, the compiler removes the branch taken code at
resolve_ifunc (sysdeps/powerpc/powerpc64/dl-machine.h) as dead-code
and thus the testcase fails because the ifunc resolves branches to an
invalid memory location.  It fixes by explicit adding a dependency of
value based on odp variable to avoid compiler optimization.

It fixes BZ#17868.

9 years agoAlso treat model numbers 0x5a/0x5d as Silvermont
H.J. Lu [Sat, 24 Jan 2015 02:52:45 +0000 (18:52 -0800)] 
Also treat model numbers 0x5a/0x5d as Silvermont

9 years agoTreat model numbers 0x4a/0x4d as Silvermont
H.J. Lu [Sat, 24 Jan 2015 01:27:09 +0000 (17:27 -0800)] 
Treat model numbers 0x4a/0x4d as Silvermont

* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):
Treat model numbers 0x4a/0x4d as Intel Silvermont architecture.

9 years agoAlso use uint64_t in __new_sem_wait_fast
H.J. Lu [Sat, 24 Jan 2015 00:21:07 +0000 (16:21 -0800)] 
Also use uint64_t in __new_sem_wait_fast

9 years agoUse uint64_t and (uint64_t) 1 for 64-bit int
H.J. Lu [Fri, 23 Jan 2015 22:48:40 +0000 (14:48 -0800)] 
Use uint64_t and (uint64_t) 1 for 64-bit int

This patch replaces unsigned long int and 1UL with uint64_t and
(uint64_t) 1 to support ILP32 targets like x32.

[BZ #17870]
* nptl/sem_post.c (__new_sem_post): Replace unsigned long int
with uint64_t.
* nptl/sem_waitcommon.c (__sem_wait_cleanup): Replace 1UL with
(uint64_t) 1.
(__new_sem_wait_slow): Replace unsigned long int with uint64_t.
Replace 1UL with (uint64_t) 1.
* sysdeps/nptl/internaltypes.h (new_sem): Replace unsigned long
int with uint64_t.

9 years agoAdd missing libc_hidden_weak to stub if_nameindex, if_freenameindex.
Roland McGrath [Fri, 23 Jan 2015 19:29:02 +0000 (11:29 -0800)] 
Add missing libc_hidden_weak to stub if_nameindex, if_freenameindex.

9 years agoAdd missing libc_hidden_def to stub getrlimit64.
Roland McGrath [Fri, 23 Jan 2015 18:41:37 +0000 (10:41 -0800)] 
Add missing libc_hidden_def to stub getrlimit64.

9 years agosoft-fp: Use __label__ for all labels within macros.
Joseph Myers [Thu, 22 Jan 2015 22:39:26 +0000 (22:39 +0000)] 
soft-fp: Use __label__ for all labels within macros.

soft-fp has various macros containing labels and goto statements.
Because label names are function-scoped, this is problematic for using
the same macro more than once within a function, which some
architectures do in the Linux kernel (the soft-fp version there
predates the addition of any of these labels and gotos).  This patch
fixes this by using __label__ to make the labels local to the block
with the __label__ declaration.

Tested for powerpc-nofpu that installed stripped shared libraries are
unchanged by this patch.

* soft-fp/op-common.h (_FP_ADD_INTERNAL): Declare labels with
__label__.
(_FP_FMA): Likewise.
(_FP_TO_INT_ROUND): Likewise.
(_FP_FROM_INT): Likewise.

9 years agoBZ #16418: Fix powerpc get_clockfreq raciness
Adhemerval Zanella [Mon, 24 Nov 2014 21:18:26 +0000 (16:18 -0500)] 
BZ #16418: Fix powerpc get_clockfreq raciness

This patch fix powerpc __get_clockfreq racy and cancel-safe issues by
dropping internal static cache and by using nocancel file operations.
The vDSO failure check is also removed, since kernel code does not
return an error (it cleans cr0.so bit on function return) and the static
code (to read value /proc) now uses non-cancellable calls.

9 years agoUpdate copyright year to 2015 for new files.
Carlos O'Donell [Wed, 21 Jan 2015 15:35:31 +0000 (10:35 -0500)] 
Update copyright year to 2015 for new files.

9 years agotst-getpw: Rewrite.
Carlos O'Donell [Wed, 21 Jan 2015 15:08:18 +0000 (10:08 -0500)] 
tst-getpw: Rewrite.

The test is rewritten to look for the testable conditions and
exit once they are all detected. This prevents the test from
iterating over 2000 UIDs and looking up each one. It speeds up
the test and prevents it from failing if the system under test
has an NSS-based passwd that is slower than the test timeout.

See:
https://sourceware.org/ml/libc-alpha/2015-01/msg00394.html

9 years agoFix tst_wcscpy.c test.
Marek Polacek [Wed, 21 Jan 2015 11:30:42 +0000 (12:30 +0100)] 
Fix tst_wcscpy.c test.

9 years agoFix recursive dlopen.
Carlos O'Donell [Wed, 21 Jan 2015 06:51:10 +0000 (01:51 -0500)] 
Fix recursive dlopen.

The ability to recursively call dlopen is useful for malloc
implementations that wish to load other dynamic modules that
implement reentrant/AS-safe functions to use in their own
implementation.

Given that a user malloc implementation may be called by an
ongoing dlopen to allocate memory the user malloc
implementation interrupts dlopen and if it calls dlopen again
that's a reentrant call.

This patch fixes the issues with the ld.so.cache mapping
and the _r_debug assertion which prevent this from working
as expected.

See:
https://sourceware.org/ml/libc-alpha/2014-12/msg00446.html

9 years agoFix semaphore destruction (bug 12674).
Carlos O'Donell [Wed, 21 Jan 2015 05:46:16 +0000 (00:46 -0500)] 
Fix semaphore destruction (bug 12674).

This commit fixes semaphore destruction by either using 64b atomic
operations (where available), or by using two separate fields when only
32b atomic operations are available.  In the latter case, we keep a
conservative estimate of whether there are any waiting threads in one
bit of the field that counts the number of available tokens, thus
allowing sem_post to atomically both add a token and determine whether
it needs to call futex_wake.

See:
https://sourceware.org/ml/libc-alpha/2014-12/msg00155.html

9 years agoRegenerate INSTALL.
Carlos O'Donell [Wed, 21 Jan 2015 03:25:38 +0000 (22:25 -0500)] 
Regenerate INSTALL.

9 years agoUpdate libc.pot:
Carlos O'Donell [Wed, 21 Jan 2015 03:18:11 +0000 (22:18 -0500)] 
Update libc.pot:

In preparation for providing a tarball to the translation project.

        * po/libc.pot: Regenerated.

9 years agoCommit nios2 port to master.
Chung-Lin Tang [Sun, 18 Jan 2015 06:29:12 +0000 (22:29 -0800)] 
Commit nios2 port to master.

9 years agoS390: Get rid of linknamespace failures for utmp functions.
Stefan Liebler [Fri, 16 Jan 2015 08:18:58 +0000 (09:18 +0100)] 
S390: Get rid of linknamespace failures for utmp functions.

9 years agoS390: Get rid of linknamespace failures for string functions.
Stefan Liebler [Fri, 16 Jan 2015 08:17:32 +0000 (09:17 +0100)] 
S390: Get rid of linknamespace failures for string functions.

9 years agoFix powerpc-nofpu fesetenv namespace (bug 17748).
Joseph Myers [Wed, 14 Jan 2015 21:35:40 +0000 (21:35 +0000)] 
Fix powerpc-nofpu fesetenv namespace (bug 17748).

When fixing namespace issues for <fenv.h> functions I missed one call
to fesetenv for powerpc-nofpu.  This patch changes this to a call to
__fesetenv.

Tested for powerpc-nofpu; it fixes the previously observed math.h
linknamespace test failures.

[BZ #17748]
* sysdeps/powerpc/nofpu/feholdexcpt.c (__feholdexcept): Call
__fesetenv instead of fesetenv.

9 years ago[s390] Define a __tls_get_addr macro to avoid declaring it again
Siddhesh Poyarekar [Wed, 14 Jan 2015 15:56:50 +0000 (21:26 +0530)] 
[s390] Define a __tls_get_addr macro to avoid declaring it again

commit 050f7298e1ecc39887c329037575ccd972071255 added an extern
declaration for __tls_get_addr that conflicts with the one in s390
dl-tls.h, based on whether __tls_get_addr is defined as a macro.  The
rationale seems to be based on the assumption that __tls_get_addr is
exported for every architecture and hence an internal non-plt alias is
needed.  This is not true for s390 though, since it exports
__tls_get_offset and not __tls_get_addr.  This results in tst-audit9
being stuck in an infinite loop.

This patch fixes this by defining a __tls_get_addr macro to itself so
as to not use the conflicting declaration.

9 years agopowerpc: Fix POWER7/PPC64 performance regression on LE
Adhemerval Zanella [Mon, 12 Jan 2015 01:33:17 +0000 (19:33 -0600)] 
powerpc: Fix POWER7/PPC64 performance regression on LE

This patch fixes a performance regression on the POWER7/PPC64 memcmp
porting for Little Endian.  The LE code uses 'ldbrx' instruction to read
the memory on byte reversed form, however ISA 2.06 just provide the indexed
form which uses a register value as additional index, instead of a fixed value
enconded in the instruction.

And the port strategy for LE uses r0 index value and update the address
value on each compare loop interation.  For large compare size values,
it adds 8 more instructions plus some more depending of trailing
size.  This patch fixes it by adding pre-calculate indexes to remove the
address update on loops and tailing sizes.

For large sizes it shows a considerable gain, with double performance
pairing with BE.

9 years agopowerpc: Optimized strncmp for POWER8/PPC64
Adhemerval Zanella [Fri, 9 Jan 2015 21:04:26 +0000 (16:04 -0500)] 
powerpc: Optimized strncmp for POWER8/PPC64

This patch adds an optimized POWER8 strncmp.  The implementation focus
on speeding up unaligned cases follwing the ideas of power8 strcmp.

The algorithm first check the initial 16 bytes, then align the first
function source and uses unaligned loads on second argument only.
Aditional checks for page boundaries are done for unaligned cases
(where sources alignment are different).

9 years agopowerpc: Optimize POWER7 strcmp trailing checks
Rajalakshmi Srinivasaraghavan [Fri, 9 Jan 2015 16:56:35 +0000 (11:56 -0500)] 
powerpc: Optimize POWER7 strcmp trailing checks

This patch optimized the POWER7 trailing check by avoiding using byte
read operations and instead use the doubleword already readed with
bitwise operations.

9 years agoFix scanf15.c testsuite build on sparc.
David S. Miller [Tue, 13 Jan 2015 19:28:17 +0000 (11:28 -0800)] 
Fix scanf15.c testsuite build on sparc.

* include/signal.h (__sigreturn): Guard with __USE_MISC.

9 years agoRemove some references to bcopy/bcmp/bzero.
Roland McGrath [Tue, 13 Jan 2015 19:12:55 +0000 (11:12 -0800)] 
Remove some references to bcopy/bcmp/bzero.

9 years agopowerpc: Optimized strcmp for POWER8/PPC64
Adhemerval Zanella [Wed, 7 Jan 2015 12:18:30 +0000 (07:18 -0500)] 
powerpc: Optimized strcmp for POWER8/PPC64

This patch adds an optimized POWER8 strcmp using unaligned accesses.
The algorithm first check the initial 16 bytes, then align the first
function source and uses unaligned loads on second argument only.
Aditional checks for page boundaries are done for unaligned cases

9 years agopowerpc: Optimized st{r,p}ncpy for POWER8/PPC64
Adhemerval Zanella [Wed, 31 Dec 2014 16:47:41 +0000 (11:47 -0500)] 
powerpc: Optimized st{r,p}ncpy for POWER8/PPC64

This patch adds an optimized POWER8 st{r,p}ncpy using unaligned accesses.
It shows 10%-80% improvement over the optimized POWER7 one that uses
only aligned accesses, specially on unaligned inputs.

The algorithm first read and check 16 bytes (if inputs do not cross a 4K
page size).  The it realign source to 16-bytes and issue a 16 bytes read
and compare loop to speedup null byte checks for large strings.  Also,
different from POWER7 optimization, the null pad is done inline in the
implementation using possible unaligned accesses, instead of realying on
a memset call.  Special case is added for page cross reads.

9 years agopowerpc: Optimized strncat for POWER7/PPC64
Adhemerval Zanella [Tue, 23 Dec 2014 18:39:23 +0000 (13:39 -0500)] 
powerpc: Optimized strncat for POWER7/PPC64

With 3eb38795dbbbd816 (Simplify strncat) the generic algorithms uses
strlen, strnlen, and memcpy.  This is faster than POWER7 current
implementation, especially for unaligned strings (where POWER7 code
uses byte-byte operations).

This patch removes the assembly implementation and uses a multiarch
specialization based on default algorithm calling optimized POWER7
symbols.

9 years agopowerpc: Optimized strcat for POWER8/PPC64
Adhemerval Zanella [Tue, 23 Dec 2014 18:36:34 +0000 (13:36 -0500)] 
powerpc: Optimized strcat for POWER8/PPC64

With new optimized strcpy for POWER8, this patch adds an optimized
strcat which uses it along with default implementation at strings/.

9 years agopowerpc: Optimized st{r,p}cpy for POWER8/PPC64
Adhemerval Zanella [Tue, 23 Dec 2014 11:59:44 +0000 (05:59 -0600)] 
powerpc: Optimized st{r,p}cpy for POWER8/PPC64

This patch adds an optimized POWER8 strcpy using unaligned accesses.
For strings up to 16 bytes the implementation first calculate the
string size, like strlen, and issues a memcpy.  For larger strings,
source is first aligned to 16 bytes and then tested over a loop that
reads 16 bytes am combine the cmpb results for speedup.  Special case is
added for page cross reads.

It shows 30%-60% improvement over the optimized POWER7 one that uses
only aligned accesses.

9 years agoFix memory handling in strxfrm_l [BZ #16009]
Leonhard Holz [Tue, 13 Jan 2015 06:03:56 +0000 (11:33 +0530)] 
Fix memory handling in strxfrm_l [BZ #16009]

[Modified from the original email by Siddhesh Poyarekar]

This patch solves bug #16009 by implementing an additional path in
strxfrm that does not depend on caching the weight and rule indices.

In detail the following changed:

* The old main loop was factored out of strxfrm_l into the function
do_xfrm_cached to be able to alternativly use the non-caching version
do_xfrm.

* strxfrm_l allocates a a fixed size array on the stack. If this is not
sufficiant to store the weight and rule indices, the non-caching path is
taken. As the cache size is not dependent on the input there can be no
problems with integer overflows or stack allocations greater than
__MAX_ALLOCA_CUTOFF. Note that malloc-ing is not possible because the
definition of strxfrm does not allow an oom errorhandling.

* The uncached path determines the weight and rule index for every char
and for every pass again.

* Passing all the locale data array by array resulted in very long
parameter lists, so I introduced a structure that holds them.

* Checking for zero src string has been moved a bit upwards, it is
before the locale data initialization now.

* To verify that the non-caching path works correct I added a test run
to localedata/sort-test.sh & localedata/xfrm-test.c where all strings
are patched up with spaces so that they are too large for the caching path.

9 years agoFix wake-up in sysdeps/nptl/fork.c.
Torvald Riegel [Tue, 13 Jan 2015 00:09:29 +0000 (01:09 +0100)] 
Fix wake-up in sysdeps/nptl/fork.c.

9 years agoFix ldbl-96 scalblnl underflowing results (bug 17803).
Joseph Myers [Mon, 12 Jan 2015 23:02:14 +0000 (23:02 +0000)] 
Fix ldbl-96 scalblnl underflowing results (bug 17803).

The ldbl-96 implementation of scalblnl (used for x86_64 and ia64) uses
a condition k <= -63 to determine when a standard underflowing result
tiny*__copysignl(tiny,x) should be returned.  However, that condition
corresponds to values with exponent -16446 or less, and in the case of
-16446, the correct result for round-to-nearest depends on whether the
value is exactly 0x1p-16446 (half the least subnormal) or more than
that.  This patch fixes the bug by changing the condition to k <= -64
and accordingly adjusting the exponent by 64 not 63 when converting to
a normal value.

Tested for x86_64.

[BZ #17803]
* sysdeps/ieee754/ldbl-96/s_scalblnl.c (twom63): Rename to
twom64.  Adjust value to 0x1p-64L.
(__scalblnl): Only return standard underflowing result for K <=
-64 not K <= -63; adjust exponent for underflowing result by 64
not 63.
* math/libm-test.inc (scalbn_test_data): Add more tests.
(scalbln_test_data): Likewise.

9 years agoFix ldbl-96 scalblnl for subnormal arguments (bug 17834).
Joseph Myers [Mon, 12 Jan 2015 22:34:58 +0000 (22:34 +0000)] 
Fix ldbl-96 scalblnl for subnormal arguments (bug 17834).

The ldbl-96 implementation of scalblnl (used for x86_64 and ia64) is
incorrect for subnormal arguments (this is a separate bug from bug
17803, which is about underflowing results).  There are two problems
with the adjustments of subnormal arguments: the "two63" variable
multiplied by is actually 0x1p52L not 0x1p63L, so is insufficient to
make values normal, and then GET_LDOUBLE_EXP(es,x), used to extract
the new exponent, extracts it into a variable that isn't used, while
the value taken to by the new exponent is wrongly taken from the high
part of the mantissa before the adjustment (hx).  This patch fixes
both those problems and adds appropriate tests.

Tested for x86_64.

[BZ #17834]
* sysdeps/ieee754/ldbl-96/s_scalblnl.c (two63): Change value to
0x1p63L.
(__scalblnl): Get new exponent of adjusted subnormal value from ES
not HX.
* math/libm-test.inc (scalbn_test_data): Add more tests.
(scalbln_test_data): Likewise.

9 years agoAdd x86 32 bit vDSO time function support
Adhemerval Zanella [Fri, 27 Jun 2014 21:00:18 +0000 (14:00 -0700)] 
Add x86 32 bit vDSO time function support

Linux 3.15 adds support for clock_gettime, gettimeofday, and time vDSO
(commit id 37c975545ec63320789962bf307f000f08fabd48).  This patch adds
GLIBC supports to use such symbol when they are avaiable.

Along with x86 vDSO support, this patch cleanup x86_64 code by moving
all common code to x86 common folder.  Only init-first.c is different
between implementations.

9 years agopowerpc: Fix Copyright dates and CL entry
Adhemerval Zanella [Mon, 12 Jan 2015 17:58:34 +0000 (12:58 -0500)] 
powerpc: Fix Copyright dates and CL entry

This patch fixes the copyright dates from files created by commit
8d2c0a54b45943, and 56cf276.

9 years agopowerpc: abort transaction in syscalls
Adhemerval Zanella [Fri, 7 Nov 2014 17:34:52 +0000 (12:34 -0500)] 
powerpc: abort transaction in syscalls

Linux kernel powerpc documentation states issuing a syscall inside a
transaction is not recommended and may lead to undefined behavior. It
also states syscalls does not abort transactoin neither they run in
transactional state.

To avoid side-effects being visible outside transactions, GLIBC with
lock elision enabled will issue a transaction abort instruction just
before all syscalls if hardware supports hardware transactions.

9 years agopowerpc: Add adaptive elision to rwlocks
Adhemerval Zanella [Fri, 7 Nov 2014 17:30:56 +0000 (12:30 -0500)] 
powerpc: Add adaptive elision to rwlocks

This patch adds support for lock elision using ISA 2.07 hardware
transactional memory for rwlocks.  The logic is similar to the
one presented in pthread_mutex lock elision.

9 years agopowerpc: Add the lock elision using HTM
Adhemerval Zanella [Fri, 7 Nov 2014 17:25:32 +0000 (12:25 -0500)] 
powerpc: Add the lock elision using HTM

This patch adds support for lock elision using ISA 2.07 hardware
transactional memory instructions for pthread_mutex primitives.
Similar to s390 version, the for elision logic defined in
'force-elision.h' is only enabled if ENABLE_LOCK_ELISION is defined.

Also, the lock elision code should be able to be built even with
a compiler that does not provide HTM support with builtins.
However I have noted the performance is sub-optimal due scheduling
pressures.

9 years agoRemove 17581 from NEWS
Andreas Schwab [Mon, 12 Jan 2015 09:26:16 +0000 (10:26 +0100)] 
Remove 17581 from NEWS

9 years agoFix shm-directory.h #include.
Roland McGrath [Sat, 10 Jan 2015 00:08:14 +0000 (16:08 -0800)] 
Fix shm-directory.h #include.

9 years agoRemove divide from _ELF_DYNAMIC_DO_RELOC in elf/dynamic-link.h.
Chung-Lin Tang [Fri, 9 Jan 2015 17:40:29 +0000 (09:40 -0800)] 
Remove divide from _ELF_DYNAMIC_DO_RELOC in elf/dynamic-link.h.

9 years agoMicroBlaze: Fix BZ17791 - Remove fixed page size macros and others
Matthew Fortune [Mon, 5 Jan 2015 15:12:45 +0000 (15:12 +0000)] 
MicroBlaze: Fix BZ17791 - Remove fixed page size macros and others

Microblaze apparently has a variable page size (see thread below) and
should not hard-code any page-size related macros.
Also remove macros that are only used for BFD's trad-core support
which is not relavant for microblaze also according to the thread
starting here:

https://sourceware.org/ml/libc-ports/2013-11/msg00028.html

This patch is neither built nor tested but mirrors a MIPS patch that
fixes the same issue.

Thanks,
Matthew

     * sysdepsysdeps/unix/sysv/linux/microblaze/sys/user.h
     (PAGE_SHIFT, PAGE_SIZE, PAGE_MASK, NBPG, UPAGES): Remove.
     (HOST_TEXT_START_ADDR, HOST_STACK_END_ADDR): Remove.

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
9 years agoMicroBlaze: Remove custom lowlevellock.h.
Torvald Riegel [Wed, 17 Dec 2014 22:07:50 +0000 (23:07 +0100)] 
MicroBlaze: Remove custom lowlevellock.h.

2015-01-06  Torvald Riegel <triegel@redhat.com>

  * sysdeps/unix/sysv/linux/microblaze/lowlevellock.h: Delete file.

Signed-off-by: Torvald Riegel <triegel@redhat.com>
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
9 years agoMicroBlaze: Remove custom pthread_once implementation on microblaze.
Torvald Riegel [Mon, 8 Dec 2014 17:30:33 +0000 (18:30 +0100)] 
MicroBlaze: Remove custom pthread_once implementation on microblaze.

2015-01-06  Torvald Riegel <triegel@redhat.com>

  * sysdeps/unix/sysv/linux/microblaze/pthread_once.c: Delete file.

Signed-off-by: Torvald Riegel <triegel@redhat.com>
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
9 years agoMicroBlaze: Avoid pointer to integer conversion warning
David Holsgrove [Mon, 29 Dec 2014 03:54:19 +0000 (13:54 +1000)] 
MicroBlaze: Avoid pointer to integer conversion warning

2015-01-06  David Holsgrove <david.holsgrove@xilinx.com>

  * sysdeps/microblaze/jmpbuf-unwind.h (_jmpbuf_sp): Declare SP as void
    pointer and cast to uintptr_t.

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
9 years agoMicroBlaze: Fix volatile-register-var warning in READ_THREAD_POINTER
David Holsgrove [Mon, 29 Dec 2014 02:22:26 +0000 (12:22 +1000)] 
MicroBlaze: Fix volatile-register-var warning in READ_THREAD_POINTER

Resolves warning: 'optimization may eliminate reads and/or writes to
register variables'

2015-01-06  David Holsgrove <david.holsgrove@xilinx.com>

  * sysdeps/microblaze/nptl/tls.h: Remove inline
    __microblaze_get_thread_area and update READ_THREAD_POINTER.

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
9 years agoMicroBlaze: Fix integer-pointer conversion warning
David Holsgrove [Wed, 24 Dec 2014 01:55:49 +0000 (11:55 +1000)] 
MicroBlaze: Fix integer-pointer conversion warning

2015-01-06  David Holsgrove <david.holsgrove@xilinx.com>

    * sysdeps/microblaze/nptl/tls.h (TLS_INIT_TP): Use NULL instead
      of 0.

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
9 years agoSome #include cleanup in aio/timer code.
Roland McGrath [Thu, 8 Jan 2015 23:38:15 +0000 (15:38 -0800)] 
Some #include cleanup in aio/timer code.

9 years agoClean up allocrtsig code.
Roland McGrath [Thu, 8 Jan 2015 23:31:15 +0000 (15:31 -0800)] 
Clean up allocrtsig code.

9 years agoFix copyright year on new stub sys/procfs.h file.
Roland McGrath [Thu, 8 Jan 2015 22:29:45 +0000 (14:29 -0800)] 
Fix copyright year on new stub sys/procfs.h file.

9 years agoNPTL: Fix generic pthread_sigmask.
Roland McGrath [Thu, 8 Jan 2015 22:26:51 +0000 (14:26 -0800)] 
NPTL: Fix generic pthread_sigmask.

9 years agoNPTL: Fixed missed conditionalization of setxid hooey.
Roland McGrath [Thu, 8 Jan 2015 21:41:14 +0000 (13:41 -0800)] 
NPTL: Fixed missed conditionalization of setxid hooey.

9 years agoAdd stub sys/procfs.h file
Roland McGrath [Thu, 8 Jan 2015 21:24:56 +0000 (13:24 -0800)] 
Add stub sys/procfs.h file

9 years agoNPTL: Refactor cpu_set_t validation to be sysdeps-controlled
Roland McGrath [Thu, 8 Jan 2015 18:49:40 +0000 (10:49 -0800)] 
NPTL: Refactor cpu_set_t validation to be sysdeps-controlled

This removes Linuxisms related to cpu_set_t validation from the
generic NPTL code and puts them into a new sysdeps header file.

9 years agoAdd -Wno-trampolines as needed
Richard Henderson [Thu, 8 Jan 2015 16:32:06 +0000 (08:32 -0800)] 
Add -Wno-trampolines as needed

9 years agoAdd Nios II definitions to elf/elf.h.
Chung-Lin Tang [Thu, 8 Jan 2015 16:02:43 +0000 (08:02 -0800)] 
Add Nios II definitions to elf/elf.h.

9 years agopowerpc: Fix compiler warning on some syscalls
Adhemerval Zanella [Tue, 6 Jan 2015 12:59:04 +0000 (07:59 -0500)] 
powerpc: Fix compiler warning on some syscalls

GCC 5.0 emits an warning when using sizeof on array function parameters
and powerpc internal syscall macros add a check for such cases.  More
specifically, on powerpc64 and powerpc32 sysdep.h:

  if (__builtin_classify_type (__arg3) != 5 && sizeof (__arg3) > 8) \
          __illegally_sized_syscall_arg3 (); \

And for sysdeps/unix/sysv/linux/utimensat.c build GCC emits:

error: ‘sizeof’ on array function parameter ‘tsp’ will return size of
‘const struct timespec *’

This patch uses the address of first struct member instead of the struct
itself in syscall macro.

9 years agoNEWS for MIPS ABIs
Matthew Fortune [Tue, 6 Jan 2015 15:06:14 +0000 (15:06 +0000)] 
NEWS for MIPS ABIs

* NEWS: Announce support for new MIPS ABI extensions.

9 years agoFix libm feupdateenv namespace (bug 17748).
Joseph Myers [Wed, 7 Jan 2015 19:01:20 +0000 (19:01 +0000)] 
Fix libm feupdateenv namespace (bug 17748).

Concluding the fixes for C90 libm functions calling C99 fe* functions,
this patch fixes the case of feupdateenv by making it a weak alias for
__feupdateenv and making the affected code call __feupdateenv.

Tested for x86_64 (testsuite, and that installed stripped shared
libraries are unchanged by the patch).  Also tested for ARM
(soft-float) that the math.h linknamespace tests now pass.

[BZ #17748]
* include/fenv.h (__feupdateenv): Use libm_hidden_proto.
* math/feupdateenv.c (__feupdateenv): Use libm_hidden_def.
* sysdeps/aarch64/fpu/feupdateenv.c (feupdateenv): Rename to
__feupdateenv and define as weak alias of __feupdateenv.  Use
libm_hidden_weak.
* sysdeps/alpha/fpu/feupdateenv.c (__feupdateenv): Use
libm_hidden_def.
* sysdeps/arm/feupdateenv.c (feupdateenv): Rename to __feupdateenv
and define as weak alias of __feupdateenv.  Use libm_hidden_weak.
* sysdeps/hppa/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/i386/fpu/feupdateenv.c (__feupdateenv): Use
libm_hidden_def.
* sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Rename to
__feupdateenv and define as weak alias of __feupdateenv.  Use
libm_hidden_weak.
* sysdeps/m68k/fpu/feupdateenv.c (__feupdateenv): Use
libm_hidden_def.
* sysdeps/mips/fpu/feupdateenv.c (feupdateenv): Rename to
__feupdateenv and define as weak alias of __feupdateenv.  Use
libm_hidden_weak.
* sysdeps/powerpc/fpu/feupdateenv.c (__feupdateenv): Use
libm_hidden_def.
* sysdeps/powerpc/nofpu/feupdateenv.c (__feupdateenv): Likewise.
* sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c
(__feupdateenv): Likewise.
* sysdeps/s390/fpu/feupdateenv.c (feupdateenv): Rename to
__feupdateenv and define as weak alias of __feupdateenv.  Use
libm_hidden_weak.
* sysdeps/sh/sh4/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/sparc/fpu/feupdateenv.c (__feupdateenv): Use
libm_hidden_def.
* sysdeps/tile/math_private.h (__feupdateenv): New inline
function.
* sysdeps/x86_64/fpu/feupdateenv.c (__feupdateenv): Use
libm_hidden_def.
* sysdeps/generic/math_private.h (default_libc_feupdateenv): Call
__feupdateenv instead of feupdateenv.
(default_libc_feupdateenv_test): Likewise.
(libc_feresetround_ctx): Likewise.

9 years agomips: Fix __libc_pread prototype
Adhemerval Zanella [Wed, 7 Jan 2015 18:26:26 +0000 (16:26 -0200)] 
mips: Fix __libc_pread prototype

This patch fixes the __libc_pread prototype change from
14bb4e57c094849228ad8524693ab9432c38396c.

9 years agoposix/regcomp: initialize union structure tag to avoid warning
Chris Metcalf [Wed, 7 Jan 2015 17:29:26 +0000 (12:29 -0500)] 
posix/regcomp: initialize union structure tag to avoid warning

We see some surprising warnings on tilegx with gcc 4.8.2:

In file included from regex.c:66:0:
regcomp.c: In function ‘parse_expression’:
regcomp.c:2849:15: error: ‘end_elem’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
       else if (br_elem->type == COLL_SYM)
               ^
regcomp.c:3109:34: note: ‘end_elem’ was declared here
       bracket_elem_t start_elem, end_elem;
                                  ^
regcomp.c:3109:22: error: ‘start_elem’ may be used uninitialized in
this function [-Werror=maybe-uninitialized]
       bracket_elem_t start_elem, end_elem;
                      ^

These warnings are not seen on x86, and in fact if I compile the
preprocessed tile sources with the x86 gcc 4.8.2, I don't see the
warnings.  I do see eqiuvalent warnings if I compile the
x86-preprocessed source code with tilegx gcc 4.8.2.

The fix here is to initialize the union type field appropriately in
a couple of places where we pass a union pointer to a subroutine that
"knows" what type the union is.  Setting the type explicitly seems like
a more robust way to manage such a data structure in any case.

9 years agoAArch64: Optimized implementations of strcpy and stpcpy.
Richard Earnshaw [Wed, 7 Jan 2015 11:31:10 +0000 (11:31 +0000)] 
AArch64: Optimized implementations of strcpy and stpcpy.

9 years agoAArch64 optimized implementation of strrchr.
Richard Earnshaw [Wed, 7 Jan 2015 11:26:13 +0000 (11:26 +0000)] 
AArch64 optimized implementation of strrchr.

9 years agoFix typo in ChangeLog
Siddhesh Poyarekar [Wed, 7 Jan 2015 10:45:24 +0000 (16:15 +0530)] 
Fix typo in ChangeLog

9 years agosetenv fix memory leak when setting large, duplicate string (BZ #17658)
Eric Biggers [Wed, 7 Jan 2015 06:40:52 +0000 (12:10 +0530)] 
setenv fix memory leak when setting large, duplicate string (BZ #17658)

glibc maintains a binary tree of environment strings it malloc()ed
itself.  However, it's possible for it to malloc() a string, then find
that an identical string is already in the tree.  In this case, the
memory is leaked and is not freed if the application later calls
__libc_freeres().  Fix this by freeing 'new_value' when it's unneeded.

Test case:
#include <stdlib.h>
#include <string.h>

int main()
{
char *p = calloc(100000, 1);
memset(p, 'A', 99999);
setenv("TESTVAR", p, 1);
setenv("TESTVAR", p, 1);
free(p);
}

Leak that was reported by valgrind:
100,008 bytes in 1 blocks are definitely lost in loss record 1 of 1
   at 0x4C29F90: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E6B3D4: __add_to_environ (setenv.c:176)
   by 0x4C31B8F: setenv (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x400642: main (in /mnt/tmpfs/a.out)

9 years agoFix incorrect mount table entry parsing in __getmntent_r
Vladimir A. Nazarenko [Wed, 7 Jan 2015 03:19:44 +0000 (19:19 -0800)] 
Fix incorrect mount table entry parsing in __getmntent_r

When mount entry contains only four fields and have more then one space or
tab at the and, mp.mnt_freq and mp.mnt_passno will be set to some specific
values as side effect from parsing of previus mount entry. It is because
sscanf(""," %d %d ", &a, &b) returns -1, but this case is unprocessed.
Values of mp.mnt_freq and  mp.mnt_passno stays unchanged. This patch is
attempt to fix described issue by removing trailing tabs and spaces.

9 years agoFix libm fesetround namespace (bug 17748).
Joseph Myers [Wed, 7 Jan 2015 00:41:23 +0000 (00:41 +0000)] 
Fix libm fesetround namespace (bug 17748).

Continuing the fixes for C90 libm functions calling C99 fe* functions,
this patch fixes the case of fesetround by making it a weak alias of
__fesetround and making the affected code call __fesetround.  An
existing __fesetround function in fenv_libc.h for powerpc is renamed
to __fesetround_inline.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).  Also tested for ARM
(soft-float) that fesetround failures disappear from the linknamespace
test results (feupdateenv remains to be addressed to complete fixing
bug 17748).

[BZ #17748]
* include/fenv.h (__fesetround): Declare.  Use libm_hidden_proto.
* math/fesetround.c (fesetround): Rename to __fesetround and
define as weak alias of __fesetround.  Use libm_hidden_weak.
* sysdeps/aarch64/fpu/fesetround.c (fesetround): Likewise.
* sysdeps/alpha/fpu/fesetround.c (fesetround): Likewise.
* sysdeps/arm/fesetround.c (fesetround): Likewise.
* sysdeps/hppa/fpu/fesetround.c (fesetround): Likewise.
* sysdeps/i386/fpu/fesetround.c (fesetround): Likewise.
* sysdeps/ia64/fpu/fesetround.c (fesetround): Likewise.
* sysdeps/m68k/fpu/fesetround.c (fesetround): Likewise.
* sysdeps/mips/fpu/fesetround.c (fesetround): Likewise.
* sysdeps/powerpc/fpu/fenv_libc.h (__fesetround): Rename to
__fesetround_inline.
* sysdeps/powerpc/fpu/fenv_private.h (libc_fesetround_ppc): Call
__fesetround_inline instead of __fesetround.
* sysdeps/powerpc/fpu/fesetround.c (fesetround): Rename to
__fesetround and define as weak alias of __fesetround.  Use
libm_hidden_weak.  Call __fesetround_inline instead of
__fesetround.
* sysdeps/powerpc/nofpu/fesetround.c (fesetround): Rename to
__fesetround and define as weak alias of __fesetround.  Use
libm_hidden_weak.
* sysdeps/powerpc/powerpc32/e500/nofpu/fesetround.c (fesetround):
Likewise.
* sysdeps/s390/fpu/fesetround.c (fesetround): Likewise.
* sysdeps/sh/sh4/fpu/fesetround.c (fesetround): Likewise.
* sysdeps/sparc/fpu/fesetround.c (fesetround): Likewise.
* sysdeps/tile/math_private.h (__fesetround): New inline function.
* sysdeps/x86_64/fpu/fesetround.c (fesetround): Rename to
__fesetround and define as weak alias of __fesetround.  Use
libm_hidden_weak.
* sysdeps/generic/math_private.h (default_libc_fesetround): Call
__fesetround instead of fesetround.
(default_libc_feholdexcept_setround): Likewise.
(libc_feholdsetround_ctx): Likewise.
(libc_feholdsetround_noex_ctx): Likewise.

9 years agoFix libm fesetenv namespace (bug 17748).
Joseph Myers [Tue, 6 Jan 2015 23:36:20 +0000 (23:36 +0000)] 
Fix libm fesetenv namespace (bug 17748).

Continuing the fixes for C90 libm functions calling C99 fe* functions,
this patch fixes the case of fesetenv by making it a weak alias of
__fesetenv and making the affected code (including various copies of
feupdateenv which also gets called from C90 functions) call
__fesetenv.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).  Also tested for ARM
(soft-float) that fesetenv failures disappear from the linknamespace
test results (fsetround and feupdateenv remain to be addressed to
complete fixing bug 17748).

[BZ #17748]
* include/fenv.h (__fesetenv): Use libm_hidden_proto.
* math/fesetenv.c (__fesetenv): Use libm_hidden_def.
* sysdeps/aarch64/fpu/fesetenv.c (fesetenv): Rename to __fesetenv
and define as weak alias of __fesetenv.  Use libm_hidden_weak.
* sysdeps/alpha/fpu/fesetenv.c (__fesetenv): Use libm_hidden_def.
* sysdeps/arm/fesetenv.c (fesetenv): Rename to __fesetenv and
define as weak alias of __fesetenv.  Use libm_hidden_weak.
* sysdeps/hppa/fpu/fesetenv.c (fesetenv): Likewise.
* sysdeps/i386/fpu/fesetenv.c (__fesetenv): Use libm_hidden_def.
* sysdeps/ia64/fpu/fesetenv.c (fesetenv): Rename to __fesetenv and
define as weak alias of __fesetenv.  Use libm_hidden_weak.
* sysdeps/m68k/fpu/fesetenv.c (__fesetenv): Use libm_hidden_def.
* sysdeps/mips/fpu/fesetenv.c (fesetenv): Rename to __fesetenv and
define as weak alias of __fesetenv.  Use libm_hidden_weak.
* sysdeps/powerpc/fpu/fesetenv.c (__fesetenv): Use
libm_hidden_def.
* sysdeps/powerpc/nofpu/fesetenv.c (__fesetenv): Likewise.
* sysdeps/powerpc/powerpc32/e500/nofpu/fesetenv.c (__fesetenv):
Likewise.
* sysdeps/s390/fpu/fesetenv.c (fesetenv): Rename to __fesetenv and
define as weak alias of __fesetenv.  Use libm_hidden_weak.
* sysdeps/sh/sh4/fpu/fesetenv.c (fesetenv): Likewise.
* sysdeps/sparc/fpu/fesetenv.c (__fesetenv): Use libm_hidden_def.
* sysdeps/tile/math_private.h (__fesetenv): New inline function.
* sysdeps/x86_64/fpu/fesetenv.c (fesetenv): Rename to __fesetenv
and define as weak alias of __fesetenv.  Use libm_hidden_weak.
* sysdeps/generic/math_private.h (default_libc_fesetenv): Use
__fesetenv instead of fesetenv.
(libc_feresetround_noex_ctx): Likewise.
* sysdeps/alpha/fpu/feupdateenv.c (__feupdateenv): Likewise.
* sysdeps/hppa/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/i386/fpu/feupdateenv.c (__feupdateenv): Likewise.
* sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/m68k/fpu/feupdateenv.c (__feupdateenv): Likewise.
* sysdeps/mips/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/powerpc/nofpu/feupdateenv.c (__feupdateenv): Likewise.
* sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c
(__feupdateenv): Likewise.
* sysdeps/s390/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/sh/sh4/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/sparc/fpu/feupdateenv.c (__feupdateenv): Likewise.
* sysdeps/x86_64/fpu/feupdateenv.c (__feupdateenv): Likewise.

9 years agoRevert "Suppress warning in string/tester.c for gcc 4.9"
Ondřej Bílka [Tue, 6 Jan 2015 17:43:28 +0000 (18:43 +0100)] 
Revert "Suppress warning in string/tester.c for gcc 4.9"

This reverts commit 9300797ee93422a87f443d5ba7e1411167e7a837.

9 years agoMention bug fix for BZ #17806
H.J. Lu [Tue, 6 Jan 2015 17:32:41 +0000 (09:32 -0800)] 
Mention bug fix for BZ #17806

9 years agoresolv: fix rotate option
Aurelien Jarno [Tue, 6 Jan 2015 16:50:23 +0000 (08:50 -0800)] 
resolv: fix rotate option

The rotate option doesn't work correctly, and only send the query to the
same server (the second in the list). The rotation code in itself is not
broken, but the nsaddrs structure is reinitialized each time at the
beginning of __libc_res_nsend unless RES_STAYOPEN is enabled.

This is due to a call to __res_iclose from the end of __libc_res_nsend
when answers from the name server have been received. This function
closes all the sockets, but doesn't free the addresses (it can do that,
but in that case the second argument is false).

This patch change the code of __res_iclose to clear statp->_u._ext.nsinit
 only when the addresses are actually freed.

* resolv/res_init.c (__res_iclose): Only clear nsinit if the
addresses have been freed.

9 years agoresolv: improve comments about nserv and nservall
Aurelien Jarno [Tue, 6 Jan 2015 16:33:43 +0000 (08:33 -0800)] 
resolv: improve comments about nserv and nservall

The current comments concerning nserv and nservall are not really clear
and lead to confusion when reviewing an already complex code. Improve
them, there real meaning have been confirmed by a code analysis.

* resolv/res_init.c (__res_vinit): Improve comments about nserv
and nservall.

9 years agoSuppress warning in string/tester.c for gcc 4.9
Ondřej Bílka [Tue, 6 Jan 2015 16:43:09 +0000 (17:43 +0100)] 
Suppress warning in string/tester.c for gcc 4.9