about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/powerpc64/multiarch/strncpy.c')
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncpy.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
index 0176514c1e..64495df4bc 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
@@ -18,6 +18,9 @@
 
 /* Define multiple versions only for definition in libc. */
 #if IS_IN (libc)
+# define strncpy __redirect_strncpy
+/* Omit the strncpy inline definitions because it would redefine strncpy.  */
+# define __NO_STRING_INLINES
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
@@ -25,14 +28,15 @@
 extern __typeof (strncpy) __strncpy_ppc attribute_hidden;
 extern __typeof (strncpy) __strncpy_power7 attribute_hidden;
 extern __typeof (strncpy) __strncpy_power8 attribute_hidden;
+# undef strncpy
 
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
  ifunc symbol properly. */
-libc_ifunc (strncpy,
-            (hwcap2 & PPC_FEATURE2_ARCH_2_07)
-            ? __strncpy_power8 :
-              (hwcap & PPC_FEATURE_HAS_VSX)
-              ? __strncpy_power7
-            : __strncpy_ppc);
+libc_ifunc_redirected (__redirect_strncpy, strncpy,
+		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+		       ? __strncpy_power8
+		       : (hwcap & PPC_FEATURE_HAS_VSX)
+			 ? __strncpy_power7
+			 : __strncpy_ppc);
 
 #endif