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/powerpc32 | |
parent | 7ea510127e2067efa07865158ac92c330c379950 (diff) | |
download | glibc-22999b2f0fb62eed1af4095d062bd1272d6afeb1.tar.gz glibc-22999b2f0fb62eed1af4095d062bd1272d6afeb1.tar.xz 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/powerpc32')
-rw-r--r-- | sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c | 10 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c | 12 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/power7/memrchr.S | 1 |
3 files changed, 17 insertions, 6 deletions
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c index 62e7a12989..038c5f4532 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c @@ -23,3 +23,13 @@ extern void *__memrchr_ppc (const void *, int, size_t); #endif #include <string/memrchr.c> +# if IS_IN (libc) +# undef __memrchr +# ifdef SHARED +__hidden_ver1 (__memrchr_ppc, __GI___memrchr, __memrchr_ppc); +strong_alias (__memrchr_ppc, __memrchr_ppc1); +__hidden_ver1 (__memrchr_ppc1, __memrchr, __memrchr_ppc1); +# else +strong_alias (__memrchr_ppc, __memrchr) +# endif +#endif diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c index 8c1385fe6a..fb0d2c0617 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c @@ -17,21 +17,21 @@ <https://www.gnu.org/licenses/>. */ #if IS_IN (libc) +# define memrchr __redirect_memrchr # include <string.h> # include <shlib-compat.h> # include "init-arch.h" extern __typeof (__memrchr) __memrchr_ppc attribute_hidden; extern __typeof (__memrchr) __memrchr_power7 attribute_hidden; +# undef memrchr /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle ifunc symbol properly. */ -libc_ifunc (__memrchr, - (hwcap & PPC_FEATURE_HAS_VSX) - ? __memrchr_power7 - : __memrchr_ppc); - -weak_alias (__memrchr, memrchr) +libc_ifunc_redirected (__redirect_memrchr, memrchr, + (hwcap & PPC_FEATURE_HAS_VSX) + ? __memrchr_power7 + : __memrchr_ppc); #else #include <string/memrchr.c> #endif diff --git a/sysdeps/powerpc/powerpc32/power7/memrchr.S b/sysdeps/powerpc/powerpc32/power7/memrchr.S index 9c70517d37..9f0f17fa46 100644 --- a/sysdeps/powerpc/powerpc32/power7/memrchr.S +++ b/sysdeps/powerpc/powerpc32/power7/memrchr.S @@ -191,5 +191,6 @@ L(loop_small): blr END (__memrchr) +libc_hidden_def (__memrchr) weak_alias (__memrchr, memrchr) libc_hidden_builtin_def (memrchr) |