diff options
author | Alan Modra <amodra@gmail.com> | 2017-06-14 10:44:59 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-06-14 10:44:59 +0930 |
commit | de7ee73d6f5000478173ac065ded4077fd6ddee2 (patch) | |
tree | c02db136edac440e4b9ff9cbdb2466d098ea0a22 /sysdeps/powerpc/powerpc64/power7 | |
parent | 4b6e7667db6983fa953c1cac7671f68edacca0b4 (diff) | |
download | glibc-de7ee73d6f5000478173ac065ded4077fd6ddee2.tar.gz glibc-de7ee73d6f5000478173ac065ded4077fd6ddee2.tar.xz glibc-de7ee73d6f5000478173ac065ded4077fd6ddee2.zip |
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/power7')
-rw-r--r-- | sysdeps/powerpc/powerpc64/power7/strncpy.S | 3 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/power7/strstr.S | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64/power7/strncpy.S b/sysdeps/powerpc/powerpc64/power7/strncpy.S index 0224f74898..88d797908c 100644 --- a/sysdeps/powerpc/powerpc64/power7/strncpy.S +++ b/sysdeps/powerpc/powerpc64/power7/strncpy.S @@ -59,6 +59,7 @@ /* For builds with no 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 @@ -223,7 +224,9 @@ L(zeroFill): li r4, 0 /* zero fill buffer */ mr r5, r8 /* how many bytes to fill buffer with */ bl MEMSET /* call optimized memset */ +#ifndef MEMSET_is_local nop +#endif L(update3return): #ifdef USE_AS_STPNCPY diff --git a/sysdeps/powerpc/powerpc64/power7/strstr.S b/sysdeps/powerpc/powerpc64/power7/strstr.S index 260db2ed6d..1c432534a3 100644 --- a/sysdeps/powerpc/powerpc64/power7/strstr.S +++ b/sysdeps/powerpc/powerpc64/power7/strstr.S @@ -34,6 +34,7 @@ GLIBC symbol (created by libc_hidden_builtin_def). */ # ifdef SHARED # define STRLEN __GI_strlen +# define STRLEN_is_local # else # define STRLEN strlen # endif @@ -44,6 +45,7 @@ GLIBC symbol (created by libc_hidden_builtin_def). */ # ifdef SHARED # define STRNLEN __GI_strnlen +# define STRNLEN_is_local # else # define STRNLEN __strnlen # endif @@ -52,6 +54,7 @@ #ifndef STRCHR # ifdef SHARED # define STRCHR __GI_strchr +# define STRCHR_is_local # else # define STRCHR strchr # endif @@ -86,7 +89,9 @@ EALIGN (STRSTR, 4, 0) mr r30, r4 mr r3, r4 bl STRLEN +#ifndef STRLEN_is_local nop +#endif cmpdi cr7, r3, 0 /* If search str is null. */ beq cr7, L(ret_r3) @@ -95,14 +100,18 @@ EALIGN (STRSTR, 4, 0) mr r4, r3 mr r3, r29 bl STRNLEN +#ifndef STRNLEN_is_local nop +#endif cmpd cr7, r3, r31 /* If len(r3) < len(r4). */ blt cr7, L(retnull) mr r3, r29 lbz r4, 0(r30) bl STRCHR +#ifndef STRCHR_is_local nop +#endif mr r11, r3 /* If first char of search str is not present. */ @@ -334,7 +343,9 @@ L(begin): beq cr7, L(default) lbz r4, 0(r30) bl STRCHR +#ifndef STRCHR_is_local nop +#endif /* If first char of search str is not present. */ cmpdi cr7, r3, 0 ble cr7, L(end) @@ -437,7 +448,9 @@ L(nextbyte): beq cr7, L(default) lbz r4, 0(r30) bl STRCHR +#ifndef STRCHR_is_local nop +#endif /* If first char of search str is not present. */ cmpdi cr7, r3, 0 ble cr7, L(end) |