]> sourceware.org Git - glibc.git/log
glibc.git
10 years agoAdd CVE-2013-4332 to NEWS.
Will Newton [Fri, 13 Sep 2013 08:26:02 +0000 (09:26 +0100)]
Add CVE-2013-4332 to NEWS.

10 years agomalloc: Check for integer overflow in memalign.
Will Newton [Fri, 16 Aug 2013 11:54:29 +0000 (12:54 +0100)]
malloc: Check for integer overflow in memalign.

A large bytes parameter to memalign could cause an integer overflow
and corrupt allocator internals. Check the overflow does not occur
before continuing with the allocation.

ChangeLog:

2013-09-11  Will Newton  <will.newton@linaro.org>

[BZ #15857]
* malloc/malloc.c (__libc_memalign): Check the value of bytes
does not overflow.

10 years agomalloc: Check for integer overflow in valloc.
Will Newton [Fri, 16 Aug 2013 10:59:37 +0000 (11:59 +0100)]
malloc: Check for integer overflow in valloc.

A large bytes parameter to valloc could cause an integer overflow
and corrupt allocator internals. Check the overflow does not occur
before continuing with the allocation.

ChangeLog:

2013-09-11  Will Newton  <will.newton@linaro.org>

[BZ #15856]
* malloc/malloc.c (__libc_valloc): Check the value of bytes
does not overflow.

10 years agomalloc: Check for integer overflow in pvalloc.
Will Newton [Mon, 12 Aug 2013 14:08:02 +0000 (15:08 +0100)]
malloc: Check for integer overflow in pvalloc.

A large bytes parameter to pvalloc could cause an integer overflow
and corrupt allocator internals. Check the overflow does not occur
before continuing with the allocation.

ChangeLog:

2013-09-11  Will Newton  <will.newton@linaro.org>

[BZ #15855]
* malloc/malloc.c (__libc_pvalloc): Check the value of bytes
does not overflow.

10 years agoBZ #15754: CVE-2013-4788
Carlos O'Donell [Mon, 23 Sep 2013 04:52:09 +0000 (00:52 -0400)]
BZ #15754: CVE-2013-4788

The pointer guard used for pointer mangling was not initialized for
static applications resulting in the security feature being disabled.
The pointer guard is now correctly initialized to a random value for
static applications. Existing static applications need to be
recompiled to take advantage of the fix.

The test tst-ptrguard1-static and tst-ptrguard1 add regression
coverage to ensure the pointer guards are sufficiently random
and initialized to a default value.

10 years agoCheck for integer overflow in cache size computation in strcoll
Siddhesh Poyarekar [Mon, 23 Sep 2013 05:54:30 +0000 (11:24 +0530)]
Check for integer overflow in cache size computation in strcoll

strcoll is implemented using a cache for indices and weights of
collation sequences in the strings so that subsequent passes do not
have to search through collation data again.  For very large string
inputs, the cache size computation could overflow.  In such a case,
use the fallback function that does not cache indices and weights of
collation sequences.

Fixes CVE-2012-4412.

10 years agoFall back to non-cached sequence traversal and comparison on malloc fail
Siddhesh Poyarekar [Mon, 23 Sep 2013 05:50:02 +0000 (11:20 +0530)]
Fall back to non-cached sequence traversal and comparison on malloc fail

strcoll currently falls back to alloca if malloc fails, resulting in a
possible stack overflow.  This patch implements sequence traversal and
comparison without caching indices and rules.

Fixes CVE-2012-4424.

10 years agoSimplify strcoll implementation
Siddhesh Poyarekar [Tue, 20 Aug 2013 03:10:05 +0000 (08:40 +0530)]
Simplify strcoll implementation

Break up strcoll into simpler functions so that the logic is easier to
follow and maintain.

10 years agoFix parsing of 0e+0 as float
Andreas Schwab [Thu, 31 Oct 2013 11:51:03 +0000 (12:51 +0100)]
Fix parsing of 0e+0 as float

10 years agoPowerPC: strcpy/stpcpy optimization for PPC64/POWER7
Adhemerval Zanella [Thu, 26 Sep 2013 14:29:19 +0000 (09:29 -0500)]
PowerPC: strcpy/stpcpy optimization for PPC64/POWER7

This patch intends to unify both strcpy and stpcpy implementationsi
for PPC64 and PPC64/POWER7. The idead default powerpc64 implementation
is to provide both doubleword and word aligned memory access.

For PPC64/POWER7 is also provide doubleword and word memory access,
remove the branch hints, use the cmpb instruction for compare
doubleword/words, and add an optimization for inputs of same alignment.

10 years agoFix stack overflow due to large AF_INET6 requests
Siddhesh Poyarekar [Fri, 25 Oct 2013 04:52:12 +0000 (10:22 +0530)]
Fix stack overflow due to large AF_INET6 requests

Resolves #16072 (CVE-2013-4458).

This patch fixes another stack overflow in getaddrinfo when it is
called with AF_INET6.  The AF_UNSPEC case was fixed as CVE-2013-1914,
but the AF_INET6 case went undetected back then.

10 years agoAvoid ordered comparisons of NaNs in ldbl-128ibm acosl and asinl.
Joseph Myers [Thu, 10 Oct 2013 19:11:30 +0000 (19:11 +0000)]
Avoid ordered comparisons of NaNs in ldbl-128ibm acosl and asinl.

10 years agoUse stdint.h types in union unaligned.
Alan Modra [Fri, 4 Oct 2013 03:18:51 +0000 (12:48 +0930)]
Use stdint.h types in union unaligned.

* sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela):
Use stdint types in rather than __attribute__((mode())).
* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise.

10 years agoCorrect little-endian relocation of UADDR64,32,16.
Alan Modra [Thu, 3 Oct 2013 04:21:52 +0000 (13:51 +0930)]
Correct little-endian relocation of UADDR64,32,16.

* sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela):
Correct handling of unaligned relocs for little-endian.
* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise.

10 years agoPowerPC LE configury
Alan Modra [Thu, 3 Oct 2013 04:33:03 +0000 (14:03 +0930)]
PowerPC LE configury
http://sourceware.org/ml/libc-alpha/2013-08/msg00096.html

This adds the basic configury bits for powerpc64le and powerpcle.

* configure.in: Map powerpc64le and powerpcle to base_machine/machine.
* configure: Regenerate.
* nptl/shlib-versions: Powerpc*le starts at 2.18.
* shlib-versions: Likewise.

10 years agostring/tester memrchr test
Alan Modra [Sat, 17 Aug 2013 09:08:26 +0000 (18:38 +0930)]
string/tester memrchr test
http://sourceware.org/ml/libc-alpha/2013-08/msg00095.html

I found this useful at one stage when I was seeing a huge number of
memrchr failures all of test number 10.

* string/tester.c (test_memrchr): Increment reported test cycle.

10 years agostring/test-memcpy error reporting
Alan Modra [Sat, 17 Aug 2013 09:07:58 +0000 (18:37 +0930)]
string/test-memcpy error reporting
http://sourceware.org/ml/libc-alpha/2013-08/msg00094.html

Using plain %s here runs the risk of segfaulting when displaying the
string.  src and dst aren't zero terminated strings.

* string/test-memcpy.c (do_one_test): When reporting errors, print
string address and don't overrun end of string.

10 years agoPowerPC LE memchr and memrchr
Alan Modra [Sat, 17 Aug 2013 09:18:36 +0000 (18:48 +0930)]
PowerPC LE memchr and memrchr
http://sourceware.org/ml/libc-alpha/2013-08/msg00105.html

Like strnlen, memchr and memrchr had a number of defects fixed by this
patch as well as adding little-endian support.  The first one I
noticed was that the entry to the main loop needlessly checked for
"are we done yet?" when we know the size is large enough that we can't
be done.  The second defect I noticed was that the main loop count was
wrong, which in turn meant that the small loop needed to handle an
extra word.  Thirdly, there is nothing to say that the string can't
wrap around zero, except of course that we'd normally hit a segfault
on trying to read from address zero.  Fixing that simplified a number
of places:

- /* Are we done already?  */
- addi    r9,r8,8
- cmpld r9,r7
- bge L(null)

becomes

+ cmpld r8,r7
+ beqlr

However, the exit gets an extra test because I test for being on the
last word then if so whether the byte offset is less than the end.
Overall, the change is a win.

Lastly, memrchr used the wrong cache hint.

* sysdeps/powerpc/powerpc64/power7/memchr.S: Replace rlwimi with
insrdi.  Make better use of reg selection to speed exit slightly.
Schedule entry path a little better.  Remove useless "are we done"
checks on entry to main loop.  Handle wrapping around zero address.
Correct main loop count.  Handle single left-over word from main
loop inline rather than by using loop_small.  Remove extra word
case in loop_small caused by wrong loop count.  Add little-endian
support.
* sysdeps/powerpc/powerpc32/power7/memchr.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/memrchr.S: Likewise.  Use proper
cache hint.
* sysdeps/powerpc/powerpc32/power7/memrchr.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/rawmemchr.S: Add little-endian
support.  Avoid rlwimi.
* sysdeps/powerpc/powerpc32/power7/rawmemchr.S: Likewise.

10 years agoPowerPC LE memset
Alan Modra [Sat, 17 Aug 2013 09:17:59 +0000 (18:47 +0930)]
PowerPC LE memset
http://sourceware.org/ml/libc-alpha/2013-08/msg00104.html

One of the things I noticed when looking at power7 timing is that rlwimi
is cracked and the two resulting insns have a register dependency.
That makes it a little slower than the equivalent rldimi.

* sysdeps/powerpc/powerpc64/memset.S: Replace rlwimi with
        insrdi.  Formatting.
* sysdeps/powerpc/powerpc64/power4/memset.S: Likewise.
* sysdeps/powerpc/powerpc64/power6/memset.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/memset.S: Likewise.
* sysdeps/powerpc/powerpc32/power4/memset.S: Likewise.
* sysdeps/powerpc/powerpc32/power6/memset.S: Likewise.
* sysdeps/powerpc/powerpc32/power7/memset.S: Likewise.

10 years agoPowerPC LE memcpy
Alan Modra [Sat, 17 Aug 2013 09:17:22 +0000 (18:47 +0930)]
PowerPC LE memcpy
http://sourceware.org/ml/libc-alpha/2013-08/msg00103.html

LIttle-endian support for memcpy.  I spent some time cleaning up the
64-bit power7 memcpy, in order to avoid the extra alignment traps
power7 takes for little-endian.  It probably would have been better
to copy the linux kernel version of memcpy.

* sysdeps/powerpc/powerpc32/power4/memcpy.S: Add little endian support.
* sysdeps/powerpc/powerpc32/power6/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc32/power7/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc32/power7/mempcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/power4/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/power6/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/mempcpy.S: Likewise.  Make better
use of regs.  Use power7 mtocrf.  Tidy function tails.

10 years agoPowerPC LE memcmp
Alan Modra [Sat, 17 Aug 2013 09:16:47 +0000 (18:46 +0930)]
PowerPC LE memcmp
http://sourceware.org/ml/libc-alpha/2013-08/msg00102.html

This is a rather large patch due to formatting and renaming.  The
formatting changes were to make it possible to compare power7 and
power4 versions of memcmp.  Using different register defines came
about while I was wrestling with the code, trying to find spare
registers at one stage.  I found it much simpler if we refer to a reg
by the same name throughout a function, so it's better if short-term
multiple use regs like rTMP are referred to using their register
number.  I made the cr field usage changes when attempting to reload
rWORDn regs in the exit path to byte swap before comparing when
little-endian.  That proved a bad idea due to the pipelining involved
in the main loop;  Offsets to reload the regs were different first
time around the loop..  Anyway, I left the cr field usage changes in
place for consistency.

Aside from these more-or-less cosmetic changes, I fixed a number of
places where an early exit path restores regs unnecessarily, removed
some dead code, and optimised one or two exits.

* sysdeps/powerpc/powerpc64/power7/memcmp.S: Add little-endian support.
Formatting.  Consistently use rXXX register defines or rN defines.
Use early exit labels that avoid restoring unused non-volatile regs.
Make cr field use more consistent with rWORDn compares.  Rename
regs used as shift registers for unaligned loop, using rN defines
for short lifetime/multiple use regs.
* sysdeps/powerpc/powerpc64/power4/memcmp.S: Likewise.
* sysdeps/powerpc/powerpc32/power7/memcmp.S: Likewise.  Exit with
addi 1,1,64 to pop stack frame.  Simplify return value code.
* sysdeps/powerpc/powerpc32/power4/memcmp.S: Likewise.

10 years agoPowerPC LE strchr
Alan Modra [Sat, 17 Aug 2013 09:16:05 +0000 (18:46 +0930)]
PowerPC LE strchr
http://sourceware.org/ml/libc-alpha/2013-08/msg00101.html

Adds little-endian support to optimised strchr assembly.  I've also
tweaked the big-endian code a little.  In power7/strchr.S there's a
check in the tail of the function that we didn't match 0 before
finding a c match, done by comparing leading zero counts.  It's just
as valid, and quicker, to compare the raw output from cmpb.

Another little tweak is to use rldimi/insrdi in place of rlwimi for
the power7 strchr functions.  Since rlwimi is cracked, it is a few
cycles slower.  rldimi can be used on the 32-bit power7 functions
too.

* sysdeps/powerpc/powerpc64/power7/strchr.S (strchr): Add little-endian
support.  Correct typos, formatting.  Optimize tail.  Use insrdi
rather than rlwimi.
* sysdeps/powerpc/powerpc32/power7/strchr.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/strchrnul.S (__strchrnul): Add
little-endian support.  Correct typos.
* sysdeps/powerpc/powerpc32/power7/strchrnul.S: Likewise.  Use insrdi
rather than rlwimi.
* sysdeps/powerpc/powerpc64/strchr.S (rTMP4, rTMP5): Define.  Use
in loop and entry code to keep "and." results.
(strchr): Add little-endian support.  Comment.  Move cntlzd
earlier in tail.
* sysdeps/powerpc/powerpc32/strchr.S: Likewise.

10 years agoPowerPC LE strcpy
Alan Modra [Sat, 17 Aug 2013 09:15:31 +0000 (18:45 +0930)]
PowerPC LE strcpy
http://sourceware.org/ml/libc-alpha/2013-08/msg00100.html

The strcpy changes for little-endian are quite straight-forward, just
a matter of rotating the last word differently.

I'll note that the powerpc64 version of stpcpy is just begging to be
converted to use 64-bit loads and stores..

* sysdeps/powerpc/powerpc64/strcpy.S: Add little-endian support:
* sysdeps/powerpc/powerpc32/strcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/stpcpy.S: Likewise.
* sysdeps/powerpc/powerpc32/stpcpy.S: Likewise.

10 years agoPowerPC LE strcmp and strncmp
Alan Modra [Sat, 17 Aug 2013 09:11:17 +0000 (18:41 +0930)]
PowerPC LE strcmp and strncmp
http://sourceware.org/ml/libc-alpha/2013-08/msg00099.html

More little-endian support.  I leave the main strcmp loops unchanged,
(well, except for renumbering rTMP to something other than r0 since
it's needed in an addi insn) and modify the tail for little-endian.

I noticed some of the big-endian tail code was a little untidy so have
cleaned that up too.

* sysdeps/powerpc/powerpc64/strcmp.S (rTMP2): Define as r0.
(rTMP): Define as r11.
(strcmp): Add little-endian support.  Optimise tail.
* sysdeps/powerpc/powerpc32/strcmp.S: Similarly.
* sysdeps/powerpc/powerpc64/strncmp.S: Likewise.
* sysdeps/powerpc/powerpc32/strncmp.S: Likewise.
* sysdeps/powerpc/powerpc64/power4/strncmp.S: Likewise.
* sysdeps/powerpc/powerpc32/power4/strncmp.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/strncmp.S: Likewise.
* sysdeps/powerpc/powerpc32/power7/strncmp.S: Likewise.

10 years agoPowerPC LE strnlen
Alan Modra [Sat, 17 Aug 2013 09:10:48 +0000 (18:40 +0930)]
PowerPC LE strnlen
http://sourceware.org/ml/libc-alpha/2013-08/msg00098.html

The existing strnlen code has a number of defects, so this patch is more
than just adding little-endian support.  The changes here are similar to
those for memchr.

* sysdeps/powerpc/powerpc64/power7/strnlen.S (strnlen): Add
little-endian support.  Remove unnecessary "are we done" tests.
Handle "s" wrapping around zero and extremely large "size".
Correct main loop count.  Handle single left-over word from main
loop inline rather than by using small_loop.  Correct comments.
Delete "zero" tail, use "end_max" instead.
* sysdeps/powerpc/powerpc32/power7/strnlen.S: Likewise.

10 years agoPowerPC LE strlen
Alan Modra [Sat, 17 Aug 2013 09:10:11 +0000 (18:40 +0930)]
PowerPC LE strlen
http://sourceware.org/ml/libc-alpha/2013-08/msg00097.html

This is the first of nine patches adding little-endian support to the
existing optimised string and memory functions.  I did spend some
time with a power7 simulator looking at cycle by cycle behaviour for
memchr, but most of these patches have not been run on cpu simulators
to check that we are going as fast as possible.  I'm sure PowerPC can
do better.  However, the little-endian support mostly leaves main
loops unchanged, so I'm banking on previous authors having done a
good job on big-endian..  As with most code you stare at long enough,
I found some improvements for big-endian too.

Little-endian support for strlen.  Like most of the string functions,
I leave the main word or multiple-word loops substantially unchanged,
just needing to modify the tail.

Removing the branch in the power7 functions is just a tidy.  .align
produces a branch anyway.  Modifying regs in the non-power7 functions
is to suit the new little-endian tail.

* sysdeps/powerpc/powerpc64/power7/strlen.S (strlen): Add little-endian
support.  Don't branch over align.
* sysdeps/powerpc/powerpc32/power7/strlen.S: Likewise.
* sysdeps/powerpc/powerpc64/strlen.S (strlen): Add little-endian support.
Rearrange tmp reg use to suit.  Comment.
* sysdeps/powerpc/powerpc32/strlen.S: Likewise.

10 years agoPowerPC SIGSTKSZ
Alan Modra [Sat, 17 Aug 2013 09:07:18 +0000 (18:37 +0930)]
PowerPC SIGSTKSZ
http://sourceware.org/ml/libc-alpha/2013-08/msg00093.html

This copies the sparc version of sigstack.h, which gives powerpc
 #define MINSIGSTKSZ     4096
 #define SIGSTKSZ        16384

Before the VSX changes, struct rt_sigframe size was 1920 plus 128 for
__SIGNAL_FRAMESIZE giving ppc64 exactly the default MINSIGSTKSZ of
2048.

After VSX, ucontext increased by 256 bytes.  Oops, we're over
MINSIGSTKSZ, so powerpc has been using the wrong value for quite a
while.  Add another ucontext for TM and rt_sigframe is now at 3872,
giving actual MINSIGSTKSZ of 4000.

The glibc testcase that I was looking at was tst-cancel21, which
allocates 2*SIGSTKSZ (not because the test is trying to be
conservative, but because the test actually has nested signal stack
frames).  We blew the allocation by 48 bytes when using current
mainline gcc to compile glibc (le ppc64).

The required stack depth in _dl_lookup_symbol_x from the top of the
next signal frame was 10944 bytes.  I guess you'd want to add 288 to
that, implying an actual SIGSTKSZ of 11232.

* sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h: New file.

10 years agoPowerPC makecontext
Alan Modra [Sat, 17 Aug 2013 09:06:45 +0000 (18:36 +0930)]
PowerPC makecontext
http://sourceware.org/ml/libc-alpha/2013-08/msg00092.html

Use conditional form of branch and link to avoid destroying the cpu
link stack used to predict blr return addresses.

* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S: Use
conditional form of branch and link when obtaining pc.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: Likewise.

10 years agoPowerPC LE _dl_hwcap access
Alan Modra [Sat, 17 Aug 2013 09:06:11 +0000 (18:36 +0930)]
PowerPC LE _dl_hwcap access
http://sourceware.org/ml/libc-alpha/2013-08/msg00091.html

More LE support, correcting word accesses to _dl_hwcap.

* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S: Use
HIWORD/LOWORD.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S: Ditto.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Ditto.

10 years agoPowerPC ugly symbol versioning
Alan Modra [Sat, 17 Aug 2013 09:05:40 +0000 (18:35 +0930)]
PowerPC ugly symbol versioning
http://sourceware.org/ml/libc-alpha/2013-08/msg00090.html

This patch fixes symbol versioning in setjmp/longjmp.  The existing
code uses raw versions, which results in wrong symbol versioning when
you want to build glibc with a base version of 2.19 for LE.

Note that the merging the 64-bit and 32-bit versions in novmx-lonjmp.c
and pt-longjmp.c doesn't result in GLIBC_2.0 versions for 64-bit, due
to the base in shlib_versions.

* sysdeps/powerpc/longjmp.c: Use proper symbol versioning macros.
* sysdeps/powerpc/novmx-longjmp.c: Likewise.
* sysdeps/powerpc/powerpc32/bsd-_setjmp.S: Likewise.
* sysdeps/powerpc/powerpc32/bsd-setjmp.S: Likewise.
* sysdeps/powerpc/powerpc32/fpu/__longjmp.S: Likewise.
* sysdeps/powerpc/powerpc32/fpu/setjmp.S: Likewise.
* sysdeps/powerpc/powerpc32/mcount.c: Likewise.
* sysdeps/powerpc/powerpc32/setjmp.S: Likewise.
* sysdeps/powerpc/powerpc64/setjmp.S: Likewise.
* nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Likewise.

10 years agoPowerPC LE setjmp/longjmp
Anton Blanchard [Sat, 17 Aug 2013 09:04:40 +0000 (18:34 +0930)]
PowerPC LE setjmp/longjmp
http://sourceware.org/ml/libc-alpha/2013-08/msg00089.html

Little-endian fixes for setjmp/longjmp.  When writing these I noticed
the setjmp code corrupts the non volatile VMX registers when using an
unaligned buffer.  Anton fixed this, and also simplified it quite a
bit.

The current code uses boilerplate for the case where we want to store
16 bytes to an unaligned address.  For that we have to do a
read/modify/write of two aligned 16 byte quantities.  In our case we
are storing a bunch of back to back data (consective VMX registers),
and only the start and end of the region need the read/modify/write.

[BZ #15723]
* sysdeps/powerpc/jmpbuf-offsets.h: Comment fix.
* sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S: Correct
_dl_hwcap access for little-endian.
* sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: Likewise.  Don't
destroy vmx regs when saving unaligned.
* sysdeps/powerpc/powerpc64/__longjmp-common.S: Correct CR load.
* sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise CR save.  Don't
destroy vmx regs when saving unaligned.

10 years agoPowerPC floating point little-endian [15 of 15]
Alan Modra [Sat, 17 Aug 2013 09:03:45 +0000 (18:33 +0930)]
PowerPC floating point little-endian [15 of 15]
http://sourceware.org/ml/libc-alpha/2013-07/msg00206.html

The union loses when little-endian.

* sysdeps/powerpc/powerpc32/power4/hp-timing.h (HP_TIMING_NOW):
Don't use a union to pack hi/low value.

10 years agoPowerPC floating point little-endian [14 of 15]
Anton Blanchard [Sat, 17 Aug 2013 09:03:02 +0000 (18:33 +0930)]
PowerPC floating point little-endian [14 of 15]
http://sourceware.org/ml/libc-alpha/2013-07/msg00205.html

These all wrongly specified float constants in a 64-bit word.

* sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Correct float constants
for little-endian.
* sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_roundf.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Likewise.

10 years agoPowerPC floating point little-endian [13 of 15]
Alan Modra [Sat, 17 Aug 2013 09:02:18 +0000 (18:32 +0930)]
PowerPC floating point little-endian [13 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00088.html

* sysdeps/powerpc/powerpc32/fpu/s_roundf.S: Increase alignment of
constants to usual value for .cst8 section, and remove redundant
high address load.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Use float
constant for 0x1p52.  Load little-endian words of double from
correct stack offsets.

10 years agoPowerPC floating point little-endian [12 of 15]
Alan Modra [Sat, 17 Aug 2013 09:01:45 +0000 (18:31 +0930)]
PowerPC floating point little-endian [12 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00087.html

Fixes for little-endian in 32-bit assembly.

* sysdeps/powerpc/sysdep.h (LOWORD, HIWORD, HISHORT): Define.
* sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Load little-endian
words of double from correct stack offsets.
* sysdeps/powerpc/powerpc32/fpu/s_copysignl.S: Likewise.
* sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Likewise.
* sysdeps/powerpc/powerpc32/fpu/s_lround.S: Likewise.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S: Likewise.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S: Likewise.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Likewise.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Likewise.
* sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S: Likewise.
* sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S: Likewise.
* sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S: Likewise.
* sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S: Likewise.
* sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Likewise.
* sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S: Likewise.
* sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S: Likewise.
* sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S: Use HISHORT.
* sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S: Likewise.

10 years agoPowerPC floating point little-endian [11 of 15]
Alan Modra [Sat, 17 Aug 2013 09:01:05 +0000 (18:31 +0930)]
PowerPC floating point little-endian [11 of 15]
http://sourceware.org/ml/libc-alpha/2013-07/msg00202.html

Another little-endian fix.

* sysdeps/powerpc/fpu_control.h (_FPU_GETCW): Rewrite using
64-bit int/double union.
(_FPU_SETCW): Likewise.
* sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (_GET_DI_FPSCR): Likewise.
(_SET_DI_FPSCR, _GET_SI_FPSCR, _SET_SI_FPSCR): Likewise.

10 years agoPowerPC floating point little-endian [10 of 15]
Alan Modra [Sat, 17 Aug 2013 09:00:23 +0000 (18:30 +0930)]
PowerPC floating point little-endian [10 of 15]
http://sourceware.org/ml/libc-alpha/2013-07/msg00201.html

These two functions oddly test x+1>0 when a double x is >= 0.0, and
similarly when x is negative.  I don't see the point of that since the
test should always be true.  I also don't see any need to convert x+1
to integer rather than simply using xr+1.  Note that the standard
allows these functions to return any value when the input is outside
the range of long long, but it's not too hard to prevent xr+1
overflowing so that's what I've done.

(With rounding mode FE_UPWARD, x+1 can be a lot more than what you
might naively expect, but perhaps that situation was covered by the
x - xrf < 1.0 test.)

* sysdeps/powerpc/fpu/s_llround.c (__llround): Rewrite.
* sysdeps/powerpc/fpu/s_llroundf.c (__llroundf): Rewrite.

10 years agoPowerPC floating point little-endian [9 of 15]
Alan Modra [Sat, 17 Aug 2013 08:59:43 +0000 (18:29 +0930)]
PowerPC floating point little-endian [9 of 15]
http://sourceware.org/ml/libc-alpha/2013-07/msg00200.html

This works around the fact that vsx is disabled in current
little-endian gcc.  Also, float constants take 4 bytes in memory
vs. 16 bytes for vector constants, and we don't need to write one lot
of masks for double (register format) and another for float (mem
format).

* sysdeps/powerpc/fpu/s_float_bitwise.h (__float_and_test28): Don't
use vector int constants.
(__float_and_test24, __float_and8, __float_get_exp): Likewise.

10 years agoPowerPC floating point little-endian [8 of 15]
Anton Blanchard [Sat, 17 Aug 2013 08:58:55 +0000 (18:28 +0930)]
PowerPC floating point little-endian [8 of 15]
http://sourceware.org/ml/libc-alpha/2013-07/msg00199.html

Corrects floating-point environment code for little-endian.

* sysdeps/powerpc/fpu/fenv_libc.h (fenv_union_t): Replace int
array with long long.
* sysdeps/powerpc/fpu/e_sqrt.c (__slow_ieee754_sqrt): Adjust.
* sysdeps/powerpc/fpu/e_sqrtf.c (__slow_ieee754_sqrtf): Adjust.
* sysdeps/powerpc/fpu/fclrexcpt.c (__feclearexcept): Adjust.
* sysdeps/powerpc/fpu/fedisblxcpt.c (fedisableexcept): Adjust.
* sysdeps/powerpc/fpu/feenablxcpt.c (feenableexcept): Adjust.
* sysdeps/powerpc/fpu/fegetexcept.c (__fegetexcept): Adjust.
* sysdeps/powerpc/fpu/feholdexcpt.c (feholdexcept): Adjust.
* sysdeps/powerpc/fpu/fesetenv.c (__fesetenv): Adjust.
* sysdeps/powerpc/fpu/feupdateenv.c (__feupdateenv): Adjust.
* sysdeps/powerpc/fpu/fgetexcptflg.c (__fegetexceptflag): Adjust.
* sysdeps/powerpc/fpu/fraiseexcpt.c (__feraiseexcept): Adjust.
* sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Adjust.
* sysdeps/powerpc/fpu/ftestexcept.c (fetestexcept): Adjust.

10 years agoPowerPC floating point little-endian [7 of 15]
Anton Blanchard [Sat, 17 Aug 2013 08:58:06 +0000 (18:28 +0930)]
PowerPC floating point little-endian [7 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00086.html

* sysdeps/powerpc/bits/mathinline.h (__signbitf): Use builtin.
(__signbit): Likewise.  Correct for little-endian.
(__signbitl): Call __signbit.
(lrint): Correct for little-endian.
(lrintf): Call lrint.

10 years agoPowerPC floating point little-endian [6 of 15]
Alan Modra [Sat, 17 Aug 2013 08:57:19 +0000 (18:27 +0930)]
PowerPC floating point little-endian [6 of 15]
http://sourceware.org/ml/libc-alpha/2013-07/msg00197.html

A rewrite to make this code correct for little-endian.

* sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c (mynumber): Replace
union 32-bit int array member with 64-bit int array.
(t515, tm256): Double rather than long double.
(__ieee754_sqrtl): Rewrite using 64-bit arithmetic.

10 years agoPowerPC floating point little-endian [5 of 15]
Alan Modra [Sat, 17 Aug 2013 08:56:39 +0000 (18:26 +0930)]
PowerPC floating point little-endian [5 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00085.html

Rid ourselves of ieee854.

* sysdeps/ieee754/ldbl-128ibm/ieee754.h (union ieee854_long_double):
Delete.
(IEEE854_LONG_DOUBLE_BIAS): Delete.
* sysdeps/ieee754/ldbl-128ibm/math_ldbl.h: Don't include ieee854
version of math_ldbl.h.

10 years agoPowerPC floating point little-endian [4 of 15]
Alan Modra [Sat, 17 Aug 2013 08:55:51 +0000 (18:25 +0930)]
PowerPC floating point little-endian [4 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00084.html

Another batch of ieee854 macros and union replacement.  These four
files also have bugs fixed with this patch.  The fact that the two
doubles in an IBM long double may have different signs means that
negation and absolute value operations can't just twiddle one sign bit
as you can with ieee864 style extended double.  fmodl, remainderl,
erfl and erfcl all had errors of this type.  erfl also returned +1 for
large magnitude negative input where it should return -1.  The hypotl
error is innocuous since the value adjusted twice is only used as a
flag.  The e_hypotl.c tests for large "a" and small "b" are mutually
exclusive because we've already exited when x/y > 2**120.  That allows
some further small simplifications.

[BZ #15734], [BZ #15735]
* sysdeps/ieee754/ldbl-128ibm/e_fmodl.c (__ieee754_fmodl): Rewrite
all uses of ieee875 long double macros and unions.  Simplify test
for 0.0L.  Correct |x|<|y| and |x|=|y| test.  Use
ldbl_extract_mantissa value for ix,iy exponents.  Properly
normalize after ldbl_extract_mantissa, and don't add hidden bit
already handled.  Don't treat low word of ieee854 mantissa like
low word of IBM long double and mask off bit when testing for
zero.
* sysdeps/ieee754/ldbl-128ibm/e_hypotl.c (__ieee754_hypotl): Rewrite
all uses of ieee875 long double macros and unions.  Simplify tests
for 0.0L and inf.  Correct double adjustment of k.  Delete dead code
adjusting ha,hb.  Simplify code setting kld.  Delete two600 and
two1022, instead use their values.  Recognise that tests for large
"a" and small "b" are mutually exclusive.  Rename vars.  Comment.
* sysdeps/ieee754/ldbl-128ibm/e_remainderl.c (__ieee754_remainderl):
Rewrite all uses of ieee875 long double macros and unions.  Simplify
test for 0.0L and nan.  Correct negation.
* sysdeps/ieee754/ldbl-128ibm/s_erfl.c (__erfl): Rewrite all uses of
ieee875 long double macros and unions.  Correct output for large
magnitude x.  Correct absolute value calculation.
(__erfcl): Likewise.
* math/libm-test.inc: Add tests for errors discovered in IBM long
double versions of fmodl, remainderl, erfl and erfcl.

10 years agoPowerPC floating point little-endian [3 of 15]
Alan Modra [Sat, 17 Aug 2013 08:54:58 +0000 (18:24 +0930)]
PowerPC floating point little-endian [3 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00083.html

Further replacement of ieee854 macros and unions.  These files also
have some optimisations for comparison against 0.0L, infinity and nan.
Since the ABI specifies that the high double of an IBM long double
pair is the value rounded to double, a high double of 0.0 means the
low double must also be 0.0.  The ABI also says that infinity and
nan are encoded in the high double, with the low double unspecified.
This means that tests for 0.0L, +/-Infinity and +/-NaN need only check
the high double.

* sysdeps/ieee754/ldbl-128ibm/e_atan2l.c (__ieee754_atan2l): Rewrite
all uses of ieee854 long double macros and unions.  Simplify tests
for long doubles that are fully specified by the high double.
* sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c (__ieee754_gammal_r):
Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_ilogbl.c (__ieee754_ilogbl): Likewise.
Remove dead code too.
* sysdeps/ieee754/ldbl-128ibm/e_jnl.c (__ieee754_jnl): Likewise.
(__ieee754_ynl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_log10l.c (__ieee754_log10l): Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_logl.c (__ieee754_logl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Likewise.
Remove dead code too.
* sysdeps/ieee754/ldbl-128ibm/k_tanl.c (__kernel_tanl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (__expm1l): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_frexpl.c (__frexpl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c (__isinf_nsl): Likewise.
Simplify.
* sysdeps/ieee754/ldbl-128ibm/s_isinfl.c (___isinfl): Likewise.
Simplify.
* sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_modfl.c (__modfl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Likewise.
Comment on variable precision.
* sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c (__nexttoward): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c (__nexttowardf):
Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_remquol.c (__remquol): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c (__scalblnl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c (__scalbnl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_tanhl.c (__tanhl): Likewise.
* sysdeps/powerpc/fpu/libm-test-ulps: Adjust tan_towardzero ulps.

10 years agoPowerPC floating point little-endian [2 of 15]
Alan Modra [Sat, 17 Aug 2013 08:54:05 +0000 (18:24 +0930)]
PowerPC floating point little-endian [2 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00082.html

This patch replaces occurrences of GET_LDOUBLE_* and SET_LDOUBLE_*
macros, and union ieee854_long_double_shape_type in ldbl-128ibm/,
and a stray one in the 32-bit fpu support.  These files have no
significant changes apart from rewriting the long double bit access.

* sysdeps/ieee754/ldbl-128ibm/math_ldbl.h (ldbl_high): Define.
* sysdeps/ieee754/ldbl-128ibm/e_acoshl.c (__ieee754_acoshl): Rewrite
all uses of ieee854 long double macros and unions.
* sysdeps/ieee754/ldbl-128ibm/e_acosl.c (__ieee754_acosl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_asinl.c (__ieee754_asinl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_atanhl.c (__ieee754_atanhl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_coshl.c (__ieee754_coshl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l): Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c (__ieee754_rem_pio2l):
Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_sinhl.c (__ieee754_sinhl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/k_cosl.c (__kernel_cosl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/k_sincosl.c (__kernel_sincosl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/k_sinl.c (__kernel_sinl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_asinhl.c (__asinhl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_atanl.c (__atanl): Likewise.
Simplify sign and nan test too.
* sysdeps/ieee754/ldbl-128ibm/s_cosl.c (__cosl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_fabsl.c (__fabsl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_finitel.c (___finitel): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c (___fpclassifyl):
Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_isnanl.c (___isnanl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c (__issignalingl):
Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_logbl.c (__logbl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_signbitl.c (___signbitl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_sincosl.c (__sincosl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_sinl.c (__sinl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_tanl.c (__tanl): Likewise.
* sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c (__logbl): Likewise.

10 years agoPowerPC floating point little-endian [1 of 15]
Alan Modra [Sat, 17 Aug 2013 08:51:58 +0000 (18:21 +0930)]
PowerPC floating point little-endian [1 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00081.html

This is the first of a series of patches to ban ieee854_long_double
and the ieee854_long_double macros when using IBM long double.  union
ieee854_long_double just isn't correct for IBM long double, especially
when little-endian, and pretending it is OK has allowed a number of
bugs to remain undetected in sysdeps/ieee754/ldbl-128ibm/.

This changes the few places in generic code that use it.

* stdio-common/printf_size.c (__printf_size): Don't use
union ieee854_long_double in fpnum union.
* stdio-common/printf_fphex.c (__printf_fphex): Likewise.  Use
signbit macro to retrieve sign from long double.
* stdio-common/printf_fp.c (___printf_fp): Use signbit macro to
retrieve sign from long double.
* sysdeps/ieee754/ldbl-128ibm/printf_fphex.c: Adjust for fpnum change.
* sysdeps/ieee754/ldbl-128/printf_fphex.c: Likewise.
* sysdeps/ieee754/ldbl-96/printf_fphex.c: Likewise.
* sysdeps/x86_64/fpu/printf_fphex.c: Likewise.
* math/test-misc.c (main): Don't use union ieee854_long_double.
ports/
* sysdeps/ia64/fpu/printf_fphex.c: Adjust for fpnum change.

10 years agoFix for [BZ #15680] IBM long double inaccuracy
Alan Modra [Sat, 17 Aug 2013 08:49:44 +0000 (18:19 +0930)]
Fix for [BZ #15680] IBM long double inaccuracy
http://sourceware.org/ml/libc-alpha/2013-06/msg00919.html

I discovered a number of places where denormals and other corner cases
were being handled wrongly.

- printf_fphex.c: Testing for the low double exponent being zero is
unnecessary.  If the difference in exponents is less than 53 then the
high double exponent must be nearing the low end of its range, and the
low double exponent hit rock bottom.

- ldbl2mpn.c: A denormal (ie. exponent of zero) value is treated as
if the exponent was one, so shift mantissa left by one.  Code handling
normalisation of the low double mantissa lacked a test for shift count
greater than bits in type being shifted, and lacked anything to handle
the case where the difference in exponents is less than 53 as in
printf_fphex.c.

- math_ldbl.h (ldbl_extract_mantissa): Same as above, but worse, with
code testing for exponent > 1 for some reason, probably a typo for >= 1.

- math_ldbl.h (ldbl_insert_mantissa): Round the high double as per
mpn2ldbl.c (hi is odd or explicit mantissas non-zero) so that the
number we return won't change when applying ldbl_canonicalize().
Add missing overflow checks and normalisation of high mantissa.
Correct misleading comment: "The hidden bit of the lo mantissa is
zero" is not always true as can be seen from the code rounding the hi
mantissa.  Also by inspection, lzcount can never be less than zero so
remove that test.  Lastly, masking bitfields to their widths can be
left to the compiler.

- mpn2ldbl.c: The overflow checks here on rounding of high double were
just plain wrong.  Incrementing the exponent must be accompanied by a
shift right of the mantissa to keep the value unchanged.  Above notes
for ldbl_insert_mantissa are also relevant.

[BZ #15680]
* sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c: Comment fix.
* sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
(PRINT_FPHEX_LONG_DOUBLE): Tidy code by moving -53 into ediff
calculation.  Remove unnecessary test for denormal exponent.
* sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c (__mpn_extract_long_double):
Correct handling of denormals.  Avoid undefined shift behaviour.
Correct normalisation of low mantissa when low double is denormal.
* sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
(ldbl_extract_mantissa): Likewise.  Comment.  Use uint64_t* for hi64.
(ldbl_insert_mantissa): Make both hi64 and lo64 parms uint64_t.
Correct normalisation of low mantissa.  Test for overflow of high
mantissa and normalise.
(ldbl_nearbyint): Use more readable constant for two52.
* sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
(__mpn_construct_long_double): Fix test for overflow of high
mantissa and correct normalisation.  Avoid undefined shift.

10 years agoIBM long double mechanical changes to support little-endian
Alan Modra [Sat, 17 Aug 2013 08:42:56 +0000 (18:12 +0930)]
IBM long double mechanical changes to support little-endian
http://sourceware.org/ml/libc-alpha/2013-07/msg00001.html

This patch starts the process of supporting powerpc64 little-endian
long double in glibc.  IBM long double is an array of two ieee
doubles, so making union ibm_extended_long_double reflect this fact is
the correct way to access fields of the doubles.

* sysdeps/ieee754/ldbl-128ibm/ieee754.h
(union ibm_extended_long_double): Define as an array of ieee754_double.
(IBM_EXTENDED_LONG_DOUBLE_BIAS): Delete.
* sysdeps/ieee754/ldbl-128ibm/printf_fphex.c: Update all references
to ibm_extended_long_double and IBM_EXTENDED_LONG_DOUBLE_BIAS.
* sysdeps/ieee754/ldbl-128ibm/e_exp10l.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_expl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/math_ldbl.h: Likewise.
* sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/strtold_l.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c: Likewise.

10 years agoFix memory leak in stdlib/isomac.c
Allan McRae [Mon, 9 Sep 2013 12:52:58 +0000 (22:52 +1000)]
Fix memory leak in stdlib/isomac.c

10 years agoFix memory leaks in libio on allocation failure
Allan McRae [Mon, 9 Sep 2013 12:50:41 +0000 (22:50 +1000)]
Fix memory leaks in libio on allocation failure

10 years agoPowerPC: fix POWER7 memrchr for some large inputs
Adhemerval Zanella [Thu, 5 Sep 2013 14:32:56 +0000 (09:32 -0500)]
PowerPC: fix POWER7 memrchr for some large inputs

10 years agoAdd memrchr testcase
Adhemerval Zanella [Thu, 29 Aug 2013 18:28:00 +0000 (15:28 -0300)]
Add memrchr testcase

10 years agoFix lgammaf spurious underflow (bug 15427).
Joseph Myers [Tue, 3 Sep 2013 15:32:54 +0000 (15:32 +0000)]
Fix lgammaf spurious underflow (bug 15427).

10 years agoFix spurious jnf underflows (bug 14155).
Joseph Myers [Mon, 2 Sep 2013 14:51:24 +0000 (14:51 +0000)]
Fix spurious jnf underflows (bug 14155).

10 years ago[BZ #15522] strtod ("nan(N)") returning a sNaN in some cases
Thomas Schwinge [Thu, 23 May 2013 16:00:10 +0000 (18:00 +0200)]
[BZ #15522] strtod ("nan(N)") returning a sNaN in some cases

10 years agoFix cexp (NaN + i0) (bug 15532).
Joseph Myers [Fri, 23 Aug 2013 19:45:38 +0000 (19:45 +0000)]
Fix cexp (NaN + i0) (bug 15532).

10 years agoFix fdim handling of infinities (bug 15797).
Joseph Myers [Wed, 21 Aug 2013 19:56:48 +0000 (19:56 +0000)]
Fix fdim handling of infinities (bug 15797).

10 years agoPowerPC: fix backtrace to handle signal trampolines
Adhemerval Zanella [Tue, 20 Aug 2013 20:01:59 +0000 (15:01 -0500)]
PowerPC: fix backtrace to handle signal trampolines

This patch fixes backtrace for PPC32 and PPC64 to correctly handle
signal trampolines. The 'debug/tst-backtrace6.c' also check for
SA_SIGINFO handling, where is triggers another vDSO symbols for PPC32.

10 years agoFix cproj handling of (finite, NaN) arguments (bug 15531).
Joseph Myers [Tue, 20 Aug 2013 19:41:15 +0000 (19:41 +0000)]
Fix cproj handling of (finite, NaN) arguments (bug 15531).

10 years ago* elf/setup-vdso.h (setup_vdso): Fix missing string termination.
Andreas Arnez [Tue, 20 Aug 2013 12:03:04 +0000 (14:03 +0200)]
* elf/setup-vdso.h (setup_vdso): Fix missing string termination.

10 years agoCVE-2013-4237, BZ #14699: Buffer overflow in readdir_r
Florian Weimer [Fri, 16 Aug 2013 07:38:52 +0000 (09:38 +0200)]
CVE-2013-4237, BZ #14699: Buffer overflow in readdir_r

* sysdeps/posix/dirstream.h (struct __dirstream): Add errcode
member.
* sysdeps/posix/opendir.c (__alloc_dir): Initialize errcode
member.
* sysdeps/posix/rewinddir.c (rewinddir): Reset errcode member.
* sysdeps/posix/readdir_r.c (__READDIR_R): Enforce NAME_MAX limit.
Return delayed error code.  Remove GETDENTS_64BIT_ALIGNED
conditional.
* sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Do not define
GETDENTS_64BIT_ALIGNED.
* sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise.
* manual/filesys.texi (Reading/Closing Directory): Document
ENAMETOOLONG return value of readdir_r.  Recommend readdir more
strongly.
* manual/conf.texi (Limits for Files): Add portability note to
NAME_MAX, PATH_MAX.
(Pathconf): Add portability note for _PC_NAME_MAX, _PC_PATH_MAX.

10 years agoPartially revert commit 2663b74f8103a2a8a46b4896439b7a452480fc7c
Tulio Magno Quites Machado Filho [Fri, 15 Nov 2013 13:44:20 +0000 (07:44 -0600)]
Partially revert commit 2663b74f8103a2a8a46b4896439b7a452480fc7c

This change is necessary in order to avoid the issue documented at
http://sourceware.org/ml/libc-alpha/2013-05/msg00350.html.

10 years agoRemove assert() if DT_RUNPATH and DT_RPATH flags are found in ld.so.
Ryan S. Arnold [Fri, 15 Nov 2013 13:42:33 +0000 (07:42 -0600)]
Remove assert() if DT_RUNPATH and DT_RPATH flags are found in ld.so.

10 years agoFix sparc 64-bit GMP ifunc resolution in static builds.
David S. Miller [Tue, 12 Nov 2013 20:48:01 +0000 (12:48 -0800)]
Fix sparc 64-bit GMP ifunc resolution in static builds.

[BZ #16150]
* sysdeps/sparc/sparc64/multiarch/add_n.S: Resolve to the correct generic
symbol in the non-vis3 case in static builds.
* sysdeps/sparc/sparc64/multiarch/addmul_1.S: Likewise.
* sysdeps/sparc/sparc64/multiarch/mul_1.S: Likewise.
* sysdeps/sparc/sparc64/multiarch/sub_n.S: Likewise.
* sysdeps/sparc/sparc64/multiarch/submul_1.S: Likewise.

10 years agoFix build on pre-v9 32-bit Sparc.
David S. Miller [Wed, 6 Nov 2013 21:01:36 +0000 (13:01 -0800)]
Fix build on pre-v9 32-bit Sparc.

We cannot use fnegd in this code, as fnegd was added in v9.
Only fnegs exists in v8 and earlier.

[BZ #15985]
* sysdeps/sparc/sparc32/fpu/s_fdim.S (__fdim): Do not use fnegd
on pre-v9 cpus, use a fnegs+fmovs sequence instead.

10 years agoFix PI mutex check in pthread_cond_broadcast and pthread_cond_signal
Siddhesh Poyarekar [Thu, 3 Oct 2013 02:56:21 +0000 (08:26 +0530)]
Fix PI mutex check in pthread_cond_broadcast and pthread_cond_signal

Fixes BZ #15996.

The check had a typo - it checked for PTHREAD_MUTEX_ROBUST_NP instead
of PTHREAD_MUTEX_ROBUST_NORMAL_NP.  It has now been replaced by the
already existing convenience macro USE_REQUEUE_PI.

10 years agoUpdate Chinese (traditional) translations.
David S. Miller [Fri, 6 Sep 2013 19:25:07 +0000 (15:25 -0400)]
Update Chinese (traditional) translations.

* po/zh_TW.po: Update Chinese (traditional) translation from
translation project.

11 years agoARM: Fix clone code when built for Thumb.
Will Newton [Thu, 29 Aug 2013 19:10:26 +0000 (20:10 +0100)]
ARM: Fix clone code when built for Thumb.

The mov lr, pc instruction will lose the Thumb bit from the return address
so use blx lr instead.

ports/ChangeLog.arm:

2013-08-30  Will Newton  <will.newton@linaro.org>

[BZ #15909]
* sysdeps/unix/sysv/linux/arm/clone.S (__clone): Use blx
instead of mov lr, pc.

(cherry picked from commit 6b06ac56cdfc9293908724e51e827534e97819aa)

11 years agoAdd Ukrainian translations.
David S. Miller [Thu, 22 Aug 2013 23:35:51 +0000 (16:35 -0700)]
Add Ukrainian translations.

* po/uk.po: Add Ukrainian translations from translation project.

11 years agoUpdate Catalan translations.
David S. Miller [Thu, 22 Aug 2013 23:30:34 +0000 (16:30 -0700)]
Update Catalan translations.

* po/ca.po: Update Catalan translation from translation project.

11 years agoUpdate version.h and include/features.h for 2.18 release. glibc-2.18
David S. Miller [Sat, 10 Aug 2013 22:52:55 +0000 (15:52 -0700)]
Update version.h and include/features.h for 2.18 release.

11 years agoFix typo in ChangeLog
Andreas Schwab [Tue, 6 Aug 2013 09:13:03 +0000 (11:13 +0200)]
Fix typo in ChangeLog

11 years agoUpdate Korean translations.
David S. Miller [Sat, 3 Aug 2013 17:35:26 +0000 (10:35 -0700)]
Update Korean translations.

* po/ko.po: Update Korean translation from translation project.

11 years agoUpdate manual/contrib.texi
David S. Miller [Fri, 2 Aug 2013 00:27:04 +0000 (17:27 -0700)]
Update manual/contrib.texi

* manual/contrib.texi: Update entry for Siddhesh Poyarekar.  Add
entries for Will Newton, Andi Kleen, David Holsgrove, and Ondrej
Bilka.

11 years agoUpdate French translations.
David S. Miller [Tue, 30 Jul 2013 18:27:46 +0000 (11:27 -0700)]
Update French translations.

* po/fr.po: Update French translation from translation project.

11 years agoUpdate Czech translations.
David S. Miller [Sun, 28 Jul 2013 20:01:03 +0000 (13:01 -0700)]
Update Czech translations.

* po/cs.po: Update Czech translation from translation project.

11 years agoUpdate Swedish translations.
David S. Miller [Sun, 28 Jul 2013 18:11:13 +0000 (11:11 -0700)]
Update Swedish translations.

* po/sv.po: Update Swedish translation from translation project.

11 years agoUpdate Esperanto translations.
David S. Miller [Sun, 28 Jul 2013 00:49:14 +0000 (17:49 -0700)]
Update Esperanto translations.

* po/eo.po: Update Esperanto translation from translation project.

11 years agoUpdate Vietnamese translations.
David S. Miller [Sat, 27 Jul 2013 08:49:29 +0000 (01:49 -0700)]
Update Vietnamese translations.

* po/vi.po: Update Vietnamese translation from translation project.

11 years agoUpdate German translations.
David S. Miller [Sat, 27 Jul 2013 07:56:58 +0000 (00:56 -0700)]
Update German translations.

* po/de.po: Update German translation from translation project.

11 years agoUpdate Bulgarian translations.
David S. Miller [Fri, 26 Jul 2013 22:58:17 +0000 (15:58 -0700)]
Update Bulgarian translations.

* po/bg.po: Update Bulgarian translation from translation project.

11 years agoUpdate Dutch, Polish, and Russian translations.
David S. Miller [Fri, 26 Jul 2013 20:21:03 +0000 (13:21 -0700)]
Update Dutch, Polish, and Russian translations.

* po/nl.po: Update Dutch translation from translation project.
* po/pl.po: Update Polish translation from translation project.
* po/ru.po: Update Russian translation from translation project.

11 years ago[AArch64] Provide symbol version for _mcount.
Marcus Shawcroft [Fri, 26 Jul 2013 07:29:17 +0000 (08:29 +0100)]
[AArch64] Provide symbol version for _mcount.

11 years agoUpdate libc.pot in preparation for giving tarball to translation project.
David S. Miller [Thu, 25 Jul 2013 06:31:57 +0000 (23:31 -0700)]
Update libc.pot in preparation for giving tarball to translation project.

* po/libc.pot: Update.

11 years agoAdded NEWS entries for AT_HWCAP2 and POWER8 enablement.
Ryan S. Arnold [Thu, 25 Jul 2013 15:49:13 +0000 (10:49 -0500)]
Added NEWS entries for AT_HWCAP2 and POWER8 enablement.

11 years agohppa: Regenerate libm-test-ulps.
Carlos O'Donell [Wed, 24 Jul 2013 03:49:00 +0000 (23:49 -0400)]
hppa: Regenerate libm-test-ulps.

11 years agoRemove Linux kernel version ambiguity in comment added by previous commit.
David S. Miller [Tue, 23 Jul 2013 18:31:39 +0000 (11:31 -0700)]
Remove Linux kernel version ambiguity in comment added by previous commit.

* tst-cancel4.c (WRITE_BUFFER_SIZE): Adjust comment.

11 years agoPowerPC: use _dl_static_init to set GLRO(gl_pagesize)
Adhemerval Zanella [Tue, 23 Jul 2013 12:39:57 +0000 (07:39 -0500)]
PowerPC: use _dl_static_init to set GLRO(gl_pagesize)

This patch fixes dlfcn/tststatic5 for PowerPC where pagesize
variable was not properly initialized in certain cases. This patch
is based on other architecture code.

11 years agoIncrease nptl test case buffer size so we really block on current Linux kernels.
David S. Miller [Tue, 23 Jul 2013 09:31:37 +0000 (02:31 -0700)]
Increase nptl test case buffer size so we really block on current Linux kernels.

* tst-cancel4.c (WRITE_BUFFER_SIZE): Increase to 16384.

11 years agotile BZ #15759: Fix bug in _dl_unmap
Chris Metcalf [Mon, 22 Jul 2013 15:46:44 +0000 (11:46 -0400)]
tile BZ #15759: Fix bug in _dl_unmap

We returned without calling __munmap if not in the simulator.
Now we call a separate sim_dlclose() function to make the
control flow work correctly.

11 years agoS/390: ULPs update.
Andreas Krebbel [Mon, 22 Jul 2013 07:51:52 +0000 (09:51 +0200)]
S/390: ULPs update.

11 years agoCVE-2013-2207, BZ #15755: Disable pt_chown.
Carlos O'Donell [Fri, 19 Jul 2013 06:42:03 +0000 (02:42 -0400)]
CVE-2013-2207, BZ #15755: Disable pt_chown.

The helper binary pt_chown tricked into granting access to another
user's pseudo-terminal.

Pre-conditions for the attack:

 * Attacker with local user account
 * Kernel with FUSE support
 * "user_allow_other" in /etc/fuse.conf
 * Victim with allocated slave in /dev/pts

Using the setuid installed pt_chown and a weak check on whether a file
descriptor is a tty, an attacker could fake a pty check using FUSE and
trick pt_chown to grant ownership of a pty descriptor that the current
user does not own.  It cannot access /dev/pts/ptmx however.

In most modern distributions pt_chown is not needed because devpts
is enabled by default. The fix for this CVE is to disable building
and using pt_chown by default. We still provide a configure option
to enable hte use of pt_chown but distributions do so at their own
risk.

11 years agoUpdate Sparc ULPs.
David S. Miller [Sat, 20 Jul 2013 23:46:24 +0000 (16:46 -0700)]
Update Sparc ULPs.

* sysdeps/sparc/fpu/libm-test-ulps: Update ULPs to handle minor
difference between 32-bit and 64-bit.

11 years agom68k: use _dl_static_init to set GLR0(dl_pagesize)
Andreas Schwab [Sat, 20 Jul 2013 20:37:42 +0000 (22:37 +0200)]
m68k: use _dl_static_init to set GLR0(dl_pagesize)

11 years agotile: add missing semicolon in <bits/ptrace.h>
Chris Metcalf [Fri, 19 Jul 2013 17:06:30 +0000 (13:06 -0400)]
tile: add missing semicolon in <bits/ptrace.h>

Change 521c6785e1fc94d added the enum but missed the semicolon.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
11 years agoClean up whitespace in lock elision patches.
Dominik Vogt [Fri, 19 Jul 2013 05:16:28 +0000 (05:16 +0000)]
Clean up whitespace in lock elision patches.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
11 years agoRemove remains of rwlock elision which is not implemented yet.
Dominik Vogt [Fri, 19 Jul 2013 05:02:44 +0000 (05:02 +0000)]
Remove remains of rwlock elision which is not implemented yet.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
---

nptl/
2013-07-19  Dominik Vogt  <vogt@de.ibm.com>

* sysdeps/unix/sysv/linux/x86/elision-conf.c:
Remove __rwlock_rtm_enabled and __rwlock_rtm_read_retries.
(elision_init): Don't set __rwlock_rtm_enabled.
* sysdeps/unix/sysv/linux/x86/elision-conf.h:
Remove __rwlock_rtm_enabled.

11 years agoBZ #15711: Avoid circular dependency for syscall.h
Carlos O'Donell [Tue, 16 Jul 2013 21:55:43 +0000 (17:55 -0400)]
BZ #15711: Avoid circular dependency for syscall.h

The generated header is compiled with `-ffreestanding' to avoid any
circular dependencies against the installed implementation headers.
Such a dependency would require the implementation header to be
installed before the generated header could be built (See bug 15711).
In current practice the generated header dependencies do not include
any of the implementation headers removed by the use of `-ffreestanding'.

---

2013-07-15  Carlos O'Donell  <carlos@redhat.com>

[BZ #15711]
* sysdeps/unix/sysv/linux/Makefile ($(objpfx)bits/syscall%h):
Avoid system header dependency with -ffreestanding.
($(objpfx)bits/syscall%d): Likewise.

11 years agoAnnotate more cases of math bug 15319.
David S. Miller [Sat, 13 Jul 2013 23:57:05 +0000 (16:57 -0700)]
Annotate more cases of math bug 15319.

* math/libm-test.inc (casin_test_data): Annotate more cases of missing
underflows from atanl/atan2l due to bug 15319.
(casinh_test_data): Likewise.

11 years ago[AArch64] Adding -funwind-tables to backtrace.c
Marcus Shawcroft [Fri, 5 Jul 2013 16:12:46 +0000 (17:12 +0100)]
[AArch64] Adding -funwind-tables to backtrace.c

This page took 0.080389 seconds and 5 git commands to generate.