platform/upstream/glibc.git
10 years agoAdd mmap usage in malloc_info output
Siddhesh Poyarekar [Fri, 30 May 2014 17:13:52 +0000 (22:43 +0530)]
Add mmap usage in malloc_info output

The current malloc_info xml output only has information about
allocations on the heap.  Display information about number of mappings
and total mmapped size to this to complete the picture.

10 years agom68k: Convert fork.c to arch-fork.h
Roland McGrath [Fri, 16 May 2014 19:57:10 +0000 (12:57 -0700)]
m68k: Convert fork.c to arch-fork.h

10 years agoRemove mi_arena nested function.
Ondřej Bílka [Fri, 30 May 2014 11:24:56 +0000 (13:24 +0200)]
Remove mi_arena nested function.

10 years agorevert commit fdfd175d46ac6a810ebdeb2a2936e6d7d13995ab
Ondřej Bílka [Fri, 30 May 2014 11:23:39 +0000 (13:23 +0200)]
revert commit fdfd175d46ac6a810ebdeb2a2936e6d7d13995ab

10 years agoaarch64: Rely on syscalls preserving registers
Richard Henderson [Thu, 22 May 2014 20:57:20 +0000 (16:57 -0400)]
aarch64: Rely on syscalls preserving registers

In several cases we've had asm routines rely on syscalls not clobbering
call-clobbered registers, and that's now deemed ABI.  So take advantage
of this in the INLINE_SYSCALL path as well.

Shrinks libc.so by about 1k.

10 years agoaarch64: Use tpidr_el0 rather than __errno_location in librt
Richard Henderson [Tue, 20 May 2014 20:34:59 +0000 (16:34 -0400)]
aarch64: Use tpidr_el0 rather than __errno_location in librt

10 years agoaarch64: Use tpidr_el0 rather than __read_tp in librt
Richard Henderson [Tue, 20 May 2014 20:17:20 +0000 (16:17 -0400)]
aarch64: Use tpidr_el0 rather than __read_tp in librt

10 years agoaarch64: Improve syscall-cancel stack frame
Richard Henderson [Sun, 25 May 2014 18:57:53 +0000 (14:57 -0400)]
aarch64: Improve syscall-cancel stack frame

One push instead of N; use stp/ldp to halve the insns.

10 years agoaarch64: Pass regno parameter to SINGLE_THREAD_P
Richard Henderson [Sun, 25 May 2014 18:15:14 +0000 (14:15 -0400)]
aarch64: Pass regno parameter to SINGLE_THREAD_P

Use cbz instead of cmp+b.eq.

10 years agoaarch64: Share code in syscall-cancel.h
Richard Henderson [Sun, 25 May 2014 18:07:17 +0000 (14:07 -0400)]
aarch64: Share code in syscall-cancel.h

Fold nocancel and error handling paths.

10 years agoaarch64: Tabify sysdep-cancel.h
Richard Henderson [Sun, 25 May 2014 17:00:00 +0000 (13:00 -0400)]
aarch64: Tabify sysdep-cancel.h

10 years agoAvoid stat/fstat in statvfs/fstatvfs (BZ #15132)
Eric Wong [Thu, 29 May 2014 04:11:29 +0000 (09:41 +0530)]
Avoid stat/fstat in statvfs/fstatvfs (BZ #15132)

Delay the use of stat/fstat until stat data is required.  When the
kernel returns ST_VALID, stat data is not used by __internal_statvfs.

10 years agoSH: Consolidate NPTL/non versions of clone
Roland McGrath [Thu, 29 May 2014 00:23:19 +0000 (17:23 -0700)]
SH: Consolidate NPTL/non versions of clone

10 years agotile: Convert fork.c to arch-fork.h
Roland McGrath [Wed, 28 May 2014 18:23:16 +0000 (14:23 -0400)]
tile: Convert fork.c to arch-fork.h

10 years agoIA64: Convert fork.c to arch-fork.h
Roland McGrath [Tue, 27 May 2014 22:43:45 +0000 (15:43 -0700)]
IA64: Convert fork.c to arch-fork.h

10 years agoSH: Convert fork.c to arch-fork.h
Roland McGrath [Tue, 27 May 2014 19:58:01 +0000 (12:58 -0700)]
SH: Convert fork.c to arch-fork.h

10 years agoRemove duplicate code in elf/dl-deps.c.
Ondřej Bílka [Tue, 27 May 2014 14:56:11 +0000 (16:56 +0200)]
Remove duplicate code in elf/dl-deps.c.

10 years agoRemove second argument from TLS_INIT_TP macro
Andreas Schwab [Tue, 13 May 2014 14:40:41 +0000 (16:40 +0200)]
Remove second argument from TLS_INIT_TP macro

10 years agoARM: Fix handling of concurrent TLS descriptor resolution
Will Newton [Fri, 23 May 2014 14:24:30 +0000 (15:24 +0100)]
ARM: Fix handling of concurrent TLS descriptor resolution

The current code for handling concurrent resolution says that the
ABI for _dl_tlsdesc_resolve_hold is the same as that of
_dl_tlsdesc_lazy_resolver. However _dl_tlsdesc_resolve_hold is
called from the trampoline directly rather than the lazy resolver
stub so, for example, r2 has not been pushed so does not needed
to be restored.

This fixes an intermittent failure in nptl/tst-tls3 when building
glibc for arm-linux-gnueabihf with -mtls-dialect=gnu2.

ChangeLog:

2014-05-27  Will Newton  <will.newton@linaro.org>

[BZ #16990]
* sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_resolve_hold): Save
and restore r2 rather than just restoring.

10 years agoFix offset computation for append+ mode on switching from read (BZ #16724)
Siddhesh Poyarekar [Tue, 27 May 2014 08:24:19 +0000 (13:54 +0530)]
Fix offset computation for append+ mode on switching from read (BZ #16724)

The offset computation in write mode uses the fact that _IO_read_end
is kept in sync with the external file offset.  This however is not
true when O_APPEND is in effect since switching to write mode ought to
send the external file offset to the end of file without making the
necessary adjustment to _IO_read_end.

Hence in append mode, offset computation when writing should only
consider the effect of unflushed writes, i.e. from _IO_write_base to
_IO_write_ptr.

The wiki has a detailed document that describes the rationale for
offsets returned by ftell in various conditions:

https://sourceware.org/glibc/wiki/File%20offsets%20in%20a%20stdio%20stream%20and%20ftell

10 years agoUpdate powerpc-fpu ULPs.
Adhemerval Zanella [Mon, 26 May 2014 17:40:08 +0000 (12:40 -0500)]
Update powerpc-fpu ULPs.

10 years agoPowerPC: Move remaining nptl/sysdeps/unix/sysv/linux/powerpc/ files.
Adhemerval Zanella [Wed, 21 May 2014 21:08:06 +0000 (16:08 -0500)]
PowerPC: Move remaining nptl/sysdeps/unix/sysv/linux/powerpc/ files.

10 years agoPowerPC: Move NPTL ABI headers to sysdeps.
Adhemerval Zanella [Wed, 21 May 2014 21:06:30 +0000 (16:06 -0500)]
PowerPC: Move NPTL ABI headers to sysdeps.

10 years agoPowerPC: Move powerpc64 timer_*.c out of nptl/
Adhemerval Zanella [Fri, 23 May 2014 12:43:37 +0000 (07:43 -0500)]
PowerPC: Move powerpc64 timer_*.c out of nptl/

10 years agoPowerPC: Consolidate NPTL/non versions of clone
Adhemerval Zanella [Wed, 21 May 2014 01:31:04 +0000 (20:31 -0500)]
PowerPC: Consolidate NPTL/non versions of clone

10 years agoPowerPC: Consolidate NPTL/non versions of vfork
Adhemerval Zanella [Mon, 26 May 2014 16:41:28 +0000 (11:41 -0500)]
PowerPC: Consolidate NPTL/non versions of vfork

10 years agoRemove nested function mi_arena from malloc_info.
Carlos O'Donell [Mon, 26 May 2014 13:54:59 +0000 (09:54 -0400)]
Remove nested function mi_arena from malloc_info.

The nested function mi_arena was removed from malloc_info
and made into a non-nested static inline function of the same
name with the correct set of arguments passed from malloc_info.
This enables building glibc with compilers that don't support
nested functions. Future work on malloc_info should remove these
functions entirely to support JSON format output. Therefore we
do the minimum required to remove the nested function.

10 years agoPowerPC: Remove 64 bits instructions in PPC32 code
Adhemerval Zanella [Thu, 22 May 2014 19:48:38 +0000 (14:48 -0500)]
PowerPC: Remove 64 bits instructions in PPC32 code

This patch replaces the insrdi by insrwi in powerpc32 assembly.

10 years agoFix searching localedef input on I18NPATH (BZ #16984)
Andreas Schwab [Mon, 26 May 2014 10:31:13 +0000 (12:31 +0200)]
Fix searching localedef input on I18NPATH (BZ #16984)

10 years agoDisable lock elision for PTHREAD_MUTEX_NORMAL.
Stefan Liebler [Mon, 26 May 2014 09:14:25 +0000 (11:14 +0200)]
Disable lock elision for PTHREAD_MUTEX_NORMAL.

10 years agoFix typo in tst-mutex5 ifndef -> ifdef
Stefan Liebler [Mon, 26 May 2014 09:12:44 +0000 (11:12 +0200)]
Fix typo in tst-mutex5 ifndef -> ifdef

10 years agobenchtests: Add new directive for benchmark initialization hook
Siddhesh Poyarekar [Sat, 22 Feb 2014 04:39:27 +0000 (10:09 +0530)]
benchtests: Add new directive for benchmark initialization hook

Add a new 'init' directive that specifies the name of the function to
call to do function-specific initialization.  This is useful for
benchmarks that need to do a one-time initialization before the
functions are executed.

10 years ago[AARCH64] correct alignment of TLS_TCB_ALIGN (BZ #16796)
Kyle McMartin [Mon, 26 May 2014 07:03:22 +0000 (12:33 +0530)]
[AARCH64] correct alignment of TLS_TCB_ALIGN (BZ #16796)

This fixes a variety of testsuite failures for me:
tststatic.out Error 1
tststatic2.out Error 1
tst-tls9-static.out Error 1
tst-audit8.out Error 127
tst-audit9.out Error 127
tst-audit1.out Error 127
and also has the added benefit of making LD_AUDIT/sotruss work on
AArch64.

Otherwise, we bail out early in _dl_try_allocate_static_tls as the
alignment requirement of the PT_TLS section in libc is 16.

10 years agoUse NSS_STATUS_TRYAGAIN to indicate insufficient buffer (BZ #16878)
Siddhesh Poyarekar [Mon, 26 May 2014 06:10:08 +0000 (11:40 +0530)]
Use NSS_STATUS_TRYAGAIN to indicate insufficient buffer (BZ #16878)

The netgroups nss modules in the glibc tree use NSS_STATUS_UNAVAIL
(with errno as ERANGE) when the supplied buffer does not have
sufficient space for the result.  This is wrong, because the canonical
way to indicate insufficient buffer is to set the errno to ERANGE and
the status to NSS_STATUS_TRYAGAIN, as is used by all other modules.

This fixes nscd behaviour when the nss_ldap module returns
NSS_STATUS_TRYAGAIN to indicate that a netgroup entry is too long to
fit into the supplied buffer.

10 years agoarm,aarch64: Remove SINGLE_THREAD_P_PIC
Richard Henderson [Fri, 23 May 2014 20:37:15 +0000 (16:37 -0400)]
arm,aarch64: Remove SINGLE_THREAD_P_PIC

This macro was removed by

2005-11-16  Daniel Jacobowitz  <dan@codesourcery.com>

but not applied to the (still separate) eabi port so necro'd
when the eabi port superceded the old abi.  It was thence
copied into the new AArch64 port.

10 years agoaarch64: Tidy syscall error check
Richard Henderson [Tue, 20 May 2014 18:40:22 +0000 (14:40 -0400)]
aarch64: Tidy syscall error check

Move the error branch from the PSEUDO_RET macro to the PSEUDO macro.
This is in line with other architectures, and will enable further improvments.

10 years agoaarch64: Remove DOARGS/UNDOARGS macros
Richard Henderson [Thu, 22 May 2014 15:38:05 +0000 (11:38 -0400)]
aarch64: Remove DOARGS/UNDOARGS macros

While they do something for AArch32, they're useless for AArch64.

10 years agoaarch64: Fix DO_CALL block comment
Richard Henderson [Sun, 25 May 2014 16:33:00 +0000 (12:33 -0400)]
aarch64: Fix DO_CALL block comment

10 years agoalpha: Do non-default symbols in pt-vfork.S
Richard Henderson [Sun, 25 May 2014 16:04:54 +0000 (09:04 -0700)]
alpha: Do non-default symbols in pt-vfork.S

10 years agoOnly provide non-default symbols in libpthread for vfork
Richard Henderson [Fri, 23 May 2014 23:03:28 +0000 (16:03 -0700)]
Only provide non-default symbols in libpthread for vfork

* nptl/pt-vfork.c (vfork_resolve): Rename from vfork_ifunc.
(vfork, __vfork): Define via compat_symbol.

10 years agoOnly support ifunc in nptl/pt-vfork.c
Richard Henderson [Fri, 23 May 2014 22:24:20 +0000 (15:24 -0700)]
Only support ifunc in nptl/pt-vfork.c

* nptl/pt-vfork.c: Error if !HAVE_IFUNC.
[!HAVE_IFUNC] (vfork_compat): Remove.
[!HAVE_IFUNC] (DEFINE_VFORK): Remove.

10 years agoDefine TSVTX in tar.h for older POSIX (bug 16978).
Joseph Myers [Fri, 23 May 2014 20:37:40 +0000 (20:37 +0000)]
Define TSVTX in tar.h for older POSIX (bug 16978).

As noted in bug 16978, older POSIX versions include

in the specified contents of <tar.h>, with only the 2001 edition
introducing the notion of XSI-conditional definitions and conditioning
that definition.  Thus, this macro should be defined for
!__USE_XOPEN2K as well as for __USE_XOPEN, and this patch duly defines
it in that case.  Tested x86_64.

[BZ #16978]
* posix/tar.h [!__USE_XOPEN2K] (TSVTX): Define macro.
* conform/Makefile (test-xfail-POSIX/tar.h/conform): Remove
variable.

10 years agoalpha: Move remaining files out of sysdeps/unix/sysv/linux/alpha/nptl/
Richard Henderson [Thu, 22 May 2014 15:51:13 +0000 (08:51 -0700)]
alpha: Move remaining files out of sysdeps/unix/sysv/linux/alpha/nptl/

10 years agoalpha: Consolidate NPTL/non versions of vfork
Richard Henderson [Thu, 22 May 2014 03:31:38 +0000 (20:31 -0700)]
alpha: Consolidate NPTL/non versions of vfork

10 years agoalpha: Merge standard and nptl clone.S
Richard Henderson [Wed, 21 May 2014 21:36:45 +0000 (14:36 -0700)]
alpha: Merge standard and nptl clone.S

10 years agoalpha: Remove nptl/fork.c
Richard Henderson [Wed, 21 May 2014 18:58:13 +0000 (11:58 -0700)]
alpha: Remove nptl/fork.c

The merge at ab21431318d99c94e644606dee1e6a4545d98007 failed
to properly remove the file.

10 years agoFix log10 (1) in round-downward mode (bug 16977).
Joseph Myers [Fri, 23 May 2014 12:07:50 +0000 (12:07 +0000)]
Fix log10 (1) in round-downward mode (bug 16977).

As with various other issues of this kind, bug 16977 is log10 (1)
wrongly returning -0 rather than +0 in round-downward mode because of
an implementation effectively in terms of log1p (x - 1).  This patch
fixes the issue in the same way used for log.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 to confirm a fix was needed for ldbl-128 and to validate that
fix (also applied to ldbl-128ibm since that version of logl is
essentially the same as the ldbl-128 one).

[BZ #16977]
* sysdeps/i386/fpu/e_log10.S (__ieee754_log10): Take absolute
value when x - 1 is zero.
* sysdeps/i386/fpu/e_log10f.S (__ieee754_log10f): Likewise.
* sysdeps/i386/fpu/e_log10l.S (__ieee754_log10l): Likewise.
* sysdeps/ieee754/ldbl-128/e_log10l.c (__ieee754_log10l): Return
0.0L for an argument of 1.0L.
* sysdeps/ieee754/ldbl-128ibm/e_log10l.c (__ieee754_log10l):
Likewise.
* sysdeps/x86_64/fpu/e_log10l.S (__ieee754_log10l): Take absolute
value when x - 1 is zero.
* math/libm-test.inc (log10_test): Use ALL_RM_TEST.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agomanual: Update prototypes for alphasort and friends
Rasmus Villemoes [Tue, 20 May 2014 21:20:19 +0000 (23:20 +0200)]
manual: Update prototypes for alphasort and friends

The four functions {alpha,version}sort{,64} take parameters of type
const struct dirent{,64} **, not const void *.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
10 years agoPowerPC: Remove unneeded copysign[f] macros
Adhemerval Zanella [Thu, 22 May 2014 20:54:41 +0000 (15:54 -0500)]
PowerPC: Remove unneeded copysign[f] macros

This patch remove the unneeded copysign[f] macro from powerpc
math_private.h, since they are already covered in generic version.

10 years agoFix date in ChangeLog
Siddhesh Poyarekar [Thu, 22 May 2014 14:57:32 +0000 (20:27 +0530)]
Fix date in ChangeLog

10 years agoFix formatting
Siddhesh Poyarekar [Thu, 22 May 2014 06:08:50 +0000 (11:38 +0530)]
Fix formatting

10 years agoRemove nested functions: crypt/md5-crypt.c
Konstantin Serebryany [Thu, 22 May 2014 02:59:00 +0000 (08:29 +0530)]
Remove nested functions: crypt/md5-crypt.c

This patch is the first in the series of patches that remove nested
functions from glibc.
Rationale: nested functions is a non-standard language feature;
removing nested functions
will allow to compile glibc with compilers other than GCC and thus
benefit from other compilers
and code analysis tools.

10 years agoPowerPC: Fix memchr ifunc hidden symbol for PPC32
Adhemerval Zanella [Thu, 22 May 2014 12:53:44 +0000 (07:53 -0500)]
PowerPC: Fix memchr ifunc hidden symbol for PPC32

This patch fixes a similar issue to
736c304a1ab4cee36a2f3343f1698bc0abae4608, where for PPC32 if the symbol
is defined as hidden (memchr) then compiler will create a local branc
(symbol@local) and the linker will not create a required PLT call to
make the ifunc work.  It changes the default hidden symbol (__GI_memchr)
to default memchr symbol for powerpc32 (__memchr_ppc32).

10 years agoAArch64: Convert fork.c to arch-fork.h
Roland McGrath [Fri, 16 May 2014 20:09:39 +0000 (13:09 -0700)]
AArch64: Convert fork.c to arch-fork.h

10 years agoDon't mention linuxthreads in Depend files.
Joseph Myers [Wed, 21 May 2014 16:53:11 +0000 (16:53 +0000)]
Don't mention linuxthreads in Depend files.

I noticed that some of the Depend files, used to determine the
subdirectory build order in sysd-sorted, still mentioned linuxthreads,
although it hasn't been supported for many years.  This patch removes
those references.  In the case of nscd, it substitutes an nptl
reference, since I believe there is a fact a thread library dependence
there; the others already mentioned nptl.

Note that I am not at all confident in the completeness of these
Depend files.

Note also that references to linuxthreads remain in a comment in
sysdeps/unix/sysv/linux/ia64/Versions, and in manual/maint.texi,
manual/signal.texi and scripts/documented.sh.

Tested x86_64 that the installed shared libraries are unchanged by the
patch (as is sysd-sorted).

* nscd/Depend (linuxthreads): Remove.
(nptl): Add.
* resolv/Depend (linuxthreads): Remove.
* rt/Depend (linuxthreads): Remove.

10 years agoConsistently use $(elf-objpfx).
Joseph Myers [Wed, 21 May 2014 16:52:08 +0000 (16:52 +0000)]
Consistently use $(elf-objpfx).

As previously noted
<https://sourceware.org/ml/libc-alpha/2013-05/msg00696.html>,
$(elf-objpfx) and $(elfobjdir) are redundant and should be
consolidated.  This patch consolidates on $(elf-objpfx) (for
consistency with $(csu-objpfx)), also changing direct uses of
$(common-objpfx)elf/ to use $(elf-objpfx).

Tested x86_64, including that installed shared libraries are unchanged
by the patch.

* Makeconfig [$(build-hardcoded-path-in-tests) = yes]
(rtld-tests-LDFLAGS): Use $(elf-objpfx) instead of
$(common-objpfx)elf/.
(link-libc-before-gnulib): Likewise.
(elfobjdir): Remove variable.
* Makefile (install): Use $(elf-objpfx) instead of
$(common-objpfx)elf/.
* Makerules (link-libc-args): Use $(elf-objpfx) instead of
$(elfobjdir)/.
(link-libc-deps): Likewise.
($(common-objpfx)libc.so): Likewise.
($(common-objpfx)linkobj/libc.so): Likewise.
[$(cross-compiling) = no] (symbolic-link-prog): Use $(elf-objpfx)
instead of $(common-objpfx)elf/.
(symbolic-link-list): Likewise.
* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
[$(cross-compiling) = no]: Likewise.
* sysdeps/arm/Makefile (gnulib-arch): Use $(elf-objpfx) instead of
$(elfobjdir)/.
(static-gnulib-arch): Likewise.
* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
[$(cross-compiling) = no]: Use $(elf-objpfx) instead of
$(common-objpfx)elf/.

localedata/ChangeLog:
* Makefile (LOCALEDEF): Use $(elf-objpfx) instead of
$(common-objpfx)elf/.

10 years agoaarch64: Merge __local_multiple_threads offset with memory reference
Richard Henderson [Wed, 21 May 2014 15:36:51 +0000 (11:36 -0400)]
aarch64: Merge __local_multiple_threads offset with memory reference

This also highlights that we'd been loading 64-bits instead of
the proper 32-bits.  Caught by the linker as a relocation error,
since the variable happened to be unaligned for 64-bits.

10 years agoaarch64: Merge rtld_errno offset with memory reference
Richard Henderson [Wed, 21 May 2014 15:36:03 +0000 (11:36 -0400)]
aarch64: Merge rtld_errno offset with memory reference

10 years agoFix ARM build with GCC trunk.
Joseph Myers [Tue, 20 May 2014 21:27:13 +0000 (21:27 +0000)]
Fix ARM build with GCC trunk.

sysdeps/unix/sysv/linux/arm/unwind-resume.c and
sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
variables that are written in C code but only read from toplevel asms.
Current GCC trunk now optimizes away such apparently write-only static
variables, so causing a build failure.  This patch marks those
variables with __attribute_used__ to avoid that optimization.

Tested that this fixes the build for ARM.

* sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
(libgcc_s_resume): Use __attribute_used__.
* sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
Likewise.

10 years agoUpdate powerpc-fpu ULPs.
Adhemerval Zanella [Tue, 20 May 2014 21:21:51 +0000 (16:21 -0500)]
Update powerpc-fpu ULPs.

10 years agoPowerPC: Fix copysignf optimization macro
Adhemerval Zanella [Tue, 20 May 2014 21:07:49 +0000 (16:07 -0500)]
PowerPC: Fix copysignf optimization macro

This patch fixes the __copysignf optimized macro meant to internal libm
usage when used with constant value.  Without the explicit cast to
float, if it is used with const double value (for instance, on
s_casinhf.c) double constants will be used and it may lead to precision
issues in some algorithms.

It fixes the following failures on PPC64/POWER7:

Failure: Test: Real part of: cacos_downward (inf + 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_downward (inf - 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_downward (inf + 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_downward (inf - 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf + 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf - 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf + 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf - 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0

10 years agoFix strtold on 32-bit sparc (and probably others) (BZ #16965)
Aurelien Jarno [Tue, 20 May 2014 12:41:44 +0000 (14:41 +0200)]
Fix strtold on 32-bit sparc (and probably others) (BZ #16965)

This patch fixes an issue observed running the tst-strtod-round test on
32 bit sparc. In some conditions, strtold calls round_and_return, which in
turn calls __mpn_rshift with cnt = 0, while stdlib/rshift.c explicitly says
that cnts should satisfy 0 < CNT < BITS_PER_MP_LIMB. In this case, the code
end up doing a logical shift right of the same amount than the register,
which is undefined in the C standard.

Due to this bug, 32-bit sparc does not correctly convert the value
"0x1p-16446", but it is likely that other architectures are also
affected for other input values.

10 years agofix nl_langinfo with static linking (BZ #16915)
Aurelien Jarno [Thu, 15 May 2014 22:06:54 +0000 (00:06 +0200)]
fix nl_langinfo with static linking (BZ #16915)

For static linking the locale code avoids linking code and data for
unused categories. However for nl_langinfo we know only at runtime which
categories are used, so direct reference to every nl_current_CATEGORY
symbol should be done.

This was broken by commit bc3e1c127392da88d0c8bf2ae728147982a3d1bc where
nl_langinfo_l and nl_langinfo have been merged and some code has been
lost in the process.

In order to detect locales issues with static linking, compile a version
of tst-langinfo with static linking.

Note: this is Debian bug#747103 reported by Raphael <raphael.astier@eliot-sa.com>

10 years agoalpha: fix sa_flags type (BZ 16967)
Richard Henderson [Tue, 20 May 2014 14:15:46 +0000 (07:15 -0700)]
alpha: fix sa_flags type (BZ 16967)

10 years agoalpha: Remove bits/siginfo.h (BZ 16966)
Richard Henderson [Tue, 20 May 2014 13:59:52 +0000 (06:59 -0700)]
alpha: Remove bits/siginfo.h (BZ 16966)

Using the default header instead.  This matches the kernel, which also
uses the generic header.  Fixes the sys/wait.h conform issue, where
si_band had the wrong type.

10 years agoalpha: Define ELF_MACHINE_NO_RELA
Richard Henderson [Mon, 19 May 2014 05:09:30 +0000 (22:09 -0700)]
alpha: Define ELF_MACHINE_NO_RELA

10 years agoAArch64: Fix handling of nocancel syscall failures
Will Newton [Mon, 19 May 2014 13:38:30 +0000 (14:38 +0100)]
AArch64: Fix handling of nocancel syscall failures

The current code for nocancel syscalls does not do a comparison of
the system call return value. This leads to code being generated
where the b.cs follows the svc instruction directly without setting
the flags on which the branch depends.

ChangeLog:

2014-05-20  Will Newton  <will.newton@linaro.org>

* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
Test the return value of the system call in the nocancel case.

10 years agoAArch64: Remove asm/ptrace.h inclusion in sys/user.h and sys/procfs.h
Yvan Roux [Tue, 20 May 2014 12:45:22 +0000 (13:45 +0100)]
AArch64: Remove asm/ptrace.h inclusion in sys/user.h and sys/procfs.h

This patch fixes an issue observed by the Xen project, where including
signal.h exposes various PSR_MODE #defines.  This is due to the usage
in sys/user.h and sys/procfs.h of the struct user_pt_regs and
user_fpsimd_state included via asm/ptrace.h.  The namespace pollution
this inclusion introduce is already partially fixed with some #undef
of the PTRACE_* symbols, but other symbols like the PSR_MODE ones are
still present, and undefining them is not safe since a user can
include ptrace.h before user.h.

My proposition is to define the 2 structures we need in user.h and get
rid of the asm/ptrace.h inclusion.

Build and make check are clean on AArch64.

2014-05-20  Will Newton  <will.newton@linaro.org>
    Yvan Roux  <yvan.roux@linaro.org>

* sysdeps/unix/sysv/linux/aarch64/sys/user.h: Remove unused
#include of asm/ptrace.h.
(PTRACE_GET_THREAD_AREA): Remove #undef.
(PTRACE_GETHBPREGS): Likewise.
(PTRACE_SETHBPREGS): Likewise.
(struct user_regs_struct): New structure.
(struct user_fpsimd_struct): New structure.
* sysdeps/unix/sysv/linux/aarch64/sys/procfs.h: Remove unused
#include of asm/ptrace.h and second #include of sys/user.h.
(PTRACE_GET_THREAD_AREA): Remove #undef.
(PTRACE_GETHBPREGS): Likewise.
(PTRACE_SETHBPREGS): Likewise.
(ELF_NGREG): Use new struct user_regs_struct.
(elf_fpregset_t): Use new struct user_fpsimd_struct.

10 years agoPowerPC: Fix multiarch hypotf PPC64 path
Adhemerval Zanella [Mon, 19 May 2014 22:56:55 +0000 (17:56 -0500)]
PowerPC: Fix multiarch hypotf PPC64 path

This patch moves the hypotf multiarch implementation to correct path.

10 years agoRevert "ARM: Improve fenv implementation"
Marcus Shawcroft [Mon, 19 May 2014 08:08:59 +0000 (09:08 +0100)]
Revert "ARM: Improve fenv implementation"

This reverts commit c0c08d02c82275353f5c556f935a1a01714d9d7f.

10 years agoFix sparc memcpy data corruption when using niagara2 optimized routines.
Jose E. Marchesi [Sat, 17 May 2014 18:20:27 +0000 (11:20 -0700)]
Fix sparc memcpy data corruption when using niagara2 optimized routines.

* sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S: Add missing
membar to avoid block loads/stores to overlap previous stores.

10 years agoalpha: Create __syscall_nocancel entry points
Richard Henderson [Sat, 17 May 2014 18:25:19 +0000 (11:25 -0700)]
alpha: Create __syscall_nocancel entry points

10 years agoMerge remote-tracking branch 'origin/roland/nptl-alpha'
Richard Henderson [Sat, 17 May 2014 18:20:44 +0000 (11:20 -0700)]
Merge remote-tracking branch 'origin/roland/nptl-alpha'

10 years agoFix some termios.h conformtest failures on sparc.
David S. Miller [Sat, 17 May 2014 18:11:53 +0000 (11:11 -0700)]
Fix some termios.h conformtest failures on sparc.

* sysdeps/unix/sysv/linux/sparc/bits/termios.h (PAGEOUT, WRAP):
Protect with __USE_GNU.
(TIOCSET_TEMPT): Likewise.
(TIOCM_LE, TIOCM_DTR, TIOCM_RTS, TIOCM_ST, TIOCM_SR, TIOCM_CTS,
TIOCM_CAR, TIOCM_RNG, TIOCM_DSR, TIOCM_CD, TIOCM_RI): Remove as
these are already provided in bits/ioctl-types.h

10 years agoFix __waitpid_nocancel link error.
Roland McGrath [Fri, 16 May 2014 21:00:35 +0000 (14:00 -0700)]
Fix __waitpid_nocancel link error.

10 years agoARM: soft-fp NaN representation correction
Maciej W. Rozycki [Fri, 16 May 2014 21:46:53 +0000 (22:46 +0100)]
ARM: soft-fp NaN representation correction

Commit 7d92b78723848ae616709eb8f0191ea067025b18 [Fix ARM NAN fraction
bits.] removed all the bits set from NANFRAC macros and, when propagated
to libgcc, regressed gcc.dg/torture/builtin-math-7.c on soft-fp arm-eabi
targets, currently ARMv6-M (`-march=armv6-m -mthumb') only.  This is
because when used to construct a NaN in the semi-raw mode, they now
build an infinity instead.  Consequently operations such as (Inf - Inf)
now produce Inf rather than NaN.  The change worked for the original
test case, posted with PR libgcc/60166, because division is made in the
canonical mode, where the quiet bit is set separately, from the fp
class.

This change brings the quiet bit back to these macros, making semi-raw
mode calculations produce the expected results again.

10 years agoUse existing makefile variables for dependencies on glibc libraries.
Joseph Myers [Fri, 16 May 2014 21:38:08 +0000 (21:38 +0000)]
Use existing makefile variables for dependencies on glibc libraries.

glibc's Makeconfig defines some variables such as $(libm) and $(libdl)
for linking with libraries built by glibc, and nptl/Makeconfig
(included by the toplevel Makeconfig) defines others such as
$(shared-thread-library).

In some places glibc's Makefiles use those variables when linking
against the relevant libraries, but in other places they hardcode the
location of the libraries in the build tree.  This patch cleans up
various places to use the variables that already exist (in the case of
libm, replacing several duplicate definitions of a $(link-libm)
variable in subdirectory Makefiles).  (It's not necessarily exactly
equivalent to what the existing code does - in particular,
$(shared-thread-library) includes libpthread_nonshared, but is
replacing places that just referred to libpthread.so.  But I think
that change is desirable on the general principle of linking things as
close as possible to the way in which they would be linked with an
installed library, unless there is a clear reason not to do so.)

To support running tests with an installed copy of glibc without
needing the full build tree from when that copy was built, I think it
will be useful to use such variables more generally and systematically
- every time the rules for building a test refer to some file from the
build tree that's also installed by glibc, use a makefile variable so
that the installed-testing case can point those variables to installed
copies of the files.  This patch just deals with straightforward cases
where such variables already exist.

It's quite possible some uses of $(shared-thread-library) should
actually be a new $(thread-library) variable that's set appropriately
in the --disable-shared case, if those uses would in fact work without
shared libraries.  I didn't change the status quo that those cases
hardcode use of a shared library whether or not it's actually needed
(but other uses such as $(libm) and $(libdl) would now get the static
library if the shared library isn't built, when some previously
hardcoded use of the shared library - if they actually need shared
libraries, the test itself needs an enable-shared conditional anyway).

Tested x86_64.

* benchtests/Makefile
($(addprefix $(objpfx)bench-,$(bench-math))): Depend on $(libm),
not $(common-objpfx)math/libm.so.
($(addprefix $(objpfx)bench-,$(bench-pthread))): Depend on
$(shared-thread-library), not $(common-objpfx)nptl/libpthread.so.
* elf/Makefile ($(objpfx)noload): Depend on $(libdl), not
$(common-objpfx)dlfcn/libdl.so.
($(objpfx)tst-audit8): Depend on $(libm), not
$(common-objpfx)math/libm.so.
* malloc/Makefile ($(objpfx)libmemusage.so): Depend on $(libdl),
not $(common-objpfx)dlfcn/libdl.so.
* math/Makefile
($(addprefix $(objpfx),$(filter-out $(tests-static),$(tests)))):
Depend on $(libm), not $(objpfx)libm.so.  Do not condition on
[$(build-shared) = yes].
($(objpfx)test-fenv-tls): Depend on $(shared-thread-library), not
$(common-objpfx)nptl/libpthread.so.
* misc/Makefile ($(objpfx)tst-tsearch): Depend on $(libm), not
$(common-objpfx)math/libm.so$(libm.so-version) or
$(common-objpfx)math/libm.a depending on [$(build-shared) = yes].
* nptl/Makefile ($(objpfx)tst-unload): Depend on $(libdl), not
$(common-objpfx)dlfcn/libdl.so.
* setjmp/Makefile (link-libm): Remove variable.
($(objpfx)tst-setjmp-fp): Depend on $(libm), not $(link-libm).
* stdio-common/Makefile (link-libm): Remove variable.
($(objpfx)tst-printf-round): Depend on $(libm), not $(link-libm).
* stdlib/Makefile (link-libm): Remove variable.
($(objpfx)bug-getcontext): Depend on $(libm), not $(link-libm).
($(objpfx)tst-strtod-round): Likewise.
($(objpfx)tst-tininess): Likewise.
($(objpfx)tst-strtod-underflow): Likewise.
($(objpfx)tst-strtod6): Likewise.
($(objpfx)tst-tls-atexit): Depend on $(shared-thread-library) and
$(libdl), not $(common-objpfx)nptl/libpthread.so and
$(common-objpfx)dlfcn/libdl.so.

10 years agoPowerPC: clean BSD Terminal Modes expectation in termios.h
Adhemerval Zanella [Wed, 7 May 2014 11:43:04 +0000 (06:43 -0500)]
PowerPC: clean BSD Terminal Modes expectation in termios.h

This patch guard the BSD definition for terminal modes in PowerPC
specific header fixing the following conformance failures:

FAIL: conform/POSIX/termios.h/conform
FAIL: conform/POSIX2008/termios.h/conform
FAIL: conform/UNIX98/termios.h/conform

10 years agoAlpha: Convert fork.c to arch-fork.h
Roland McGrath [Fri, 16 May 2014 20:03:08 +0000 (13:03 -0700)]
Alpha: Convert fork.c to arch-fork.h

10 years agoARM: Convert fork.c to arch-fork.h
Roland McGrath [Fri, 16 May 2014 19:51:39 +0000 (12:51 -0700)]
ARM: Convert fork.c to arch-fork.h

10 years agoAdd stub arch-fork.h header.
Roland McGrath [Fri, 16 May 2014 18:47:13 +0000 (11:47 -0700)]
Add stub arch-fork.h header.

10 years agoSplit arch-fork.h from fork.h
Roland McGrath [Fri, 16 May 2014 18:17:41 +0000 (11:17 -0700)]
Split arch-fork.h from fork.h

10 years agoUpdate Swedish translations
Allan McRae [Fri, 16 May 2014 04:21:12 +0000 (14:21 +1000)]
Update Swedish translations

10 years agoFix variable used in sed expression in timezone/Makefile
Allan McRae [Fri, 16 May 2014 03:43:47 +0000 (13:43 +1000)]
Fix variable used in sed expression in timezone/Makefile

10 years agoSPARC: add prlimit and prlimit64 in <bits/resource.h> (BZ #16943)
Aurelien Jarno [Thu, 15 May 2014 22:04:41 +0000 (00:04 +0200)]
SPARC: add prlimit and prlimit64 in <bits/resource.h> (BZ #16943)

prlimit and prlimit64 have been added in the main <bits/resource.h>, but
not in the SPARC specific version. Fix that.

Note: this is Debian bug#703559, reported by Emilio Pozuelo Monfort
<pochu@debian.org>

10 years agoptsname_r: don't leak uninitialized memory (BZ #16917)
Aurelien Jarno [Thu, 15 May 2014 22:03:37 +0000 (00:03 +0200)]
ptsname_r: don't leak uninitialized memory (BZ #16917)

If the fd refers to a terminal device, but not a pty master, the
TIOCGPTN ioctl returns with ENOTTY. This error is not caught, and the
possibly undefined buffer passed to ptsname_r is sent directly to the
stat64 syscall.

Fix this by using a fallback to the old method only if the TIOCGPTN
ioctl fails with EINVAL. This also fix the return value in that specific
case (it return ENOENT without this patch).

Also add tests to the ptsname_r function (and ptsname at the same time).

Note: this is Debian bug#741482, reported by Jakub Wilk <jwilk@debian.org>

10 years agoARM: Improve fenv implementation
Wilco [Thu, 15 May 2014 14:21:55 +0000 (15:21 +0100)]
ARM: Improve fenv implementation

10 years agoARM: Improve fenv implementation
Wilco [Thu, 15 May 2014 14:18:40 +0000 (15:18 +0100)]
ARM: Improve fenv implementation

10 years agoReturn EAI_AGAIN for AF_UNSPEC when herrno is TRY_AGAIN (BZ #16849)
Siddhesh Poyarekar [Thu, 15 May 2014 07:03:11 +0000 (12:33 +0530)]
Return EAI_AGAIN for AF_UNSPEC when herrno is TRY_AGAIN (BZ #16849)

getaddrinfo correctly returns EAI_AGAIN for AF_INET and AF_INET6
queries.  For AF_UNSPEC however, an older change
(a682a1bf553b1efe4dbb03207fece5b719cec482) broke the check and due to
that the returned error was EAI_NONAME.

This patch fixes the check so that a non-authoritative not-found is
returned as EAI_AGAIN to the user instead of EAI_NONAME.

10 years agox86: Move abilist files out of nptl/ subdirectories.
Roland McGrath [Wed, 14 May 2014 22:45:23 +0000 (15:45 -0700)]
x86: Move abilist files out of nptl/ subdirectories.

10 years agoMove remaining files out of nptl/sysdeps/unix/sysv/linux/x86/.
Roland McGrath [Wed, 14 May 2014 22:32:18 +0000 (15:32 -0700)]
Move remaining files out of nptl/sysdeps/unix/sysv/linux/x86/.

10 years agoFix mips fork after i386 reorganization.
Roland McGrath [Wed, 14 May 2014 21:00:23 +0000 (14:00 -0700)]
Fix mips fork after i386 reorganization.

10 years agoMove remaining nptl/sysdeps/unix/sysv/linux/i386/ files.
Roland McGrath [Wed, 14 May 2014 20:37:40 +0000 (13:37 -0700)]
Move remaining nptl/sysdeps/unix/sysv/linux/i386/ files.

10 years agoFix powerpc fork after i386 reorganization.
Roland McGrath [Wed, 14 May 2014 20:28:40 +0000 (13:28 -0700)]
Fix powerpc fork after i386 reorganization.

10 years agoUpdate alpha and ia64 timer_*.c files for x86_64 file moves.
Roland McGrath [Wed, 14 May 2014 20:24:17 +0000 (13:24 -0700)]
Update alpha and ia64 timer_*.c files for x86_64 file moves.

10 years agoi386: Remove useless pthread_spin_{init,unlock} wrapper files.
Roland McGrath [Wed, 14 May 2014 19:57:21 +0000 (12:57 -0700)]
i386: Remove useless pthread_spin_{init,unlock} wrapper files.

10 years agoMove remaining nptl/sysdeps/unix/sysv/linux/x86_64/ files.
Roland McGrath [Wed, 14 May 2014 19:33:43 +0000 (12:33 -0700)]
Move remaining nptl/sysdeps/unix/sysv/linux/x86_64/ files.

10 years agox86: Consolidate NPTL fork.
Roland McGrath [Wed, 14 May 2014 18:31:37 +0000 (11:31 -0700)]
x86: Consolidate NPTL fork.

10 years agoConsolidate not-cancel.h files.
Roland McGrath [Wed, 14 May 2014 18:06:36 +0000 (11:06 -0700)]
Consolidate not-cancel.h files.

10 years agoUpdate s390 timer_*.c files for x86_64 file moves.
Roland McGrath [Wed, 14 May 2014 17:57:40 +0000 (10:57 -0700)]
Update s390 timer_*.c files for x86_64 file moves.