aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-06-23 20:04:23 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-06-23 20:04:23 +0000
commit16000c8d04f60a15fc0187e8719d741329501c39 (patch)
tree5710ffa231ea070279974c830e6e50bb9e1c259d /sysdeps/x86
parent049816c3be14e47e5fe10f8cd5a38bb611d34ce5 (diff)
downloadglibc-16000c8d04f60a15fc0187e8719d741329501c39.tar
glibc-16000c8d04f60a15fc0187e8719d741329501c39.tar.gz
glibc-16000c8d04f60a15fc0187e8719d741329501c39.tar.bz2
glibc-16000c8d04f60a15fc0187e8719d741329501c39.zip
Avoid localplt issues from x86 fereaiseexcept inline.
Building for x86_64 with float128 support, I get a localplt test failure from lrintf128 calling feraiseexcept. The problem is that an inline optimized version of feraiseexcept calls __feraiseexcept_renamed in cases where it doesn't completely expand inline, and that in turn is redirected to feraiseexcept for a library call, so meaning the redirection of feraiseexcept to __GI_feraiseexcept inside libm is lost for that call. This patch fixes the problem by moving the redirect to an internal header in the _LIBC case, with the internal header using __GI_feraiseexcept where appropriate. Tested for x86_64 (in conjunction with float128 patches). * sysdeps/x86/fpu/bits/fenv.h [_LIBC] (__feraiseexcept_renamed): Do not declare. * sysdeps/x86/fpu/include/bits/fenv.h [_LIBC && __USE_EXTERN_INLINES] (__feraiseexcept_renamed): Declare here, redirected to __GI_feraiseexcept if [SHARED && IS_IN (libm)].
Diffstat (limited to 'sysdeps/x86')
-rw-r--r--sysdeps/x86/fpu/bits/fenv.h2
-rw-r--r--sysdeps/x86/fpu/include/bits/fenv.h9
2 files changed, 11 insertions, 0 deletions
diff --git a/sysdeps/x86/fpu/bits/fenv.h b/sysdeps/x86/fpu/bits/fenv.h
index fd7327902c..e6fcf9431b 100644
--- a/sysdeps/x86/fpu/bits/fenv.h
+++ b/sysdeps/x86/fpu/bits/fenv.h
@@ -120,7 +120,9 @@ femode_t;
__BEGIN_DECLS
/* Optimized versions. */
+#ifndef _LIBC
extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept);
+#endif
__extern_always_inline void
__NTH (__feraiseexcept_invalid_divbyzero (int __excepts))
{
diff --git a/sysdeps/x86/fpu/include/bits/fenv.h b/sysdeps/x86/fpu/include/bits/fenv.h
index a39b6fa85d..aa61666fc3 100644
--- a/sysdeps/x86/fpu/include/bits/fenv.h
+++ b/sysdeps/x86/fpu/include/bits/fenv.h
@@ -17,6 +17,15 @@
<http://www.gnu.org/licenses/>. */
#ifndef _BITS_FENV_H
+
+#if defined _LIBC && defined __USE_EXTERN_INLINES
+# if defined SHARED && IS_IN (libm)
+extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), __GI_feraiseexcept);
+# else
+extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept);
+# endif
+#endif
+
#include_next <bits/fenv.h>
# ifndef _ISOMAC