]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
9 years agoRe-sort the list of bugs fixed
Tulio Magno Quites Machado Filho [Thu, 26 Nov 2015 18:53:24 +0000 (16:53 -0200)] 
Re-sort the list of bugs fixed

Fix a bug number that was out of order.

9 years agoMerge branch 'release/2.19/master' into ibm/2.19/master
Tulio Magno Quites Machado Filho [Tue, 24 Nov 2015 14:07:51 +0000 (12:07 -0200)] 
Merge branch 'release/2.19/master' into ibm/2.19/master

Conflicts:
NEWS
nss/nss_files/files-XXX.c

9 years agoDon't read past end of pattern in fnmatch (BZ #17062)
Andreas Schwab [Wed, 18 Jun 2014 09:58:45 +0000 (11:58 +0200)] 
Don't read past end of pattern in fnmatch (BZ #17062)

(cherry picked from commit b3a9f56ba59c3d8eadd3135a1c25c37a63151450)

Conflicts:
NEWS
posix/Makefile

9 years agoCVE-2014-8121: Do not close NSS files database during iteration [BZ #18007]
Florian Weimer [Wed, 29 Apr 2015 12:41:25 +0000 (14:41 +0200)] 
CVE-2014-8121: Do not close NSS files database during iteration [BZ #18007]

Robin Hack discovered Samba would enter an infinite loop processing
certain quota-related requests.  We eventually tracked this down to a
glibc issue.

Running a (simplified) test case under strace shows that /etc/passwd
is continuously opened and closed:


open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0
read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2717
lseek(3, 2717, SEEK_SET)                = 2717
close(3)                                = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0
lseek(3, 0, SEEK_SET)                   = 0
read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2717
lseek(3, 2717, SEEK_SET)                = 2717
close(3)                                = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0


The lookup function implementation in
nss/nss_files/files-XXX.c:DB_LOOKUP has code to prevent that.  It is
supposed skip closing the input file if it was already open.

  /* Reset file pointer to beginning or open file.  */       \
  status = internal_setent (keep_stream);       \
      \
  if (status == NSS_STATUS_SUCCESS)       \
    {       \
      /* Tell getent function that we have repositioned the file pointer.  */ \
      last_use = getby;       \
      \
      while ((status = internal_getent (result, buffer, buflen, errnop       \
H_ERRNO_ARG EXTRA_ARGS_VALUE))       \
     == NSS_STATUS_SUCCESS)       \
{ break_if_match }       \
      \
      if (! keep_stream)       \
internal_endent ();       \
    }       \

keep_stream is initialized from the stayopen flag in internal_setent.
internal_setent is called from the set*ent implementation as:

  status = internal_setent (stayopen);

However, for non-host database, this flag is always 0, per the
STAYOPEN magic in nss/getXXent_r.c.

Thus, the fix is this:

-  status = internal_setent (stayopen);
+  status = internal_setent (1);

This is not a behavioral change even for the hosts database (where the
application can specify the stayopen flag) because with a call to
sethostent(0), the file handle is still not closed in the
implementation of gethostent.

(cherry picked from commit 03d2730b44cc2236318fd978afa2651753666c55)

Conflicts:
ChangeLog
NEWS

9 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:
ChangeLog
NEWS

9 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:
ChangeLog
NEWS

9 years agoDon't ignore too long lines in nss_files (BZ #17079)
Andreas Schwab [Mon, 23 Jun 2014 08:24:45 +0000 (10:24 +0200)] 
Don't ignore too long lines in nss_files (BZ #17079)

(cherry picked from commit ac60763eac3d43b7234dd21286ad3ec3f17957fc)

Conflicts:
ChangeLog
NEWS

9 years agoFix parsing of getai result from nscd for IPv6-only request
Andreas Schwab [Wed, 7 May 2014 09:47:20 +0000 (11:47 +0200)] 
Fix parsing of getai result from nscd for IPv6-only request

(cherry picked from commit 8dc9751764eb1bedf06d19695524b31a16773413)

9 years agoCorrect DT_PPC64_NUM
Alan Modra [Mon, 14 Jul 2014 11:44:50 +0000 (21:14 +0930)] 
Correct DT_PPC64_NUM

[BZ #17153]
* elf/elf.h (DT_PPC64_NUM): Correct value.
* NEWS: Add to fixed bug list.

(cherry picked from commit f6c44d475104e931bab2b4ffa499961088de673c)

Conflicts:
NEWS

9 years agoFix use of half-initialized result in getaddrinfo when using nscd (bug 16743)
Andreas Schwab [Thu, 20 Mar 2014 14:05:25 +0000 (15:05 +0100)] 
Fix use of half-initialized result in getaddrinfo when using nscd (bug 16743)

This fixes a bug in the way the results from __nscd_getai are collected:
for every returned result a new entry is first added to the
gaih_addrtuple list, but if that result doesn't match the request this
entry remains uninitialized.  So for this non-matching result an extra
result with uninitialized content is returned.

To reproduce (with nscd running):

$ getent ahostsv4 localhost
127.0.0.1       STREAM localhost
127.0.0.1       DGRAM
127.0.0.1       RAW
(null)          STREAM
(null)          DGRAM
(null)          RAW

(cherry picked from commit a071766ebfd853179ac39f9773f894029bf86d36)

Conflicts:
ChangeLog
NEWS

9 years agoCVE-2015-1781: resolv/nss_dns/dns-host.c buffer overflow [BZ#18287]
Arjun Shankar [Tue, 21 Apr 2015 12:06:31 +0000 (14:06 +0200)] 
CVE-2015-1781: resolv/nss_dns/dns-host.c buffer overflow [BZ#18287]

(cherry picked from commit 2959eda9272a033863c271aff62095abd01bd4e3)

9 years agoProperly handle forced elision in pthread_mutex_trylock (bug 16657)
Andreas Schwab [Tue, 4 Mar 2014 12:00:26 +0000 (13:00 +0100)] 
Properly handle forced elision in pthread_mutex_trylock (bug 16657)

(cherry picked from commit b0a3c1640ab2fb7d16d9b9a8d9c0e524e9cb0001)

9 years agoPowerPC: Fix gprof entry point for LE
Adhemerval Zanella [Tue, 29 Jul 2014 18:56:44 +0000 (13:56 -0500)] 
PowerPC: Fix gprof entry point for LE

This patch fixes the ELFv2 gprof entry point since the ABI
does not define function descriptors.  It fixes BZ#17213.

Conflicts:
NEWS

10 years agoSeparate internal state between getXXent and getXXbyYY NSS calls (bug 18007)
Andreas Schwab [Wed, 25 Mar 2015 15:35:46 +0000 (16:35 +0100)] 
Separate internal state between getXXent and getXXbyYY NSS calls (bug 18007)

Conflicts:
NEWS

10 years agoCVE-2014-8121: Do not close NSS files database during iteration [BZ #18007]
Florian Weimer [Wed, 29 Apr 2015 12:41:25 +0000 (14:41 +0200)] 
CVE-2014-8121: Do not close NSS files database during iteration [BZ #18007]

Robin Hack discovered Samba would enter an infinite loop processing
certain quota-related requests.  We eventually tracked this down to a
glibc issue.

Running a (simplified) test case under strace shows that /etc/passwd
is continuously opened and closed:


open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0
read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2717
lseek(3, 2717, SEEK_SET)                = 2717
close(3)                                = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0
lseek(3, 0, SEEK_SET)                   = 0
read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2717
lseek(3, 2717, SEEK_SET)                = 2717
close(3)                                = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0


The lookup function implementation in
nss/nss_files/files-XXX.c:DB_LOOKUP has code to prevent that.  It is
supposed skip closing the input file if it was already open.

  /* Reset file pointer to beginning or open file.  */       \
  status = internal_setent (keep_stream);       \
      \
  if (status == NSS_STATUS_SUCCESS)       \
    {       \
      /* Tell getent function that we have repositioned the file pointer.  */ \
      last_use = getby;       \
      \
      while ((status = internal_getent (result, buffer, buflen, errnop       \
H_ERRNO_ARG EXTRA_ARGS_VALUE))       \
     == NSS_STATUS_SUCCESS)       \
{ break_if_match }       \
      \
      if (! keep_stream)       \
internal_endent ();       \
    }       \

keep_stream is initialized from the stayopen flag in internal_setent.
internal_setent is called from the set*ent implementation as:

  status = internal_setent (stayopen);

However, for non-host database, this flag is always 0, per the
STAYOPEN magic in nss/getXXent_r.c.

Thus, the fix is this:

-  status = internal_setent (stayopen);
+  status = internal_setent (1);

This is not a behavioral change even for the hosts database (where the
application can specify the stayopen flag) because with a call to
sethostent(0), the file handle is still not closed in the
implementation of gethostent.

Conflicts:
NEWS

10 years agoCVE-2015-1781: resolv/nss_dns/dns-host.c buffer overflow [BZ#18287]
Arjun Shankar [Tue, 21 Apr 2015 12:06:31 +0000 (14:06 +0200)] 
CVE-2015-1781: resolv/nss_dns/dns-host.c buffer overflow [BZ#18287]

Conflicts:
NEWS
resolv/nss_dns/dns-host.c

10 years agoMerge branch 'release/2.19/master' into ibm/2.19/master
Tulio Magno Quites Machado Filho [Fri, 13 Mar 2015 15:13:50 +0000 (12:13 -0300)] 
Merge branch 'release/2.19/master' into ibm/2.19/master

10 years agopowerpc: Fix incorrect results for pow when using FMA
Adhemerval Zanella [Tue, 10 Mar 2015 13:38:54 +0000 (09:38 -0400)] 
powerpc: Fix incorrect results for pow when using FMA

This patch adds no FMA generation for e_pow to avoid precision issues
for powerpc.  This fixes BZ#18104.

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

Conflicts:
ChangeLog
NEWS

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

10 years agoLabel CVE-2014-9402 in NEWS
Allan McRae [Thu, 18 Dec 2014 01:01:43 +0000 (11:01 +1000)] 
Label CVE-2014-9402 in NEWS

10 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]

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

10 years agoMention CVE-2014-4043 in NEWS
Allan McRae [Sat, 21 Jun 2014 07:23:55 +0000 (17:23 +1000)] 
Mention CVE-2014-4043 in NEWS

10 years agoposix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)
Florian Weimer [Wed, 11 Jun 2014 21:12:52 +0000 (23:12 +0200)] 
posix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)

POSIX requires that we make a copy, so we allocate a new string
and free it in posix_spawn_file_actions_destroy.

Reported by David Reid, Alex Gaynor, and Glyph Lefkowitz.  This bug
may have security implications.

10 years ago_nl_find_locale: Improve handling of crafted locale names [BZ #17137]
Florian Weimer [Mon, 12 May 2014 13:24:12 +0000 (15:24 +0200)] 
_nl_find_locale: Improve handling of crafted locale names [BZ #17137]

Prevent directory traversal in locale-related environment variables
(CVE-2014-0475).

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 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 ago[AArch64] End frame record chain correctly.
Renlin Li [Tue, 11 Nov 2014 15:50:07 +0000 (15:50 +0000)] 
[AArch64] End frame record chain correctly.

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.

(cherry picked from commit 41488498b6d9440ee66ab033808cce8323bba7ac)

Conflicts:
NEWS
iconvdata/Makefile

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

(cherry picked from commit a1a6a401ab0a3c9f15fb7eaebbdcee24192254e8)
(cherry picked from commit f9df71e895d3552d557e783fdb9d133328195645)

Conflicts:
NEWS

10 years agoNEWS: Explain the s390 jmp_buf / ucontext_t ABI change reversal.
Stefan Liebler [Fri, 1 Aug 2014 07:48:17 +0000 (09:48 +0200)] 
NEWS: Explain the s390 jmp_buf / ucontext_t ABI change reversal.

(cherry picked from commit 95ee7fb13ba99ba265b49531c57e1cb8db629bc6)

Typo fix as in commit 45ef66289acbab17278a73512f9b2a9d8a7ca79d and
NEW enty adjusted to reflect revert occuring in 2.19.1 and 2.20.

Conflicts:
NEWS

10 years agoS/390: Revert the jmp_buf/ucontext_t ABI change
Stefan Liebler [Thu, 28 Aug 2014 06:53:13 +0000 (16:53 +1000)] 
S/390: Revert the jmp_buf/ucontext_t ABI change

Backport of commit 2f438e20ab591641760e97458d5d1569942eced5

10 years agomanual: Update the locale documentation
Florian Weimer [Wed, 28 May 2014 12:05:03 +0000 (14:05 +0200)] 
manual: Update the locale documentation

(cherry picked from commit 585367266923156ac6fb789939a923641ba5aaf4)

Conflicts:
manual/locale.texi

10 years ago_nl_find_locale: Improve handling of crafted locale names [BZ #17137]
Florian Weimer [Mon, 12 May 2014 13:24:12 +0000 (15:24 +0200)] 
_nl_find_locale: Improve handling of crafted locale names [BZ #17137]

Prevent directory traversal in locale-related environment variables
(CVE-2014-0475).

(cherry picked from commit 4e8f95a0df7c2300b830ec12c0ae1e161bc8a8a3)

Addiational backporting fixes:
  Added tst-setlocale3-ENV to localedata/Makefile

Conflicts:
NEWS
localedata/Makefile

10 years agosetlocale: Use the heap for the copy of the locale argument
Florian Weimer [Wed, 28 May 2014 12:41:52 +0000 (14:41 +0200)] 
setlocale: Use the heap for the copy of the locale argument

This avoids alloca calls with potentially large arguments.

(cherry picked from commit d183645616b0533b3acee28f1a95570bffbdf50f)

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

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

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

(cherry picked from commit c3ec475c5dd16499aa040908e11d382c3ded9692)

Conflicts:
NEWS

10 years agoProvide correct buffer length to netgroup queries in nscd (BZ #16695)
Siddhesh Poyarekar [Wed, 12 Mar 2014 11:57:22 +0000 (17:27 +0530)] 
Provide correct buffer length to netgroup queries in nscd (BZ #16695)

The buffer to query netgroup entries is allocated sufficient space for
the netgroup entries and the key to be appended at the end, but it
sends in an incorrect available length to the NSS netgroup query
functions, resulting in overflow of the buffer in some special cases.
The fix here is to factor in the key length when sending the available
buffer and buffer length to the query functions.

(cherry picked from commit c44496df2f090a56d3bf75df930592dac6bba46f)

Conflicts:
NEWS

10 years ago[BZ #16046] dl_iterate_phdr static executable test
Maciej W. Rozycki [Fri, 20 Jun 2014 20:52:53 +0000 (21:52 +0100)] 
[BZ #16046] dl_iterate_phdr static executable test

(cherry picked from commit 257ce7127e2f64a6a959b146786cd43de0e42b5f)

10 years agoFix another memory leak in regexp compiler (BZ #17069)
Andreas Schwab [Fri, 20 Jun 2014 10:41:27 +0000 (12:41 +0200)] 
Fix another memory leak in regexp compiler (BZ #17069)

(cherry picked from commit aa6ec754f3b4b1df81d186480c534b6486a1e6ee)

Conflicts:
NEWS

10 years agoFix memory leak in regexp compiler (BZ #17069)
Andreas Schwab [Thu, 19 Jun 2014 13:38:03 +0000 (15:38 +0200)] 
Fix memory leak in regexp compiler (BZ #17069)

(cherry picked from commit 4d43ef1e7434d7d419afbcd754931cb0c794763c)

Conflicts:
posix/Makefile

10 years agoFix invalid file descriptor reuse while sending DNS query (BZ #15946)
Andreas Schwab [Mon, 26 May 2014 16:01:31 +0000 (18:01 +0200)] 
Fix invalid file descriptor reuse while sending DNS query (BZ #15946)

(cherry picked from commit f9d2d03254a58d92635a311a42253eeed5a40a47)

Conflicts:
NEWS

10 years agoProperly fix memory leak in _nss_dns_gethostbyname4_r with big DNS answer
Andreas Schwab [Tue, 18 Feb 2014 09:57:25 +0000 (10:57 +0100)] 
Properly fix memory leak in _nss_dns_gethostbyname4_r with big DNS answer

Instead of trying to guess whether the second buffer needs to be freed
set a flag at the place it is allocated

(cherry picked from commit ab09bf616ad527b249aca5f2a4956fd526f0712f)

10 years agoDeduplicate resolv/nss_dns/dns-host.c
Ondřej Bílka [Sun, 16 Feb 2014 11:59:23 +0000 (12:59 +0100)] 
Deduplicate resolv/nss_dns/dns-host.c

In resolv/nss_dns/dns-host.c one of code path duplicated code after
that. We merge these paths.

(cherry picked from commit ab7ac0f2cf8731fe4c3f3aea6088a7c0127b5725)

10 years agoFix memory leak in _nss_dns_gethostbyname4_r with big DNS answer
Andreas Schwab [Thu, 13 Feb 2014 10:01:57 +0000 (11:01 +0100)] 
Fix memory leak in _nss_dns_gethostbyname4_r with big DNS answer

(cherry picked from commit d668061994a7486a3ba9c7d5e7882d85a2883707)

Conflicts:
NEWS

10 years agoFix unbound stack use in NIS NSS module
Andreas Schwab [Thu, 8 May 2014 14:53:01 +0000 (16:53 +0200)] 
Fix unbound stack use in NIS NSS module

(cherry picked from commit 315eb1d86aea489cd6325fd1c2521dcfb4fc0e1c)

Conflicts:
NEWS

10 years agoMention CVE-2014-4043 in NEWS
Allan McRae [Sat, 21 Jun 2014 07:23:55 +0000 (17:23 +1000)] 
Mention CVE-2014-4043 in NEWS

(cherry picked from commit d03efb2f979defd473955a455d66b949961d26b2)

Conflicts:
NEWS

10 years agoposix_spawn_faction_addopen: Add missing string.h include directive
Stefan Liebler [Thu, 12 Jun 2014 12:15:25 +0000 (14:15 +0200)] 
posix_spawn_faction_addopen: Add missing string.h include directive

This is needed to avoid a PLT call on s390.

(cherry picked from commit 35a5e3e338ae17f3d42c60a708763c5d498fb840)

10 years agoPowerPC: Fix gprof entry point for LE
Adhemerval Zanella [Tue, 29 Jul 2014 18:56:44 +0000 (13:56 -0500)] 
PowerPC: Fix gprof entry point for LE

This patch fixes the ELFv2 gprof entry point since the ABI
does not define function descriptors.  It fixes BZ#17213.

This is a backport of a53fbd8e6cd2f69bdfa3431d616a5f332aea6664.

10 years agoCorrect DT_PPC64_NUM
Alan Modra [Mon, 14 Jul 2014 11:44:50 +0000 (21:14 +0930)] 
Correct DT_PPC64_NUM

[BZ #17153]
* elf/elf.h (DT_PPC64_NUM): Correct value.
* NEWS: Add to fixed bug list.

This is a backport of f6c44d475104e931bab2b4ffa499961088de673c.

10 years agoPowerPC: Cleanup powerpc memmove
Adhemerval Zanella [Tue, 8 Jul 2014 13:54:09 +0000 (08:54 -0500)] 
PowerPC: Cleanup powerpc memmove

Now that MEMCPY_OK_FOR_FWD_MEMMOVE should be define on memcopy.h there
is no need to specialized powerpc memmove implementation.  This patch
moves the define set to powerpc memcopy and cleanup its definition on
powerpc code.

10 years agoPowerPC: Fix compiler warnings
Adhemerval Zanella [Tue, 8 Jul 2014 13:49:54 +0000 (08:49 -0500)] 
PowerPC: Fix compiler warnings

This patch fixes some compiler due trailing data in #undef directives
and due missing prototypes.

10 years agoPowerPC: Add ifunc tests for memmove
Adhemerval Zanella [Tue, 8 Jul 2014 13:35:44 +0000 (08:35 -0500)] 
PowerPC: Add ifunc tests for memmove

This patch add the missing ifunc tests definition for memmove ppc32
optimization patch (commit 07aedd7).

This is a backport of 91f4b564bd7bedcd93e7047cad570ce292d6330b.

10 years agoPowerPC: Align power7 memcpy using VSX to quadword
Adhemerval Zanella [Wed, 25 Jun 2014 16:54:31 +0000 (11:54 -0500)] 
PowerPC: Align power7 memcpy using VSX to quadword

This patch changes power7 memcpy to use VSX instructions only when
memory is aligned to quardword.  It is to avoid unaligned kernel traps
on non-cacheable memory (for instance, memory-mapped I/O).

10 years agoPowerPC: optimized memmove for POWER7/PPC32
Adhemerval Zanella [Tue, 24 Jun 2014 13:47:52 +0000 (08:47 -0500)] 
PowerPC: optimized memmove for POWER7/PPC32

This patch adds a optimized memmove for power7 by using the optimized
power7 memcpy for forward copying.

10 years agoPowerPC: optimized memmove for POWER7/PPC64
Adhemerval Zanella [Fri, 20 Jun 2014 17:55:16 +0000 (12:55 -0500)] 
PowerPC: optimized memmove for POWER7/PPC64

This patch adds an optimized memmove optimization for POWER7/powerpc64.
Basically the idea is to use the memcpy for POWER7 on non-overlapped
memory regions and a optimized backward memcpy for memory regions
that overlap (similar to the idea of string/memmove.c).

The backward memcpy algorithm used is similar the one use for memcpy for
POWER7, with adjustments done for alignment.  The difference is memory
is always aligned to 16 bytes before using VSX/altivec instructions.

10 years agoPowerPC: memmove default implementation cleanup
Adhemerval Zanella [Tue, 24 Jun 2014 11:42:31 +0000 (06:42 -0500)] 
PowerPC: memmove default implementation cleanup

This patch removes the powerpc specific logic in memmove and instead
include default implementation with MEMCPY_OK_FOR_FWD_MEMMOVE defined.
This lead in a increase performance, since the constraints to use
memcpy in powerpc code are too restrictive and memcpy can be used for
any forward memmove.

This is a backport of d6f68bbef4427850c2901728a1d13efc0e687297.

10 years agoPowerPC: strcat optimization for PPC64/POWER7
Vidya Ranganathan [Thu, 12 Jun 2014 03:21:20 +0000 (22:21 -0500)] 
PowerPC: strcat optimization for PPC64/POWER7

This patch adds an ifunc power7 strcat symbol that uses the logic on
sysdeps/powerpc/strcat.c but call power7 strlen/strcpy symbols instead
of default ones.

This is a backport of bc8ea38590070604006399e42469087e943fc8ec.

10 years agoPowerPC: sync hwcap.h capabilities
Adhemerval Zanella [Mon, 23 Jun 2014 14:38:47 +0000 (09:38 -0500)] 
PowerPC: sync hwcap.h capabilities

Linux commit dd58a092c4202f2bd490adab7285b3ff77f8e467 added the
PPC_FEATURE2_VEC_CRYPTO auvx capability to indicate whether to
hardware supports vector crypto hardware instructions.  This patch
adds its definition to powerpc hwcap bits.

This is a backport of db22400947e1c82153e5270d23fed53fc1e3a659.

10 years agoPowerPC: Fix nearbyintl failure for few inputs
Rajalakshmi Srinivasaraghavan [Tue, 17 Jun 2014 13:46:25 +0000 (08:46 -0500)] 
PowerPC: Fix nearbyintl failure for few inputs

This patch fixes few failures in nearbyintl() where the fraction part is
close to 0.5.i  The new tests added report few extra failures in
nearbyint_downward and nearbyint_towardzero which is a known issue.

Fixes #17031.

This is a backport of 754c5a08aacb44895d1ab97c553ce424eb43f761.

11 years agoposix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)
Florian Weimer [Wed, 11 Jun 2014 21:12:52 +0000 (23:12 +0200)] 
posix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)

POSIX requires that we make a copy, so we allocate a new string
and free it in posix_spawn_file_actions_destroy.

Reported by David Reid, Alex Gaynor, and Glyph Lefkowitz.  This bug
may have security implications.

(cherry picked from commit 89e435f3559c53084498e9baad22172b64429362)

Conflicts:
NEWS

11 years agoPowerPC: Optimized strcmp for PPC64/POWER7
Vidya Ranganathan [Fri, 6 Jun 2014 12:56:07 +0000 (07:56 -0500)] 
PowerPC: Optimized strcmp for PPC64/POWER7

Optimization is achieved on 8 byte aligned strings with double word
comparison using cmpb instruction. On unaligned strings loop unrolling
is applied for Power7 gain.

It is a backport of e23d3d2690bf63207b1a47e83a94693daebbbfe5.

11 years agoPowerPC: Fix optimized strncat strlen call
Adhemerval Zanella [Fri, 6 Jun 2014 14:37:07 +0000 (09:37 -0500)] 
PowerPC: Fix optimized strncat strlen call

This patch fixes the optimized ppc64/power7 strncat strlen call for
static build without ifunc enabled.  The strlen symbol to call in such
situation is just strlen, instead of __GI_strlen (since the __GI_
alias is just created for shared objects).

It is a backport of ed36bfa18faf9be457575568e64b8409e46caa22.

11 years agoPowerPC: Fix --disable-multi-arch builds
Adhemerval Zanella [Tue, 8 Apr 2014 22:25:14 +0000 (17:25 -0500)] 
PowerPC: Fix --disable-multi-arch builds

This patch fixes some powerpc32 and powerpc64 builds with
--disable-multi-arch option along with different --with-cpu=powerN.
It cleanups the Implies directories by removing the multiarch
folder for non multiarch config and also fixing two assembly
implementations: powerpc64/power7/strncat.S that is calling the
wrong strlen; and power8/fpu/s_isnan.S that misses the hidden_def and
weak_alias directives.

It is a backport of de21c33c068c8e39afb5711613a7c083c11ce6a1.

11 years agoFixed pthread_spin_lock on sparc32/64 (bug 16882)
Guo Yixuan [Tue, 3 Jun 2014 23:19:11 +0000 (16:19 -0700)] 
Fixed pthread_spin_lock on sparc32/64 (bug 16882)

[BZ #16882]
* nptl/sysdeps/sparc/sparc32/pthread_spin_lock.S
(pthread_spin_lock): Branch out of spin loop to proper location.
* nptl/sysdeps/sparc/sparc64/pthread_spin_lock.S
(pthread_spin_lock): Likewise.

* nptl/tst-spin4.c: New test.
* nptl/Makefile (tests): Add tst-spin4.

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

This patch replaces the insrdi by insrwi in powerpc32 assembly.

It is a backport of d298c41635ce7f2dc7c3eccc842fe3aa754c0c8e.

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

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

Backport of 3d2badacf185fac740a2992240a817fb2ca325af.

11 years agoaarch64: Merge __local_multiple_threads offset with memory reference
Richard Henderson [Wed, 21 May 2014 17:24:03 +0000 (13:24 -0400)] 
aarch64: Merge __local_multiple_threads offset with memory reference

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

Cherry-pick of a6b3657be6bc5067aeec98d990f60765361c6557.

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

This patch moves the hypotf multiarch implementation to correct path.

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

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

11 years agotzselect: use zonedir instead of current working directory
Sami Kerola [Tue, 13 May 2014 17:38:32 +0000 (19:38 +0200)] 
tzselect: use zonedir instead of current working directory

(cherry picked from commit 893b4f375668c025cbd6828f82a8844edda276d1)
(cherry picked from commit c72399fbc5228580a560d8fe319ff98150928b05)

Conflicts:
timezone/Makefile

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

(cherry picked from commit d51d659d114e2edb0037b2af45d6ee36458e48d1)

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

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

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

(cherry picked from commit d16e6ec7ca2c861ba681e3a2fbd431725774292e)

11 years agoSPARC: add EFD_SEMAPHORE in <bits/eventfd.h> (BZ #16916)
Aurelien Jarno [Tue, 6 May 2014 21:31:44 +0000 (23:31 +0200)] 
SPARC: add EFD_SEMAPHORE in <bits/eventfd.h> (BZ #16916)

EFD_SEMAPHORE has been added in the main <bits/eventfd.h>, but not in
the SPARC specific version. Fix that.

(cherry picked from commit 83df9ad0cc861ef24f08a88c5a4c055e2516d33c)

11 years agoPowerPC: strncpy/stpncpy optimization for PPC64/POWER7
Vidya Ranganathan [Tue, 6 May 2014 00:10:45 +0000 (19:10 -0500)] 
PowerPC: strncpy/stpncpy optimization for PPC64/POWER7

The optimization is achieved by following techniques:
  > data alignment [gain from aligned memory access on read/write]
  > POWER7 gains performance with loop unrolling/unwinding
    [gain by reduction of branch penalty].
  > zero padding done by calling optimized memset

11 years agoPowerPC: ifunc improvement for internal calls
Adhemerval Zanella [Fri, 2 May 2014 17:00:36 +0000 (12:00 -0500)] 
PowerPC: ifunc improvement for internal calls

This patch changes de default symbol redirection for internal call of
memcpy, memset, memchr, and strlen to the IFUNC resolved ones.  The
performance improvement is noticeable in algorithms that uses these
symbols extensible, like the regex functions.

This is a backport of 19c4bec0f43599eecc2f32de96ae179cd7d64053.

11 years agomisc/sys/xattr.h: guard against linux uapi header inclusion
Serge Hallyn [Tue, 11 Mar 2014 04:17:07 +0000 (23:17 -0500)] 
misc/sys/xattr.h: guard against linux uapi header inclusion

If the glibc xattr.h header is included after the uapi header,
compilation fails due to an enum re-using a #define from the
uapi header.  Protect against this by guarding the define and
enum inclusions against each other.

(A corresponding kernel patch has been sent here:
http://lkml.org/lkml/2014/3/7/331 )

(See https://lists.debian.org/debian-glibc/2014/03/msg00029.html
and https://sourceware.org/glibc/wiki/Synchronizing_Headers
for more information.)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
(cherry picked from commit fdbe8eae2b9aed74dabba1b0a189c5d7d61bf032)

11 years agoUpdate Esperanto translations
Allan McRae [Sun, 4 May 2014 03:35:16 +0000 (13:35 +1000)] 
Update Esperanto translations

(cherry picked from commit d69aeb123961252ddd2a23acc7dc9ce0ae2cfa5f)

11 years agoNEWS: Add 16885 to fixed bug list.
David S. Miller [Thu, 1 May 2014 20:44:59 +0000 (16:44 -0400)] 
NEWS: Add 16885 to fixed bug list.

11 years agoFix v9/64-bit strcmp when string ends in multiple zero bytes.
David S. Miller [Wed, 30 Apr 2014 19:57:51 +0000 (12:57 -0700)] 
Fix v9/64-bit strcmp when string ends in multiple zero bytes.

[BZ #16885]
* sysdeps/sparc/sparc64/strcmp.S: Fix end comparison handling when
multiple zero bytes exist at the end of a string.
Reported by Aurelien Jarno <aurelien@aurel32.net>

* string/test-strcmp.c (check): Add explicit test for situations where
there are multiple zero bytes after the first.

11 years agoCorrect IBM long double frexpl.
Alan Modra [Wed, 16 Apr 2014 10:03:32 +0000 (19:33 +0930)] 
Correct IBM long double frexpl.

Besides fixing the bugzilla, this also fixes corner-cases where the high
and low double differ greatly in magnitude, and handles a denormal
input without resorting to a fp rescale.

[BZ #16740]
[BZ #16619]
* sysdeps/ieee754/ldbl-128ibm/s_frexpl.c (__frexpl): Rewrite.
* math/libm-test.inc (frexp_test_data): Add tests.

Backport of aa5f0ff11ad2cc85277c64cf65c723a9664e1149 and
9860b0450275ad2b69cb9360fd01d5c122a65fc5.

11 years agoPowerPC: Fix nearbyint/nearbyintf result for FE_DOWNWARD
Adhemerval Zanella [Sun, 6 Apr 2014 19:50:11 +0000 (14:50 -0500)] 
PowerPC: Fix nearbyint/nearbyintf result for FE_DOWNWARD

This patch fixes the powerpc32 optimized nearbyint/nearbyintf bogus
results for FE_DOWNWARD rounding mode.  This is due wrong instructions
sequence used in the rounding calculation (two subtractions instead of
adition and a subtraction).

Fixes BZ#16815.

Backport of 8bd70862e11023e7f827f240a5a214f847ae982d.

11 years agoCorrect IBM long double nextafterl.
Alan Modra [Wed, 2 Apr 2014 03:16:19 +0000 (13:46 +1030)] 
Correct IBM long double nextafterl.

Fix for values near a power of two, and some tidies.

[BZ #16739]
* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Correct
output when value is near a power of two.  Use int64_t for lx and
remove casts.  Use decimal rather than hex exponent constants.
Don't use long double multiplication when double will suffice.
* math/libm-test.inc (nextafter_test_data): Add tests.
* NEWS: Add 16739 and 16786 to bug list.

Backport of b0abbc21034f0e5edc49023d8fda0616173faf17.

11 years agoCorrect prefetch hint in power7 memrchr.
Alan Modra [Wed, 2 Apr 2014 03:12:27 +0000 (13:42 +1030)] 
Correct prefetch hint in power7 memrchr.

Typo fix.

* sysdeps/powerpc/powerpc64/power7/memrchr.S: Correct stream hint.

Backport of af6b17973cbc07ac06cfb40eeab5cc2391fb489a.

11 years agoFix reference to toc symbol.
Alan Modra [Wed, 2 Apr 2014 03:10:21 +0000 (13:40 +1030)] 
Fix reference to toc symbol.

https://sourceware.org/ml/binutils/2014-03/msg00033.html removes the
"magic" treatment of symbols defined in a .toc section.

* sysdeps/powerpc/powerpc64/start.S: Add @toc to toc symbol reference.

Backport of 483818d768ed99a5edf4114298a75ebedaee8d5c.

11 years agoFix s_copysign stack temp for PowerPC64 ELFv2
Alan Modra [Tue, 1 Apr 2014 03:37:42 +0000 (14:07 +1030)] 
Fix s_copysign stack temp for PowerPC64 ELFv2

[BZ #16786]
* sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Don't trash stack.

Backport of c859b32e9d76afe8a3f20bb9528961a573c06937.

11 years agoPowerPC: Fix little endian enconding for mfvsrd
Adhemerval Zanella [Mon, 31 Mar 2014 13:07:55 +0000 (08:07 -0500)] 
PowerPC: Fix little endian enconding for mfvsrd

This patch fixes the MFVSRD_R3_V1 macro that encodes 'mfvsrd  r3,vs1'
(to support old binutils) for little endian.

Backport of 757d9dd5c3efa56fac75965abc014faaae7b7895.

11 years agoPowerPC: optimized strpbrk for POWER7
Adhemerval Zanella [Thu, 20 Mar 2014 20:28:07 +0000 (15:28 -0500)] 
PowerPC: optimized strpbrk for POWER7

This patch add an optimized strpbrk for POWER7 by using a different
algorithm than default implementation: it constructs a table based on
the 'accept' argument and use this table to check for any occurance on
the input string. The idea is similar as x86_64 uses.
For PowerPC some tunings were added, such as unroll loops and memory
clear using VSX instructions.

Backport of 6f23d0939e9651d8ac3c77a835fb6464b35a1dc4

11 years agoPowerPC: optimized strcspn for PPC64/POWER7
Adhemerval Zanella [Thu, 20 Mar 2014 16:24:52 +0000 (11:24 -0500)] 
PowerPC: optimized strcspn for PPC64/POWER7

This patch add a optimized strcspn for POWER7 by using a different
algorithm than default implementation: it constructs a table based on
the 'accept' argument and use this table to check for any occurance
on the input string. The idea is similar as x86_64 uses.
For PowerPC some tunings were added, such as unroll loops and align
stack memory to table to 16 bytes (so VSX clean can ran without
alignment issues).

Backport of 6eaf95cbfa0031ea267682dc2c9c17ed3e3dc167

11 years agoPowerPC: remove wrong roundl implementation for PowerPC64
Adhemerval Zanella [Fri, 14 Mar 2014 17:49:45 +0000 (12:49 -0500)] 
PowerPC: remove wrong roundl implementation for PowerPC64

The roundl assembly implementation
(sysdeps/powerpc/powerpc64/fpu/s_roundl.S)
returns wrong results for some inputs where first double is a exact
integer and the precision is determined by second long double.

Checking on implementation comments and history, I am very confident the
assembly implementation was based on a version before commit
5c68d401698a58cf7da150d9cce769fa6679ba5f that fixes BZ#2423 (Errors in
long double (ldbl-128ibm) rounding functions in glibc-2.4).

By just removing the implementation and make the build select
sysdeps/ieee754/ldbl-128ibm/s_roundl.c instead fixes the failing math.

This fixes 16707.

Backport of c7de50250367167d8c9f35594b264f6a0af8dd0c

11 years agoPowerPC: remove wrong nearbyintl implementation for PPC64
Adhemerval Zanella [Fri, 14 Mar 2014 17:27:52 +0000 (12:27 -0500)] 
PowerPC: remove wrong nearbyintl implementation for PPC64

The nearbyintl assembly implementation
(sysdeps/powerpc/powerpc64/fpu/s_nearbyintl.S)
returns wrong results for some inputs where first double is a exact
integer and the precision is determined by second long double.

Checking on implementation comments and history, I am very confident the
assembly implementation was based on a version before commit
5c68d401698a58cf7da150d9cce769fa6679ba5f that fixes BZ#2423 (Errors in
long double (ldbl-128ibm) rounding functions in glibc-2.4).

By just removing the implementation and make the build select
sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c instead fixes the failing
math.

Fixes BZ#16706.

Backport of 98fb27a373f37554232e0060eef1a5bb00a07eb0

11 years agoPowerPC: remove wrong ceill implementation for PowerPC64
Adhemerval Zanella [Fri, 14 Mar 2014 12:35:43 +0000 (07:35 -0500)] 
PowerPC: remove wrong ceill implementation for PowerPC64

The ceill assembly implementation (sysdeps/powerpc/powerpc64/fpu/s_ceill.S)
returns wrong results for some inputs where first double is a exact
integer and the precision is determined by second long double.

Checking on implementation comments and history, I am very confident the
assembly implementation was based on a version before commit
5c68d401698a58cf7da150d9cce769fa6679ba5f that fixes BZ#2423 (Errors in
long double (ldbl-128ibm) rounding functions in glibc-2.4).

By just removing the implementation and make the build select
sysdeps/ieee754/ldbl-128ibm/s_ceill.c instead fixes the failing math.

Fixes BZ#16701.

Backport of 374f7f61214967bb4e2257695aeeeecc2a77f369

11 years agoAdd truncl tests related to BZ#16414
Adhemerval Zanella [Fri, 14 Mar 2014 17:15:40 +0000 (12:15 -0500)] 
Add truncl tests related to BZ#16414

Backport of 4655c291d1808c35b7c54236ae62be7a3aaa0a2d

11 years agoPowerPC: Fix bzero definition for static libc for PPC32
Adhemerval Zanella [Wed, 12 Mar 2014 13:55:50 +0000 (08:55 -0500)] 
PowerPC: Fix bzero definition for static libc for PPC32

This patch fixes an issue for powerpc32-fpu static build which fails
with an 'bzero' undefined reference. This patch adds bzero ifunc selector
for static builds and fixes the '__bzero_ppc' reference to default
memset symbol (since static memset build does not provide ifunc
selector).

Fixes BZ#16689.

Backport of dd3946c615184e1957a0cb09352cac72be5d6d5b.

11 years agoPowerPC: Fix strspn for static build
Adhemerval Zanella [Tue, 11 Mar 2014 21:17:50 +0000 (16:17 -0500)] 
PowerPC: Fix strspn for static build

This patch makes the strspn ifunc selector build for static builds.

This is a backport of 27c7220a483bda576533aa9a0a9b42175644b1a1

11 years agoPowerPC: Fix bzero definition for static libc for PPC64
Adhemerval Zanella [Mon, 10 Mar 2014 20:26:20 +0000 (15:26 -0500)] 
PowerPC: Fix bzero definition for static libc for PPC64

This patch fixes an issue for powerpc64[le] static build where __bzero
is definied in multiple places (memset-ppc64.o and bzero.o). It is now
defined only in bzero.o and memset-ppc64.o only defined __bzero_ppc for
both dynamic and static library.

Fixes BZ#16683.

Backport of 4facea473059914983b7da8dd654c06b8e3dcc41

11 years agoPowerPC: strspn optimization for PPC64/POWER7
Vidya Ranganathan [Mon, 10 Mar 2014 16:20:36 +0000 (12:20 -0400)] 
PowerPC: strspn optimization for PPC64/POWER7

The optimization is achieved by following techniques:
  > hashing of needle.
  > hashing avoids scanning of duplicate entries in needle across the string.
  > initializing the hash table with Vector instructions (VSX) by quadword access.
  > unrolling when scanning for character in string across hash table.

11 years agoPowerPC: strncat optimization for PPC64
Adhemerval Zanella [Fri, 7 Mar 2014 12:09:47 +0000 (06:09 -0600)] 
PowerPC: strncat optimization for PPC64

The optimization is achieved by following techniques:
1. Doubleword aligned memory access and compares using
   cmpb instruction.
2. Loop unrolling for byte load/store.
3. CPU pre-fetch to avoid cache miss.

Backport of ba9cc0714e58a9e8fa73cf6b0e205cbf1e6b71f2

11 years agoPowerPC: strrchr optimization for POWER7/PPC64
Rajalakshmi Srinivasaraghavan [Mon, 3 Mar 2014 14:06:41 +0000 (08:06 -0600)] 
PowerPC: strrchr optimization for POWER7/PPC64

This patch optimizes strrchr() for ppc64. It uses aligned memory
access along with cmpb instruction and CPU prefetch to avoid
cache misses for speed improvement.

Backport of c7debbdfacbef150aaf9113eb05ccaf2b9e7af6c

11 years agoPowerPC: llround/llroundf POWER8 optimization
Adhemerval Zanella [Mon, 17 Feb 2014 16:44:08 +0000 (10:44 -0600)] 
PowerPC: llround/llroundf POWER8 optimization

This patch add a optimized llround/llroundf implementation for POWER8
using the new Move From VSR Doubleword instruction to gains some
cycles from FP to GRP register move.

Backport fe13a20c37578f08ce393ccaeb45caeb48815ca5