aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-01-07 19:01:20 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-01-07 19:01:20 +0000
commit8116321f657549e80d0167b8a790a7aa54d6379d (patch)
treee37ed85c1a187c09c97233ebc819192dc06db14c /sysdeps
parent882dfe184a81a8924bc8acb79e96fbf7556fa60b (diff)
downloadglibc-8116321f657549e80d0167b8a790a7aa54d6379d.tar
glibc-8116321f657549e80d0167b8a790a7aa54d6379d.tar.gz
glibc-8116321f657549e80d0167b8a790a7aa54d6379d.tar.bz2
glibc-8116321f657549e80d0167b8a790a7aa54d6379d.zip
Fix libm feupdateenv namespace (bug 17748).
Concluding the fixes for C90 libm functions calling C99 fe* functions, this patch fixes the case of feupdateenv by making it a weak alias for __feupdateenv and making the affected code call __feupdateenv. Tested for x86_64 (testsuite, and that installed stripped shared libraries are unchanged by the patch). Also tested for ARM (soft-float) that the math.h linknamespace tests now pass. [BZ #17748] * include/fenv.h (__feupdateenv): Use libm_hidden_proto. * math/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/aarch64/fpu/feupdateenv.c (feupdateenv): Rename to __feupdateenv and define as weak alias of __feupdateenv. Use libm_hidden_weak. * sysdeps/alpha/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/arm/feupdateenv.c (feupdateenv): Rename to __feupdateenv and define as weak alias of __feupdateenv. Use libm_hidden_weak. * sysdeps/hppa/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/i386/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Rename to __feupdateenv and define as weak alias of __feupdateenv. Use libm_hidden_weak. * sysdeps/m68k/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/mips/fpu/feupdateenv.c (feupdateenv): Rename to __feupdateenv and define as weak alias of __feupdateenv. Use libm_hidden_weak. * sysdeps/powerpc/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/powerpc/nofpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/s390/fpu/feupdateenv.c (feupdateenv): Rename to __feupdateenv and define as weak alias of __feupdateenv. Use libm_hidden_weak. * sysdeps/sh/sh4/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/sparc/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/tile/math_private.h (__feupdateenv): New inline function. * sysdeps/x86_64/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/generic/math_private.h (default_libc_feupdateenv): Call __feupdateenv instead of feupdateenv. (default_libc_feupdateenv_test): Likewise. (libc_feresetround_ctx): Likewise.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/aarch64/fpu/feupdateenv.c6
-rw-r--r--sysdeps/alpha/fpu/feupdateenv.c1
-rw-r--r--sysdeps/arm/feupdateenv.c6
-rw-r--r--sysdeps/generic/math_private.h6
-rw-r--r--sysdeps/hppa/fpu/feupdateenv.c6
-rw-r--r--sysdeps/i386/fpu/feupdateenv.c1
-rw-r--r--sysdeps/ia64/fpu/feupdateenv.c6
-rw-r--r--sysdeps/m68k/fpu/feupdateenv.c1
-rw-r--r--sysdeps/mips/fpu/feupdateenv.c6
-rw-r--r--sysdeps/powerpc/fpu/feupdateenv.c1
-rw-r--r--sysdeps/powerpc/nofpu/feupdateenv.c1
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c1
-rw-r--r--sysdeps/s390/fpu/feupdateenv.c6
-rw-r--r--sysdeps/sh/sh4/fpu/feupdateenv.c6
-rw-r--r--sysdeps/sparc/fpu/feupdateenv.c1
-rw-r--r--sysdeps/tile/math_private.h1
-rw-r--r--sysdeps/x86_64/fpu/feupdateenv.c1
17 files changed, 40 insertions, 17 deletions
diff --git a/sysdeps/aarch64/fpu/feupdateenv.c b/sysdeps/aarch64/fpu/feupdateenv.c
index 94958a887f..12e799ec77 100644
--- a/sysdeps/aarch64/fpu/feupdateenv.c
+++ b/sysdeps/aarch64/fpu/feupdateenv.c
@@ -20,7 +20,7 @@
#include <fpu_control.h>
int
-feupdateenv (const fenv_t *envp)
+__feupdateenv (const fenv_t *envp)
{
fpu_control_t fpcr;
fpu_control_t fpcr_new;
@@ -84,4 +84,6 @@ feupdateenv (const fenv_t *envp)
return 0;
}
-libm_hidden_def (feupdateenv)
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/alpha/fpu/feupdateenv.c b/sysdeps/alpha/fpu/feupdateenv.c
index 8b521454de..ab63c962d2 100644
--- a/sysdeps/alpha/fpu/feupdateenv.c
+++ b/sysdeps/alpha/fpu/feupdateenv.c
@@ -45,5 +45,6 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_def (__feupdateenv)
libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/sysdeps/arm/feupdateenv.c b/sysdeps/arm/feupdateenv.c
index cc2989545c..f7478e1bc7 100644
--- a/sysdeps/arm/feupdateenv.c
+++ b/sysdeps/arm/feupdateenv.c
@@ -23,7 +23,7 @@
int
-feupdateenv (const fenv_t *envp)
+__feupdateenv (const fenv_t *envp)
{
fpu_control_t fpscr, new_fpscr, updated_fpscr;
int excepts;
@@ -73,4 +73,6 @@ feupdateenv (const fenv_t *envp)
return 0;
}
-libm_hidden_def (feupdateenv)
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index 24e2babd61..0ab547d82f 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -478,7 +478,7 @@ default_libc_fesetenv (fenv_t *e)
static __always_inline void
default_libc_feupdateenv (fenv_t *e)
{
- (void) feupdateenv (e);
+ (void) __feupdateenv (e);
}
#ifndef libc_feupdateenv
@@ -499,7 +499,7 @@ static __always_inline int
default_libc_feupdateenv_test (fenv_t *e, int ex)
{
int ret = fetestexcept (ex);
- feupdateenv (e);
+ __feupdateenv (e);
return ret;
}
@@ -608,7 +608,7 @@ libc_feresetround_ctx (struct rm_ctx *ctx)
{
/* Restore the rounding mode if updated. */
if (__glibc_unlikely (ctx->updated_status))
- feupdateenv (&ctx->env);
+ __feupdateenv (&ctx->env);
}
static __always_inline void
diff --git a/sysdeps/hppa/fpu/feupdateenv.c b/sysdeps/hppa/fpu/feupdateenv.c
index e6a07c31f4..931f7e6292 100644
--- a/sysdeps/hppa/fpu/feupdateenv.c
+++ b/sysdeps/hppa/fpu/feupdateenv.c
@@ -21,7 +21,7 @@
#include <string.h>
int
-feupdateenv (const fenv_t *envp)
+__feupdateenv (const fenv_t *envp)
{
union { unsigned long long l; unsigned int sw[2]; } s;
fenv_t temp;
@@ -37,4 +37,6 @@ feupdateenv (const fenv_t *envp)
/* Success. */
return 0;
}
-libm_hidden_def (feupdateenv)
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/i386/fpu/feupdateenv.c b/sysdeps/i386/fpu/feupdateenv.c
index 2f58ab39ff..de461a4d51 100644
--- a/sysdeps/i386/fpu/feupdateenv.c
+++ b/sysdeps/i386/fpu/feupdateenv.c
@@ -55,5 +55,6 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_def (__feupdateenv)
libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/sysdeps/ia64/fpu/feupdateenv.c b/sysdeps/ia64/fpu/feupdateenv.c
index c6415ed38b..89597bef61 100644
--- a/sysdeps/ia64/fpu/feupdateenv.c
+++ b/sysdeps/ia64/fpu/feupdateenv.c
@@ -20,7 +20,7 @@
#include <fenv.h>
int
-feupdateenv (const fenv_t *envp)
+__feupdateenv (const fenv_t *envp)
{
fenv_t fpsr;
@@ -37,4 +37,6 @@ feupdateenv (const fenv_t *envp)
/* Success. */
return 0;
}
-libm_hidden_def (feupdateenv)
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/m68k/fpu/feupdateenv.c b/sysdeps/m68k/fpu/feupdateenv.c
index 80bd59322e..9bd3418725 100644
--- a/sysdeps/m68k/fpu/feupdateenv.c
+++ b/sysdeps/m68k/fpu/feupdateenv.c
@@ -46,5 +46,6 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_def (__feupdateenv)
libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/sysdeps/mips/fpu/feupdateenv.c b/sysdeps/mips/fpu/feupdateenv.c
index 2fe8ebe60c..899d49441b 100644
--- a/sysdeps/mips/fpu/feupdateenv.c
+++ b/sysdeps/mips/fpu/feupdateenv.c
@@ -21,7 +21,7 @@
#include <fpu_control.h>
int
-feupdateenv (const fenv_t *envp)
+__feupdateenv (const fenv_t *envp)
{
int temp;
@@ -40,4 +40,6 @@ feupdateenv (const fenv_t *envp)
/* Success. */
return 0;
}
-libm_hidden_def (feupdateenv)
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/powerpc/fpu/feupdateenv.c b/sysdeps/powerpc/fpu/feupdateenv.c
index 326efe0f8f..1e0db9e3c1 100644
--- a/sysdeps/powerpc/fpu/feupdateenv.c
+++ b/sysdeps/powerpc/fpu/feupdateenv.c
@@ -63,5 +63,6 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_def (__feupdateenv)
libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/sysdeps/powerpc/nofpu/feupdateenv.c b/sysdeps/powerpc/nofpu/feupdateenv.c
index 892e463727..04413430ce 100644
--- a/sysdeps/powerpc/nofpu/feupdateenv.c
+++ b/sysdeps/powerpc/nofpu/feupdateenv.c
@@ -48,5 +48,6 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_def (__feupdateenv)
libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c b/sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c
index cb6a1487ac..ca88d2afea 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c
@@ -43,5 +43,6 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_def (__feupdateenv)
libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/sysdeps/s390/fpu/feupdateenv.c b/sysdeps/s390/fpu/feupdateenv.c
index 957c8fe9ad..7e2cf15079 100644
--- a/sysdeps/s390/fpu/feupdateenv.c
+++ b/sysdeps/s390/fpu/feupdateenv.c
@@ -22,7 +22,7 @@
#include <fpu_control.h>
int
-feupdateenv (const fenv_t *envp)
+__feupdateenv (const fenv_t *envp)
{
fexcept_t temp;
@@ -37,4 +37,6 @@ feupdateenv (const fenv_t *envp)
/* Success. */
return 0;
}
-libm_hidden_def (feupdateenv)
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/sh/sh4/fpu/feupdateenv.c b/sysdeps/sh/sh4/fpu/feupdateenv.c
index 25729d9c1f..b72822b032 100644
--- a/sysdeps/sh/sh4/fpu/feupdateenv.c
+++ b/sysdeps/sh/sh4/fpu/feupdateenv.c
@@ -21,7 +21,7 @@
#include <fpu_control.h>
int
-feupdateenv (const fenv_t *envp)
+__feupdateenv (const fenv_t *envp)
{
fpu_control_t temp;
@@ -36,4 +36,6 @@ feupdateenv (const fenv_t *envp)
return 0;
}
-libm_hidden_def (feupdateenv)
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/sparc/fpu/feupdateenv.c b/sysdeps/sparc/fpu/feupdateenv.c
index cb001e19c8..f46e6c6529 100644
--- a/sysdeps/sparc/fpu/feupdateenv.c
+++ b/sysdeps/sparc/fpu/feupdateenv.c
@@ -45,5 +45,6 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_def (__feupdateenv)
libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/sysdeps/tile/math_private.h b/sysdeps/tile/math_private.h
index b06e3a321d..9b6b68b324 100644
--- a/sysdeps/tile/math_private.h
+++ b/sysdeps/tile/math_private.h
@@ -34,6 +34,7 @@ extern inline int __fegetenv (fenv_t *__e) { return 0; }
extern inline int fesetenv (const fenv_t *__e) { return 0; }
extern inline int __fesetenv (const fenv_t *__e) { return 0; }
extern inline int feupdateenv (const fenv_t *__e) { return 0; }
+extern inline int __feupdateenv (const fenv_t *__e) { return 0; }
extern inline int fegetround (void) { return FE_TONEAREST; }
extern inline int __fegetround (void) { return FE_TONEAREST; }
extern inline int fesetround (int __d) { return 0; }
diff --git a/sysdeps/x86_64/fpu/feupdateenv.c b/sysdeps/x86_64/fpu/feupdateenv.c
index 7aab1ad2ca..99dfdd8f5c 100644
--- a/sysdeps/x86_64/fpu/feupdateenv.c
+++ b/sysdeps/x86_64/fpu/feupdateenv.c
@@ -47,5 +47,6 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_def (__feupdateenv)
libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);