summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-05-05 11:06:02 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-05-05 11:06:02 +0000
commit9dffe5df04949a0dd0f37832415009bf84d882b6 (patch)
tree5218a6b2ebaaa2dcd1c1e55e6858ccacda03397e /libc/sysdeps
parentc46d4a9b60ba79c321ab9075f71751389808a15a (diff)
Merge changes between r13354 and r13697 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@13698 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/generic/tls.h4
-rw-r--r--libc/sysdeps/i386/dl-tls.h5
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S2
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memcpy-ssse3.S2
-rw-r--r--libc/sysdeps/i386/stpncpy.S4
-rw-r--r--libc/sysdeps/ia64/dl-tls.h5
-rw-r--r--libc/sysdeps/ia64/fpu/libm_lgammal.S2
-rw-r--r--libc/sysdeps/ia64/fpu/s_erfcl.S2
-rw-r--r--libc/sysdeps/ia64/fpu/s_expm1l.S2
-rw-r--r--libc/sysdeps/ia64/memcmp.S4
-rw-r--r--libc/sysdeps/ia64/strcpy.S4
-rw-r--r--libc/sysdeps/mach/hurd/fchflags.c4
-rw-r--r--libc/sysdeps/mach/hurd/fchmod.c4
-rw-r--r--libc/sysdeps/mach/hurd/ftruncate.c4
-rw-r--r--libc/sysdeps/posix/getaddrinfo.c73
-rw-r--r--libc/sysdeps/powerpc/dl-tls.h5
-rw-r--r--libc/sysdeps/powerpc/powerpc32/dl-machine.c4
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/memcpy.S98
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/strncmp.S24
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power6/memcpy.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/strncmp.S13
-rw-r--r--libc/sysdeps/powerpc/powerpc32/strncmp.S14
-rw-r--r--libc/sysdeps/powerpc/powerpc64/memcpy.S74
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power4/memcmp.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power4/memcpy.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power4/strncmp.S24
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power6/memcpy.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power7/memcmp.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power7/strncmp.S13
-rw-r--r--libc/sysdeps/powerpc/powerpc64/strchr.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/strcmp.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/strcpy.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/strlen.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/strncmp.S4
-rw-r--r--libc/sysdeps/s390/dl-tls.h7
-rw-r--r--libc/sysdeps/s390/s390-32/elf/start.S12
-rw-r--r--libc/sysdeps/s390/s390-64/utf16-utf32-z9.c5
-rw-r--r--libc/sysdeps/s390/s390-64/utf8-utf16-z9.c5
-rw-r--r--libc/sysdeps/s390/s390-64/utf8-utf32-z9.c5
-rw-r--r--libc/sysdeps/sh/dl-tls.h5
-rw-r--r--libc/sysdeps/sparc/dl-tls.h5
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/time.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/check_pf.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/ftruncate64.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/sysconf.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/ifaddrs.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/pathconf.c19
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c16
-rw-r--r--libc/sysdeps/unix/sysv/linux/sys/syscall.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/truncate64.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S26
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S3
-rw-r--r--libc/sysdeps/x86_64/Versions5
-rw-r--r--libc/sysdeps/x86_64/cacheinfo.c2
-rw-r--r--libc/sysdeps/x86_64/dl-tls.h5
-rw-r--r--libc/sysdeps/x86_64/memcpy.S11
-rw-r--r--libc/sysdeps/x86_64/memmove.c27
-rw-r--r--libc/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S2
-rw-r--r--libc/sysdeps/x86_64/multiarch/memcpy-ssse3.S2
-rw-r--r--libc/sysdeps/x86_64/multiarch/memcpy.S12
-rw-r--r--libc/sysdeps/x86_64/multiarch/memmove.c8
67 files changed, 387 insertions, 273 deletions
diff --git a/libc/sysdeps/generic/tls.h b/libc/sysdeps/generic/tls.h
index 06e41ad12..aa7f9aa57 100644
--- a/libc/sysdeps/generic/tls.h
+++ b/libc/sysdeps/generic/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. Generic version.
- Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -71,6 +71,6 @@
THREAD_DTV()
This macro returns the address of the DTV of the current thread.
- This normally is done using the the thread register which points
+ This normally is done using the thread register which points
to the dtv or the TCB (from which the DTV can found).
*/
diff --git a/libc/sysdeps/i386/dl-tls.h b/libc/sysdeps/i386/dl-tls.h
index 58705c778..21b949bd1 100644
--- a/libc/sysdeps/i386/dl-tls.h
+++ b/libc/sysdeps/i386/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. i386 version.
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,3 +58,6 @@ strong_alias (___tls_get_addr, ___tls_get_addr_internal)
# endif
#endif
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S b/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
index 48a109ccd..8e8118382 100644
--- a/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
+++ b/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
@@ -110,7 +110,7 @@ __i686.get_pc_thunk.bx:
#endif
.section .text.ssse3,"ax",@progbits
-#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BCOPY
+#if !defined USE_AS_BCOPY
ENTRY (MEMCPY_CHK)
movl 12(%esp), %eax
cmpl %eax, 16(%esp)
diff --git a/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3.S b/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
index ec9eeb95e..f64f8d214 100644
--- a/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
+++ b/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
@@ -110,7 +110,7 @@ __i686.get_pc_thunk.bx:
#endif
.section .text.ssse3,"ax",@progbits
-#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BCOPY
+#if !defined USE_AS_BCOPY
ENTRY (MEMCPY_CHK)
movl 12(%esp), %eax
cmpl %eax, 16(%esp)
diff --git a/libc/sysdeps/i386/stpncpy.S b/libc/sysdeps/i386/stpncpy.S
index c163a3359..8a3633bcb 100644
--- a/libc/sysdeps/i386/stpncpy.S
+++ b/libc/sysdeps/i386/stpncpy.S
@@ -1,7 +1,7 @@
/* copy no more then N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
- Copyright (C) 1994-1997,2000,2002,2005 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997,2000,2002,2005,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
@@ -56,7 +56,7 @@ ENTRY (BP_SYM (__stpncpy))
ALIGN(4)
/* Four times unfolded loop with two loop counters. We get the
- the third value (the source address) by using the index+base
+ third value (the source address) by using the index+base
addressing mode. */
L(2): movb (%eax,%esi), %dl /* load current char */
movb %dl, (%eax) /* and store it */
diff --git a/libc/sysdeps/ia64/dl-tls.h b/libc/sysdeps/ia64/dl-tls.h
index 26f3d2adf..5e9a165d7 100644
--- a/libc/sysdeps/ia64/dl-tls.h
+++ b/libc/sysdeps/ia64/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. IA-64 version.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,3 +28,6 @@
#define DONT_USE_TLS_INDEX 1
extern void *__tls_get_addr (size_t m, size_t offset);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libc/sysdeps/ia64/fpu/libm_lgammal.S b/libc/sysdeps/ia64/fpu/libm_lgammal.S
index 407b3452c..351befb14 100644
--- a/libc/sysdeps/ia64/fpu/libm_lgammal.S
+++ b/libc/sysdeps/ia64/fpu/libm_lgammal.S
@@ -7463,7 +7463,7 @@ lgammal_spec:
{ .mfb
nop.m 0
nop.f 0
- // branch out if if x is natval, nan, +inf
+ // branch out if x is natval, nan, +inf
(p6) br.cond.spnt lgammal_nan_pinf
};;
{ .mfb
diff --git a/libc/sysdeps/ia64/fpu/s_erfcl.S b/libc/sysdeps/ia64/fpu/s_erfcl.S
index 266e1e1c9..31ffc2db1 100644
--- a/libc/sysdeps/ia64/fpu/s_erfcl.S
+++ b/libc/sysdeps/ia64/fpu/s_erfcl.S
@@ -168,7 +168,7 @@
// Case exp_small:
//
// Here, exp(X) and exp(X) - 1 can all be
-// appproximated by a relatively simple polynomial.
+// approximated by a relatively simple polynomial.
//
// This polynomial resembles the truncated Taylor series
//
diff --git a/libc/sysdeps/ia64/fpu/s_expm1l.S b/libc/sysdeps/ia64/fpu/s_expm1l.S
index 5f135faf6..a3a6e401e 100644
--- a/libc/sysdeps/ia64/fpu/s_expm1l.S
+++ b/libc/sysdeps/ia64/fpu/s_expm1l.S
@@ -139,7 +139,7 @@
// Case exp_small:
//
// Here, exp(X) and exp(X) - 1 can all be
-// appproximated by a relatively simple polynomial.
+// approximated by a relatively simple polynomial.
//
// This polynomial resembles the truncated Taylor series
//
diff --git a/libc/sysdeps/ia64/memcmp.S b/libc/sysdeps/ia64/memcmp.S
index 2eed49a2e..fcc66d06a 100644
--- a/libc/sysdeps/ia64/memcmp.S
+++ b/libc/sysdeps/ia64/memcmp.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard memcmp() function.
This file is part of the GNU C Library.
- Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2004, 2011 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,7 @@
in1: src (aka s2)
in2: byte count
- In this form, it assumes little endian mode. For big endian mode, the
+ In this form, it assumes little endian mode. For big endian mode,
the two shifts in .l2 must be inverted:
shl tmp1[0] = r[1 + MEMLAT], sh1 // tmp1 = w0 << sh1
diff --git a/libc/sysdeps/ia64/strcpy.S b/libc/sysdeps/ia64/strcpy.S
index 8745c8e8e..5001f831c 100644
--- a/libc/sysdeps/ia64/strcpy.S
+++ b/libc/sysdeps/ia64/strcpy.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard strcpy() function.
This file is part of the GNU C Library.
- Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2003, 2011 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
in0: dest
in1: src
- In this form, it assumes little endian mode. For big endian mode, the
+ In this form, it assumes little endian mode. For big endian mode,
the two shifts in .l2 must be inverted:
shl value = r[1], sh1 // value = w0 << sh1
diff --git a/libc/sysdeps/mach/hurd/fchflags.c b/libc/sysdeps/mach/hurd/fchflags.c
index 71bcbf0c9..dbf19ba4b 100644
--- a/libc/sysdeps/mach/hurd/fchflags.c
+++ b/libc/sysdeps/mach/hurd/fchflags.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 97, 98, 11 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
#include <hurd.h>
#include <hurd/fd.h>
-/* Change the flags of the file FD refers to to FLAGS. */
+/* Change the flags of the file referenced by FD to FLAGS. */
/* XXX should be __fchflags? */
int
diff --git a/libc/sysdeps/mach/hurd/fchmod.c b/libc/sysdeps/mach/hurd/fchmod.c
index 025b09200..e8714dced 100644
--- a/libc/sysdeps/mach/hurd/fchmod.c
+++ b/libc/sysdeps/mach/hurd/fchmod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1994, 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1994, 1995, 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
#include <hurd.h>
#include <hurd/fd.h>
-/* Change the protections of the file FD refers to to MODE. */
+/* Change the permissions of the file referenced by FD to MODE. */
int
__fchmod (fd, mode)
int fd;
diff --git a/libc/sysdeps/mach/hurd/ftruncate.c b/libc/sysdeps/mach/hurd/ftruncate.c
index 404459e6d..b38393ea3 100644
--- a/libc/sysdeps/mach/hurd/ftruncate.c
+++ b/libc/sysdeps/mach/hurd/ftruncate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 97, 98, 11 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
#include <hurd.h>
#include <hurd/fd.h>
-/* Truncate the file FD refers to to LENGTH bytes. */
+/* Truncate the file referenced by FD to LENGTH bytes. */
int
__ftruncate (fd, length)
int fd;
diff --git a/libc/sysdeps/posix/getaddrinfo.c b/libc/sysdeps/posix/getaddrinfo.c
index c61c72a24..7bd89c45c 100644
--- a/libc/sysdeps/posix/getaddrinfo.c
+++ b/libc/sysdeps/posix/getaddrinfo.c
@@ -510,12 +510,10 @@ gaih_inet (const char *name, const struct gaih_service *service,
int no_more;
int old_res_options;
- /* If we do not have to look for IPv4 and IPv6 together, use
- the simple, old functions. */
- if (req->ai_family == AF_INET
- || (req->ai_family == AF_INET6
- && ((req->ai_flags & AI_V4MAPPED) == 0
- || (req->ai_flags & AI_ALL) == 0)))
+ /* If we do not have to look for IPv6 addresses, use
+ the simple, old functions, which do not support
+ IPv6 scope ids. */
+ if (req->ai_family == AF_INET)
{
int family = req->ai_family;
size_t tmpbuflen = 512;
@@ -525,7 +523,6 @@ gaih_inet (const char *name, const struct gaih_service *service,
struct hostent *h;
int herrno;
- simple_again:
while (1)
{
rc = __gethostbyname2_r (name, family, &th, tmpbuf,
@@ -537,44 +534,30 @@ gaih_inet (const char *name, const struct gaih_service *service,
if (rc == 0)
{
- if (h == NULL)
- {
- if (req->ai_family == AF_INET6
- && (req->ai_flags & AI_V4MAPPED)
- && family == AF_INET6)
- {
- /* Try again, this time looking for IPv4
- addresses. */
- family = AF_INET;
- goto simple_again;
- }
- }
- else
- {
- /* We found data, now convert it into the list. */
- for (int i = 0; h->h_addr_list[i]; ++i)
- {
- if (*pat == NULL)
- {
- *pat = __alloca (sizeof (struct gaih_addrtuple));
- (*pat)->scopeid = 0;
- }
- (*pat)->next = NULL;
- (*pat)->family = req->ai_family;
- if (family == req->ai_family)
- memcpy ((*pat)->addr, h->h_addr_list[i],
- h->h_length);
- else
- {
- uint32_t *addr = (uint32_t *) (*pat)->addr;
- addr[3] = *(uint32_t *) h->h_addr_list[i];
- addr[2] = htonl (0xffff);
- addr[1] = 0;
- addr[0] = 0;
- }
- pat = &((*pat)->next);
- }
- }
+ if (h != NULL)
+ /* We found data, now convert it into the list. */
+ for (int i = 0; h->h_addr_list[i]; ++i)
+ {
+ if (*pat == NULL)
+ {
+ *pat = __alloca (sizeof (struct gaih_addrtuple));
+ (*pat)->scopeid = 0;
+ }
+ (*pat)->next = NULL;
+ (*pat)->family = req->ai_family;
+ if (family == req->ai_family)
+ memcpy ((*pat)->addr, h->h_addr_list[i],
+ h->h_length);
+ else
+ {
+ uint32_t *addr = (uint32_t *) (*pat)->addr;
+ addr[3] = *(uint32_t *) h->h_addr_list[i];
+ addr[2] = htonl (0xffff);
+ addr[1] = 0;
+ addr[0] = 0;
+ }
+ pat = &((*pat)->next);
+ }
}
else
{
diff --git a/libc/sysdeps/powerpc/dl-tls.h b/libc/sysdeps/powerpc/dl-tls.h
index 957d4b4b9..9ab81f996 100644
--- a/libc/sysdeps/powerpc/dl-tls.h
+++ b/libc/sysdeps/powerpc/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. PowerPC version.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -47,3 +47,6 @@ extern void *__tls_get_addr (tls_index *ti);
# define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
# define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
#endif
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libc/sysdeps/powerpc/powerpc32/dl-machine.c b/libc/sysdeps/powerpc/powerpc32/dl-machine.c
index 33a010184..77cd0d5d6 100644
--- a/libc/sysdeps/powerpc/powerpc32/dl-machine.c
+++ b/libc/sysdeps/powerpc/powerpc32/dl-machine.c
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation functions. PowerPC version.
- Copyright (C) 1995-2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1995-2006, 2008, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -205,7 +205,7 @@ __elf_preferred_address (struct link_map *loader, size_t maplength,
(1) and (3), this is obvious because only one instruction is
changed and the PPC architecture guarantees that aligned stores are
atomic. For (5), this is more tricky. When changing (4) to (5),
- the `b' instruction is first changed to to `mtctr'; this is safe
+ the `b' instruction is first changed to `mtctr'; this is safe
and is why the `lwzu' instruction is not just a simple `addi'.
Once this is done, and is visible to all processors, the `lwzu' can
safely be changed to a `lwz'. */
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S b/libc/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S
index 8be3cf184..c03dfa37f 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S
+++ b/libc/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S
@@ -1,5 +1,5 @@
/* sqrt function. PowerPC32 version.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,7 +36,7 @@
This part of the function is a leaf routine, so no need to stack a
frame or execute prologue/epilogue code. This means it is safe to
transfer directly to w_sqrt as long as the input value (f1) is
- preserved. Putting the the sqrt result into f2 (double parameter 2)
+ preserved. Putting the sqrt result into f2 (double parameter 2)
allows passing both the input value and sqrt result into the extended
wrapper so there is no need to recompute.
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S b/libc/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S
index 9fa282c16..050323da5 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S
+++ b/libc/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S
@@ -1,5 +1,5 @@
/* sqrtf function. PowerPC32 version.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,7 +36,7 @@
This part of the function is a leaf routine, so no need to stack a
frame or execute prologue/epilogue code. This means it is safe to
transfer directly to w_sqrt as long as the input value (f1) is
- preserved. Putting the the sqrt result into f2 (float parameter 2)
+ preserved. Putting the sqrt result into f2 (float parameter 2)
allows passing both the input value and sqrt result into the extended
wrapper so there is no need to recompute.
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/memcpy.S b/libc/sysdeps/powerpc/powerpc32/power4/memcpy.S
index 73020c6da..d6c6e6851 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/power4/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC32 on PowerPC64.
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,10 +24,10 @@
/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
Returns 'dst'.
- Memcpy handles short copies (< 32-bytes) using a binary move blocks
- (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled
- with the appropriate combination of byte and halfword load/stores.
- There is minimal effort to optimize the alignment of short moves.
+ Memcpy handles short copies (< 32-bytes) using a binary move blocks
+ (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled
+ with the appropriate combination of byte and halfword load/stores.
+ There is minimal effort to optimize the alignment of short moves.
Longer moves (>= 32-bytes) justify the effort to get at least the
destination word (4-byte) aligned. Further optimization is
@@ -43,7 +43,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
stw 30,20(1)
cfi_offset(30,(20-32))
mr 30,3
- cmplwi cr1,5,31
+ cmplwi cr1,5,31
stw 31,24(1)
cfi_offset(31,(24-32))
neg 0,3
@@ -52,13 +52,13 @@ EALIGN (BP_SYM (memcpy), 5, 0)
clrlwi 10,4,30 /* check alignment of src. */
cmplwi cr6,5,8
ble- cr1,.L2 /* If move < 32 bytes use short move code. */
- cmplw cr6,10,11
+ cmplw cr6,10,11
mr 12,4
srwi 9,5,2 /* Number of full words remaining. */
mtcrf 0x01,0
mr 31,5
beq .L0
-
+
subf 31,0,5
/* Move 0-3 bytes as needed to get the destination word aligned. */
1: bf 31,2f
@@ -72,17 +72,17 @@ EALIGN (BP_SYM (memcpy), 5, 0)
sth 6,0(3)
addi 3,3,2
0:
- clrlwi 10,12,30 /* check alignment of src again. */
+ clrlwi 10,12,30 /* check alignment of src again. */
srwi 9,31,2 /* Number of full words remaining. */
-
- /* Copy words from source to destination, assuming the destination is
+
+ /* Copy words from source to destination, assuming the destination is
aligned on a word boundary.
At this point we know there are at least 25 bytes left (32-7) to copy.
- The next step is to determine if the source is also word aligned.
+ The next step is to determine if the source is also word aligned.
If not branch to the unaligned move code at .L6. which uses
a load, shift, store strategy.
-
+
Otherwise source and destination are word aligned, and we can use
the optimized word copy loop. */
.L0:
@@ -92,16 +92,16 @@ EALIGN (BP_SYM (memcpy), 5, 0)
/* Move words where destination and source are word aligned.
Use an unrolled loop to copy 4 words (16-bytes) per iteration.
- If the the copy is not an exact multiple of 16 bytes, 1-3
+ If the copy is not an exact multiple of 16 bytes, 1-3
words are copied as needed to set up the main loop. After
- the main loop exits there may be a tail of 1-3 bytes. These bytes are
+ the main loop exits there may be a tail of 1-3 bytes. These bytes are
copied a halfword/byte at a time as needed to preserve alignment. */
srwi 8,31,4 /* calculate the 16 byte loop count */
cmplwi cr1,9,4
cmplwi cr6,11,0
mr 11,12
-
+
bf 30,1f
lwz 6,0(12)
lwz 7,4(12)
@@ -112,7 +112,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
addi 10,3,8
bf 31,4f
lwz 0,8(12)
- stw 0,8(3)
+ stw 0,8(3)
blt cr1,3f
addi 11,12,12
addi 10,3,12
@@ -126,7 +126,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
addi 11,12,4
stw 6,0(3)
addi 10,3,4
-
+
.align 4
4:
lwz 6,0(11)
@@ -140,14 +140,14 @@ EALIGN (BP_SYM (memcpy), 5, 0)
addi 11,11,16
addi 10,10,16
bdnz 4b
-3:
+3:
clrrwi 0,31,2
mtcrf 0x01,31
beq cr6,0f
.L9:
add 3,3,0
add 12,12,0
-
+
/* At this point we have a tail of 0-3 bytes and we know that the
destination is word aligned. */
2: bf 30,1f
@@ -165,27 +165,27 @@ EALIGN (BP_SYM (memcpy), 5, 0)
lwz 31,24(1)
addi 1,1,32
blr
-
-/* Copy up to 31 bytes. This is divided into two cases 0-8 bytes and
- 9-31 bytes. Each case is handled without loops, using binary
- (1,2,4,8) tests.
-
+
+/* Copy up to 31 bytes. This is divided into two cases 0-8 bytes and
+ 9-31 bytes. Each case is handled without loops, using binary
+ (1,2,4,8) tests.
+
In the short (0-8 byte) case no attempt is made to force alignment
- of either source or destination. The hardware will handle the
- unaligned load/stores with small delays for crossing 32- 64-byte, and
+ of either source or destination. The hardware will handle the
+ unaligned load/stores with small delays for crossing 32- 64-byte, and
4096-byte boundaries. Since these short moves are unlikely to be
- unaligned or cross these boundaries, the overhead to force
+ unaligned or cross these boundaries, the overhead to force
alignment is not justified.
-
+
The longer (9-31 byte) move is more likely to cross 32- or 64-byte
boundaries. Since only loads are sensitive to the 32-/64-byte
- boundaries it is more important to align the source than the
+ boundaries it is more important to align the source than the
destination. If the source is not already word aligned, we first
- move 1-3 bytes as needed. While the destination and stores may
+ move 1-3 bytes as needed. While the destination and stores may
still be unaligned, this is only an issue for page (4096 byte
- boundary) crossing, which should be rare for these short moves.
- The hardware handles this case automatically with a small delay. */
-
+ boundary) crossing, which should be rare for these short moves.
+ The hardware handles this case automatically with a small delay. */
+
.align 4
.L2:
mtcrf 0x01,5
@@ -248,11 +248,11 @@ EALIGN (BP_SYM (memcpy), 5, 0)
lwz 6,0(12)
addi 12,12,4
stw 6,0(3)
- addi 3,3,4
+ addi 3,3,4
2: /* Move 2-3 bytes. */
bf 30,1f
lhz 6,0(12)
- sth 6,0(3)
+ sth 6,0(3)
bf 31,0f
lbz 7,2(12)
stb 7,2(3)
@@ -292,7 +292,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
6:
bf 30,5f
lhz 7,4(4)
- sth 7,4(3)
+ sth 7,4(3)
bf 31,0f
lbz 8,6(4)
stb 8,6(3)
@@ -301,7 +301,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
addi 1,1,32
blr
.align 4
-5:
+5:
bf 31,0f
lbz 6,4(4)
stb 6,4(3)
@@ -318,15 +318,15 @@ EALIGN (BP_SYM (memcpy), 5, 0)
/* Copy words where the destination is aligned but the source is
not. Use aligned word loads from the source, shifted to realign
- the data, to allow aligned destination stores.
+ the data, to allow aligned destination stores.
Use an unrolled loop to copy 4 words (16-bytes) per iteration.
A single word is retained for storing at loop exit to avoid walking
off the end of a page within the loop.
- If the copy is not an exact multiple of 16 bytes, 1-3
+ If the copy is not an exact multiple of 16 bytes, 1-3
words are copied as needed to set up the main loop. After
- the main loop exits there may be a tail of 1-3 bytes. These bytes are
+ the main loop exits there may be a tail of 1-3 bytes. These bytes are
copied a halfword/byte at a time as needed to preserve alignment. */
-
+
cmplwi cr6,11,0 /* are there tail bytes left ? */
subf 5,10,12 /* back up src pointer to prev word alignment */
@@ -381,8 +381,8 @@ EALIGN (BP_SYM (memcpy), 5, 0)
.align 4
4:
/* copy 16 bytes at a time */
- slw 0,6,10
- srw 8,7,9
+ slw 0,6,10
+ srw 8,7,9
or 0,0,8
lwz 6,0(5)
stw 0,0(4)
@@ -391,13 +391,13 @@ EALIGN (BP_SYM (memcpy), 5, 0)
or 0,0,8
lwz 7,4(5)
stw 0,4(4)
- slw 0,6,10
- srw 8,7,9
+ slw 0,6,10
+ srw 8,7,9
or 0,0,8
lwz 6,8(5)
stw 0,8(4)
slw 0,7,10
- srw 8,6,9
+ srw 8,6,9
or 0,0,8
lwz 7,12(5)
stw 0,12(4)
@@ -406,8 +406,8 @@ EALIGN (BP_SYM (memcpy), 5, 0)
bdnz+ 4b
8:
/* calculate and store the final word */
- slw 0,6,10
- srw 8,7,9
+ slw 0,6,10
+ srw 8,7,9
or 0,0,8
stw 0,0(4)
3:
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/strncmp.S b/libc/sysdeps/powerpc/powerpc32/power4/strncmp.S
index fc0835ebe..12d829344 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/strncmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/power4/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC32.
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@ EALIGN (BP_SYM(strncmp), 4, 0)
#define rSTR2 r4 /* second string arg */
#define rN r5 /* max string length */
/* Note: The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Current PPC gcc does not support -fbounds-check or -fbounded-pointers. */
#define rWORD1 r6 /* current word in s1 */
#define rWORD2 r7 /* current word in s2 */
@@ -58,7 +58,7 @@ EALIGN (BP_SYM(strncmp), 4, 0)
clrlwi rN, rN, 30
addi rFEFE, rFEFE, -0x101
addi r7F7F, r7F7F, 0x7f7f
- cmplwi cr1, rN, 0
+ cmplwi cr1, rN, 0
beq L(unaligned)
mtctr rTMP /* Power4 wants mtctr 1st in dispatch group. */
@@ -66,7 +66,7 @@ EALIGN (BP_SYM(strncmp), 4, 0)
lwz rWORD2, 0(rSTR2)
b L(g1)
-L(g0):
+L(g0):
lwzu rWORD1, 4(rSTR1)
bne- cr1, L(different)
lwzu rWORD2, 4(rSTR2)
@@ -76,11 +76,11 @@ L(g1): add rTMP, rFEFE, rWORD1
and. rTMP, rTMP, rNEG
cmpw cr1, rWORD1, rWORD2
beq+ L(g0)
-
+
/* OK. We've hit the end of the string. We need to be careful that
we don't compare two strings as different because of gunk beyond
the end of the strings... */
-
+
L(endstring):
and rTMP, r7F7F, rWORD1
beq cr1, L(equal)
@@ -139,33 +139,34 @@ L(u1):
bdz L(u4)
cmpw rWORD1, rWORD2
beq- cr1, L(u4)
+ bne- L(u4)
lbzu rWORD3, 1(rSTR1)
lbzu rWORD4, 1(rSTR2)
- bne- L(u4)
cmpwi cr1, rWORD3, 0
bdz L(u3)
cmpw rWORD3, rWORD4
beq- cr1, L(u3)
+ bne- L(u3)
lbzu rWORD1, 1(rSTR1)
lbzu rWORD2, 1(rSTR2)
- bne- L(u3)
cmpwi cr1, rWORD1, 0
bdz L(u4)
cmpw rWORD1, rWORD2
beq- cr1, L(u4)
+ bne- L(u4)
lbzu rWORD3, 1(rSTR1)
lbzu rWORD4, 1(rSTR2)
- bne- L(u4)
cmpwi cr1, rWORD3, 0
bdz L(u3)
cmpw rWORD3, rWORD4
beq- cr1, L(u3)
+ bne- L(u3)
lbzu rWORD1, 1(rSTR1)
lbzu rWORD2, 1(rSTR2)
- beq+ L(u1)
+ b L(u1)
L(u3): sub rRTN, rWORD3, rWORD4
- blr
+ blr
L(u4): sub rRTN, rWORD1, rWORD2
blr
L(ux):
@@ -173,4 +174,3 @@ L(ux):
blr
END (BP_SYM (strncmp))
libc_hidden_builtin_def (strncmp)
-
diff --git a/libc/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S b/libc/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S
index 27a1a0dcb..1c0f70dc5 100644
--- a/libc/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S
+++ b/libc/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S
@@ -1,5 +1,5 @@
/* sqrt function. PowerPC32 version.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,7 +35,7 @@
This part of the function looks like a leaf routine, so no need to
stack a frame or execute prologue/epilogue code. It is safe to
branch directly to w_sqrt as long as the input value (f1) is
- preserved. Putting the the sqrt result into f2 (float parameter 2)
+ preserved. Putting the sqrt result into f2 (float parameter 2)
allows passing both the input value and sqrt result into the extended
wrapper so there is no need to recompute.
diff --git a/libc/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S b/libc/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S
index 891485554..e638cc102 100644
--- a/libc/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S
+++ b/libc/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S
@@ -1,5 +1,5 @@
/* sqrtf function. PowerPC32 version.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,7 +35,7 @@
This part of the function looks like a leaf routine, so no need to
stack a frame or execute prologue/epilogue code. It is safe to
branch directly to w_sqrt as long as the input value (f1) is
- preserved. Putting the the sqrt result into f2 (float parameter 2)
+ preserved. Putting the sqrt result into f2 (float parameter 2)
allows passing both the input value and sqrt result into the extended
wrapper so there is no need to recompute.
diff --git a/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S b/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S
index cafe9174f..b5e289dd5 100644
--- a/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC32 on POWER6.
- Copyright (C) 2003, 2006, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2009, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -100,7 +100,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
/* Move words where destination and source are word aligned.
Use an unrolled loop to copy 4 words (16-bytes) per iteration.
- If the the copy is not an exact multiple of 16 bytes, 1-3
+ If the copy is not an exact multiple of 16 bytes, 1-3
words are copied as needed to set up the main loop. After
the main loop exits there may be a tail of 1-3 bytes. These bytes are
copied a halfword/byte at a time as needed to preserve alignment. */
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S b/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S
index ba72d0a02..6a1422a7c 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for POWER7/PowerPC32.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,7 +35,7 @@ EALIGN (BP_SYM(strncmp),4,0)
#define rSTR2 r4 /* second string arg */
#define rN r5 /* max string length */
/* Note: The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Current PPC gcc does not support -fbounds-check or -fbounded-pointers. */
#define rWORD1 r6 /* current word in s1 */
#define rWORD2 r7 /* current word in s2 */
@@ -141,30 +141,31 @@ L(u1):
bdz L(u4)
cmpw rWORD1,rWORD2
beq cr1,L(u4)
+ bne L(u4)
lbzu rWORD3,1(rSTR1)
lbzu rWORD4,1(rSTR2)
- bne L(u4)
cmpwi cr1,rWORD3,0
bdz L(u3)
cmpw rWORD3,rWORD4
beq cr1,L(u3)
+ bne L(u3)
lbzu rWORD1,1(rSTR1)
lbzu rWORD2,1(rSTR2)
- bne L(u3)
cmpwi cr1,rWORD1,0
bdz L(u4)
cmpw rWORD1,rWORD2
beq cr1,L(u4)
+ bne L(u4)
lbzu rWORD3,1(rSTR1)
lbzu rWORD4,1(rSTR2)
- bne L(u4)
cmpwi cr1,rWORD3,0
bdz L(u3)
cmpw rWORD3,rWORD4
beq cr1,L(u3)
+ bne L(u3)
lbzu rWORD1,1(rSTR1)
lbzu rWORD2,1(rSTR2)
- beq L(u1)
+ b L(u1)
L(u3): sub rRTN,rWORD3,rWORD4
blr
diff --git a/libc/sysdeps/powerpc/powerpc32/strncmp.S b/libc/sysdeps/powerpc/powerpc32/strncmp.S
index 3e0fff5ac..6b736e7b2 100644
--- a/libc/sysdeps/powerpc/powerpc32/strncmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC32.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@ EALIGN (BP_SYM(strncmp), 4, 0)
#define rSTR2 r4 /* second string arg */
#define rN r5 /* max string length */
/* Note: The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Current PPC gcc does not support -fbounds-check or -fbounded-pointers. */
#define rWORD1 r6 /* current word in s1 */
#define rWORD2 r7 /* current word in s2 */
@@ -56,7 +56,7 @@ EALIGN (BP_SYM(strncmp), 4, 0)
clrlwi rN, rN, 30
addi rFEFE, rFEFE, -0x101
addi r7F7F, r7F7F, 0x7f7f
- cmplwi cr1, rN, 0
+ cmplwi cr1, rN, 0
beq L(unaligned)
mtctr rTMP /* Power4 wants mtctr 1st in dispatch group. */
@@ -64,7 +64,7 @@ EALIGN (BP_SYM(strncmp), 4, 0)
lwz rWORD2, 0(rSTR2)
b L(g1)
-L(g0):
+L(g0):
lwzu rWORD1, 4(rSTR1)
bne- cr1, L(different)
lwzu rWORD2, 4(rSTR2)
@@ -74,11 +74,11 @@ L(g1): add rTMP, rFEFE, rWORD1
and. rTMP, rTMP, rNEG
cmpw cr1, rWORD1, rWORD2
beq+ L(g0)
-
+
/* OK. We've hit the end of the string. We need to be careful that
we don't compare two strings as different because of gunk beyond
the end of the strings... */
-
+
L(endstring):
and rTMP, r7F7F, rWORD1
beq cr1, L(equal)
@@ -154,7 +154,7 @@ L(u1):
lbzu rWORD1, 1(rSTR1)
bne+ cr1, L(u0)
-L(u2): lbzu rWORD1, -1(rSTR1)
+L(u2): lbzu rWORD1, -1(rSTR1)
L(u3): sub rRTN, rWORD1, rWORD2
blr
END (BP_SYM (strncmp))
diff --git a/libc/sysdeps/powerpc/powerpc64/memcpy.S b/libc/sysdeps/powerpc/powerpc64/memcpy.S
index f395de906..28fc6cf5b 100644
--- a/libc/sysdeps/powerpc/powerpc64/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc64/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC64.
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,10 +24,10 @@
/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
Returns 'dst'.
- Memcpy handles short copies (< 32-bytes) using a binary move blocks
- (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled
- with the appropriate combination of byte and halfword load/stores.
- There is minimal effort to optimize the alignment of short moves.
+ Memcpy handles short copies (< 32-bytes) using a binary move blocks
+ (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled
+ with the appropriate combination of byte and halfword load/stores.
+ There is minimal effort to optimize the alignment of short moves.
The 64-bit implementations of POWER3 and POWER4 do a reasonable job
of handling unligned load/stores that do not cross 32-byte boundries.
@@ -49,13 +49,13 @@ EALIGN (BP_SYM (memcpy), 5, 0)
clrldi 10,4,61 /* check alignement of src. */
cmpldi cr6,5,8
ble- cr1,.L2 /* If move < 32 bytes use short move code. */
- cmpld cr6,10,11
+ cmpld cr6,10,11
mr 12,4
srdi 9,5,3 /* Number of full double words remaining. */
mtcrf 0x01,0
mr 31,5
beq .L0
-
+
subf 31,0,5
/* Move 0-7 bytes as needed to get the destination doubleword alligned. */
1: bf 31,2f
@@ -74,17 +74,17 @@ EALIGN (BP_SYM (memcpy), 5, 0)
stw 6,0(3)
addi 3,3,4
0:
- clrldi 10,12,61 /* check alignement of src again. */
+ clrldi 10,12,61 /* check alignement of src again. */
srdi 9,31,3 /* Number of full double words remaining. */
-
+
/* Copy doublewords from source to destination, assumpting the
destination is aligned on a doubleword boundary.
At this point we know there are at least 25 bytes left (32-7) to copy.
- The next step is to determine if the source is also doubleword aligned.
+ The next step is to determine if the source is also doubleword aligned.
If not branch to the unaligned move code at .L6. which uses
a load, shift, store strategy.
-
+
Otherwise source and destination are doubleword aligned, and we can
the optimized doubleword copy loop. */
.L0:
@@ -94,16 +94,16 @@ EALIGN (BP_SYM (memcpy), 5, 0)
/* Move doublewords where destination and source are DW aligned.
Use a unrolled loop to copy 4 doubleword (32-bytes) per iteration.
- If the the copy is not an exact multiple of 32 bytes, 1-3
+ If the copy is not an exact multiple of 32 bytes, 1-3
doublewords are copied as needed to set up the main loop. After
- the main loop exits there may be a tail of 1-7 bytes. These byte are
+ the main loop exits there may be a tail of 1-7 bytes. These byte are
copied a word/halfword/byte at a time as needed to preserve alignment. */
srdi 8,31,5
cmpldi cr1,9,4
cmpldi cr6,11,0
mr 11,12
-
+
bf 30,1f
ld 6,0(12)
ld 7,8(12)
@@ -114,7 +114,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
addi 10,3,16
bf 31,4f
ld 0,16(12)
- std 0,16(3)
+ std 0,16(3)
blt cr1,3f
addi 11,12,24
addi 10,3,24
@@ -128,7 +128,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
addi 11,12,8
std 6,0(3)
addi 10,3,8
-
+
.align 4
4:
ld 6,0(11)
@@ -143,7 +143,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
std 0,24(10)
addi 10,10,32
bdnz 4b
-3:
+3:
rldicr 0,31,0,60
mtcrf 0x01,31
@@ -151,7 +151,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
.L9:
add 3,3,0
add 12,12,0
-
+
/* At this point we have a tail of 0-7 bytes and we know that the
destiniation is double word aligned. */
4: bf 29,2f
@@ -172,29 +172,29 @@ EALIGN (BP_SYM (memcpy), 5, 0)
ld 31,-8(1)
ld 3,-16(1)
blr
-
-/* Copy up to 31 bytes. This divided into two cases 0-8 bytes and 9-31
- bytes. Each case is handled without loops, using binary (1,2,4,8)
- tests.
-
+
+/* Copy up to 31 bytes. This divided into two cases 0-8 bytes and 9-31
+ bytes. Each case is handled without loops, using binary (1,2,4,8)
+ tests.
+
In the short (0-8 byte) case no attempt is made to force alignment
- of either source or destination. The hardware will handle the
- unaligned load/stores with small delays for crossing 32- 64-byte, and
+ of either source or destination. The hardware will handle the
+ unaligned load/stores with small delays for crossing 32- 64-byte, and
4096-byte boundaries. Since these short moves are unlikely to be
- unaligned or cross these boundaries, the overhead to force
+ unaligned or cross these boundaries, the overhead to force
alignment is not justified.
-
+
The longer (9-31 byte) move is more likely to cross 32- or 64-byte
boundaries. Since only loads are sensitive to the 32-/64-byte
- boundaries it is more important to align the source then the
+ boundaries it is more important to align the source then the
destination. If the source is not already word aligned, we first
- move 1-3 bytes as needed. Since we are only word aligned we don't
- use double word load/stores to insure that all loads are aligned.
+ move 1-3 bytes as needed. Since we are only word aligned we don't
+ use double word load/stores to insure that all loads are aligned.
While the destination and stores may still be unaligned, this
is only an issue for page (4096 byte boundary) crossing, which
should be rare for these short moves. The hardware handles this
- case automatically with a small delay. */
-
+ case automatically with a small delay. */
+
.align 4
.L2:
mtcrf 0x01,5
@@ -257,11 +257,11 @@ EALIGN (BP_SYM (memcpy), 5, 0)
lwz 6,0(12)
addi 12,12,4
stw 6,0(3)
- addi 3,3,4
+ addi 3,3,4
2: /* Move 2-3 bytes. */
bf 30,1f
lhz 6,0(12)
- sth 6,0(3)
+ sth 6,0(3)
bf 31,0f
lbz 7,2(12)
stb 7,2(3)
@@ -282,7 +282,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
mr 12,4
bne cr6,4f
/* Would have liked to use use ld/std here but the 630 processors are
- slow for load/store doubles that are not at least word aligned.
+ slow for load/store doubles that are not at least word aligned.
Unaligned Load/Store word execute with only a 1 cycle penaltity. */
lwz 6,0(4)
lwz 7,4(4)
@@ -298,14 +298,14 @@ EALIGN (BP_SYM (memcpy), 5, 0)
6:
bf 30,5f
lhz 7,4(4)
- sth 7,4(3)
+ sth 7,4(3)
bf 31,0f
lbz 8,6(4)
stb 8,6(3)
ld 3,-16(1)
blr
.align 4
-5:
+5:
bf 31,0f
lbz 6,4(4)
stb 6,4(3)
diff --git a/libc/sysdeps/powerpc/powerpc64/power4/memcmp.S b/libc/sysdeps/powerpc/powerpc64/power4/memcmp.S
index a5e0c758d..9406a8ca2 100644
--- a/libc/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/libc/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC64.
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@ EALIGN (BP_SYM(memcmp), 4, 0)
#define rSTR2 r4 /* second string arg */
#define rN r5 /* max string length */
/* Note: The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Current PPC gcc does not support -fbounds-check or -fbounded-pointers. */
#define rWORD1 r6 /* current word in s1 */
#define rWORD2 r7 /* current word in s2 */
diff --git a/libc/sysdeps/powerpc/powerpc64/power4/memcpy.S b/libc/sysdeps/powerpc/powerpc64/power4/memcpy.S
index 56f313b4b..64f8fe8e6 100644
--- a/libc/sysdeps/powerpc/powerpc64/power4/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc64/power4/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC64.
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -96,7 +96,7 @@ EALIGN (BP_SYM (memcpy), 5, 0)
/* Move doublewords where destination and source are DW aligned.
Use a unrolled loop to copy 4 doubleword (32-bytes) per iteration.
- If the the copy is not an exact multiple of 32 bytes, 1-3
+ If the copy is not an exact multiple of 32 bytes, 1-3
doublewords are copied as needed to set up the main loop. After
the main loop exits there may be a tail of 1-7 bytes. These byte are
copied a word/halfword/byte at a time as needed to preserve alignment. */
diff --git a/libc/sysdeps/powerpc/powerpc64/power4/strncmp.S b/libc/sysdeps/powerpc/powerpc64/power4/strncmp.S
index 7a1665d2b..5ca53cc16 100644
--- a/libc/sysdeps/powerpc/powerpc64/power4/strncmp.S
+++ b/libc/sysdeps/powerpc/powerpc64/power4/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC64.
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,7 +34,7 @@ EALIGN (BP_SYM(strncmp), 4, 0)
#define rSTR2 r4 /* second string arg */
#define rN r5 /* max string length */
/* Note: The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Current PPC gcc does not support -fbounds-check or -fbounded-pointers. */
#define rWORD1 r6 /* current word in s1 */
#define rWORD2 r7 /* current word in s2 */
@@ -59,7 +59,7 @@ EALIGN (BP_SYM(strncmp), 4, 0)
clrldi rN, rN, 61
addi rFEFE, rFEFE, -0x101
addi r7F7F, r7F7F, 0x7f7f
- cmpldi cr1, rN, 0
+ cmpldi cr1, rN, 0
beq L(unaligned)
mtctr rTMP /* Power4 wants mtctr 1st in dispatch group. */
@@ -70,7 +70,7 @@ EALIGN (BP_SYM(strncmp), 4, 0)
add rFEFE, rFEFE, rTMP
b L(g1)
-L(g0):
+L(g0):
ldu rWORD1, 8(rSTR1)
bne- cr1, L(different)
ldu rWORD2, 8(rSTR2)
@@ -80,11 +80,11 @@ L(g1): add rTMP, rFEFE, rWORD1
and. rTMP, rTMP, rNEG
cmpd cr1, rWORD1, rWORD2
beq+ L(g0)
-
+
/* OK. We've hit the end of the string. We need to be careful that
we don't compare two strings as different because of gunk beyond
the end of the strings... */
-
+
L(endstring):
and rTMP, r7F7F, rWORD1
beq cr1, L(equal)
@@ -143,33 +143,34 @@ L(u1):
bdz L(u4)
cmpd rWORD1, rWORD2
beq- cr1, L(u4)
+ bne- L(u4)
lbzu rWORD3, 1(rSTR1)
lbzu rWORD4, 1(rSTR2)
- bne- L(u4)
cmpdi cr1, rWORD3, 0
bdz L(u3)
cmpd rWORD3, rWORD4
beq- cr1, L(u3)
+ bne- L(u3)
lbzu rWORD1, 1(rSTR1)
lbzu rWORD2, 1(rSTR2)
- bne- L(u3)
cmpdi cr1, rWORD1, 0
bdz L(u4)
cmpd rWORD1, rWORD2
beq- cr1, L(u4)
+ bne- L(u4)
lbzu rWORD3, 1(rSTR1)
lbzu rWORD4, 1(rSTR2)
- bne- L(u4)
cmpdi cr1, rWORD3, 0
bdz L(u3)
cmpd rWORD3, rWORD4
beq- cr1, L(u3)
+ bne- L(u3)
lbzu rWORD1, 1(rSTR1)
lbzu rWORD2, 1(rSTR2)
- beq+ L(u1)
+ b L(u1)
L(u3): sub rRTN, rWORD3, rWORD4
- blr
+ blr
L(u4): sub rRTN, rWORD1, rWORD2
blr
L(ux):
@@ -177,4 +178,3 @@ L(ux):
blr
END (BP_SYM (strncmp))
libc_hidden_builtin_def (strncmp)
-
diff --git a/libc/sysdeps/powerpc/powerpc64/power6/memcpy.S b/libc/sysdeps/powerpc/powerpc64/power6/memcpy.S
index d105f8302..1edc7c98b 100644
--- a/libc/sysdeps/powerpc/powerpc64/power6/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc64/power6/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC64.
- Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2007, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -119,7 +119,7 @@ EALIGN (BP_SYM (memcpy), 7, 0)
/* Move doublewords where destination and source are DW aligned.
Use a unrolled loop to copy 16 doublewords (128-bytes) per iteration.
- If the the copy is not an exact multiple of 128 bytes, 1-15
+ If the copy is not an exact multiple of 128 bytes, 1-15
doublewords are copied as needed to set up the main loop. After
the main loop exits there may be a tail of 1-7 bytes. These byte
are copied a word/halfword/byte at a time as needed to preserve
diff --git a/libc/sysdeps/powerpc/powerpc64/power7/memcmp.S b/libc/sysdeps/powerpc/powerpc64/power7/memcmp.S
index f1afffb4e..dcf0f9da7 100644
--- a/libc/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/libc/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1,5 +1,5 @@
/* Optimized memcmp implementation for POWER7/PowerPC64.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,7 +35,7 @@ EALIGN (BP_SYM(memcmp),4,0)
#define rSTR2 r4 /* second string arg */
#define rN r5 /* max string length */
/* Note: The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Current PPC gcc does not support -fbounds-check or -fbounded-pointers. */
#define rWORD1 r6 /* current word in s1 */
#define rWORD2 r7 /* current word in s2 */
diff --git a/libc/sysdeps/powerpc/powerpc64/power7/strncmp.S b/libc/sysdeps/powerpc/powerpc64/power7/strncmp.S
index 34f1e52df..498b19c71 100644
--- a/libc/sysdeps/powerpc/powerpc64/power7/strncmp.S
+++ b/libc/sysdeps/powerpc/powerpc64/power7/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for POWER7/PowerPC64.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,7 +36,7 @@ EALIGN (BP_SYM(strncmp),4,0)
#define rSTR2 r4 /* second string arg */
#define rN r5 /* max string length */
/* Note: The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Current PPC gcc does not support -fbounds-check or -fbounded-pointers. */
#define rWORD1 r6 /* current word in s1 */
#define rWORD2 r7 /* current word in s2 */
@@ -145,30 +145,31 @@ L(u1):
bdz L(u4)
cmpd rWORD1,rWORD2
beq cr1,L(u4)
+ bne L(u4)
lbzu rWORD3,1(rSTR1)
lbzu rWORD4,1(rSTR2)
- bne L(u4)
cmpdi cr1,rWORD3,0
bdz L(u3)
cmpd rWORD3,rWORD4
beq cr1,L(u3)
+ bne L(u3)
lbzu rWORD1,1(rSTR1)
lbzu rWORD2,1(rSTR2)
- bne L(u3)
cmpdi cr1,rWORD1,0
bdz L(u4)
cmpd rWORD1,rWORD2
beq cr1,L(u4)
+ bne L(u4)
lbzu rWORD3,1(rSTR1)
lbzu rWORD4,1(rSTR2)
- bne L(u4)
cmpdi cr1,rWORD3,0
bdz L(u3)
cmpd rWORD3,rWORD4
beq cr1,L(u3)
+ bne L(u3)
lbzu rWORD1,1(rSTR1)
lbzu rWORD2,1(rSTR2)
- beq L(u1)
+ b L(u1)
L(u3): sub rRTN,rWORD3,rWORD4
blr
diff --git a/libc/sysdeps/powerpc/powerpc64/strchr.S b/libc/sysdeps/powerpc/powerpc64/strchr.S
index 93ea61e49..d31a26cd6 100644
--- a/libc/sysdeps/powerpc/powerpc64/strchr.S
+++ b/libc/sysdeps/powerpc/powerpc64/strchr.S
@@ -1,5 +1,5 @@
/* Optimized strchr implementation for PowerPC64.
- Copyright (C) 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2002, 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@ ENTRY (BP_SYM (strchr))
#define rTMP1 r0
#define rRTN r3 /* outgoing result */
/* Note: The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Currently PPC gcc does not support -fbounds-check or -fbounded-pointers.
These artifacts are left in the code as a reminder in case we need
bounded pointer support in the future. */
diff --git a/libc/sysdeps/powerpc/powerpc64/strcmp.S b/libc/sysdeps/powerpc/powerpc64/strcmp.S
index 4d7eb21bf..53d82e372 100644
--- a/libc/sysdeps/powerpc/powerpc64/strcmp.S
+++ b/libc/sysdeps/powerpc/powerpc64/strcmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC64.
- Copyright (C) 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2002, 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@ EALIGN (BP_SYM(strcmp), 4, 0)
#define rSTR1 r3 /* first string arg */
#define rSTR2 r4 /* second string arg */
/* Note: The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Current PPC gcc does not support -fbounds-check or -fbounded-pointers.
These artifacts are left in the code as a reminder in case we need
bounded pointer support in the future. */
diff --git a/libc/sysdeps/powerpc/powerpc64/strcpy.S b/libc/sysdeps/powerpc/powerpc64/strcpy.S
index e9e9fc78c..17653b29c 100644
--- a/libc/sysdeps/powerpc/powerpc64/strcpy.S
+++ b/libc/sysdeps/powerpc/powerpc64/strcpy.S
@@ -1,5 +1,5 @@
/* Optimized strcpy implementation for PowerPC64.
- Copyright (C) 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2002, 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@ EALIGN (BP_SYM (strcpy), 4, 0)
#define rTMP r0
#define rRTN r3 /* incoming DEST arg preserved as result */
/* Note. The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Current PPC gcc does not support -fbounds-check or -fbounded-pointers.
These artifacts are left in the code as a reminder in case we need
bounded pointer support in the future. */
diff --git a/libc/sysdeps/powerpc/powerpc64/strlen.S b/libc/sysdeps/powerpc/powerpc64/strlen.S
index 4c1385aea..aa2289634 100644
--- a/libc/sysdeps/powerpc/powerpc64/strlen.S
+++ b/libc/sysdeps/powerpc/powerpc64/strlen.S
@@ -1,5 +1,5 @@
/* Optimized strlen implementation for PowerPC64.
- Copyright (C) 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2002, 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -96,7 +96,7 @@ ENTRY (BP_SYM (strlen))
#define rTMP4 r12
/* Note: The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Current PPC gcc does not support -fbounds-check or -fbounded-pointers.
These artifacts are left in the code as a reminder in case we need
bounded pointer support in the future. */
diff --git a/libc/sysdeps/powerpc/powerpc64/strncmp.S b/libc/sysdeps/powerpc/powerpc64/strncmp.S
index 34479e2e9..84e7b6906 100644
--- a/libc/sysdeps/powerpc/powerpc64/strncmp.S
+++ b/libc/sysdeps/powerpc/powerpc64/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC64.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,7 +34,7 @@ EALIGN (BP_SYM(strncmp), 4, 0)
#define rSTR2 r4 /* second string arg */
#define rN r5 /* max string length */
/* Note: The Bounded pointer support in this code is broken. This code
- was inherited from PPC32 and and that support was never completed.
+ was inherited from PPC32 and that support was never completed.
Current PPC gcc does not support -fbounds-check or -fbounded-pointers. */
#define rWORD1 r6 /* current word in s1 */
#define rWORD2 r7 /* current word in s2 */
diff --git a/libc/sysdeps/s390/dl-tls.h b/libc/sysdeps/s390/dl-tls.h
index 056046285..7295abc6b 100644
--- a/libc/sysdeps/s390/dl-tls.h
+++ b/libc/sysdeps/s390/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. s390 version.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -72,6 +72,9 @@ __tls_get_offset:\n\
# define __TLS_GET_ADDR(__ti) \
({ extern char _GLOBAL_OFFSET_TABLE_[] attribute_hidden; \
(void *) __tls_get_offset ((char *) (__ti) - _GLOBAL_OFFSET_TABLE_) \
- + (unsigned long) __builtin_thread_pointer (); })
+ + (unsigned long) __builtin_thread_pointer (); })
#endif
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libc/sysdeps/s390/s390-32/elf/start.S b/libc/sysdeps/s390/s390-32/elf/start.S
index 8e48abbcc..c568f824f 100644
--- a/libc/sysdeps/s390/s390-32/elf/start.S
+++ b/libc/sysdeps/s390/s390-32/elf/start.S
@@ -75,6 +75,18 @@ _start:
ltr %r5,%r5
jne .L12
+ /* Usually the auxiliary vector can be expected directly after
+ the environment variables. But we have to skip extra zeros
+ because the loader might have removed unsecure variables for
+ setuid programs. */
+
+.L26: l %r5,0(%r6)
+ la %r6,4(%r6)
+ ltr %r5,%r5
+ jz .L26
+
+ ahi %r6,-4
+
/* Obtain the needed values from the auxiliary vector. */
lhi %r7,16 /* AT_HWCAP */
diff --git a/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c b/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c
index 14daf2118..5bcaaaede 100644
--- a/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c
+++ b/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c
@@ -169,7 +169,10 @@ gconv_end (struct __gconv_step *data)
register unsigned long long outlen asm("11") = outend - outptr; \
uint64_t cc = 0; \
\
- asm volatile ("0: " INSTRUCTION " \n\t" \
+ asm volatile (".machine push \n\t" \
+ ".machine \"z9-109\" \n\t" \
+ "0: " INSTRUCTION " \n\t" \
+ ".machine pop \n\t" \
" jo 0b \n\t" \
" ipm %2 \n" \
: "+a" (pOutput), "+a" (pInput), "+d" (cc), \
diff --git a/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c b/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c
index 5f73f3c59..812a42fae 100644
--- a/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c
+++ b/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c
@@ -151,7 +151,10 @@ gconv_end (struct __gconv_step *data)
register unsigned long long outlen asm("11") = outend - outptr; \
uint64_t cc = 0; \
\
- asm volatile ("0: " INSTRUCTION " \n\t" \
+ asm volatile (".machine push \n\t" \
+ ".machine \"z9-109\" \n\t" \
+ "0: " INSTRUCTION " \n\t" \
+ ".machine pop \n\t" \
" jo 0b \n\t" \
" ipm %2 \n" \
: "+a" (pOutput), "+a" (pInput), "+d" (cc), \
diff --git a/libc/sysdeps/s390/s390-64/utf8-utf32-z9.c b/libc/sysdeps/s390/s390-64/utf8-utf32-z9.c
index 17ef8bc89..0ffd848c8 100644
--- a/libc/sysdeps/s390/s390-64/utf8-utf32-z9.c
+++ b/libc/sysdeps/s390/s390-64/utf8-utf32-z9.c
@@ -155,7 +155,10 @@ gconv_end (struct __gconv_step *data)
register unsigned long long outlen asm("11") = outend - outptr; \
uint64_t cc = 0; \
\
- asm volatile ("0: " INSTRUCTION " \n\t" \
+ asm volatile (".machine push \n\t" \
+ ".machine \"z9-109\" \n\t" \
+ "0: " INSTRUCTION " \n\t" \
+ ".machine pop \n\t" \
" jo 0b \n\t" \
" ipm %2 \n" \
: "+a" (pOutput), "+a" (pInput), "+d" (cc), \
diff --git a/libc/sysdeps/sh/dl-tls.h b/libc/sysdeps/sh/dl-tls.h
index 98e2f1904..cf607903d 100644
--- a/libc/sysdeps/sh/dl-tls.h
+++ b/libc/sysdeps/sh/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. SH version.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,3 +27,6 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libc/sysdeps/sparc/dl-tls.h b/libc/sysdeps/sparc/dl-tls.h
index 6edf8d525..fb2535e1c 100644
--- a/libc/sysdeps/sparc/dl-tls.h
+++ b/libc/sysdeps/sparc/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. SPARC version.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,3 +27,6 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libc/sysdeps/unix/sysv/linux/bits/time.h b/libc/sysdeps/unix/sysv/linux/bits/time.h
index 02a05114f..a0d4b7823 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/time.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/time.h
@@ -71,6 +71,8 @@ extern long int __sysconf (int);
# define CLOCK_REALTIME_COARSE 5
/* Monotonic system-wide clock, updated only on ticks. */
# define CLOCK_MONOTONIC_COARSE 6
+/* Monotonic system-wide clock that includes time spent in suspension. */
+# define CLOCK_BOOTTIME 7
/* Flag to indicate time is absolute. */
# define TIMER_ABSTIME 1
diff --git a/libc/sysdeps/unix/sysv/linux/check_pf.c b/libc/sysdeps/unix/sysv/linux/check_pf.c
index b789a32ea..c053adcda 100644
--- a/libc/sysdeps/unix/sysv/linux/check_pf.c
+++ b/libc/sysdeps/unix/sysv/linux/check_pf.c
@@ -1,5 +1,5 @@
/* Determine protocol families for which interfaces exist. Linux version.
- Copyright (C) 2003, 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -240,7 +240,7 @@ out_fail:
}
-/* We don't know if we have NETLINK support compiled in in our
+/* We don't know if we have NETLINK support compiled into our
Kernel. */
#if __ASSUME_NETLINK_SUPPORT == 0
/* Define in ifaddrs.h. */
diff --git a/libc/sysdeps/unix/sysv/linux/ftruncate64.c b/libc/sysdeps/unix/sysv/linux/ftruncate64.c
index 60e7ae0ac..533071943 100644
--- a/libc/sysdeps/unix/sysv/linux/ftruncate64.c
+++ b/libc/sysdeps/unix/sysv/linux/ftruncate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2001,2003,2005,2006
+/* Copyright (C) 1997,1998,1999,2000,2001,2003,2005,2006,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -34,7 +34,7 @@ extern int __have_no_truncate64;
#endif
-/* Truncate the file FD refers to to LENGTH bytes. */
+/* Truncate the file referenced by FD to LENGTH bytes. */
int
__ftruncate64 (int fd, off64_t length)
{
diff --git a/libc/sysdeps/unix/sysv/linux/i386/sysconf.c b/libc/sysdeps/unix/sysv/linux/i386/sysconf.c
index 1f5d3b06b..6d8e9ab7a 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/sysconf.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/sysconf.c
@@ -135,7 +135,7 @@ static const struct intel_02_cache_info
{ 0xdc, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
{ 0xdd, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
{ 0xde, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
- { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
+ { 0xe2, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
{ 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
{ 0xe4, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
{ 0xea, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 12582912 },
diff --git a/libc/sysdeps/unix/sysv/linux/ifaddrs.c b/libc/sysdeps/unix/sysv/linux/ifaddrs.c
index 84f223ddb..ca8c490cb 100644
--- a/libc/sysdeps/unix/sysv/linux/ifaddrs.c
+++ b/libc/sysdeps/unix/sysv/linux/ifaddrs.c
@@ -1,5 +1,5 @@
/* getifaddrs -- get names and addresses of all network interfaces
- Copyright (C) 2003-2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2003-2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,7 +38,7 @@
#include "netlinkaccess.h"
-/* We don't know if we have NETLINK support compiled in in our
+/* We don't know if we have NETLINK support compiled into our
Kernel, so include the old implementation as fallback. */
#if __ASSUME_NETLINK_SUPPORT == 0
int __no_netlink_support attribute_hidden;
diff --git a/libc/sysdeps/unix/sysv/linux/pathconf.c b/libc/sysdeps/unix/sysv/linux/pathconf.c
index ae597fb5b..52610a14d 100644
--- a/libc/sysdeps/unix/sysv/linux/pathconf.c
+++ b/libc/sysdeps/unix/sysv/linux/pathconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux version.
- Copyright (C) 1991,1995,1996,1998-2003,2008,2010 Free Software Foundation, Inc.
+ Copyright (C) 1991,1995,1996,1998-2003,2008,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,6 +36,8 @@ long int
__pathconf (const char *file, int name)
{
struct statfs fsbuf;
+ int fd;
+ int flags;
switch (name)
{
@@ -51,6 +53,21 @@ __pathconf (const char *file, int name)
case _PC_CHOWN_RESTRICTED:
return __statfs_chown_restricted (__statfs (file, &fsbuf), &fsbuf);
+ case _PC_PIPE_BUF:
+ flags = O_RDONLY|O_NONBLOCK|O_NOCTTY;
+#ifdef O_CLOEXEC
+ flags |= O_CLOEXEC;
+#endif
+ fd = open_not_cancel_2 (file, flags);
+ if (fd >= 0)
+ {
+ long int r = __fcntl (fd, F_GETPIPE_SZ);
+ close_not_cancel_no_status (fd);
+ if (r > 0)
+ return r;
+ }
+ /* FALLTHROUGH */
+
default:
return posix_pathconf (file, name);
}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c
index e83f7f04b..3d70be892 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2002,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2002,2005,2006,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,7 +32,7 @@ extern int __have_no_truncate64;
#endif
-/* Truncate the file FD refers to to LENGTH bytes. */
+/* Truncate the file referenced by FD to LENGTH bytes. */
int
__ftruncate64 (fd, length)
int fd;
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
index f107e8437..d1f55e4fc 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2005,2006
+/* Copyright (C) 1997,1998,1999,2000,2002,2005,2006,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -34,7 +34,7 @@ int __have_no_truncate64;
#endif
-/* Truncate the file FD refers to to LENGTH bytes. */
+/* Truncate the file referenced by FD to LENGTH bytes. */
int
truncate64 (path, length)
const char *path;
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
index 1ca4ce66d..ccbca4d25 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
@@ -1,5 +1,5 @@
/* Selective file content synch'ing.
- Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
#include <fcntl.h>
#include <sys/types.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
#include <sys/syscall.h>
@@ -29,7 +29,17 @@
int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{
- return INLINE_SYSCALL (sync_file_range2, 4, fd, flags, from, to);
+ if (SINGLE_THREAD_P)
+ return INLINE_SYSCALL (sync_file_range2, 4, fd, flags, from, to);
+
+ int result;
+ int oldtype = LIBC_CANCEL_ASYNC ();
+
+ result = INLINE_SYSCALL (sync_file_range2, 4, fd, flags, from, to);
+
+ LIBC_CANCEL_RESET (oldtype);
+
+ return result;
}
#else
int
diff --git a/libc/sysdeps/unix/sysv/linux/sys/syscall.h b/libc/sysdeps/unix/sysv/linux/sys/syscall.h
index 445ca3763..0fd72d075 100644
--- a/libc/sysdeps/unix/sysv/linux/sys/syscall.h
+++ b/libc/sysdeps/unix/sysv/linux/sys/syscall.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
#ifndef _SYSCALL_H
#define _SYSCALL_H 1
-/* This file should list the numbers of the system the system knows.
+/* This file should list the numbers of the system calls the system knows.
But instead of duplicating this we use the information available
from the kernel sources. */
#include <asm/unistd.h>
diff --git a/libc/sysdeps/unix/sysv/linux/truncate64.c b/libc/sysdeps/unix/sysv/linux/truncate64.c
index f43cffe01..63efed816 100644
--- a/libc/sysdeps/unix/sysv/linux/truncate64.c
+++ b/libc/sysdeps/unix/sysv/linux/truncate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2000,2003,2004,2005,2006
+/* Copyright (C) 1997-2000,2003,2004,2005,2006,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -34,7 +34,7 @@
int __have_no_truncate64;
#endif
-/* Truncate the file FD refers to to LENGTH bytes. */
+/* Truncate the file referenced by FD to LENGTH bytes. */
int
truncate64 (const char *path, off64_t length)
{
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
index da35115b9..3881082cf 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2004,2005,2006,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2004,2005,2006,2009,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,19 +30,23 @@ longjmp_msg:
//#define __longjmp ____longjmp_chk
#ifdef PIC
-# define CALL_FAIL leaq longjmp_msg(%rip), %rdi; \
- call __GI___fortify_fail
+# define CALL_FAIL subq $8, %rsp; \
+ cfi_remember_state; \
+ cfi_def_cfa_offset(16); \
+ leaq longjmp_msg(%rip), %rdi; \
+ call __GI___fortify_fail; \
+ nop; \
+ cfi_restore_state
#else
-# define CALL_FAIL movq $longjmp_msg, %rdi; \
- call __fortify_fail
+# define CALL_FAIL subq $8, %rsp; \
+ cfi_remember_state; \
+ cfi_def_cfa_offset(16); \
+ movq $longjmp_msg, %rdi; \
+ call __fortify_fail; \
+ nop; \
+ cfi_restore_state
#endif
-#define CHECK_RSP(reg) \
- cmpq reg, %rsp; \
- jbe .Lok; \
- CALL_FAIL; \
-.Lok:
-
/* Jump to the position specified by ENV, causing the
setjmp call there to return VAL, or 1 if VAL is 0.
void __longjmp (__jmp_buf env, int val). */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S b/libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S
index 4bbc7a4d2..1a31d72da 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -62,6 +62,7 @@ ENTRY(__getcontext)
movq %rcx, oFPREGS(%rdi)
/* Save the floating-point environment. */
fnstenv (%rcx)
+ fldenv (%rcx)
stmxcsr oMXCSR(%rdi)
/* Save the current signal mask with
diff --git a/libc/sysdeps/x86_64/Versions b/libc/sysdeps/x86_64/Versions
index 253a65f04..a437f85e6 100644
--- a/libc/sysdeps/x86_64/Versions
+++ b/libc/sysdeps/x86_64/Versions
@@ -1,3 +1,8 @@
+libc {
+ GLIBC_2.14 {
+ memcpy;
+ }
+}
libm {
GLIBC_2.1 {
# A generic bug got this omitted from other configurations' version
diff --git a/libc/sysdeps/x86_64/cacheinfo.c b/libc/sysdeps/x86_64/cacheinfo.c
index bd4be3d2d..fdba6efef 100644
--- a/libc/sysdeps/x86_64/cacheinfo.c
+++ b/libc/sysdeps/x86_64/cacheinfo.c
@@ -130,7 +130,7 @@ static const struct intel_02_cache_info
{ 0xdc, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
{ 0xdd, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
{ 0xde, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
- { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
+ { 0xe2, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
{ 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
{ 0xe4, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
{ 0xea, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 12582912 },
diff --git a/libc/sysdeps/x86_64/dl-tls.h b/libc/sysdeps/x86_64/dl-tls.h
index 9b389edb4..c382cd848 100644
--- a/libc/sysdeps/x86_64/dl-tls.h
+++ b/libc/sysdeps/x86_64/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. x86-64 version.
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,3 +27,6 @@ typedef struct dl_tls_index
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libc/sysdeps/x86_64/memcpy.S b/libc/sysdeps/x86_64/memcpy.S
index b4545ac9f..724d44e6c 100644
--- a/libc/sysdeps/x86_64/memcpy.S
+++ b/libc/sysdeps/x86_64/memcpy.S
@@ -31,6 +31,12 @@
# define RETVAL (0)
#else
# define RETVAL (-8)
+# if defined SHARED && !defined USE_MULTIARCH && !defined NOT_IN_libc
+# define memcpy __memcpy
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_memcpy; __GI_memcpy = __memcpy
+# endif
#endif
#define SAVE0 (RETVAL - 8)
#define SAVE1 (SAVE0 - 8)
@@ -571,4 +577,9 @@ END(memcpy)
#ifndef USE_AS_MEMPCPY
libc_hidden_builtin_def (memcpy)
+# if defined SHARED && !defined USE_MULTIARCH && !defined NOT_IN_libc
+# undef memcpy
+# include <shlib-compat.h>
+versioned_symbol (libc, __memcpy, memcpy, GLIBC_2_14);
+# endif
#endif
diff --git a/libc/sysdeps/x86_64/memmove.c b/libc/sysdeps/x86_64/memmove.c
new file mode 100644
index 000000000..1a6f87dc8
--- /dev/null
+++ b/libc/sysdeps/x86_64/memmove.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include "string/memmove.c"
+
+#if !defined memmove && !defined NOT_IN_libc
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
+compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5);
+#endif
+#endif
diff --git a/libc/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S b/libc/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
index 48c974e97..bdd114a1b 100644
--- a/libc/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
+++ b/libc/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
@@ -49,7 +49,7 @@
ud2
.section .text.ssse3,"ax",@progbits
-#if defined SHARED && !defined NOT_IN_libc
+#if !defined USE_AS_BCOPY
ENTRY (MEMCPY_CHK)
cmpq %rdx, %rcx
jb HIDDEN_JUMPTARGET (__chk_fail)
diff --git a/libc/sysdeps/x86_64/multiarch/memcpy-ssse3.S b/libc/sysdeps/x86_64/multiarch/memcpy-ssse3.S
index 9a878d35f..cd7e45f25 100644
--- a/libc/sysdeps/x86_64/multiarch/memcpy-ssse3.S
+++ b/libc/sysdeps/x86_64/multiarch/memcpy-ssse3.S
@@ -49,7 +49,7 @@
ud2
.section .text.ssse3,"ax",@progbits
-#if defined SHARED && !defined NOT_IN_libc
+#if !defined USE_AS_BCOPY
ENTRY (MEMCPY_CHK)
cmpq %rdx, %rcx
jb HIDDEN_JUMPTARGET (__chk_fail)
diff --git a/libc/sysdeps/x86_64/multiarch/memcpy.S b/libc/sysdeps/x86_64/multiarch/memcpy.S
index 8e9fb190d..9863014f5 100644
--- a/libc/sysdeps/x86_64/multiarch/memcpy.S
+++ b/libc/sysdeps/x86_64/multiarch/memcpy.S
@@ -1,5 +1,6 @@
/* Multiple versions of memcpy
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011
+ Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -19,6 +20,7 @@
02111-1307 USA. */
#include <sysdep.h>
+#include <shlib-compat.h>
#include <init-arch.h>
/* Define multiple versions only for the definition in lib and for
@@ -26,8 +28,8 @@
happened. */
#if defined SHARED && !defined NOT_IN_libc
.text
-ENTRY(memcpy)
- .type memcpy, @gnu_indirect_function
+ENTRY(__new_memcpy)
+ .type __new_memcpy, @gnu_indirect_function
cmpl $0, KIND_OFFSET+__cpu_features(%rip)
jne 1f
call __init_cpu_features
@@ -39,7 +41,7 @@ ENTRY(memcpy)
jz 2f
leaq __memcpy_ssse3_back(%rip), %rax
2: ret
-END(memcpy)
+END(__new_memcpy)
# undef ENTRY
# define ENTRY(name) \
@@ -68,6 +70,8 @@ END(memcpy)
by the indirect call in the PLT. */
# define libc_hidden_builtin_def(name) \
.globl __GI_memcpy; __GI_memcpy = __memcpy_sse2
+
+versioned_symbol (libc, __new_memcpy, memcpy, GLIBC_2_14);
#endif
#include "../memcpy.S"
diff --git a/libc/sysdeps/x86_64/multiarch/memmove.c b/libc/sysdeps/x86_64/multiarch/memmove.c
index 379862722..04de89129 100644
--- a/libc/sysdeps/x86_64/multiarch/memmove.c
+++ b/libc/sysdeps/x86_64/multiarch/memmove.c
@@ -1,5 +1,6 @@
/* Multiple versions of memmove.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +21,7 @@
#include <string.h>
#ifndef NOT_IN_libc
+#include <shlib-compat.h>
#include "init-arch.h"
#define MEMMOVE __memmove_sse2
@@ -42,4 +44,8 @@ libc_ifunc (memmove,
? (HAS_FAST_COPY_BACKWARD
? __memmove_ssse3_back : __memmove_ssse3)
: __memmove_sse2);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
+compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5);
+#endif
#endif