platform/upstream/glibc.git
11 years agoWhen glob pattern contains a trailing slash match only directories. Fixes bug 10278.
Ondřej Bílka [Sun, 20 Oct 2013 08:00:31 +0000 (10:00 +0200)]
When glob pattern contains a trailing slash match only directories. Fixes bug 10278.

11 years agoReplace alloca in __tzfile_read by malloc. Fixes bug 15670
Ondřej Bílka [Sun, 20 Oct 2013 06:25:25 +0000 (08:25 +0200)]
Replace alloca in __tzfile_read by malloc. Fixes bug 15670

11 years agoMention FIPS 140-2 compliance and Sun RPC.
Carlos O'Donell [Sat, 19 Oct 2013 04:11:31 +0000 (00:11 -0400)]
Mention FIPS 140-2 compliance and Sun RPC.

The Secure RPC implementation in glibc uses DES encryption
during authentication of the user. This use of DES means
that anyone using Sun RPC will likely not be compliant
with FIPS 140-2 which forbids the use of DES.

One solution to the compliance issue is to disable AUTH_DES
and AUTH_KERB, both use DES, when in FIPS compliance mode.
This is not a good idea because it disables all of the even
mildly secure methods of authentication allowing only plain
text methods.

Instead we leave AUTH_DES and AUTH_KERB enabled in FIPS
compliance mode and document the compliance issue in the
manual. FIPS allows this, that is to say that if you can't
fix it you must document the non-compliance.

This commit adds documentation to that effect in the
"DES encryption and password handling" section of the
manual.

11 years agoEnhance localedef --list-archive option.
Carlos O'Donell [Sat, 19 Oct 2013 03:41:30 +0000 (23:41 -0400)]
Enhance localedef --list-archive option.

The localedef --list-archive option claims that it can
accept a [file] argument and list the contents of that
archive. The support was never implemented. This patch
adds that support and allows --list-archive to work as
expected. You can now use localedef to list the contents
of arbitrary locale archives by using:
./localedef --list-archive file

11 years agoMove entries to correct port ChangeLog files.
Joseph Myers [Fri, 18 Oct 2013 21:28:57 +0000 (21:28 +0000)]
Move entries to correct port ChangeLog files.

11 years agoAdd e500 port.
Joseph Myers [Fri, 18 Oct 2013 21:03:40 +0000 (21:03 +0000)]
Add e500 port.

11 years agoRemove duplicate bug numbers from NEWS.
Joseph Myers [Fri, 18 Oct 2013 21:00:20 +0000 (21:00 +0000)]
Remove duplicate bug numbers from NEWS.

11 years agoFix localedef collation handling of <U0000> (bug 15948).
Richard Sandiford [Fri, 18 Oct 2013 20:58:31 +0000 (20:58 +0000)]
Fix localedef collation handling of <U0000> (bug 15948).

11 years agoDon't include tls.h in test cases
Siddhesh Poyarekar [Fri, 18 Oct 2013 14:15:36 +0000 (19:45 +0530)]
Don't include tls.h in test cases

Remove tls.h includes where they are not needed.

11 years agoRemove assert in malloc statistic. Fixes bug 12486.
Ondřej Bílka [Fri, 18 Oct 2013 07:32:35 +0000 (09:32 +0200)]
Remove assert in malloc statistic. Fixes bug 12486.

11 years agoFix inet_network("1 bar"). Fixes bug 15277.
Ondřej Bílka [Thu, 17 Oct 2013 16:33:58 +0000 (18:33 +0200)]
Fix inet_network("1 bar"). Fixes bug 15277.

11 years agoDon't use gethostbyaddr to determine canonical name
Andreas Schwab [Tue, 15 Oct 2013 08:21:13 +0000 (10:21 +0200)]
Don't use gethostbyaddr to determine canonical name

11 years agoFormat floating routines.
Ondřej Bílka [Thu, 17 Oct 2013 14:03:24 +0000 (16:03 +0200)]
Format floating routines.

11 years agosoft-fp: make extensions quiet signaling NaNs (bug 16041).
Joseph Myers [Thu, 17 Oct 2013 12:36:02 +0000 (12:36 +0000)]
soft-fp: make extensions quiet signaling NaNs (bug 16041).

11 years agosoft-fp: fix horizontal whitespace.
Joseph Myers [Wed, 16 Oct 2013 01:22:21 +0000 (01:22 +0000)]
soft-fp: fix horizontal whitespace.

11 years agosoft-fp: remove unused macros.
Joseph Myers [Tue, 15 Oct 2013 23:33:37 +0000 (23:33 +0000)]
soft-fp: remove unused macros.

11 years agoClear initfini list after freeing. Fixes bug 15308.
Ondřej Bílka [Tue, 15 Oct 2013 07:45:37 +0000 (09:45 +0200)]
Clear initfini list after freeing. Fixes bug 15308.

11 years agosoft-fp: fix vertical whitespace and indentation.
Joseph Myers [Tue, 15 Oct 2013 00:17:35 +0000 (00:17 +0000)]
soft-fp: fix vertical whitespace and indentation.

11 years agoFix error_tail overflow in allocation calculation.
Ondřej Bílka [Mon, 14 Oct 2013 15:15:08 +0000 (17:15 +0200)]
Fix error_tail overflow in allocation calculation.

11 years agoCorrectly copy resolver address. Fixes bug #13028.
Ondřej Bílka [Sun, 13 Oct 2013 21:03:28 +0000 (23:03 +0200)]
Correctly copy resolver address. Fixes bug #13028.

11 years agoldd: make try_trace more robust and portable
Patrick 'P. J.' McDermott [Thu, 12 Sep 2013 03:13:36 +0000 (23:13 -0400)]
ldd: make try_trace more robust and portable

It was noted in 2005 (BZ #832), 2006 (BZ #3266), and 2007 [1] that ldd
fails on shells other than Bash >= 3.0 because of the pipefail option
around try_trace (added on 2004-12-08).  EGLIBC was patched in 2008 [2]
(r6912) to make the pipefail check run only on shells that support it,
but RTLD output would still be lost on other shells with certain SELinux
policies.

This patch rewrites try_trace to work on any POSIX-conformant shell in
such a way as to also work with such SELinux policies.  It also obviates
one difference between glibc and EGLIBC.

URL: https://sourceware.org/ml/libc-alpha/2007-01/msg00041.html
URL: http://www.eglibc.org/archives/patches/msg00526.html

2013-09-11  P. J. McDermott  <pj@pehjota.net>

[BZ #832]
* elf/ldd.bash.in (try_trace): More robustly and portably work around
SELinux terminal write permissions by using a command substitution
instead of a pipeline and pipefail option.

11 years agoAdjust language-code fields of LC_ADDRESS.
Chris Leonard [Sun, 13 Oct 2013 12:37:42 +0000 (08:37 -0400)]
Adjust language-code fields of LC_ADDRESS.

11 years agosoft-fp: fix preprocessor indentation.
Joseph Myers [Sat, 12 Oct 2013 14:15:30 +0000 (14:15 +0000)]
soft-fp: fix preprocessor indentation.

11 years agoFix typos.
Yuri Chornoivan [Sat, 12 Oct 2013 12:21:55 +0000 (14:21 +0200)]
Fix typos.

11 years agoFix typo in setlocale.c. Fixes BZ #15764
Reuben Thomas [Sat, 12 Oct 2013 12:07:25 +0000 (14:07 +0200)]
Fix typo in setlocale.c. Fixes BZ #15764

11 years agosoft-fp: make __unord* raise "invalid" for signaling NaNs (bug 16036).
Joseph Myers [Sat, 12 Oct 2013 12:23:28 +0000 (12:23 +0000)]
soft-fp: make __unord* raise "invalid" for signaling NaNs (bug 16036).

11 years agosoft-fp: make ordered comparisons raise "invalid" for quiet NaNs (bug 14910).
Joseph Myers [Sat, 12 Oct 2013 12:22:14 +0000 (12:22 +0000)]
soft-fp: make ordered comparisons raise "invalid" for quiet NaNs (bug 14910).

11 years agosoft-fp: add missing FP_INIT_EXCEPTIONS and FP_INIT_ROUNDMODE calls.
Joseph Myers [Sat, 12 Oct 2013 12:21:04 +0000 (12:21 +0000)]
soft-fp: add missing FP_INIT_EXCEPTIONS and FP_INIT_ROUNDMODE calls.

11 years agosoft-fp: add macro FP_NO_EXCEPTIONS.
Joseph Myers [Sat, 12 Oct 2013 12:20:12 +0000 (12:20 +0000)]
soft-fp: add macro FP_NO_EXCEPTIONS.

11 years agosoft-fp: fix _FP_DIV_MEAT_* returning results with wrong exponent (bug 16032).
Joseph Myers [Sat, 12 Oct 2013 12:18:55 +0000 (12:18 +0000)]
soft-fp: fix _FP_DIV_MEAT_* returning results with wrong exponent (bug 16032).

11 years agosoft-fp: fix floating-point to integer unsigned saturation.
Joseph Myers [Sat, 12 Oct 2013 12:17:16 +0000 (12:17 +0000)]
soft-fp: fix floating-point to integer unsigned saturation.

11 years agoAdd systemtap markers to math function slow paths
Siddhesh Poyarekar [Fri, 11 Oct 2013 17:07:53 +0000 (22:37 +0530)]
Add systemtap markers to math function slow paths

Add systemtap probes to various slow paths in libm so that application
developers may use systemtap to find out if their applications are
hitting these slow paths.  We have added probes for pow, exp, log,
tan, atan and atan2.

11 years agoFix fwrite() reading beyond end of buffer in error path
Eric Biggers [Fri, 11 Oct 2013 16:59:38 +0000 (22:29 +0530)]
Fix fwrite() reading beyond end of buffer in error path

Partially revert commits 2b766585f9b4ffabeef2f36200c275976b93f2c7 and
de2fd463b1c0310d75084b6d774fb974075a4ad9, which were intended to fix BZ#11741
but caused another, likely worse bug, namely that fwrite() and fputs() could,
in an error path, read data beyond the end of the specified buffer, and
potentially even write this data to the file.

Fix BZ#11741 properly by checking the return value from _IO_padn() in
stdio-common/vfprintf.c.

11 years agoFix readdir regressions on sparc 32-bit.
David S. Miller [Fri, 11 Oct 2013 05:32:36 +0000 (22:32 -0700)]
Fix readdir regressions on sparc 32-bit.

* sysdeps/posix/dirstream.h (struct __dirstream): Fix alignment of
directory block.

11 years agoUpdate copyright and license notices in soft-fp files from libgcc.
Joseph Myers [Thu, 10 Oct 2013 23:58:13 +0000 (23:58 +0000)]
Update copyright and license notices in soft-fp files from libgcc.

11 years agoAdd soft-fp files from libgcc.
Joseph Myers [Thu, 10 Oct 2013 23:57:22 +0000 (23:57 +0000)]
Add soft-fp files from libgcc.

11 years agoUpdate sparc ULPs.
David S. Miller [Wed, 9 Oct 2013 22:25:52 +0000 (15:25 -0700)]
Update sparc ULPs.

* sysdeps/sparc/fpu/libm-test-ulps: Update.

11 years agoExtend powerpc-nofpu -fno-builtin-fabsl workaround to more files.
Joseph Myers [Thu, 10 Oct 2013 19:12:09 +0000 (19:12 +0000)]
Extend powerpc-nofpu -fno-builtin-fabsl workaround to more files.

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

11 years agomalloc/hooks.c: Correct check for overflow in memalign_check.
Will Newton [Wed, 9 Oct 2013 13:41:57 +0000 (14:41 +0100)]
malloc/hooks.c: Correct check for overflow in memalign_check.

A large value of bytes passed to memalign_check can cause an integer
overflow in _int_memalign and heap corruption. This issue can be
exposed by running tst-memalign with MALLOC_CHECK_=3.

ChangeLog:

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

* malloc/hooks.c (memalign_check): Ensure the value of bytes
passed to _int_memalign does not overflow.

11 years agobenchtests: Add include-sources directive.
Torvald Riegel [Tue, 8 Oct 2013 11:04:10 +0000 (14:04 +0300)]
benchtests: Add include-sources directive.

This adds the "include-sources" directive to scripts/bench.pl.  This
allows for including source code (vs including headers, which might get
a different search path) after the inclusion of any headers.

11 years agosoft-fp: split FP_INIT_EXCEPTIONS from FP_INIT_ROUNDMODE.
Joseph Myers [Thu, 10 Oct 2013 11:40:25 +0000 (11:40 +0000)]
soft-fp: split FP_INIT_EXCEPTIONS from FP_INIT_ROUNDMODE.

11 years agosoft-fp: fix negation NaN handling (bug 16034).
Joseph Myers [Thu, 10 Oct 2013 11:38:56 +0000 (11:38 +0000)]
soft-fp: fix negation NaN handling (bug 16034).

11 years agosoft-fp: Remove trailing semicolon from _FP_FRAC_DISASSEMBLE_4.
Joseph Myers [Wed, 9 Oct 2013 19:23:05 +0000 (19:23 +0000)]
soft-fp: Remove trailing semicolon from _FP_FRAC_DISASSEMBLE_4.

11 years agosoft-fp: fix typo in comment.
Adam Buchbinder [Wed, 9 Oct 2013 19:20:48 +0000 (19:20 +0000)]
soft-fp: fix typo in comment.

11 years agoUpdate gethostbyname2_r documentation. Fixes bug #156.
Yogesh Chaudhari [Tue, 8 Oct 2013 19:42:42 +0000 (21:42 +0200)]
Update gethostbyname2_r documentation. Fixes bug #156.

11 years agoFix typo in last change
Andreas Schwab [Tue, 8 Oct 2013 19:24:56 +0000 (21:24 +0200)]
Fix typo in last change

11 years agom68k: use PIC for Scrt1.o
Andreas Schwab [Tue, 8 Oct 2013 18:59:47 +0000 (20:59 +0200)]
m68k: use PIC for Scrt1.o

11 years agoUse p2align instead ALIGN
Ondřej Bílka [Tue, 8 Oct 2013 13:46:48 +0000 (15:46 +0200)]
Use p2align instead ALIGN

11 years agocorrect LC_TELEPHONE for pap locales
Chris Leonard [Tue, 8 Oct 2013 11:34:10 +0000 (07:34 -0400)]
correct LC_TELEPHONE for pap locales

11 years agoFormat e_pow.c
Siddhesh Poyarekar [Tue, 8 Oct 2013 10:53:16 +0000 (16:23 +0530)]
Format e_pow.c

11 years agoFormat e_exp.c
Siddhesh Poyarekar [Tue, 8 Oct 2013 10:52:28 +0000 (16:22 +0530)]
Format e_exp.c

11 years agoConsolidate multiple precision sin/cos functions
Siddhesh Poyarekar [Tue, 8 Oct 2013 06:20:17 +0000 (11:50 +0530)]
Consolidate multiple precision sin/cos functions

11 years agoClean up locale file alignment handling.
Joseph Myers [Tue, 8 Oct 2013 00:14:08 +0000 (00:14 +0000)]
Clean up locale file alignment handling.

11 years agoFixes to Changelog for locale splits
Chris Leonard [Mon, 7 Oct 2013 22:30:37 +0000 (18:30 -0400)]
Fixes to Changelog for locale splits

11 years agoFix up ChangeLog formatting.
Roland McGrath [Mon, 7 Oct 2013 22:14:36 +0000 (15:14 -0700)]
Fix up ChangeLog formatting.

11 years agoremove localdata path from Changelog entries
Chris Leonard [Mon, 7 Oct 2013 21:23:18 +0000 (17:23 -0400)]
remove localdata path from Changelog entries

11 years agoFix ar_SS in SUPPORTED
Chris Leonard [Mon, 7 Oct 2013 20:50:12 +0000 (16:50 -0400)]
Fix ar_SS in SUPPORTED

11 years agoFix ChangeLog formatting
Siddhesh Poyarekar [Mon, 7 Oct 2013 06:22:44 +0000 (11:52 +0530)]
Fix ChangeLog formatting

11 years agoAdd more directives to benchmark input files
Siddhesh Poyarekar [Mon, 7 Oct 2013 06:21:24 +0000 (11:51 +0530)]
Add more directives to benchmark input files

This patch adds some more directives to the benchmark inputs file,
moving functionality from the Makefile and making the code generation
script a bit cleaner.  The function argument and return types that
were earlier added as variables in the makefile and passed to the
script via command line arguments are now the 'args' and 'ret'
directive respectively.  'args' should be a colon separated list of
argument types (skipped if the function doesn't accept any arguments)
and 'ret' should be the return type.

Additionally, an 'includes' directive may have a comma separated list
of headers to include in the source.  For example, the pow input file
now looks like this:

42.0, 42.0
1.0000000000000020, 1.5

I did this to unclutter the benchtests Makefile a bit and eventually
eliminate dependency of the tests on the Makefile and have tests
depend on their respective include files only.

11 years agoFix careless merge.
Alan Modra [Sun, 6 Oct 2013 23:23:41 +0000 (09:53 +1030)]
Fix careless merge.

11 years agoAdjust language-code fields of LC_ADDRESS.
Chris Leonard [Sun, 6 Oct 2013 00:38:38 +0000 (20:38 -0400)]
Adjust language-code fields of LC_ADDRESS.

11 years agoMention powerpc64le support in NEWS and README, plus bugs fixed.
Alan Modra [Sat, 5 Oct 2013 07:02:10 +0000 (16:32 +0930)]
Mention powerpc64le support in NEWS and README, plus bugs fixed.

* NEWS: Mention powerpc64le support and bugs fixed.
* README: Both big-endian and little-endian powerpc64 supported.

11 years agonptl: tst-mutex8.c: Handle ENOTSUP PI mutex failure
Maciej W. Rozycki [Fri, 4 Oct 2013 23:00:32 +0000 (00:00 +0100)]
nptl: tst-mutex8.c: Handle ENOTSUP PI mutex failure

11 years agoFix typos in 3166.def.
Chris Leonard [Fri, 4 Oct 2013 22:51:42 +0000 (18:51 -0400)]
Fix typos in 3166.def.

11 years agoAdd fork hooks for pthread_atfork
Samuel Thibault [Tue, 24 Sep 2013 21:08:15 +0000 (23:08 +0200)]
Add fork hooks for pthread_atfork

pthread_atfork needs application callbacks to be called outside any locking.

11 years agoUpdate generic swapon definition to match prototype.
Ryan S. Arnold [Fri, 4 Oct 2013 17:07:04 +0000 (12:07 -0500)]
Update generic swapon definition to match prototype.

11 years agoMove powerpc ports pieces to libc.
Joseph Myers [Fri, 4 Oct 2013 16:02:33 +0000 (16:02 +0000)]
Move powerpc ports pieces to libc.

11 years agoe500 port: adjust sysdeps/unix/sysv/linux/configure.in case.
Joseph Myers [Fri, 4 Oct 2013 15:57:50 +0000 (15:57 +0000)]
e500 port: adjust sysdeps/unix/sysv/linux/configure.in case.

11 years agoe500 port: fix fpu_control.h constant values.
Joseph Myers [Fri, 4 Oct 2013 15:56:48 +0000 (15:56 +0000)]
e500 port: fix fpu_control.h constant values.

11 years agoe500 port: getcontext / setcontext / swapcontext.
Joseph Myers [Fri, 4 Oct 2013 15:55:15 +0000 (15:55 +0000)]
e500 port: getcontext / setcontext / swapcontext.

11 years agoCorrect error in iso-3166.def
Chris Leonard [Fri, 4 Oct 2013 13:48:45 +0000 (09:48 -0400)]
Correct error in iso-3166.def

11 years agoCopy / modify pap_AN into pap_AW and pap_CW.
Chris Leonard [Fri, 4 Oct 2013 12:54:27 +0000 (08:54 -0400)]
Copy / modify pap_AN into pap_AW and pap_CW.

11 years agoSplit ar_SD into ar_SD and ar_SS
Chris Leonard [Fri, 4 Oct 2013 12:44:04 +0000 (08:44 -0400)]
Split ar_SD into ar_SD and ar_SS

11 years agoUpdate iso-1366.def and related occurrences
Chris Leonard [Fri, 4 Oct 2013 12:35:44 +0000 (08:35 -0400)]
Update iso-1366.def and related occurrences

11 years agoFix typo in manual
Siddhesh Poyarekar [Fri, 4 Oct 2013 11:49:11 +0000 (17:19 +0530)]
Fix typo in manual

11 years agoARM: Allow building __sigsetjmp as Thumb.
Will Newton [Wed, 25 Sep 2013 09:17:28 +0000 (10:17 +0100)]
ARM: Allow building __sigsetjmp as Thumb.

Convert __sigsetjmp code to allow building as Thumb.

ports/ChangeLog.arm:

2013-10-04  Will Newton  <will.newton@linaro.org>

* sysdeps/arm/setjmp.S (NO_THUMB): Remove define.
(__sigsetjmp): Use Thumb supported instructions.

11 years agoARM: Allow building __longjmp as Thumb.
Will Newton [Wed, 25 Sep 2013 09:14:20 +0000 (10:14 +0100)]
ARM: Allow building __longjmp as Thumb.

Convert __longjmp code to allow building as Thumb.

ports/ChangeLog.arm:

2013-10-04  Will Newton  <will.newton@linaro.org>

* sysdeps/arm/__longjmp.S (NO_THUMB): Remove define.
(__longjmp): Use Thumb supported instructions.
* sysdeps/unix/sysv/linux/arm/____longjmp_chk.S (NO_THUMB):
Remove define.

11 years agomalloc/tst-valloc.c: Tidy up code.
Will Newton [Thu, 3 Oct 2013 10:26:34 +0000 (11:26 +0100)]
malloc/tst-valloc.c: Tidy up code.

Add some comments and call free on all potentially allocated pointers.
Also remove duplicate check for NULL pointer.

ChangeLog:

2013-10-04  Will Newton  <will.newton@linaro.org>

* malloc/tst-valloc.c: Add comments.
(do_test): Add comments and call free on all potentially
allocated pointers. Remove duplicate check for NULL pointer.
Add space after cast.

11 years agomalloc/tst-pvalloc.c: Tidy up code.
Will Newton [Thu, 3 Oct 2013 10:24:38 +0000 (11:24 +0100)]
malloc/tst-pvalloc.c: Tidy up code.

Add some comments and call free on all potentially allocated pointers.
Also remove duplicate check for NULL pointer.

ChangeLog:

2013-10-04  Will Newton  <will.newton@linaro.org>

* malloc/tst-pvalloc.c: Add comments.
(do_test): Add comments and call free on all potentially
allocated pointers. Remove duplicate check for NULL pointer.
Add space after cast.

11 years agomalloc/tst-posix_memalign.c: Tidy up code.
Will Newton [Thu, 3 Oct 2013 10:21:15 +0000 (11:21 +0100)]
malloc/tst-posix_memalign.c: Tidy up code.

Add some comments and call free on all potentially allocated pointers.

ChangeLog:

2013-10-04  Will Newton  <will.newton@linaro.org>

* malloc/tst-posix_memalign.c: Add comments.
(do_test): Add comments and call free on all potentially
allocated pointers. Add space after cast.

11 years agomalloc: Add memalign test.
Will Newton [Fri, 16 Aug 2013 16:06:10 +0000 (17:06 +0100)]
malloc: Add memalign test.

ChangeLog:

2013-10-04  Will Newton  <will.newton@linaro.org>

    * malloc/Makefile: Add tst-memalign.
    * malloc/tst-memalign.c: New file.

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

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

11 years agofix changelog date
Alan Modra [Fri, 4 Oct 2013 01:27:05 +0000 (10:57 +0930)]
fix changelog date

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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