]> sourceware.org Git - glibc.git/commitdiff
Remove attribute_hidden for wchar ifunc symbols.
authorStefan Liebler <stli@linux.vnet.ibm.com>
Tue, 21 Nov 2017 07:39:53 +0000 (08:39 +0100)
committerStefan Liebler <stli@linux.vnet.ibm.com>
Tue, 21 Nov 2017 07:43:23 +0000 (08:43 +0100)
On s390 (31bit) various debug/tst-*chk* testcases are failing as the tests
are ending with a segmentation fault.

One test is e.g. calling wcsnrtombs in debug/tst-chk1.c:1549.
The function wcsnrtombs itself calls __wcsnlen. This function is called via
PLT! The PLT-stub itself loads the address from GOT (r12 is assumed to be
the GOT-pointer). In this case the loaded address is zero and the following
branch leads to the segmentation fault.

Due to the attribute_hidden in commit 44af8a32c341672b5160fdc2839767e9a837ad26
"Mark internal wchar functions with attribute_hidden [BZ #18822]"
for e.g. the __wcsnlen function, r12 is not loaded with the GOT-pointer
in wcsnrtombs.

On s390x (64bit), this __wcsnlen call is also using the PLT-stub. But it is
not failing as the GOT-pointer is setup with larl-instruction by the PLT-stub
itself.
Note: On s390x/s390, __wcsnlen is an IFUNC symbol.

On x86_64, __wcsnlen is also an IFUNC symbol and is called via PLT, too.

Further IFUNC symbols on s390 which were marked as hidden by the mentioned
commit are: __wcscat, __wcsncpy, __wcpncpy, __wcschrnul.

This patch removes the attribute_hidden in wchar.h.
Then the compiler setups e.g. r12 on s390 in order to call __wcsnlen via PLT.

ChangeLog:

* include/wchar.h (__wcsnlen, __wcscat, __wcsncpy, __wcpncpy,
__wcschrnul): Remove attribute_hidden.

ChangeLog
include/wchar.h

index 50da3df0b98cf783b0baba8ea4d8706bdf093db0..ca6024c35c3fa8d2ffcede4c54b6dbc7187f3d8d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-11-21  Stefan Liebler  <stli@linux.vnet.ibm.com>
+
+       * include/wchar.h (__wcsnlen, __wcscat, __wcsncpy, __wcpncpy,
+       __wcschrnul): Remove attribute_hidden.
+
 2017-11-20  Paul Eggert  <eggert@cs.ucla.edu>
 
        regex: don't assume uint64_t or uint32_t
index 24b2eaa5f98168e6997ffa69c4c35eccd9254fe8..1db0ac82785f940309ba52768deb276439fa37e9 100644 (file)
@@ -152,9 +152,8 @@ extern int __wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2,
      __attribute_pure__;
 extern size_t __wcslen (const wchar_t *__s) __attribute_pure__;
 extern size_t __wcsnlen (const wchar_t *__s, size_t __maxlen)
-     attribute_hidden __attribute_pure__;
-extern wchar_t *__wcscat (wchar_t *dest, const wchar_t *src)
-     attribute_hidden;
+     __attribute_pure__;
+extern wchar_t *__wcscat (wchar_t *dest, const wchar_t *src);
 extern wint_t __btowc (int __c) attribute_hidden;
 extern int __mbsinit (const __mbstate_t *__ps);
 extern size_t __mbrtowc (wchar_t *__restrict __pwc,
@@ -182,11 +181,10 @@ extern size_t __wcsnrtombs (char *__restrict __dst,
                            __mbstate_t *__restrict __ps)
      attribute_hidden;
 extern wchar_t *__wcsncpy (wchar_t *__restrict __dest,
-                          const wchar_t *__restrict __src, size_t __n)
-     attribute_hidden;
+                          const wchar_t *__restrict __src, size_t __n);
 extern wchar_t *__wcpcpy (wchar_t *__dest, const wchar_t *__src);
 extern wchar_t *__wcpncpy (wchar_t *__dest, const wchar_t *__src,
-                          size_t __n) attribute_hidden;
+                          size_t __n);
 extern wchar_t *__wmemcpy (wchar_t *__s1, const wchar_t *s2,
                           size_t __n) attribute_hidden;
 extern wchar_t *__wmempcpy (wchar_t *__restrict __s1,
@@ -195,7 +193,7 @@ extern wchar_t *__wmempcpy (wchar_t *__restrict __s1,
 extern wchar_t *__wmemmove (wchar_t *__s1, const wchar_t *__s2,
                            size_t __n) attribute_hidden;
 extern wchar_t *__wcschrnul (const wchar_t *__s, wchar_t __wc)
-     attribute_hidden __attribute_pure__;
+     __attribute_pure__;
 
 extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
                               size_t __ns) __THROW;
This page took 0.084248 seconds and 5 git commands to generate.