]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
s390: Refactor ifunc resolvers due to false debuginfo.
authorStefan Liebler <stli@linux.vnet.ibm.com>
Fri, 7 Oct 2016 07:56:47 +0000 (09:56 +0200)
committerStefan Liebler <stli@linux.vnet.ibm.com>
Fri, 7 Oct 2016 08:11:21 +0000 (10:11 +0200)
This patch adjusts the s390 specific ifunc helper macros in ifunc-resolve.h to
use the common __ifunc macro, which uses gcc attribute ifunc to get rid of the
false debuginfo. Therefore the redirection construct is applied where needed.

Perhaps in future we can switch some of the internal symbols __GI_* from the
fallback variant to the ifunc function. But this change is not
straightforward due to a segmentation fault while linking libc.so with older
binutils on s390.

ChangeLog:

[BZ #20478]
* sysdeps/s390/multiarch/ifunc-resolve.h
(s390_vx_libc_ifunc2, s390_libc_ifunc): Use __ifunc from libc-symbols.h
to create ifunc symbols.
(s390_vx_libc_ifunc_init, s390_vx_libc_ifunc_redirected
, s390_vx_libc_ifunc2_redirected, s390_libc_ifunc_init): New define.
* sysdeps/s390/multiarch/memchr.c: Redirect ifunced function in header
for using it as type for ifunc function.
* sysdeps/s390/multiarch/mempcpy.c: Likewise.
* sysdeps/s390/multiarch/rawmemchr.c: Likewise.
* sysdeps/s390/multiarch/stpcpy.c: Likewise.
* sysdeps/s390/multiarch/stpncpy.c: Likewise.
* sysdeps/s390/multiarch/strcat.c: Likewise.
* sysdeps/s390/multiarch/strchr.c: Likewise.
* sysdeps/s390/multiarch/strcmp.c: Likewise.
* sysdeps/s390/multiarch/strcpy.c: Likewise.
* sysdeps/s390/multiarch/strcspn.c: Likewise.
* sysdeps/s390/multiarch/strlen.c: Likewise.
* sysdeps/s390/multiarch/strncmp.c: Likewise.
* sysdeps/s390/multiarch/strncpy.c: Likewise.
* sysdeps/s390/multiarch/strnlen.c: Likewise.
* sysdeps/s390/multiarch/strpbrk.c: Likewise.
* sysdeps/s390/multiarch/strrchr.c: Likewise.
* sysdeps/s390/multiarch/strspn.c: Likewise.
* sysdeps/s390/multiarch/wcschr.c: Likewise.
* sysdeps/s390/multiarch/wcscmp.c: Likewise.
* sysdeps/s390/multiarch/wcspbrk.c: Likewise.
* sysdeps/s390/multiarch/wcsspn.c: Likewise.
* sysdeps/s390/multiarch/wmemchr.c: Likewise.
* sysdeps/s390/multiarch/wmemset.c: Likewise.
* sysdeps/s390/s390-32/multiarch/memcmp.c: Likewise.
* sysdeps/s390/s390-32/multiarch/memcpy.c: Likewise.
* sysdeps/s390/s390-32/multiarch/memset.c: Likewise.
* sysdeps/s390/s390-64/multiarch/memcmp.c: Likewise.
* sysdeps/s390/s390-64/multiarch/memcpy.c: Likewise.
* sysdeps/s390/s390-64/multiarch/memset.c: Likewise.

31 files changed:
ChangeLog
sysdeps/s390/multiarch/ifunc-resolve.h
sysdeps/s390/multiarch/memchr.c
sysdeps/s390/multiarch/mempcpy.c
sysdeps/s390/multiarch/rawmemchr.c
sysdeps/s390/multiarch/stpcpy.c
sysdeps/s390/multiarch/stpncpy.c
sysdeps/s390/multiarch/strcat.c
sysdeps/s390/multiarch/strchr.c
sysdeps/s390/multiarch/strcmp.c
sysdeps/s390/multiarch/strcpy.c
sysdeps/s390/multiarch/strcspn.c
sysdeps/s390/multiarch/strlen.c
sysdeps/s390/multiarch/strncmp.c
sysdeps/s390/multiarch/strncpy.c
sysdeps/s390/multiarch/strnlen.c
sysdeps/s390/multiarch/strpbrk.c
sysdeps/s390/multiarch/strrchr.c
sysdeps/s390/multiarch/strspn.c
sysdeps/s390/multiarch/wcschr.c
sysdeps/s390/multiarch/wcscmp.c
sysdeps/s390/multiarch/wcspbrk.c
sysdeps/s390/multiarch/wcsspn.c
sysdeps/s390/multiarch/wmemchr.c
sysdeps/s390/multiarch/wmemset.c
sysdeps/s390/s390-32/multiarch/memcmp.c
sysdeps/s390/s390-32/multiarch/memcpy.c
sysdeps/s390/s390-32/multiarch/memset.c
sysdeps/s390/s390-64/multiarch/memcmp.c
sysdeps/s390/s390-64/multiarch/memcpy.c
sysdeps/s390/s390-64/multiarch/memset.c

index 8fb29da25a356fc3ae773b6316b6c87535ba3aa8..6069c23606d0a3ba8877bfc1f7fdf96f5a3f75a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,42 @@
+2016-10-07  Stefan Liebler  <stli@linux.vnet.ibm.com>
+
+       [BZ #20478]
+       * sysdeps/s390/multiarch/ifunc-resolve.h
+       (s390_vx_libc_ifunc2, s390_libc_ifunc): Use __ifunc from libc-symbols.h
+       to create ifunc symbols.
+       (s390_vx_libc_ifunc_init, s390_vx_libc_ifunc_redirected
+       , s390_vx_libc_ifunc2_redirected, s390_libc_ifunc_init): New define.
+       * sysdeps/s390/multiarch/memchr.c: Redirect ifunced function in header
+       for using it as type for ifunc function.
+       * sysdeps/s390/multiarch/mempcpy.c: Likewise.
+       * sysdeps/s390/multiarch/rawmemchr.c: Likewise.
+       * sysdeps/s390/multiarch/stpcpy.c: Likewise.
+       * sysdeps/s390/multiarch/stpncpy.c: Likewise.
+       * sysdeps/s390/multiarch/strcat.c: Likewise.
+       * sysdeps/s390/multiarch/strchr.c: Likewise.
+       * sysdeps/s390/multiarch/strcmp.c: Likewise.
+       * sysdeps/s390/multiarch/strcpy.c: Likewise.
+       * sysdeps/s390/multiarch/strcspn.c: Likewise.
+       * sysdeps/s390/multiarch/strlen.c: Likewise.
+       * sysdeps/s390/multiarch/strncmp.c: Likewise.
+       * sysdeps/s390/multiarch/strncpy.c: Likewise.
+       * sysdeps/s390/multiarch/strnlen.c: Likewise.
+       * sysdeps/s390/multiarch/strpbrk.c: Likewise.
+       * sysdeps/s390/multiarch/strrchr.c: Likewise.
+       * sysdeps/s390/multiarch/strspn.c: Likewise.
+       * sysdeps/s390/multiarch/wcschr.c: Likewise.
+       * sysdeps/s390/multiarch/wcscmp.c: Likewise.
+       * sysdeps/s390/multiarch/wcspbrk.c: Likewise.
+       * sysdeps/s390/multiarch/wcsspn.c: Likewise.
+       * sysdeps/s390/multiarch/wmemchr.c: Likewise.
+       * sysdeps/s390/multiarch/wmemset.c: Likewise.
+       * sysdeps/s390/s390-32/multiarch/memcmp.c: Likewise.
+       * sysdeps/s390/s390-32/multiarch/memcpy.c: Likewise.
+       * sysdeps/s390/s390-32/multiarch/memset.c: Likewise.
+       * sysdeps/s390/s390-64/multiarch/memcmp.c: Likewise.
+       * sysdeps/s390/s390-64/multiarch/memcpy.c: Likewise.
+       * sysdeps/s390/s390-64/multiarch/memset.c: Likewise.
+
 2016-10-07  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
        * include/libc-symbols.h (__ifunc_resolver):
index 26e097ad6e00525b42d3b0330d80c0357def37fc..768829b39b6d38c394d34346417152a42a12d00e 100644 (file)
                       ".machine pop"         "\n"                      \
                       : "=QS" (STFLE_BITS), "+d" (reg0)                \
                       : : "cc");
+#define s390_libc_ifunc_init()                                         \
+  unsigned long long stfle_bits = 0ULL;                                        \
+  if (__glibc_likely((dl_hwcap & HWCAP_S390_STFLE)                     \
+                    && (dl_hwcap & HWCAP_S390_ZARCH)                   \
+                    && (dl_hwcap & HWCAP_S390_HIGH_GPRS)))             \
+    {                                                                  \
+      S390_STORE_STFLE (stfle_bits);                                   \
+    }
 
-#define s390_libc_ifunc(FUNC)                                          \
-  __asm__ (".globl " #FUNC "\n\t"                                      \
-          ".type  " #FUNC ",@gnu_indirect_function\n\t"                \
-          ".set   " #FUNC ",__resolve_" #FUNC "\n\t");                 \
-                                                                       \
+#define s390_libc_ifunc(TYPE_FUNC, RESOLVERFUNC, FUNC)                 \
   /* Make the declarations of the optimized functions hidden in order
      to prevent GOT slots being generated for them. */                 \
-  extern void *__##FUNC##_z196 attribute_hidden;                       \
-  extern void *__##FUNC##_z10 attribute_hidden;                                \
-  extern void *__##FUNC##_default attribute_hidden;                    \
-                                                                       \
-  void *__resolve_##FUNC (unsigned long int dl_hwcap)                  \
-  {                                                                    \
-    if ((dl_hwcap & HWCAP_S390_STFLE)                                  \
-       && (dl_hwcap & HWCAP_S390_ZARCH)                                \
-       && (dl_hwcap & HWCAP_S390_HIGH_GPRS))                           \
-      {                                                                        \
-       unsigned long long stfle_bits;                                  \
-       S390_STORE_STFLE (stfle_bits);                                  \
-                                                                       \
-       if (S390_IS_Z196 (stfle_bits))                                  \
-         return &__##FUNC##_z196;                                      \
-       else if (S390_IS_Z10 (stfle_bits))                              \
-         return &__##FUNC##_z10;                                       \
-       else                                                            \
-         return &__##FUNC##_default;                                   \
-      }                                                                        \
-    else                                                               \
-      return &__##FUNC##_default;                                      \
-  }
+  extern __typeof (TYPE_FUNC) RESOLVERFUNC##_z196 attribute_hidden;    \
+  extern __typeof (TYPE_FUNC) RESOLVERFUNC##_z10 attribute_hidden;      \
+  extern __typeof (TYPE_FUNC) RESOLVERFUNC##_default attribute_hidden;  \
+  __ifunc (TYPE_FUNC, FUNC,                                            \
+          __glibc_likely (S390_IS_Z196 (stfle_bits))                   \
+          ? RESOLVERFUNC##_z196                                        \
+          : __glibc_likely (S390_IS_Z10 (stfle_bits))                  \
+            ? RESOLVERFUNC##_z10                                       \
+            : RESOLVERFUNC##_default,                                  \
+          unsigned long int dl_hwcap, s390_libc_ifunc_init);
 
 #define s390_vx_libc_ifunc(FUNC)               \
-  s390_vx_libc_ifunc2(FUNC, FUNC)
+  s390_vx_libc_ifunc2_redirected(FUNC, FUNC, FUNC)
 
-#define s390_vx_libc_ifunc2(RESOLVERFUNC, FUNC)                                \
+#define s390_vx_libc_ifunc_redirected(TYPE_FUNC, FUNC) \
+  s390_vx_libc_ifunc2_redirected(TYPE_FUNC, FUNC, FUNC)
+
+#define s390_vx_libc_ifunc2(RESOLVERFUNC, FUNC)        \
+  s390_vx_libc_ifunc2_redirected(FUNC, RESOLVERFUNC, FUNC)
+
+#define s390_vx_libc_ifunc_init()
+#define s390_vx_libc_ifunc2_redirected(TYPE_FUNC, RESOLVERFUNC, FUNC)  \
   /* Make the declarations of the optimized functions hidden in order
      to prevent GOT slots being generated for them.  */                        \
-  extern __typeof (FUNC) RESOLVERFUNC##_vx attribute_hidden;           \
-  extern __typeof (FUNC) RESOLVERFUNC##_c attribute_hidden;            \
-  extern void *__resolve_##RESOLVERFUNC (unsigned long int) __asm__ (#FUNC); \
-                                                                       \
-  void *__resolve_##RESOLVERFUNC (unsigned long int dl_hwcap)          \
-  {                                                                    \
-    if (dl_hwcap & HWCAP_S390_VX)                                      \
-      return &RESOLVERFUNC##_vx;                                       \
-    else                                                               \
-      return &RESOLVERFUNC##_c;                                                \
-  }                                                                    \
- __asm__ (".type " #FUNC ", %gnu_indirect_function");
+  extern __typeof (TYPE_FUNC) RESOLVERFUNC##_vx attribute_hidden;      \
+  extern __typeof (TYPE_FUNC) RESOLVERFUNC##_c attribute_hidden;       \
+  __ifunc (TYPE_FUNC, FUNC,                                            \
+          (dl_hwcap & HWCAP_S390_VX)                                   \
+          ? RESOLVERFUNC##_vx                                          \
+          : RESOLVERFUNC##_c,                                          \
+          unsigned long int dl_hwcap, s390_vx_libc_ifunc_init);
index f80de1cc1f1132ebe29872ea96eb9490a30c81e0..891ec7aa56bb86df29a29f591c585f1717a6d7ed 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define memchr __redirect_memchr
 # include <string.h>
+# undef memchr
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc2 (__memchr, memchr)
+s390_vx_libc_ifunc2_redirected (__redirect_memchr, __memchr, memchr)
+
 #endif
index 34d8329ba8e122917df9110d1ed7e1ad0d3f35c1..bee3ee47bbca5c98233439361b3a78913e387c55 100644 (file)
 
 
 #if defined SHARED && IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
+/* Omit the mempcpy inline definitions because it would redefine mempcpy.  */
+# define _HAVE_STRING_ARCH_mempcpy 1
+# include <string.h>
+# undef mempcpy
+# undef __mempcpy
 # include <ifunc-resolve.h>
-s390_libc_ifunc (__mempcpy)
 
-__asm__ (".weak mempcpy\n\t"
-        ".set mempcpy,__mempcpy\n\t");
+s390_libc_ifunc (__redirect___mempcpy, ____mempcpy, __mempcpy)
+weak_alias (__mempcpy, mempcpy);
 #endif
index 7186ccd9d436beb4c66397171b996ced9c16bf75..c4afa240049b841d3312a1a00ce2e3664949f27e 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define __rawmemchr __redirect___rawmemchr
 # include <string.h>
+# undef __rawmemchr
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc (__rawmemchr)
+s390_vx_libc_ifunc2_redirected (__redirect___rawmemchr, __rawmemchr
+                               , __rawmemchr)
 weak_alias (__rawmemchr, rawmemchr)
 
 #else
index dcde01278ba44eb5d1cc006d7d8c22ef42ca9ee8..cea6c0793f934afa2d1f92740c92d0c76728781b 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define stpcpy __redirect_stpcpy
+# define __stpcpy __redirect___stpcpy
+/* Omit the stpcpy inline definitions because it would redefine stpcpy.  */
+# define __NO_STRING_INLINES
 # define NO_MEMPCPY_STPCPY_REDIRECT
 # include <string.h>
+# undef stpcpy
+# undef __stpcpy
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc (__stpcpy)
+s390_vx_libc_ifunc_redirected (__redirect___stpcpy, __stpcpy);
 weak_alias (__stpcpy, stpcpy)
-libc_hidden_builtin_def (stpcpy)
 
 #else
 # include <string/stpcpy.c>
index f5335b42acda7315b32c97281fcc0b7aacca18ec..cbbe8ba4fe6daea9de045399d7630734a796ac79 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define stpncpy __redirect_stpncpy
+# define __stpncpy __redirect___stpncpy
 # include <string.h>
+# undef stpncpy
+# undef __stpncpy
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc (__stpncpy)
+s390_vx_libc_ifunc_redirected (__redirect___stpncpy, __stpncpy)
 weak_alias (__stpncpy, stpncpy)
 
 #else
index c3b5e1c9d667d741fc91602398ef083df3fbbb6f..0c74c91954700abe58c6c1517375960a9348185e 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strcat __redirect_strcat
 # include <string.h>
+# undef strcat
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc2 (__strcat, strcat)
+s390_vx_libc_ifunc2_redirected (__redirect_strcat, __strcat, strcat)
 
 #else
 # include <string/strcat.c>
index 3c8c7e4600137319453ed5bfdd4c578ff6408e69..3b378b93205113eba6d7e178fada5a16c4471e2c 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strchr __redirect_strchr
+/* Omit the strchr inline definitions because it would redefine strchr.  */
+# define __NO_STRING_INLINES
 # include <string.h>
+# undef strchr
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc2 (__strchr, strchr)
+s390_vx_libc_ifunc2_redirected (__redirect_strchr, __strchr, strchr)
 weak_alias (strchr, index)
 
 #else
index c4ccd344203b899d462b28b4e91022d791c25a8e..faeaaa54a641f3966ab6234723b9db42352d15da 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strcmp __redirect_strcmp
+/* Omit the strcmp inline definitions because it would redefine strcmp.  */
+# define __NO_STRING_INLINES
 # include <string.h>
 # include <ifunc-resolve.h>
+# undef strcmp
 
+s390_vx_libc_ifunc2_redirected (__redirect_strcmp, __strcmp, strcmp)
 
-# undef strcmp
-s390_vx_libc_ifunc2 (__strcmp, strcmp)
 #endif
index f3481991125abe8da99d4536b2f7952895ecc44d..9053b12963182ee2a5b0350b896a8dd8488c5a6b 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strcpy __redirect_strcpy
 # include <string.h>
+# undef strcpy
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc2 (__strcpy, strcpy)
+s390_vx_libc_ifunc2_redirected (__redirect_strcpy, __strcpy, strcpy)
+
 #endif
index c23452a79191374072775e8b9e64e2c885944dff..d1fe33b91f93e1fc1da765223c5a218cd417ce56 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strcspn __redirect_strcspn
+/* Omit the strcspn inline definitions because it would redefine strcspn.  */
+# define __NO_STRING_INLINES
 # include <string.h>
+# undef strcspn
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc2 (__strcspn, strcspn)
+s390_vx_libc_ifunc2_redirected (__redirect_strcspn, __strcspn, strcspn)
 
 #else
 # include <string/strcspn.c>
index 098d4e1e5852b1c66b5cda225297f0718e903381..8329f2bec6490383c156f83f0996e0e90c846e93 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strlen __redirect_strlen
 # include <string.h>
 # include <ifunc-resolve.h>
+# undef strlen
 
-s390_vx_libc_ifunc2 (__strlen, strlen)
+s390_vx_libc_ifunc2_redirected (__redirect_strlen, __strlen, strlen)
 
 #else
 # include <string/strlen.c>
index 9a72c79bfd627a1a42316a1964147afc5ba90460..2bdf4bf8dec97d9bd0cfb4c958f5ecf5c2003d4a 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strncmp __redirect_strncmp
+/* Omit the strncmp inline definitions because it would redefine strncmp.  */
+# define __NO_STRING_INLINES
 # include <string.h>
+# undef strncmp
 # include <ifunc-resolve.h>
 
-
-# undef strcmp
-extern __typeof (strncmp) __strncmp;
-s390_vx_libc_ifunc2 (__strncmp, strncmp)
+s390_vx_libc_ifunc2_redirected (__redirect_strncmp, __strncmp, strncmp)
 
 #else
 # include <string/strncmp.c>
index 1464551875c95fec8b7c59f75275cfeb268febf5..c4d13a98a916e5d4ed7f5e87df7a0bf3968335cc 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strncpy __redirect_strncpy
+/* Omit the strncpy inline definitions because it would redefine strncpy.  */
+# define __NO_STRING_INLINES
 # include <string.h>
+# undef strncpy
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc2 (__strncpy, strncpy)
+s390_vx_libc_ifunc2_redirected (__redirect_strncpy, __strncpy, strncpy);
+
 #endif
index 48c3bb73e6ae6c9ecbf6a7356feec68ec7502962..ecb69ebad3f2147b31bfd7fee60cd5a8e7a75042 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strnlen __redirect_strnlen
+# define __strnlen __redirect___strnlen
 # include <string.h>
+# undef strnlen
+# undef __strnlen
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc (__strnlen)
+s390_vx_libc_ifunc_redirected (__redirect___strnlen, __strnlen)
 weak_alias (__strnlen, strnlen)
-libc_hidden_def (strnlen)
 
 #else
 # include <string/strnlen.c>
index cdc139929f05f316e28433cab0635d3d0a76c2de..09c3fffdf15fdda81c573037a81af428a5090185 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strpbrk __redirect_strpbrk
+/* Omit the strpbrk inline definitions because it would redefine strpbrk.  */
+# define __NO_STRING_INLINES
 # include <string.h>
+# undef strpbrk
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc2 (__strpbrk, strpbrk)
+s390_vx_libc_ifunc2_redirected (__redirect_strpbrk, __strpbrk, strpbrk)
 
 #else
 # include <string/strpbrk.c>
index e515d6b6e676a2a879b20f2eff85573e3a675f0b..2da8581708a9c89c50eda707cad24a072cee227f 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strrchr __redirect_strrchr
 # include <string.h>
+# undef strrchr
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc2 (__strrchr, strrchr)
-weak_alias (strrchr, rindex)
+s390_vx_libc_ifunc2_redirected (__redirect_strrchr, __strrchr, strrchr)
+weak_alias (strrchr, rindex);
 
 #else
 # include <string/strrchr.c>
index 7c26af8ced78933f18f746d1b0a7ee829e58d121..1d9514d463cbff26feb12aed1daa4349895f5103 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strspn __redirect_strspn
+/* Omit the strspn inline definitions because it would redefine strspn.  */
+# define __NO_STRING_INLINES
 # include <string.h>
+# undef strspn
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc2 (__strspn, strspn)
+s390_vx_libc_ifunc2_redirected (__redirect_strspn, __strspn, strspn)
 
 #else
 # include <string/strspn.c>
index fb51097cd6b54e487e3e1eec740efa38669a5376..3e0ff8b6dbdf56459d141c648b63978fa7c25edc 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define wcschr __redirect_wcschr
+# define __wcschr __redirect___wcschr
 # include <wchar.h>
+# undef wcschr
+# undef __wcschr
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc (__wcschr)
+s390_vx_libc_ifunc_redirected (__redirect___wcschr, __wcschr)
 weak_alias (__wcschr, wcschr)
-libc_hidden_weak (wcschr)
 
 #else
 # include <wcsmbs/wcschr.c>
index 705ef4596ef2d9a27d62eff7ae0732e6e0156992..dc29b32a29c44da1bcdd732446a671aa6e7e8bbc 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define __wcscmp __redirect___wcscmp
 # include <wchar.h>
+# undef __wcscmp
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc (__wcscmp)
+s390_vx_libc_ifunc_redirected (__redirect___wcscmp, __wcscmp)
 weak_alias (__wcscmp, wcscmp)
 
 #else
index 198144d2c5bba860766167f7ffae44bd5952ec5a..9824bd536c9d51b996dbcde22130ad4f819246fb 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define wcspbrk __redirect_wcspbrk
 # include <wchar.h>
+# undef wcspbrk
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc2 (__wcspbrk, wcspbrk)
+s390_vx_libc_ifunc2_redirected (__redirect_wcspbrk, __wcspbrk, wcspbrk)
 
 #else
 # include <wcsmbs/wcspbrk.c>
index 167a881d137104d871d297a9d9f9286eba4fd656..d153d44b2fefd51325b0c955b1ee27c3df4296d9 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define wcsspn __redirect_wcsspn
 # include <wchar.h>
+# undef wcsspn
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc2 (__wcsspn, wcsspn)
+s390_vx_libc_ifunc2_redirected (__redirect_wcsspn, __wcsspn, wcsspn)
 
 #else
 # include <wcsmbs/wcsspn.c>
index f2bfe3c7a58cc54a95ce9ec2c62131899f56d2de..45b344182f471ad8faa783fb2c63a5b8299db8f6 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define wmemchr __redirect_wmemchr
+# define __wmemchr __redirect___wmemchr
 # include <wchar.h>
+# undef wmemchr
+# undef __wmemchr
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc (__wmemchr)
+s390_vx_libc_ifunc_redirected (__redirect___wmemchr, __wmemchr)
 weak_alias (__wmemchr, wmemchr)
-libc_hidden_weak (wmemchr)
 
 #else
 # include <wcsmbs/wmemchr.c>
index e9e695fc0afb013ce3300cfcddc23d78debb7036..2fc57ee71de5701d61cdd3a1ce99c5eb1cb95213 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define wmemset __redirect_wmemset
+# define __wmemset __redirect___wmemset
 # include <wchar.h>
+# undef wmemset
+# undef __wmemset
 # include <ifunc-resolve.h>
 
-s390_vx_libc_ifunc (__wmemset)
+s390_vx_libc_ifunc_redirected (__redirect___wmemset, __wmemset)
 weak_alias (__wmemset, wmemset)
-libc_hidden_weak (wmemset)
 
 #else
 # include <wcsmbs/wmemset.c>
index 44f72dc8cabfea0403f8ef1e87d41d837f25d083..453b1706f789ec0d43b29ce2341f67ced1fad046 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if IS_IN (libc)
+# define memcmp __redirect_memcmp
+# include <string.h>
+# undef memcmp
 # include <ifunc-resolve.h>
 
-s390_libc_ifunc (memcmp)
-__asm__(".weak bcmp ; bcmp = memcmp");
+s390_libc_ifunc (__redirect_memcmp, __memcmp, memcmp)
+weak_alias (memcmp, bcmp);
 #endif
index 2a98aa0b82650d8a7e097a0425f9e795ad59caa1..33e4bcdca271549bcd9fe89419f2c6085ad74f9e 100644 (file)
 
 /* In the static lib memcpy is needed before the reloc is resolved.  */
 #if defined SHARED && IS_IN (libc)
+# define memcpy __redirect_memcpy
+# include <string.h>
+# undef memcpy
 # include <ifunc-resolve.h>
 
-s390_libc_ifunc (memcpy)
+s390_libc_ifunc (__redirect_memcpy, __memcpy, memcpy)
 #endif
index 89b8102f2ab46438ed61708c2c9d6ecf6a90537c..84ddedaf045abe360201d62c3b3f393d3315eb68 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if IS_IN (libc)
+# define memset __redirect_memset
+# include <string.h>
+# undef memset
 # include <ifunc-resolve.h>
 
-s390_libc_ifunc (memset)
+s390_libc_ifunc (__redirect_memset, __memset, memset)
 #endif
index 44f72dc8cabfea0403f8ef1e87d41d837f25d083..453b1706f789ec0d43b29ce2341f67ced1fad046 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if IS_IN (libc)
+# define memcmp __redirect_memcmp
+# include <string.h>
+# undef memcmp
 # include <ifunc-resolve.h>
 
-s390_libc_ifunc (memcmp)
-__asm__(".weak bcmp ; bcmp = memcmp");
+s390_libc_ifunc (__redirect_memcmp, __memcmp, memcmp)
+weak_alias (memcmp, bcmp);
 #endif
index 2a98aa0b82650d8a7e097a0425f9e795ad59caa1..33e4bcdca271549bcd9fe89419f2c6085ad74f9e 100644 (file)
 
 /* In the static lib memcpy is needed before the reloc is resolved.  */
 #if defined SHARED && IS_IN (libc)
+# define memcpy __redirect_memcpy
+# include <string.h>
+# undef memcpy
 # include <ifunc-resolve.h>
 
-s390_libc_ifunc (memcpy)
+s390_libc_ifunc (__redirect_memcpy, __memcpy, memcpy)
 #endif
index 89b8102f2ab46438ed61708c2c9d6ecf6a90537c..84ddedaf045abe360201d62c3b3f393d3315eb68 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #if IS_IN (libc)
+# define memset __redirect_memset
+# include <string.h>
+# undef memset
 # include <ifunc-resolve.h>
 
-s390_libc_ifunc (memset)
+s390_libc_ifunc (__redirect_memset, __memset, memset)
 #endif