aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-02-06 13:15:22 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-02-08 17:13:56 -0300
commit7ea510127e2067efa07865158ac92c330c379950 (patch)
treedf830b3da00683a56693e2cca08268b8764c14eb /sysdeps/powerpc
parent9fd63e35371b9939e9153907c6a753e6960b68ad (diff)
downloadglibc-7ea510127e2067efa07865158ac92c330c379950.tar
glibc-7ea510127e2067efa07865158ac92c330c379950.tar.gz
glibc-7ea510127e2067efa07865158ac92c330c379950.tar.bz2
glibc-7ea510127e2067efa07865158ac92c330c379950.zip
string: Add libc_hidden_proto for strchrnul
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')
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c7
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c17
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchrnul.c1
3 files changed, 17 insertions, 8 deletions
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c
index da03ac7c04..fbd947def1 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c
@@ -22,3 +22,10 @@
extern __typeof (strchrnul) __strchrnul_ppc attribute_hidden;
#include <string/strchrnul.c>
+#undef __strchrnul
+weak_alias (__strchrnul_ppc, __strchrnul)
+#ifdef SHARED
+__hidden_ver1 (__strchrnul_ppc, __GI___strchrnul, __strchrnul_ppc);
+#else
+weak_alias (__strchrnul_ppc, strchrnul)
+#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c
index d17dfa4fcf..b11e2a4ff7 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c
@@ -16,22 +16,23 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#if IS_IN (libc)
+#if defined SHARED && IS_IN (libc)
+# define __strchrnul __redirect___strchrnul
+# define strchrnul __redirect_strchrnul
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (__strchrnul) __strchrnul_ppc attribute_hidden;
extern __typeof (__strchrnul) __strchrnul_power7 attribute_hidden;
+# undef __strchrnul
+# undef strchrnul
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (__strchrnul,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strchrnul_power7
- : __strchrnul_ppc);
-
+libc_ifunc_redirected (__redirect___strchrnul, __strchrnul,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strchrnul_power7
+ : __strchrnul_ppc);
weak_alias (__strchrnul, strchrnul)
-#else
-#include <string/strchrnul.c>
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
index a901fa3c45..94873507a6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
@@ -35,6 +35,7 @@ libc_ifunc (__strchrnul,
? __strchrnul_power7
: __strchrnul_ppc);
+libc_hidden_def (__strchrnul)
weak_alias (__strchrnul, strchrnul)
#else
#include <string/strchrnul.c>