aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/powerpc64/power8/strncpy.S
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-06-14 10:44:59 +0930
committerAlan Modra <amodra@gmail.com>2017-06-14 10:44:59 +0930
commitde7ee73d6f5000478173ac065ded4077fd6ddee2 (patch)
treec02db136edac440e4b9ff9cbdb2466d098ea0a22 /sysdeps/powerpc/powerpc64/power8/strncpy.S
parent4b6e7667db6983fa953c1cac7671f68edacca0b4 (diff)
downloadglibc-de7ee73d6f5000478173ac065ded4077fd6ddee2.zip
glibc-de7ee73d6f5000478173ac065ded4077fd6ddee2.tar.gz
glibc-de7ee73d6f5000478173ac065ded4077fd6ddee2.tar.bz2
PowerPC64 strncpy, stpncpy and strstr fixes
Makes __stpncpy_power8 call __memset_power8 directly rather than via an IFUNC. Fixes a missing _mcount, and removes some redundant NOPS. The *_is_local defines are also used in a followup patch. * sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S: Define MEMSET_is_local. * sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S: Likewise. Define MEMSET. * sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S: Define STRLEN_is_local, STRNLEN_is_local, and STRCHR_is_local. * sysdeps/powerpc/powerpc64/power7/strstr.S: Likewise. Don't add nop after local calls. * sysdeps/powerpc/powerpc64/power7/strncpy.S: Define MEMSET_is_local. Don't add nop after local call. * sysdeps/powerpc/powerpc64/power8/strncpy.S: Likewise. Add missing CALL_MCOUNT.
Diffstat (limited to 'sysdeps/powerpc/powerpc64/power8/strncpy.S')
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strncpy.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64/power8/strncpy.S b/sysdeps/powerpc/powerpc64/power8/strncpy.S
index 6d40f30..552c5cc 100644
--- a/sysdeps/powerpc/powerpc64/power8/strncpy.S
+++ b/sysdeps/powerpc/powerpc64/power8/strncpy.S
@@ -36,6 +36,7 @@
/* For builds without IFUNC support, local calls should be made to internal
GLIBC symbol (created by libc_hidden_builtin_def). */
# ifdef SHARED
+# define MEMSET_is_local
# define MEMSET __GI_memset
# else
# define MEMSET memset
@@ -61,6 +62,7 @@
.machine power7
EALIGN (FUNC_NAME, 4, 0)
+ CALL_MCOUNT 3
/* Check if the [src]+15 will cross a 4K page by checking if the bit
indicating the page size changes. Basically:
@@ -242,7 +244,9 @@ L(zero_pad_start_1):
cfi_adjust_cfa_offset(FRAMESIZE)
bl MEMSET
+#ifndef MEMSET_is_local
nop
+#endif
/* Restore the stack frame. */
addi r1,r1,FRAMESIZE