diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-02-06 15:05:56 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-02-08 17:13:58 -0300 |
commit | 22999b2f0fb62eed1af4095d062bd1272d6afeb1 (patch) | |
tree | cb21ffd0c043cdb5393c3529148b83679349d7a5 /sysdeps/powerpc/powerpc64 | |
parent | 7ea510127e2067efa07865158ac92c330c379950 (diff) | |
download | glibc-22999b2f0fb62eed1af4095d062bd1272d6afeb1.tar glibc-22999b2f0fb62eed1af4095d062bd1272d6afeb1.tar.gz glibc-22999b2f0fb62eed1af4095d062bd1272d6afeb1.tar.bz2 glibc-22999b2f0fb62eed1af4095d062bd1272d6afeb1.zip |
string: Add libc_hidden_proto for memrchr
Although static linker can optimize it to local call, it follows the
internal scheme to provide hidden proto and definitions.
Reviewed-by: Carlos Eduardo Seo <carlos.seo@linaro.org>
Diffstat (limited to 'sysdeps/powerpc/powerpc64')
-rw-r--r-- | sysdeps/powerpc/powerpc64/multiarch/memrchr.c | 18 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/power7/memrchr.S | 1 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/power8/memrchr.S | 1 |
3 files changed, 11 insertions, 9 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c index 59527a83eb..5e7c00fdce 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c +++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c @@ -17,6 +17,7 @@ <https://www.gnu.org/licenses/>. */ #if IS_IN (libc) +# define memrchr __redirect_memrchr # include <string.h> # include <shlib-compat.h> # include "init-arch.h" @@ -24,18 +25,17 @@ extern __typeof (__memrchr) __memrchr_ppc attribute_hidden; extern __typeof (__memrchr) __memrchr_power7 attribute_hidden; extern __typeof (__memrchr) __memrchr_power8 attribute_hidden; +# undef memrchr /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle ifunc symbol properly. */ -libc_ifunc (__memrchr, - (hwcap2 & PPC_FEATURE2_ARCH_2_07 - && hwcap & PPC_FEATURE_HAS_ALTIVEC) - ? __memrchr_power8 : - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __memrchr_power7 - : __memrchr_ppc); - -weak_alias (__memrchr, memrchr) +libc_ifunc_redirected (__redirect_memrchr, memrchr, + (hwcap2 & PPC_FEATURE2_ARCH_2_07 + && hwcap & PPC_FEATURE_HAS_ALTIVEC) + ? __memrchr_power8 : + (hwcap & PPC_FEATURE_ARCH_2_06) + ? __memrchr_power7 + : __memrchr_ppc); #else #include <string/memrchr.c> #endif diff --git a/sysdeps/powerpc/powerpc64/power7/memrchr.S b/sysdeps/powerpc/powerpc64/power7/memrchr.S index 56e79f3cd5..3b0430ccff 100644 --- a/sysdeps/powerpc/powerpc64/power7/memrchr.S +++ b/sysdeps/powerpc/powerpc64/power7/memrchr.S @@ -196,5 +196,6 @@ L(loop_small): blr END (MEMRCHR) +libc_hidden_def (__memrchr) weak_alias (__memrchr, memrchr) libc_hidden_builtin_def (memrchr) diff --git a/sysdeps/powerpc/powerpc64/power8/memrchr.S b/sysdeps/powerpc/powerpc64/power8/memrchr.S index fec76cf586..ebe4017968 100644 --- a/sysdeps/powerpc/powerpc64/power8/memrchr.S +++ b/sysdeps/powerpc/powerpc64/power8/memrchr.S @@ -332,5 +332,6 @@ L(loop_small): blr END (MEMRCHR) +libc_hidden_def (__memrchr) weak_alias (__memrchr, memrchr) libc_hidden_builtin_def (memrchr) |