Blame SOURCES/glibc-rh731837-03.patch

147e83
From 3cd86ba149cd650c338332dddb63e16f95041daf Mon Sep 17 00:00:00 2001
147e83
From: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
147e83
Date: Wed, 30 Jul 2014 05:10:37 -0500
147e83
Subject: [PATCH] PowerPC: multiarch memset/bzero for PowerPC64
147e83
147e83
commit 8a29a3d00b5d8ce33fc291baecfd59d715190fd1
147e83
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
147e83
Date:   Fri Dec 13 14:33:16 2013 -0500
147e83
147e83
---
147e83
 sysdeps/powerpc/powerpc64/memset.S                 |  2 +
147e83
 sysdeps/powerpc/powerpc64/multiarch/Makefile       |  3 +-
147e83
 sysdeps/powerpc/powerpc64/multiarch/bzero-power4.S | 26 ++++++++++
147e83
 sysdeps/powerpc/powerpc64/multiarch/bzero-power6.S | 26 ++++++++++
147e83
 sysdeps/powerpc/powerpc64/multiarch/bzero-power7.S | 26 ++++++++++
147e83
 sysdeps/powerpc/powerpc64/multiarch/bzero.c        | 40 ++++++++++++++++
147e83
 .../powerpc/powerpc64/multiarch/ifunc-impl-list.c  | 20 ++++++++
147e83
 .../powerpc/powerpc64/multiarch/memset-power4.S    | 40 ++++++++++++++++
147e83
 .../powerpc/powerpc64/multiarch/memset-power6.S    | 40 ++++++++++++++++
147e83
 .../powerpc/powerpc64/multiarch/memset-power7.S    | 40 ++++++++++++++++
147e83
 sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S | 55 ++++++++++++++++++++++
147e83
 sysdeps/powerpc/powerpc64/multiarch/memset.c       | 50 ++++++++++++++++++++
147e83
 sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c  | 18 +++++++
147e83
 sysdeps/powerpc/powerpc64/power4/memset.S          |  2 +
147e83
 sysdeps/powerpc/powerpc64/power6/memset.S          |  2 +
147e83
 sysdeps/powerpc/powerpc64/power7/memset.S          |  2 +
147e83
 16 files changed, 391 insertions(+), 1 deletion(-)
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/bzero-power4.S
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/bzero-power6.S
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/bzero-power7.S
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/bzero.c
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/memset.c
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c
147e83
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S
147e83
index d02af98..fd5d4e5 100644
147e83
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S
147e83
@@ -265,6 +265,7 @@ L(medium_28t):
147e83
 END_GEN_TB (BP_SYM (memset),TB_TOCLESS)
147e83
 libc_hidden_builtin_def (memset)
147e83
 
147e83
+#ifndef NO_BZERO_IMPL
147e83
 /* Copied from bzero.S to prevent the linker from inserting a stub
147e83
    between bzero and memset.  */
147e83
 ENTRY (BP_SYM (__bzero))
147e83
@@ -284,3 +285,4 @@ ENTRY (BP_SYM (__bzero))
147e83
 END_GEN_TB (BP_SYM (__bzero),TB_TOCLESS)
147e83
 
147e83
 weak_alias (BP_SYM (__bzero), BP_SYM (bzero))
147e83
+#endif
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
147e83
index c0bc520..424d2cd 100644
147e83
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
147e83
@@ -1,5 +1,6 @@
147e83
 ifeq ($(subdir),string)
147e83
 sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
147e83
                   memcpy-power4 memcpy-ppc64 memcmp-power7 memcmp-power4 \
147e83
-                  memcmp-ppc64
147e83
+                  memcmp-ppc64 memset-power7 memset-power6 memset-power4 \
147e83
+                  memset-ppc64 bzero-power4 bzero-power6 bzero-power7
147e83
 endif
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero-power4.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero-power4.S
147e83
new file mode 100644
147e83
index 0000000..72b75ac
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero-power4.S
147e83
@@ -0,0 +1,26 @@
147e83
+/* Optimized bzero implementation for PowerPC64/POWER4.
147e83
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#include <sysdep.h>
147e83
+
147e83
+ENTRY (__bzero_power4)
147e83
+	CALL_MCOUNT 3
147e83
+	mr	r5,r4
147e83
+	li	r4,0
147e83
+	b	__memset_power4
147e83
+END_GEN_TB (__bzero_power4,TB_TOCLESS)
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero-power6.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero-power6.S
147e83
new file mode 100644
147e83
index 0000000..d0917c5
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero-power6.S
147e83
@@ -0,0 +1,26 @@
147e83
+/* Optimized bzero implementation for PowerPC64/POWER6.
147e83
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#include <sysdep.h>
147e83
+
147e83
+ENTRY (__bzero_power6)
147e83
+	CALL_MCOUNT 3
147e83
+	mr	r5,r4
147e83
+	li	r4,0
147e83
+	b	__memset_power6
147e83
+END_GEN_TB (__bzero_power6,TB_TOCLESS)
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero-power7.S
147e83
new file mode 100644
147e83
index 0000000..0ec285a
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero-power7.S
147e83
@@ -0,0 +1,26 @@
147e83
+/* Optimized bzero implementation for PowerPC64/POWER7.
147e83
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#include <sysdep.h>
147e83
+
147e83
+ENTRY (__bzero_power7)
147e83
+	CALL_MCOUNT 3
147e83
+	mr	r5,r4
147e83
+	li	r4,0
147e83
+	b	__memset_power7
147e83
+END_GEN_TB (__bzero_power7,TB_TOCLESS)
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero.c
147e83
new file mode 100644
147e83
index 0000000..ed83541
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero.c
147e83
@@ -0,0 +1,40 @@
147e83
+/* Multiple versions of bzero. PowerPC64 version.
147e83
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+/* Define multiple versions only for definition in libc.  */
147e83
+#ifndef NOT_IN_libc
147e83
+# include <string.h>
147e83
+# include <strings.h>
147e83
+# include "init-arch.h"
147e83
+
147e83
+extern __typeof (bzero) __bzero_ppc attribute_hidden;
147e83
+extern __typeof (bzero) __bzero_power4 attribute_hidden;
147e83
+extern __typeof (bzero) __bzero_power6 attribute_hidden;
147e83
+extern __typeof (bzero) __bzero_power7 attribute_hidden;
147e83
+
147e83
+libc_ifunc (__bzero,
147e83
+            (hwcap & PPC_FEATURE_HAS_VSX)
147e83
+            ? __bzero_power7 :
147e83
+	      (hwcap & PPC_FEATURE_ARCH_2_05)
147e83
+		? __bzero_power6 :
147e83
+		  (hwcap & PPC_FEATURE_POWER4)
147e83
+		? __bzero_power4
147e83
+            : __bzero_ppc);
147e83
+
147e83
+weak_alias (__bzero, bzero)
147e83
+#endif
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
147e83
index 295ebca..11e7063 100644
147e83
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
147e83
@@ -60,6 +60,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
147e83
              IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_POWER4,
147e83
                              __memcpy_power4)
147e83
              IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ppc))
147e83
+
147e83
+  /* Support sysdeps/powerpc/powerpc64/multiarch/memset.c.  */
147e83
+  IFUNC_IMPL (i, name, memset,
147e83
+             IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_HAS_VSX,
147e83
+                             __memset_power7)
147e83
+             IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_ARCH_2_05,
147e83
+                             __memset_power6)
147e83
+             IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_POWER4,
147e83
+                             __memset_power4)
147e83
+             IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ppc))
147e83
 #endif
147e83
 
147e83
   /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c.  */
147e83
@@ -70,5 +80,15 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
147e83
                              __memcmp_power4)
147e83
              IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ppc))
147e83
 
147e83
+  /* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c.  */
147e83
+  IFUNC_IMPL (i, name, bzero,
147e83
+             IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_HAS_VSX,
147e83
+                             __bzero_power7)
147e83
+             IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_ARCH_2_05,
147e83
+                             __bzero_power6)
147e83
+             IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_POWER4,
147e83
+                             __bzero_power4)
147e83
+             IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc))
147e83
+
147e83
   return i;
147e83
 }
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
147e83
new file mode 100644
147e83
index 0000000..9074b95
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
147e83
@@ -0,0 +1,40 @@
147e83
+/* Optimized memset implementation for PowerPC64/POWER4.
147e83
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#include <sysdep.h>
147e83
+
147e83
+#undef EALIGN
147e83
+#define EALIGN(name, alignt, words)				\
147e83
+  .section ".text";						\
147e83
+  ENTRY_2(__memset_power4)					\
147e83
+  .align ALIGNARG(alignt);					\
147e83
+  EALIGN_W_##words;						\
147e83
+  BODY_LABEL(__memset_power4):					\
147e83
+  cfi_startproc;
147e83
+
147e83
+#undef END_GEN_TB
147e83
+#define END_GEN_TB(name, mask)					\
147e83
+  cfi_endproc;							\
147e83
+  TRACEBACK_MASK(__memset_power4,mask)				\
147e83
+  END_2(__memset_power4)
147e83
+
147e83
+#undef libc_hidden_builtin_def
147e83
+#define libc_hidden_builtin_def(name)
147e83
+
147e83
+#define NO_BZERO_IMPL
147e83
+#include <sysdeps/powerpc/powerpc64/power4/memset.S>
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
147e83
new file mode 100644
147e83
index 0000000..70688b5
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
147e83
@@ -0,0 +1,40 @@
147e83
+/* Optimized memset implementation for PowerPC64/POWER6.
147e83
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#include <sysdep.h>
147e83
+
147e83
+#undef EALIGN
147e83
+#define EALIGN(name, alignt, words)				\
147e83
+  .section ".text";						\
147e83
+  ENTRY_2(__memset_power6)					\
147e83
+  .align ALIGNARG(alignt);					\
147e83
+  EALIGN_W_##words;						\
147e83
+  BODY_LABEL(__memset_power6):					\
147e83
+  cfi_startproc;
147e83
+
147e83
+#undef END_GEN_TB
147e83
+#define END_GEN_TB(name, mask)					\
147e83
+  cfi_endproc;							\
147e83
+  TRACEBACK_MASK(__memset_power6,mask)				\
147e83
+  END_2(__memset_power6)
147e83
+
147e83
+#undef libc_hidden_builtin_def
147e83
+#define libc_hidden_builtin_def(name)
147e83
+
147e83
+#define NO_BZERO_IMPL
147e83
+#include <sysdeps/powerpc/powerpc64/power6/memset.S>
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
147e83
new file mode 100644
147e83
index 0000000..ab226c5
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
147e83
@@ -0,0 +1,40 @@
147e83
+/* Optimized memset implementation for PowerPC64/POWER7.
147e83
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#include <sysdep.h>
147e83
+
147e83
+#undef EALIGN
147e83
+#define EALIGN(name, alignt, words)				\
147e83
+  .section ".text";						\
147e83
+  ENTRY_2(__memset_power7)					\
147e83
+  .align ALIGNARG(alignt);					\
147e83
+  EALIGN_W_##words;						\
147e83
+  BODY_LABEL(__memset_power7):					\
147e83
+  cfi_startproc;
147e83
+
147e83
+#undef END_GEN_TB
147e83
+#define END_GEN_TB(name, mask)					\
147e83
+  cfi_endproc;							\
147e83
+  TRACEBACK_MASK(__memset_power7,mask)				\
147e83
+  END_2(__memset_power7)
147e83
+
147e83
+#undef libc_hidden_builtin_def
147e83
+#define libc_hidden_builtin_def(name)
147e83
+
147e83
+#define NO_BZERO_IMPL
147e83
+#include <sysdeps/powerpc/powerpc64/power7/memset.S>
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
147e83
new file mode 100644
147e83
index 0000000..dc5549c
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
147e83
@@ -0,0 +1,55 @@
147e83
+/* Default memset/bzero implementation for PowerPC64.
147e83
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#include <sysdep.h>
147e83
+
147e83
+/* Copied from bzero.S to prevent the linker from inserting a stub
147e83
+   between bzero and memset.  NOTE: this code should be positioned
147e83
+   before ENTRY/END_GEN_TB redefinition.  */
147e83
+ENTRY (__bzero_ppc)
147e83
+        CALL_MCOUNT 3
147e83
+        mr      r5,r4
147e83
+        li      r4,0
147e83
+        b       L(_memset)
147e83
+END_GEN_TB (__bzero_ppc,TB_TOCLESS)
147e83
+
147e83
+
147e83
+#if defined SHARED && !defined NOT_IN_libc
147e83
+# undef EALIGN
147e83
+# define EALIGN(name, alignt, words)				\
147e83
+  .section ".text";						\
147e83
+  ENTRY_2(__memset_ppc)						\
147e83
+  .align ALIGNARG(alignt);					\
147e83
+  EALIGN_W_##words;						\
147e83
+  BODY_LABEL(__memset_ppc):					\
147e83
+  cfi_startproc;
147e83
+
147e83
+# undef END_GEN_TB
147e83
+# define END_GEN_TB(name, mask)					\
147e83
+  cfi_endproc;							\
147e83
+  TRACEBACK_MASK(__memset_ppc,mask)				\
147e83
+  END_2(__memset_ppc)
147e83
+
147e83
+# undef libc_hidden_builtin_def
147e83
+# define libc_hidden_builtin_def(name)
147e83
+#endif
147e83
+
147e83
+/* Do not implement __bzero at powerpc64/memset.S.  */
147e83
+#define NO_BZERO_IMPL
147e83
+
147e83
+#include <sysdeps/powerpc/powerpc64/memset.S>
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset.c
147e83
new file mode 100644
147e83
index 0000000..aa2ae70
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset.c
147e83
@@ -0,0 +1,50 @@
147e83
+/* Multiple versions of memset.
147e83
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+/* Define multiple versions only for definition in libc.  */
147e83
+#if defined SHARED && !defined NOT_IN_libc
147e83
+/* Redefine memset so that the compiler won't complain about the type
147e83
+   mismatch with the IFUNC selector in strong_alias, below.  */
147e83
+# undef memset
147e83
+# define memset __redirect_memset
147e83
+# include <string.h>
147e83
+# include <shlib-compat.h>
147e83
+# include "init-arch.h"
147e83
+
147e83
+extern __typeof (__redirect_memset) __libc_memset;
147e83
+
147e83
+extern __typeof (__redirect_memset) __memset_ppc attribute_hidden;
147e83
+extern __typeof (__redirect_memset) __memset_power4 attribute_hidden;
147e83
+extern __typeof (__redirect_memset) __memset_power6 attribute_hidden;
147e83
+extern __typeof (__redirect_memset) __memset_power7 attribute_hidden;
147e83
+
147e83
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
147e83
+   ifunc symbol properly.  */
147e83
+libc_ifunc (__libc_memset,
147e83
+            (hwcap & PPC_FEATURE_HAS_VSX)
147e83
+            ? __memset_power7 :
147e83
+	      (hwcap & PPC_FEATURE_ARCH_2_05)
147e83
+		? __memset_power6 :
147e83
+		  (hwcap & PPC_FEATURE_POWER4)
147e83
+		? __memset_power4
147e83
+            : __memset_ppc);
147e83
+
147e83
+#undef memset
147e83
+strong_alias (__libc_memset, memset);
147e83
+libc_hidden_ver (__libc_memset, memset);
147e83
+#endif
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c
147e83
new file mode 100644
147e83
index 0000000..8eac85b
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c
147e83
@@ -0,0 +1,18 @@
147e83
+/* Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#include <sysdeps/powerpc/powerpc64/rtld-memset.c>
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S
147e83
index c86a68a..c077ae7 100644
147e83
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S
147e83
@@ -253,6 +253,7 @@ L(medium_28t):
147e83
 END_GEN_TB (BP_SYM (memset),TB_TOCLESS)
147e83
 libc_hidden_builtin_def (memset)
147e83
 
147e83
+#ifndef NO_BZERO_IMPL
147e83
 /* Copied from bzero.S to prevent the linker from inserting a stub
147e83
    between bzero and memset.  */
147e83
 ENTRY (BP_SYM (__bzero))
147e83
@@ -272,3 +273,4 @@ ENTRY (BP_SYM (__bzero))
147e83
 END_GEN_TB (BP_SYM (__bzero),TB_TOCLESS)
147e83
 
147e83
 weak_alias (BP_SYM (__bzero), BP_SYM (bzero))
147e83
+#endif
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S
147e83
index 930ecce..967642a3 100644
147e83
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S
147e83
@@ -397,6 +397,7 @@ L(medium_28t):
147e83
 END_GEN_TB (BP_SYM (memset),TB_TOCLESS)
147e83
 libc_hidden_builtin_def (memset)
147e83
 
147e83
+#ifndef NO_BZERO_IMPL
147e83
 /* Copied from bzero.S to prevent the linker from inserting a stub
147e83
    between bzero and memset.  */
147e83
 ENTRY (BP_SYM (__bzero))
147e83
@@ -416,3 +417,4 @@ ENTRY (BP_SYM (__bzero))
147e83
 END_GEN_TB (BP_SYM (__bzero),TB_TOCLESS)
147e83
 
147e83
 weak_alias (BP_SYM (__bzero), BP_SYM (bzero))
147e83
+#endif
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S
147e83
index 5970fbe..2716656 100644
147e83
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S
147e83
@@ -385,6 +385,7 @@ L(small):
147e83
 END_GEN_TB (BP_SYM (memset),TB_TOCLESS)
147e83
 libc_hidden_builtin_def (memset)
147e83
 
147e83
+#ifndef NO_BZERO_IMPL
147e83
 /* Copied from bzero.S to prevent the linker from inserting a stub
147e83
    between bzero and memset.  */
147e83
 ENTRY (BP_SYM (__bzero))
147e83
@@ -395,3 +396,4 @@ ENTRY (BP_SYM (__bzero))
147e83
 END_GEN_TB (BP_SYM (__bzero),TB_TOCLESS)
147e83
 
147e83
 weak_alias (BP_SYM (__bzero), BP_SYM (bzero))
147e83
+#endif
147e83
-- 
147e83
1.8.3.1
147e83