platform/upstream/linaro-glibc.git
8 years agoAdd atomic operations similar to those provided by C11.
Torvald Riegel [Sun, 14 Sep 2014 18:04:54 +0000 (20:04 +0200)]
Add atomic operations similar to those provided by C11.

Change-Id: I4138c4d17bfa5f70e85530933aadd4fc7662fc84

8 years agoAdd arch-specific configuration for C11 atomics support.
Torvald Riegel [Fri, 17 Oct 2014 23:02:59 +0000 (01:02 +0200)]
Add arch-specific configuration for C11 atomics support.

This sets __HAVE_64B_ATOMICS if provided.  It also sets
USE_ATOMIC_COMPILER_BUILTINS to true if the existing atomic ops use the
__atomic* builtins (aarch64, mips partially) or if this has been
tested (x86_64); otherwise, this is set to false so that C11 atomics will
be based on the existing atomic operations.

Change-Id: Idb0f82007ca89b26bf330e63ddbc52ada6bfe5e0

8 years agoNew Bhilodi and Tulu locales (BZ #17475)
Tatiana Udalova [Wed, 12 Nov 2014 11:36:39 +0000 (17:06 +0530)]
New Bhilodi and Tulu locales (BZ #17475)

Change-Id: Id08824de571c2b70e5c76849fd2afa49c25eee05

8 years agoApply linaro-gcc-version.patch
Dongkyun, Son [Wed, 10 Jun 2015 02:11:14 +0000 (11:11 +0900)]
Apply linaro-gcc-version.patch

Change-Id: I58a06e487be977cc370d589a314fa1a528da5187
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agoarm: Re-enable PI futex support for ARM kernels >= 3.14.3
Gratian Crisan [Mon, 27 Oct 2014 22:45:43 +0000 (22:45 +0000)]
arm: Re-enable PI futex support for ARM kernels >= 3.14.3

ARM linux kernels before 3.14.3 may or may not support
futex_atomic_cmpxchg_inatomic depending on the kernel configuration (e.g.
CONFIG_CPU_USE_DOMAINS && CONFIG_SMP configuration was not supported)

Starting with 3.14.3 the linux kernel unconditionally enables support for
ARM, and this re-enables the relevant __ASSUME_* macros.

Tested on ARM both with kernels >= 3.14.3 and older kernels.

* sysdeps/unix/sysv/linux/arm/kernel-features.h
[__LINUX_KERNEL_VERSION >= 0x030E03] (__ASSUME_FUTEX_LOCK_PI): Do
not undefine.
[__LINUX_KERNEL_VERSION >= 0x030E03] (__ASSUME_REQUEUE_PI):
Likewise.
[__LINUX_KERNEL_VERSION >= 0x030E03] (__ASSUME_SET_ROBUST_LIST):
Likewise.

Change-Id: I45cd4a85dd5d5351633143d2cda7b12e624468b2

8 years agoPackaging version change
Vyacheslav Barinov [Tue, 20 Oct 2015 07:50:42 +0000 (10:50 +0300)]
Packaging version change

Change-Id: I1b113d575918d95fb331c96a6489cb3d51b2d6f9

8 years agopackaging: add packaging (from tizen branch)
Dongkyun, Son [Tue, 20 Oct 2015 02:05:27 +0000 (11:05 +0900)]
packaging: add packaging (from tizen branch)

Change-Id: I24d27a18a96d6d8dd60e7876469efb8f21abd214
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agoS390: Fix "backtrace() returns infinitely deep stack frames with makecontext()" ...
Stefan Liebler [Thu, 28 Apr 2016 08:26:35 +0000 (10:26 +0200)]
S390: Fix "backtrace() returns infinitely deep stack frames with makecontext()" [BZ #18508].

On s390/s390x backtrace(buffer, size) returns the series of called functions until
"makecontext_ret" and additional entries (up to "size") with "makecontext_ret".
GDB-backtrace is also warning:
"Backtrace stopped: previous frame identical to this frame (corrupt stack?)"

To reproduce this scenario you have to setup a new context with makecontext()
and activate it with setcontext(). See e.g. cf() function in testcase stdlib/tst-makecontext.c.
Or see bug in libgo "Bug 66303 - runtime.Caller() returns infinitely deep stack frames
on s390x " (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66303).

This patch omits the cfi_startproc/cfi_endproc directives in ENTRY/END macro of
__makecontext_ret. Thus no frame information is generated in .eh_frame and backtrace
stops after __makecontext_ret. There is also no .eh_frame info for _start or
thread_start functions.

ChangeLog:

[BZ #18508]
* stdlib/Makefile ($(objpfx)tst-makecontext3):
Depend on $(libdl).
* stdlib/tst-makecontext.c (cf): Test if _Unwind_Backtrace
is not called infinitely times.
(backtrace_helper): New function.
(trace_arg): New struct.
(st1): Enlarge stack size.
* sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S:
(__makecontext_ret): Omit cfi_startproc and cfi_endproc.
* sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S:
Likewise.

(cherry picked from commit 890b7a4b33d482b5c768ab47d70758b80227e9bc)

8 years agoS/390: Fix setcontext/swapcontext which are not restoring sigmask.
Stefan Liebler [Thu, 28 Apr 2016 08:25:49 +0000 (10:25 +0200)]
S/390: Fix setcontext/swapcontext which are not restoring sigmask.

This patch uses sigprocmask(SIG_SETMASK) instead of SIG_BLOCK
in setcontext, swapcontext.

(cherry picked from commit 2e807f29595eb5b1e5d0decc6e356a3562ecc58e)

8 years agoconfigure: fix `test ==` usage
Mike Frysinger [Sun, 10 Apr 2016 00:02:48 +0000 (20:02 -0400)]
configure: fix `test ==` usage

POSIX defines the = operator, but not ==.  Fix the few places where we
incorrectly used ==.

(cherry picked from commit b2d4456b333970ab4cb01ed8045b9a8d2c4832f3)

8 years agoS390: Extend structs La_s390_regs / La_s390_retval with vector-registers.
Stefan Liebler [Mon, 4 Apr 2016 11:20:27 +0000 (13:20 +0200)]
S390: Extend structs La_s390_regs / La_s390_retval with vector-registers.

Starting with z13, vector registers can also occur as argument registers.
Thus the passed input/output register structs for
la_s390_[32|64]_gnu_plt[enter|exit] functions should reflect those new
registers. This patch extends these structs La_s390_regs and La_s390_retval
and adjusts _dl_runtime_profile() to handle those fields in case of
running on a z13 machine.

ChangeLog:

* sysdeps/s390/bits/link.h: (La_s390_vr) New typedef.
(La_s390_32_regs): Append vector register lr_v24-lr_v31.
(La_s390_64_regs): Likewise.
(La_s390_32_retval): Append vector register lrv_v24.
(La_s390_64_retval): Likeweise.
* sysdeps/s390/s390-32/dl-trampoline.h (_dl_runtime_profile):
Handle extended structs La_s390_32_regs and La_s390_32_retval.
* sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_profile):
Handle extended structs La_s390_64_regs and La_s390_64_retval.

(cherry picked from commit 5cdd1989d1d2f135d02e66250f37ba8e767f9772)

8 years agoS390: Save and restore fprs/vrs while resolving symbols.
Stefan Liebler [Mon, 4 Apr 2016 11:20:27 +0000 (13:20 +0200)]
S390: Save and restore fprs/vrs while resolving symbols.

On s390, no fpr/vrs were saved while resolving a symbol
via _dl_runtime_resolve/_dl_runtime_profile.

According to the abi, the fpr-arguments are defined as call clobbered.
In leaf-functions, gcc 4.9 and newer can use fprs for saving/restoring gprs
instead of saving them to the stack.
If gcc do this in one of the resolver-functions, then the floating point
arguments of a library-function are invalid for the first library-function-call.
Thus, this patch saves/restores the fprs around the resolving code.

The same could occur for vector registers. Furthermore an ifunc-resolver
could also clobber the vector/floating point argument registers.
Thus this patch provides the further variants _dl_runtime_resolve_vx/
_dl_runtime_profile_vx, which are used if the kernel claims, that
we run on a machine with vector registers.

Furthermore, if _dl_runtime_profile calls _dl_call_pltexit,
the pointers to inregs-/outregs-structs were setup invalid.
Now they point to the correct location in the stack-frame.
Before branching back to the caller, the return values are now
restored instead of containing the return values of the
_dl_call_pltexit() call.
On s390-32, an endless loop occurs if _dl_call_pltexit() should be called.
Now, this code-path branches to this function instead of just after the
preceding basr-instruction.

ChangeLog:

* sysdeps/s390/s390-32/dl-trampoline.S: Include dl-trampoline.h twice
to create a non-vector/vector version for _dl_runtime_resolve and
_dl_runtime_profile. Move implementation to ...
* sysdeps/s390/s390-32/dl-trampoline.h: ... here.
(_dl_runtime_resolve) Save and restore fpr/vrs.
(_dl_runtime_profile) Save and restore vrs and fix some issues
if _dl_call_pltexit is called.
* sysdeps/s390/s390-32/dl-machine.h (elf_machine_runtime_setup):
Choose the correct resolver function if running on a machine with vx.
* sysdeps/s390/s390-64/dl-trampoline.S: Include dl-trampoline.h twice
to create a non-vector/vector version for _dl_runtime_resolve and
_dl_runtime_profile. Move implementation to ...
* sysdeps/s390/s390-64/dl-trampoline.h: ... here.
(_dl_runtime_resolve) Save and restore fpr/vrs.
(_dl_runtime_profile) Save and restore vrs and fix some issues
* sysdeps/s390/s390-64/dl-machine.h: (elf_machine_runtime_setup):
Choose the correct resolver function if running on a machine with vx.

(cherry picked from commit 4603c51ef7989d7eb800cdd6f42aab206f891077
and commit d8a012c5c9e4bfc1b8db2bc6deacb85b44a2e1eb)

8 years agoS390: configure check for vector instruction support in assembler.
Stefan Liebler [Mon, 4 Apr 2016 11:20:26 +0000 (13:20 +0200)]
S390: configure check for vector instruction support in assembler.

The S390 specific test checks if the assembler has support for the new z13
vector instructions by compiling a vector instruction. The .machine and
.machinemode directives are needed to compile the vector instruction without
-march=z13 option on 31/64 bit.
On success the macro HAVE_S390_VX_ASM_SUPPORT is defined. This macro is used
to determine if the optimized functions can be build without compile errors.
If the used assembler lacks vector support, then a warning is dumped while
configuring and only the common code functions are build.

The z13 instruction support was introduced in
"[Committed] S/390: Add support for IBM z13."
(https://sourceware.org/ml/binutils/2015-01/msg00197.html)

ChangeLog:

* config.h.in (HAVE_S390_VX_ASM_SUPPORT): New macro undefine.
* sysdeps/s390/configure.ac: Add test for S390 vector instruction
assembler support.
* sysdeps/s390/configure: Regenerated.

(cherry picked from commit 4f0a1cea34c05fb2acc16f1a2d291f53230eb4fb)

8 years agoS390: Add new s390 platform.
Stefan Liebler [Mon, 4 Apr 2016 11:20:26 +0000 (13:20 +0200)]
S390: Add new s390 platform.

The new IBM z13 is added to platform string array.
The macro _DL_PLATFORMS_COUNT is incremented to 8,
because it was not incremented by commit
"S/390: Sync AUXV capabilities and archs with kernel".

ChangeLog:

* sysdeps/s390/dl-procinfo.c (_dl_s390_cap_flags): Add z13.
* sysdeps/s390/dl-procinfo.h (_DL_PLATFORMS_COUNT): Increased.

(cherry picked from commit a1b0488fc9df3d895a2e5eefbcd348d3f7fe0e52)

8 years agoS390: Add hwcaps value for vector facility.
Stefan Liebler [Mon, 4 Apr 2016 11:20:26 +0000 (13:20 +0200)]
S390: Add hwcaps value for vector facility.

The HWCAP_S390_VX flag in hwcap field of auxiliary vector indicates
if the vector facility is available and the kernel is aware of it.
This can be tested with LD_SHOW_AUXV=1 <prog>.
Currently it does not show te, because it was not incremented
by commit "S/390: Add hwcap value for transactional execution.".
Thus _DL_HWCAP_COUNT is incremented by two.

ChangeLog:

* sysdeps/s390/dl-procinfo.c (_dl_s390_platforms): Add vector flag.
* sysdeps/s390/dl-procinfo.h: Add vector capability.
* sysdeps/unix/sysv/linux/s390/bits/hwcap.h (HWCAP_S390_VX): Define.

(cherry picked from commit 4e28fa80886c71e6aaf85016b82ce981c0f12e6d)

8 years agoS390: Do not use direct socket syscalls if build on kernels >= 4.3. [BZ #19682]
Stefan Liebler [Thu, 3 Mar 2016 07:24:18 +0000 (08:24 +0100)]
S390: Do not use direct socket syscalls if build on kernels >= 4.3. [BZ #19682]

Beginning with Linux 4.3, the kernel headers contain direct
system call numbers __NR_socket etc. on s390x. On older kernels,
the socket-multiplexer syscall __NR_socketcall was used.

To enable these new syscalls, the patch
"S390: Call direct system calls for socket operations."
(https://sourceware.org/git/?p=glibc.git;a=commit;h=016495b818cb61df7d0d10e6db54074271b3e3a5)
was applied upstream.

If glibc 2.23 is configured with --enable-kernel=4.3 and newer,
the direct socket syscalls are used.
For older kernels, the socket-multiplexer syscall is used instead.

In glibc 2.22 and earlier, this patch is not applied.
If you build glibc on a kernel < 4.3, the socket-multiplexer
syscall is used. But if you build glibc on kernel >= 4.3, the
direct socket-syscalls are used. If you install this glibc on a
kernel < 4.3, all socket operations will fail.
See "Bug 19682 - s390x: Incorrect syscall definitions cause
breakage with Linux 4.3 headers"
(https://sourceware.org/bugzilla/show_bug.cgi?id=19682)
The configure switch --enable-kernel does not influence this
behaviour on older glibc-releases.

The solution is to remove the direct socket-syscalls in
sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
(this patch) on older glibc-releases as it was done by the
upstream patch, too. These entries were never used on s390x,
but the c-files in sysdeps/unix/sysv/linux/.
After this removal, the behaviour of the socket functions are
not changed compared to the original glibc release version
and the socket-multiplexer-syscall is always used.

8 years agoCVE-2015-7547: getaddrinfo() stack-based buffer overflow (Bug 18665).
Carlos O'Donell [Wed, 17 Feb 2016 02:26:37 +0000 (21:26 -0500)]
CVE-2015-7547: getaddrinfo() stack-based buffer overflow (Bug 18665).

* A stack-based buffer overflow was found in libresolv when invoked from
  libnss_dns, allowing specially crafted DNS responses to seize control
  of execution flow in the DNS client.  The buffer overflow occurs in
  the functions send_dg (send datagram) and send_vc (send TCP) for the
  NSS module libnss_dns.so.2 when calling getaddrinfo with AF_UNSPEC
  family.  The use of AF_UNSPEC triggers the low-level resolver code to
  send out two parallel queries for A and AAAA.  A mismanagement of the
  buffers used for those queries could result in the response of a query
  writing beyond the alloca allocated buffer created by
  _nss_dns_gethostbyname4_r.  Buffer management is simplified to remove
  the overflow.  Thanks to the Google Security Team and Red Hat for
  reporting the security impact of this issue, and Robert Holiday of
  Ciena for reporting the related bug 18665. (CVE-2015-7547)

See also:
https://sourceware.org/ml/libc-alpha/2016-02/msg00416.html
https://sourceware.org/ml/libc-alpha/2016-02/msg00418.html

(cherry picked from commit 16d0a0ce7613552301786bf05d7eba8784b5732c)

Conflicts:
NEWS
resolv/res_send.c

8 years agoFix read past end of pattern in fnmatch (bug 18032)
Andreas Schwab [Thu, 26 Feb 2015 13:55:24 +0000 (14:55 +0100)]
Fix read past end of pattern in fnmatch (bug 18032)

(cherry picked from commit 4a28f4d55a6cc33474c0792fe93b5942d81bf185)

Conflicts:
NEWS

8 years agoFix BZ #17269 -- _IO_wstr_overflow integer overflow
Paul Pluzhnikov [Sun, 22 Feb 2015 20:01:47 +0000 (12:01 -0800)]
Fix BZ #17269 -- _IO_wstr_overflow integer overflow

(cherry picked from commit bdf1ff052a8e23d637f2c838fa5642d78fcedc33)

Conflicts:
NEWS

8 years agoHarden tls_dtor_list with pointer mangling [BZ #19018]
Florian Weimer [Tue, 6 Oct 2015 11:12:36 +0000 (13:12 +0200)]
Harden tls_dtor_list with pointer mangling [BZ #19018]

(cherry picked from commit f586e1328681b400078c995a0bb6ad301ef73549)

Conflicts:
NEWS
stdlib/cxa_thread_atexit_impl.c

8 years agoAlways enable pointer guard [BZ #18928]
Florian Weimer [Thu, 15 Oct 2015 07:23:07 +0000 (09:23 +0200)]
Always enable pointer guard [BZ #18928]

Honoring the LD_POINTER_GUARD environment variable in AT_SECURE mode
has security implications.  This commit enables pointer guard
unconditionally, and the environment variable is now ignored.

        [BZ #18928]
        * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
        _dl_pointer_guard member.
        * elf/rtld.c (_rtld_global_ro): Remove _dl_pointer_guard
        initializer.
        (security_init): Always set up pointer guard.
        (process_envvars): Do not process LD_POINTER_GUARD.

(cherry picked from commit a014cecd82b71b70a6a843e250e06b541ad524f7)

Conflicts:
NEWS

8 years agosparc: fix sigaction for 32bit builds [BZ #18694]
Mike Frysinger [Mon, 20 Jul 2015 11:29:15 +0000 (07:29 -0400)]
sparc: fix sigaction for 32bit builds [BZ #18694]

Commit a059d359d86130b5fa74e04a978c8523a0293f77 changed the sigaction
struct to pass conform tests, but it ended up also changing the ABI for
32 bit builds.  For 64 bit builds, changing the long to two ints works,
but for 32 bit builds, it inserts 4 extra bytes.  This leads to many
packages randomly failing like bash that spews things like:
configure: line 471: wait_for: No record of process 0

Bracket the new member by a wordsize check to fix the ABI for 32bit.

(cherry picked from commit 7fde904c73c57faea48c9679bbdc0932d81b3a2f)

8 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.

(cherry picked from commit 5bd80bfe9ca0d955bfbbc002781bc7b01b6bcb06)

Conflicts:
ChangeLog
NEWS

8 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.

(cherry picked from commit 5f3d0b78e011d2a72f9e88b0e9ef5bc081d18f97)

Conflicts:
ChangeLog
NEWS

8 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.

(cherry picked from commit 0f9e585480edcdf1e30dc3d79e24b84aeee516fa)

Conflicts:
ChangeLog
NEWS

8 years agoMove findidx nested functions to top-level.
Roland McGrath [Thu, 11 Sep 2014 23:02:17 +0000 (16:02 -0700)]
Move findidx nested functions to top-level.

Needed in order to backport strxfrm_l security fix cleanly.

(cherry picked from commit 8c0ab919f63dc03a420751172602a52d2bea59a8)

Conflicts:
ChangeLog

8 years agoAvoid infinite loop in nss_dns getnetbyname [BZ #17630]
Florian Weimer [Mon, 15 Dec 2014 16:41:13 +0000 (17:41 +0100)]
Avoid infinite loop in nss_dns getnetbyname [BZ #17630]

(cherry picked from commit 11e3417af6e354f1942c68a271ae51e892b2814d)
(cherry picked from commit e54db0ea6a49affac43fa305fd134f3020c41382)

Conflicts:
NEWS

8 years agoCVE-2012-3406: Stack overflow in vfprintf [BZ #16617]
Jeff Law [Mon, 15 Dec 2014 09:09:32 +0000 (10:09 +0100)]
CVE-2012-3406: Stack overflow in vfprintf [BZ #16617]

A larger number of format specifiers coudld cause a stack overflow,
potentially allowing to bypass _FORTIFY_SOURCE format string
protection.

(cherry picked from commit a5357b7ce2a2982c5778435704bcdb55ce3667a0)
(cherry picked from commit ae61fc7b33d9d99d2763c16de8275227dc9748ba)

Conflicts:
NEWS

8 years agoMake __extern_always_inline usable on clang++ again
Siddhesh Poyarekar [Mon, 24 Nov 2014 11:55:56 +0000 (17:25 +0530)]
Make __extern_always_inline usable on clang++ again

The fix for BZ #17266 (884ddc5081278f488ef8cd49951f41cfdbb480ce)
removed changes that had gone into cdefs.h to make
__extern_always_inline usable with clang++.  This patch adds back
support for clang to detect if GNU inlining semantics are available,
this time without breaking the gcc use case.  The check put here is
based on the earlier patch and assertion[1] that checking if
__GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__ is defined is sufficient
to determine that clang++ suports GNU inlining semantics.

Tested with a simple program that builds with __extern_always_inline
with the patch and fails compilation without it.

 #include <stdio.h>
 #include <sys/cdefs.h>

extern void foo_alias (void) __asm ("foo");

__extern_always_inline void
foo (void)
{
  puts ("hi oh world!");
  return foo_alias ();
}

void
foo_alias (void)
{
  puts ("hell oh world");
}

int
main ()
{
  foo ();
}

[1] https://sourceware.org/ml/libc-alpha/2012-12/msg00306.html

[BZ #17266]
* misc/sys/cdefs.h: Define __extern_always_inline for clang
4.2 and newer.

(cherry picked from commit 602f80ec8b966cfad3b61914cbe14ee606cedf6e)

8 years agoCVE-2014-7817: wordexp fails to honour WRDE_NOCMD.
Carlos O'Donell [Wed, 19 Nov 2014 16:44:12 +0000 (11:44 -0500)]
CVE-2014-7817: wordexp fails to honour WRDE_NOCMD.

The function wordexp() fails to properly handle the WRDE_NOCMD
flag when processing arithmetic inputs in the form of "$((... ``))"
where "..." can be anything valid. The backticks in the arithmetic
epxression are evaluated by in a shell even if WRDE_NOCMD forbade
command substitution. This allows an attacker to attempt to pass
dangerous commands via constructs of the above form, and bypass
the WRDE_NOCMD flag. This patch fixes this by checking for WRDE_NOCMD
in exec_comm(), the only place that can execute a shell. All other
checks for WRDE_NOCMD are superfluous and removed.

We expand the testsuite and add 3 new regression tests of roughly
the same form but with a couple of nested levels.

On top of the 3 new tests we add fork validation to the WRDE_NOCMD
testing. If any forks are detected during the execution of a wordexp()
call with WRDE_NOCMD, the test is marked as failed. This is slightly
heuristic since vfork might be used in the future, but it provides a
higher level of assurance that no shells were executed as part of
command substitution with WRDE_NOCMD in effect. In addition it doesn't
require libpthread or libdl, instead we use the public implementation
namespace function __register_atfork (already part of the public ABI
for libpthread).

Tested on x86_64 with no regressions.

(cherry picked from commit a39208bd7fb76c1b01c127b4c61f9bfd915bfe7c)

8 years agoEnd frame record chain correctly.
Renlin Li [Tue, 11 Nov 2014 15:18:04 +0000 (15:18 +0000)]
End frame record chain correctly.

8 years agoMIPS: Avoid a dangling `vfork@GLIBC_2.0' reference
Maciej W. Rozycki [Wed, 22 Oct 2014 14:20:37 +0000 (15:20 +0100)]
MIPS: Avoid a dangling `vfork@GLIBC_2.0' reference

This satisfies a symbol reference created with:

.symver __libc_vfork, vfork@GLIBC_2.0

where `__libc_vfork' has not been defined or referenced.  In this case
the `vfork@GLIBC_2.0' reference is supposed to be discarded, however a
bug present in GAS since forever causes an undefined symbol table entry
to be created.  This in turn triggers a problem in the linker that can
manifest itself by link errors such as:

ld: libpthread.so: invalid string offset 2765592330 >= 5154 for section `.dynstr'

The GAS and linker bugs need to be resolved, but we can avoid them too
by providing a `__libc_vfork' definition just like our other platforms.

[BZ #17485]
* sysdeps/unix/sysv/linux/mips/vfork.S (__libc_vfork): Define.

(cherry picked from commit b5af9297d51a43f96c5be1bafab032184690dd6f)

Conflicts:
NEWS

8 years agoRevert "version.h: Update VERSION for 2014.11 release."
Dongkyun, Son [Sun, 22 May 2016 13:25:05 +0000 (22:25 +0900)]
Revert "version.h: Update VERSION for 2014.11 release."

This reverts commit 7d0d9f33dda0b4725f76fefa433dfdf4ffafdec7.

9 years agoversion.h: Update VERSION for 2014.11 release. upstream upstream/2.20
Will Newton [Wed, 22 Oct 2014 15:03:50 +0000 (16:03 +0100)]
version.h: Update VERSION for 2014.11 release.

10 years agoBZ#17460: Fix buffer overrun in nscd --help.
Roland McGrath [Wed, 8 Oct 2014 22:36:12 +0000 (15:36 -0700)]
BZ#17460: Fix buffer overrun in nscd --help.

(cherry picked from commit c763c5d27112be055920c46f3be8d05bc8b669da)

Conflicts:
NEWS

10 years agoUpdate French translation
Allan McRae [Thu, 9 Oct 2014 12:11:30 +0000 (22:11 +1000)]
Update French translation

(cherry picked from commit b6dcfe8c2408958be246dd61f1c5415ed7667a2a)

10 years agoFix memory leak in error path of do_ftell_wide (BZ #17370)
Siddhesh Poyarekar [Tue, 16 Sep 2014 08:50:45 +0000 (14:20 +0530)]
Fix memory leak in error path of do_ftell_wide (BZ #17370)

(cherry picked from commit 545583d664b64ff234b99aca0d85e99c8a55808f)

10 years agoFix memory leak in libio/wfileops.c do_ftell_wide [BZ #17370]
Tim Lammens [Thu, 11 Sep 2014 05:05:54 +0000 (10:35 +0530)]
Fix memory leak in libio/wfileops.c do_ftell_wide [BZ #17370]

(cherry picked from commit 984c0ea97f649c869130a1ff099098e2b6f70aad)

Conflicts:
NEWS

10 years agoRevert to defining __extern_inline only for gcc-4.3+ (BZ #17266)
Siddhesh Poyarekar [Tue, 16 Sep 2014 08:44:11 +0000 (14:14 +0530)]
Revert to defining __extern_inline only for gcc-4.3+ (BZ #17266)

The check for only __GNUC_STDC_INLINE__ and __GNUC_GNU_INLINE__ may
not be sufficient since those flags were added during initial support
for C99 inlining semantics.  There is also a problem with always
defining __extern_inline and __extern_always_inline, since it enables
inline wrapper functions even when GNU inlining semantics are not
guaranteed.  This, along with the possibility of such wrappers using
redirection (btowc for example) could result in compiler generating an
infinitely recusrive call to the function.

In fact it was such a recursion that led to this code being written
the way it was; see:

https://bugzilla.redhat.com/show_bug.cgi?id=186410

The initial change was to fix bugs 14530 and 13741, but they can be
resolved by checking if __fortify_function and/or
__extern_always_inline are defined, as it has been done in this patch.
In addition, I have audited uses of __extern_always_inline to make
sure that none of the uses result in compilation errors.

There is however a regression in this patch for llvm, since it reverts
the llvm expectation that __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__
definition imply proper extern inline semantics.

2014-09-16  Siddhesh Poyarekar  <siddhesh@redhat.com>
    Jakub Jelinek  <jakub@redhat.com>

[BZ #17266]
* libio/stdio.h: Check definition of __fortify_function
instead of __extern_always_inline to include bits/stdio2.h.
* math/bits/math-finite.h [__USE_XOPEN || __USE_ISOC99]: Also
check if __extern_always_inline is defined.
[__USE_MISC || __USE_XOPEN]: Likewise.
[__USE_ISOC99] Likewise.
* misc/sys/cdefs.h (__fortify_function): Define only if
__extern_always_inline is defined.
[!__cplusplus || __GNUC_PREREQ (4,3)]: Revert to defining
__extern_always_inline and __extern_inline only for g++-4.3
and newer or a compatible gcc.

10 years agoHandle zero prefix length in getifaddrs (BZ #17371)
Andreas Schwab [Sat, 13 Sep 2014 08:10:29 +0000 (10:10 +0200)]
Handle zero prefix length in getifaddrs (BZ #17371)

(cherry picked from commit a7b872687073decdcc7effc2289877d69058aca9)

Conflicts:
NEWS

10 years agoAdd new Linux 3.16 constants to netinet/udp.h.
Joseph Myers [Fri, 12 Sep 2014 12:13:08 +0000 (12:13 +0000)]
Add new Linux 3.16 constants to netinet/udp.h.

This patch adds the new constants UDP_NO_CHECK6_TX and
UDP_NO_CHECK6_RX from Linux 3.16 to sysdeps/gnu/netinet/udp.h.  (I
believe the existing constants there are already Linux-specific,
possibly with the intention that other OSes should adopt the same
values if possible if adopting the features in question.)

Tested on x86_64.

* sysdeps/gnu/netinet/udp.h (UDP_NO_CHECK6_TX): New macro.
(UDP_NO_CHECK6_RX): Likewise.

(cherry picked from commit 0bd72468030947254e7de183cac1014dac884475)

10 years agoUpdate Russian translation
Allan McRae [Sat, 13 Sep 2014 05:41:54 +0000 (15:41 +1000)]
Update Russian translation

(cherry picked from commit d8f879ee3e4131542c2ac3d1d9db4cf12cb86729)

10 years agoUpdate version.h and include/features.h for 2.20 release
Allan McRae [Sun, 7 Sep 2014 08:09:09 +0000 (18:09 +1000)]
Update version.h and include/features.h for 2.20 release

10 years agoUpdate contrib.texi
Allan McRae [Sun, 7 Sep 2014 06:07:10 +0000 (16:07 +1000)]
Update contrib.texi

Add entries for Wilco Dijkstra and Stefan Liebler.

10 years agoUpdate Korean translation
Allan McRae [Sun, 7 Sep 2014 05:50:34 +0000 (15:50 +1000)]
Update Korean translation

10 years ago[BZ #17354] tile: Fix up corner cases with signed relocations
Chris Metcalf [Fri, 5 Sep 2014 18:40:23 +0000 (14:40 -0400)]
[BZ #17354] tile: Fix up corner cases with signed relocations

Some types of relocations technically need to be signed rather than
unsigned: in particular ones that are used with moveli or movei,
or for jump and branch.  This is almost never a problem.  Jump and
branch opcodes are pretty much uniformly resolved by the static linker
(unless you omit -fpic for a shared library, which is not recommended).
The moveli and movei opcodes that need to be sign-extended generally
are for positive displacements, like the construction of the address of
main() from _start().  However, tst-pie1 ends up with main below _start
(in a different module) and the test failed due to signedness issues in
relocation handling.

This commit treats the value as signed when shifting (to preserve the
high bit) and also sign-extends the value generated from the updated
bundle when comparing with the desired bundle, which we do to make sure
no overflow occurred.  As a result, the tst-pie1 test now passes.

10 years agoCVE-2014-6040: Crashes on invalid input in IBM gconv modules [BZ #17325]
Florian Weimer [Wed, 3 Sep 2014 17:45:43 +0000 (19:45 +0200)]
CVE-2014-6040: Crashes on invalid input in IBM gconv modules [BZ #17325]

These changes are based on the fix for BZ #14134 in commit
6e230d11837f3ae7b375ea69d7905f0d18eb79e5.

10 years agoDefine __GI_fegetenv for e500 libm
Khem Raj [Tue, 2 Sep 2014 21:39:04 +0000 (21:39 +0000)]
Define __GI_fegetenv for e500 libm

generic HAVE_RM_CTX implementation which is used for ppc/e500 as well
has introduced calls to fegetenv which should be resolved internally
with in libm

Signed-off-by: Khem Raj <raj.khem@gmail.com>
* sysdeps/powerpc/powerpc32/e500/nofpu/fegetenv.c (fegetenv): Add
libm_hidden_ver.

10 years agoUpdate Esperanto translation
Allan McRae [Mon, 1 Sep 2014 00:48:22 +0000 (10:48 +1000)]
Update Esperanto translation

10 years agoUpdate Catalan translation
Allan McRae [Mon, 1 Sep 2014 00:47:30 +0000 (10:47 +1000)]
Update Catalan translation

10 years agoFix hang on fork
Samuel Thibault [Thu, 28 Aug 2014 20:08:39 +0000 (22:08 +0200)]
Fix hang on fork

If e.g. a signal is being received while we are running fork(), the signal
thread may be having our SS lock when we make the space copy, and thus in the
child we can not take the SS lock any more.

* sysdeps/mach/hurd/fork.c (__fork): Lock SS->lock around __proc_dostop call.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agoi386 TLS_INIT_TP might produce bogus asm changing stack pointer [BZ #17319]
Mark Wielaard [Wed, 27 Aug 2014 15:07:58 +0000 (17:07 +0200)]
i386 TLS_INIT_TP might produce bogus asm changing stack pointer [BZ #17319]

TLS_INIT_TP in sysdeps/i386/nptl/tls.h uses some hand written asm to
generate a set_thread_area that might result in exchanging ebx and esp
around the syscall causing introspection tools like valgrind to loose
track of the user stack. Just use INTERNAL_SYSCALL which makes sure
esp isn't changed arbitrarily.

Before the patch the code would generate:

mov    $0xf3,%eax
movl   $0xfffff,0x8(%esp)
movl   $0x51,0xc(%esp)
xchg   %esp,%ebx
int    $0x80
xchg   %esp,%ebx

Using INTERNAL_SYSCALL instead will generate:

movl   $0xfffff,0x8(%esp)
movl   $0x51,0xc(%esp)
xchg   %ecx,%ebx
mov    $0xf3,%eax
int    $0x80
xchg   %ecx,%ebx

Thanks to Florian Weimer for analysing why the original code generated
the bogus esp usage:

  _segdescr.desc happens to be at the top of the stack, so its address
  is in %esp.  The asm statement says that %3 is an input, so its value
  will not change, and GCC can use %esp as the input register for the
  expression &_segdescr.desc.  But the constraints do not fully describe
  the asm statement because the %3 register is actually modified, albeit
  only temporarily.

[BZ #17319]
* sysdeps/i386/nptl/tls.h (TLS_INIT_TP): Use INTERNAL_SYSCALL
to call set_thread_area instead of hand written asm.
(__NR_set_thread_area): Removed define.
(TLS_FLAG_WRITABLE): Likewise.
(__ASSUME_SET_THREAD_AREA): Remove check.
(TLS_EBX_ARG): Remove define.
(TLS_LOAD_EBX): Likewise.

10 years agoSimplify atomicity of socket creation in bind.
Samuel Thibault [Wed, 27 Aug 2014 22:11:54 +0000 (00:11 +0200)]
Simplify atomicity of socket creation in bind.

10 years agoNEWS: Typo fix: s/wil /will /g
Carlos O'Donell [Wed, 27 Aug 2014 15:53:25 +0000 (11:53 -0400)]
NEWS: Typo fix: s/wil /will /g

10 years agoUpdate x86 ULPs
Allan McRae [Wed, 27 Aug 2014 03:36:02 +0000 (13:36 +1000)]
Update x86 ULPs

Using gcc-4.9, i7-2620M, i686 Linux.

10 years agoFix typo in CVE ID
Florian Weimer [Tue, 26 Aug 2014 18:43:07 +0000 (20:43 +0200)]
Fix typo in CVE ID

10 years ago__gconv_translit_find: Disable function [BZ #17187]
Florian Weimer [Tue, 26 Aug 2014 17:38:59 +0000 (19:38 +0200)]
__gconv_translit_find: Disable function [BZ #17187]

This functionality has never worked correctly, and the implementation
contained a security vulnerability (CVE-2014-5119).

10 years agoUpdate Vietnamese translation
Allan McRae [Tue, 26 Aug 2014 12:44:23 +0000 (22:44 +1000)]
Update Vietnamese translation

10 years agoUpdate Ukrainian translation
Allan McRae [Tue, 26 Aug 2014 12:43:31 +0000 (22:43 +1000)]
Update Ukrainian translation

10 years agoUpdate French translation
Allan McRae [Tue, 26 Aug 2014 12:42:36 +0000 (22:42 +1000)]
Update French translation

10 years agoUpdate Russian translation
Allan McRae [Tue, 26 Aug 2014 12:41:48 +0000 (22:41 +1000)]
Update Russian translation

10 years agoUpdate Polish translation
Allan McRae [Tue, 26 Aug 2014 12:41:00 +0000 (22:41 +1000)]
Update Polish translation

10 years agoUpdate Czech translation
Allan McRae [Tue, 26 Aug 2014 12:39:33 +0000 (22:39 +1000)]
Update Czech translation

10 years agoUpdate German translation
Allan McRae [Tue, 26 Aug 2014 12:38:47 +0000 (22:38 +1000)]
Update German translation

10 years agoUpdate Bulgarian translation
Allan McRae [Tue, 26 Aug 2014 12:36:52 +0000 (22:36 +1000)]
Update Bulgarian translation

10 years agoUpdate Sweedish translation
Allan McRae [Tue, 26 Aug 2014 12:33:50 +0000 (22:33 +1000)]
Update Sweedish translation

10 years agoUpdate Dutch translation
Allan McRae [Tue, 26 Aug 2014 12:32:32 +0000 (22:32 +1000)]
Update Dutch translation

10 years agoUpdate Spanish translation
Allan McRae [Tue, 26 Aug 2014 12:31:31 +0000 (22:31 +1000)]
Update Spanish translation

10 years agoRemove NOT_IN_libc definition for pthread_atfork
Siddhesh Poyarekar [Thu, 21 Aug 2014 05:00:55 +0000 (10:30 +0530)]
Remove NOT_IN_libc definition for pthread_atfork

pthread_atfork is already built in an extra-libs context, which gives
it NOT_IN_libc in its CPPFLAGS.  Adding the same definition to CFLAGS
is pointless.

Verified that the code is unchanged on x86_64.

10 years agoRemove redundant CPPFLAGS for some programs
Siddhesh Poyarekar [Thu, 21 Aug 2014 04:57:13 +0000 (10:27 +0530)]
Remove redundant CPPFLAGS for some programs

These programs get the NOT_IN_libc twice, once through the 'other'
target and another explicitly.  Remove the explicitly added CPFLAG.

* catgets/Makefile (CPPFLAGS-gencat): Remove.
* iconv/Makefile (CPPFLAGS-iconv_prog): Likewise.
(CPPFLAGS-iconvconfig): Likewise.
* timezone/Makefile (CPPFLAGS-zic): Likewise.

10 years agoRemove unnecessary uses of NOT_IN_libc
Siddhesh Poyarekar [Thu, 21 Aug 2014 04:56:46 +0000 (10:26 +0530)]
Remove unnecessary uses of NOT_IN_libc

If a IS_IN_* macro is defined, then NOT_IN_libc is always defined,
except obviously for IS_IN_libc.  There's no need to check for both.
Verified on x86_64 and i686 that the source is unchanged.

       * include/libc-symbols.h: Remove unnecessary check for
       NOT_IN_libc.
       * nptl/pthreadP.h: Likewise.
       * sysdeps/aarch64/setjmp.S: Likewise.
       * sysdeps/alpha/setjmp.S: Likewise.
       * sysdeps/arm/sysdep.h: Likewise.
       * sysdeps/i386/setjmp.S: Likewise.
       * sysdeps/m68k/setjmp.c: Likewise.
       * sysdeps/posix/getcwd.c: Likewise.
       * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise.
       * sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise.
       * sysdeps/s390/s390-32/setjmp.S: Likewise.
       * sysdeps/s390/s390-64/setjmp.S: Likewise.
       * sysdeps/sh/sh3/setjmp.S: Likewise.
       * sysdeps/sh/sh4/setjmp.S: Likewise.
       * sysdeps/unix/alpha/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/ia64/setjmp.S: Likewise.
       * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
       * sysdeps/x86_64/setjmp.S: Likewise.

10 years agoMention fixes for BZs 16194 and 16275 in NEWS
H.J. Lu [Wed, 13 Aug 2014 15:04:54 +0000 (08:04 -0700)]
Mention fixes for BZs 16194 and 16275 in NEWS

10 years agoFix powerpc32 __get_clockfreq for non-power4 (bug 17263).
Joseph Myers [Wed, 13 Aug 2014 16:06:18 +0000 (16:06 +0000)]
Fix powerpc32 __get_clockfreq for non-power4 (bug 17263).

In my powerpc32 testing I've observed misc/test-gettimebasefreq
failing.

This is a glibc build (soft-float, though that's not relevant here)
without any --with-cpu and without any special configuration of the
default CPU for GCC either.  In particular, it's one not using
sysdeps/powerpc/powerpc32/power4/hp-timing.h (although in fact the
processor I'm using for testing is POWER4-based), so hp_timing_t is
32-bit not 64-bit.  But the VDSO call being used by
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK is generating a 64-bit result
(high part in r3, low part in r4).  The code extracting that result,
however, expects a result of the type hp_timing_t as passed to
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK, meaning that only r3 (= 0) is
used and the value in r4 is ignored.  This patch fixes this by always
using uint64_t as the type in INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK -
reflecting the actual ABI (unconditional in the kernel) of that VDSO
call.  This is the minimal change for this issue - no check for
overflow, no change of the type of the timebase_freq variable or the
return type of __get_clockfreq to something other than hp_timing_t
(such a change would simply move the implicit conversions to the over
callers of that function), no change to hp_timing_t itself.

Tested for powerpc32 soft float.

[BZ #17263]
* sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c: Include
<stdint.h>.
(__get_clockfreq): Use uint64_t instead of hp_timing_t in
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK call.

10 years agoFix comment error that Jakub pointed out but I forgot to fix
Siddhesh Poyarekar [Wed, 13 Aug 2014 13:16:41 +0000 (18:46 +0530)]
Fix comment error that Jakub pointed out but I forgot to fix

10 years agoDisable x87 inline functions for x86_64 and SSE [BZ #17262]
Siddhesh Poyarekar [Wed, 13 Aug 2014 08:35:15 +0000 (14:05 +0530)]
Disable x87 inline functions for x86_64 and SSE [BZ #17262]

Since:

commit 409e00bd69b8d8dd74d7327085351d26769ea6fc
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jan 29 07:51:41 2014 -0800

    Disable x87 inline functions for SSE2 math

    When i386 and x86-64 mathinline.h was merged into a single mathinline.h,
    "gcc -m32" enables x87 inline functions on x86-64 even when -mfpmath=sse
    and SSE2 is enabled.  It is a regression on x86-64.  We should check
    __SSE2_MATH__ instead of __x86_64__ when disabling x87 inline functions.

gcc-3.2 is unable to correctly compile x86_64 routines for llrint
since it gets redefined.  This is because gcc 3.2 does not set
__SSE2_MATH__ for x86_64, thus exposing the duplicate definition.

The correct fix ought to be to check for both __SSE2_MATH__ and
__x86_64__ and enable those bits only when neither are defined.

Tested fix with the reproducer for
409e00bd69b8d8dd74d7327085351d26769ea6fc as well as with gcc-3.2.

10 years agoReplace cpuid asm statement with __cpuid_count
H.J. Lu [Wed, 13 Aug 2014 00:02:51 +0000 (17:02 -0700)]
Replace cpuid asm statement with __cpuid_count

The compiler doesn't know that the cpuid asm statement in intel_check_word
will trash RBX.  We are lucky that it doesn't cause any problems since
RBX is also used by compiler for other purposes so that RBX is saved and
restored.  This patch replaces it with __cpuid_count.

[BZ #17259]
* sysdeps/x86_64/cacheinfo.c (intel_check_word): Replace cpuid
asm statement with __cpuid_count.

10 years agodetect broken linker handling of __ehdr_start
Mike Frysinger [Thu, 7 Aug 2014 03:44:29 +0000 (23:44 -0400)]
detect broken linker handling of __ehdr_start

Older versions of ld on ia64 support __ehdr_start, but generate relocs
when they shouldn't.  This causes the ld.so to not run because it tries
to resolve the __ehdr_start symbol (but it's not exported).

10 years agoFix powerpc-nofpu __fe_enabled_env and __fe_nonieee_env (bug 17261).
Joseph Myers [Tue, 12 Aug 2014 20:31:54 +0000 (20:31 +0000)]
Fix powerpc-nofpu __fe_enabled_env and __fe_nonieee_env (bug 17261).

On powerpc, floating-point environment macros are defined as pointers
to constants in the library that contain the bit-patterns of the
desired environment, instead of being magic constants cast to pointer
type.

For soft-float, the bit-patterns used for fenv_t are not laid out the
same as for hard-float.  (e500 has a third layout used; that's not an
ABI issue because these values are only meaningful within a single
process, all of whose glibc libraries must come from the same build of
glibc.)  While the __fe_dfl_env value for soft-float was appropriate
for the soft-float fenv_t representation, the other two constants had
the same bit-patterns as for hard-float.  Those bit patterns had the
effect of having exceptions already raised, causing
math/test-fenv-return to fail; this patch fixes the patterns used.
(__fe_nonieee_env also had exceptions unmasked, though they should be
masked to match hard-float semantics.  Since there is no separate
non-IEEE mode for soft-float, it's most appropriate for
__fe_nonieee_env to be the same as __fe_dfl_env; this patch makes it
an alias.)

Tested for powerpc-nofpu.

[BZ #17261]
* sysdeps/powerpc/nofpu/fenv_const.c (__fe_enabled_env): Change
value to 0.
(__fe_nonieee_env): Define as an alias for __fe_dfl_env.

10 years agoNEWS: Mention x86-64 ld.so use of Intel MPX instructions.
Roland McGrath [Tue, 12 Aug 2014 16:49:58 +0000 (09:49 -0700)]
NEWS: Mention x86-64 ld.so use of Intel MPX instructions.

10 years agoAdd BZ #16892 to NEWS
Will Newton [Tue, 12 Aug 2014 12:01:13 +0000 (13:01 +0100)]
Add BZ #16892 to NEWS

10 years agoCheck value of futex before updating in __lll_timedlock
Bernard Ogden [Mon, 11 Aug 2014 14:26:48 +0000 (15:26 +0100)]
Check value of futex before updating in __lll_timedlock

2014-08-12  Bernard Ogden  <bernie.ogden@linaro.org>

[BZ #16892]
* sysdeps/nptl/lowlevellock.h (__lll_timedlock): Use
atomic_compare_and_exchange_bool_acq rather than atomic_exchange_acq.

10 years agomalloc: fix comment typo
Sean Anderson [Tue, 12 Aug 2014 09:23:41 +0000 (05:23 -0400)]
malloc: fix comment typo

10 years agoRegenerate libc.po
Allan McRae [Sat, 9 Aug 2014 07:14:35 +0000 (17:14 +1000)]
Regenerate libc.po

10 years agotst-gettext2: make setup more robust
Mike Frysinger [Mon, 4 Aug 2014 14:31:27 +0000 (10:31 -0400)]
tst-gettext2: make setup more robust

This test should be more robust about setting up its lang dirs.
I had two completely different systems (ia64 & x86_64) get wedged
in a way where the test just kept FAILing on me due to some of the
files missing.  This probably wasn't a big deal until the recent
commit which made checking of the locale dirs more robust (for
security reasons).

10 years agoThis patch adds new function libc_feholdsetround_noex_aarch64_ctx, enabling
Wilco Dijkstra [Thu, 7 Aug 2014 16:29:55 +0000 (16:29 +0000)]
This patch adds new function libc_feholdsetround_noex_aarch64_ctx, enabling
further optimization. libc_feholdsetround_aarch64_ctx now only needs to
read the FPCR in the typical case, avoiding a redundant FPSR read.
Performance results show a good improvement (5-10% on sin()) on cores with
expensive FPCR/FPSR instructions.

10 years agoFix performance issue in misaligned strcpy.
Wilco [Thu, 7 Aug 2014 14:30:31 +0000 (14:30 +0000)]
Fix performance issue in misaligned strcpy.

10 years agoPowerPC: Fix termios definitions
Adhemerval Zanella [Thu, 24 Jul 2014 12:28:57 +0000 (08:28 -0400)]
PowerPC: Fix termios definitions

This patch fixes the incorrect guard by __USE_MISC of struct winsize and
struct termio in powerpc termios header.  Current states leads to build
failures if the program defines _XOPEN_SOURCE, but not _DEFAULT_SOURCE
or either _BSD_SOURCE or _SVID_SOURCE.  Without any definition,
__USE_MISC will not be defined and neither the struct definitions.

This patch copies the default Linux ioctl-types.h by adjusting only the
character control field (c_cc) size in struct termio.

10 years agoalpha: Fix exception raising from soft-fp
Richard Henderson [Tue, 5 Aug 2014 20:36:36 +0000 (13:36 -0700)]
alpha: Fix exception raising from soft-fp

Use the SSI_IEEE_RAISE_EXCEPTION function as from feraiseexcept,
instead of __ieee_get+set_fp_status.  Always raise the FP exceptions
from float-to-integer conversion.

10 years agoalpha: Remove linux lowlevellock.h
Richard Henderson [Tue, 5 Aug 2014 16:06:36 +0000 (09:06 -0700)]
alpha: Remove linux lowlevellock.h

For real this time.

10 years agoalpha: Remove linux lowlevellock.h
Richard Henderson [Tue, 5 Aug 2014 15:31:47 +0000 (08:31 -0700)]
alpha: Remove linux lowlevellock.h

10 years agoMIPS - Remove mips lowlevellock.h.
Bernard Ogden [Mon, 4 Aug 2014 22:12:03 +0000 (22:12 +0000)]
MIPS - Remove mips lowlevellock.h.

* sysdeps/unix/sysv/linux/mips/lowlevellock.h: Remove file.

10 years agoAArch64: Remove lowlevellock.h
Will Newton [Mon, 4 Aug 2014 15:01:31 +0000 (16:01 +0100)]
AArch64: Remove lowlevellock.h

Remove lowlevellock.h in favour of the generic implementation. The
generic implementation was tested natively and introduces no
regressions.

ChangeLog:

2014-08-04  Will Newton  <will.newton@linaro.org>

* sysdeps/unix/sysv/linux/aarch64/lowlevellock.h: Remove
file.

10 years agoadd ChangeLog for previous commit
Mike Frysinger [Mon, 4 Aug 2014 14:31:01 +0000 (10:31 -0400)]
add ChangeLog for previous commit

10 years agoia64: define nocancel entry points in PSEUDO
Mike Frysinger [Sun, 3 Aug 2014 16:14:35 +0000 (16:14 +0000)]
ia64: define nocancel entry points in PSEUDO

The previous set of not-cancel.h headers (prior to the commit
2fbdf5339aaeaa423bd661524f7ec7af41fa2606) did not require the
arch to define nocancel entry points, so ia64 never did.
However, after the various files were merged, it became a hard
requirement for arches which mean ia64 failed to build.

Here we add dedicated entry points.  It'd be nice to merge
with the existing stubs like other arches do, but the ia64
asm does not lend itself to interleaving of functions.  If
someone has a suggestion on merging these, that'd be great,
but at least now we build & pass tests again.

10 years agoIA64: Consolidate nptl/ subdirectories under linux/...
Roland McGrath [Fri, 4 Jul 2014 05:19:41 +0000 (22:19 -0700)]
IA64: Consolidate nptl/ subdirectories under linux/...

10 years agoIA64: Move NPTL public headers to sysdeps/ia64/nptl/.
Roland McGrath [Fri, 4 Jul 2014 04:51:13 +0000 (21:51 -0700)]
IA64: Move NPTL public headers to sysdeps/ia64/nptl/.

10 years agoIA64: Define TLS_DEFINE_INIT_TP
Roland McGrath [Fri, 4 Jul 2014 04:51:01 +0000 (21:51 -0700)]
IA64: Define TLS_DEFINE_INIT_TP

10 years agoIA64: Consolidate NPTL/non versions of vfork
Roland McGrath [Fri, 4 Jul 2014 05:09:33 +0000 (22:09 -0700)]
IA64: Consolidate NPTL/non versions of vfork

10 years agoIA64: Consolidate NPTL/non versions of clone
Roland McGrath [Fri, 4 Jul 2014 04:50:50 +0000 (21:50 -0700)]
IA64: Consolidate NPTL/non versions of clone

10 years agoFix missing <math_private.h> in ldbl-96 fma
Andreas Schwab [Mon, 4 Aug 2014 08:20:03 +0000 (10:20 +0200)]
Fix missing <math_private.h> in ldbl-96 fma