about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc64/multiarch/memset.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-05-02 12:00:36 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-05-05 13:30:16 -0500
commit19c4bec0f43599eecc2f32de96ae179cd7d64053 (patch)
tree26047ede88c1c4231207e887b5ee88de9c60faff /sysdeps/powerpc/powerpc64/multiarch/memset.c
parent7776e6692fe19553dafcb918df467aed522eea8d (diff)
downloadglibc-19c4bec0f43599eecc2f32de96ae179cd7d64053.tar.gz
glibc-19c4bec0f43599eecc2f32de96ae179cd7d64053.tar.xz
glibc-19c4bec0f43599eecc2f32de96ae179cd7d64053.zip
PowerPC: ifunc improvement for internal calls
This patch changes de default symbol redirection for internal call of
memcpy, memset, memchr, and strlen to the IFUNC resolved ones.  The
performance improvement is noticeable in algorithms that uses these
symbols extensible, like the regex functions.
Diffstat (limited to 'sysdeps/powerpc/powerpc64/multiarch/memset.c')
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset.c b/sysdeps/powerpc/powerpc64/multiarch/memset.c
index 829d12759a..aa2ae7056e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset.c
@@ -18,18 +18,24 @@
 
 /* Define multiple versions only for definition in libc.  */
 #if defined SHARED && !defined NOT_IN_libc
+/* Redefine memset so that the compiler won't complain about the type
+   mismatch with the IFUNC selector in strong_alias, below.  */
+# undef memset
+# define memset __redirect_memset
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
 
-extern __typeof (memset) __memset_ppc attribute_hidden;
-extern __typeof (memset) __memset_power4 attribute_hidden;
-extern __typeof (memset) __memset_power6 attribute_hidden;
-extern __typeof (memset) __memset_power7 attribute_hidden;
+extern __typeof (__redirect_memset) __libc_memset;
+
+extern __typeof (__redirect_memset) __memset_ppc attribute_hidden;
+extern __typeof (__redirect_memset) __memset_power4 attribute_hidden;
+extern __typeof (__redirect_memset) __memset_power6 attribute_hidden;
+extern __typeof (__redirect_memset) __memset_power7 attribute_hidden;
 
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
-libc_ifunc (memset,
+libc_ifunc (__libc_memset,
             (hwcap & PPC_FEATURE_HAS_VSX)
             ? __memset_power7 :
 	      (hwcap & PPC_FEATURE_ARCH_2_05)
@@ -37,4 +43,8 @@ libc_ifunc (memset,
 		  (hwcap & PPC_FEATURE_POWER4)
 		? __memset_power4
             : __memset_ppc);
+
+#undef memset
+strong_alias (__libc_memset, memset);
+libc_hidden_ver (__libc_memset, memset);
 #endif