aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-01-05 23:06:14 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-01-05 23:06:14 +0000
commitef9faf138578dc7e559a9fd58080825962ce0339 (patch)
treecf099713c5a455370a53829c314b1fef6699c425 /sysdeps
parent882c4b9f1de8b0175eae6edbd48c9a7b80b63fb9 (diff)
downloadglibc-ef9faf138578dc7e559a9fd58080825962ce0339.zip
glibc-ef9faf138578dc7e559a9fd58080825962ce0339.tar.gz
glibc-ef9faf138578dc7e559a9fd58080825962ce0339.tar.bz2
Fix libm feholdexcept namespace (bug 17748).
Continuing the fixes for C90 libm functions calling C99 fe* functions, this patch fixes the case of feholdexcept by making it a weak alias of __feholdexcept and making the affected code call __feholdexcept. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). Also tested for ARM (soft-float) that feholdexcept failures disappear from the linknamespace test failures (fesetenv, fsetround and feupdateenv remain to be addressed to complete fixing bug 17748). [BZ #17748] * include/fenv.h (__feholdexcept): Declare. Use libm_hidden_proto. * math/feholdexcpt.c (feholdexcept): Rename to __feholdexcept and define as weak alias of __feholdexcept. Use libm_hidden_weak. * sysdeps/aarch64/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/alpha/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/arm/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/hppa/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/i386/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/ia64/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/m68k/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/mips/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/powerpc/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/powerpc/nofpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/s390/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/sh/sh4/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/sparc/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/x86_64/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/generic/math_private.h (default_libc_feholdexcept): Use __feholdexcept instead of feholdexcept. (default_libc_feholdexcept_setround): Likewise.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/aarch64/fpu/feholdexcpt.c6
-rw-r--r--sysdeps/alpha/fpu/feholdexcpt.c6
-rw-r--r--sysdeps/arm/feholdexcpt.c6
-rw-r--r--sysdeps/generic/math_private.h4
-rw-r--r--sysdeps/hppa/fpu/feholdexcpt.c6
-rw-r--r--sysdeps/i386/fpu/feholdexcpt.c6
-rw-r--r--sysdeps/ia64/fpu/feholdexcpt.c6
-rw-r--r--sysdeps/m68k/fpu/feholdexcpt.c6
-rw-r--r--sysdeps/mips/fpu/feholdexcpt.c6
-rw-r--r--sysdeps/powerpc/fpu/feholdexcpt.c6
-rw-r--r--sysdeps/powerpc/nofpu/feholdexcpt.c6
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c6
-rw-r--r--sysdeps/s390/fpu/feholdexcpt.c6
-rw-r--r--sysdeps/sh/sh4/fpu/feholdexcpt.c6
-rw-r--r--sysdeps/sparc/fpu/feholdexcpt.c6
-rw-r--r--sysdeps/x86_64/fpu/feholdexcpt.c6
16 files changed, 62 insertions, 32 deletions
diff --git a/sysdeps/aarch64/fpu/feholdexcpt.c b/sysdeps/aarch64/fpu/feholdexcpt.c
index 4198804..6c2e3f9 100644
--- a/sysdeps/aarch64/fpu/feholdexcpt.c
+++ b/sysdeps/aarch64/fpu/feholdexcpt.c
@@ -20,9 +20,11 @@
#include <math_private.h>
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
libc_feholdexcept_aarch64 (envp);
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/alpha/fpu/feholdexcpt.c b/sysdeps/alpha/fpu/feholdexcpt.c
index 0cb28da..d226046 100644
--- a/sysdeps/alpha/fpu/feholdexcpt.c
+++ b/sysdeps/alpha/fpu/feholdexcpt.c
@@ -20,7 +20,7 @@
#include <fenv_libc.h>
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
/* Save the current state. */
fegetenv(envp);
@@ -30,4 +30,6 @@ feholdexcept (fenv_t *envp)
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/arm/feholdexcpt.c b/sysdeps/arm/feholdexcpt.c
index ed7fc5f..9d4a724 100644
--- a/sysdeps/arm/feholdexcpt.c
+++ b/sysdeps/arm/feholdexcpt.c
@@ -21,7 +21,7 @@
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
/* Fail if a VFP unit isn't present. */
if (!ARM_HAVE_VFP)
@@ -30,4 +30,6 @@ feholdexcept (fenv_t *envp)
libc_feholdexcept_vfp (envp);
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index 2b07f20..3a080d8 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -399,7 +399,7 @@ extern long double __gamma_productl (long double x, long double x_eps,
static __always_inline void
default_libc_feholdexcept (fenv_t *e)
{
- (void) feholdexcept (e);
+ (void) __feholdexcept (e);
}
#ifndef libc_feholdexcept
@@ -431,7 +431,7 @@ default_libc_fesetround (int r)
static __always_inline void
default_libc_feholdexcept_setround (fenv_t *e, int r)
{
- feholdexcept (e);
+ __feholdexcept (e);
fesetround (r);
}
diff --git a/sysdeps/hppa/fpu/feholdexcpt.c b/sysdeps/hppa/fpu/feholdexcpt.c
index da2f586..94eba37 100644
--- a/sysdeps/hppa/fpu/feholdexcpt.c
+++ b/sysdeps/hppa/fpu/feholdexcpt.c
@@ -21,7 +21,7 @@
#include <string.h>
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
union { unsigned long long buf[4]; fenv_t env; } clear;
unsigned long long *bufptr;
@@ -50,4 +50,6 @@ feholdexcept (fenv_t *envp)
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/i386/fpu/feholdexcpt.c b/sysdeps/i386/fpu/feholdexcpt.c
index 7890248..f6db2ba 100644
--- a/sysdeps/i386/fpu/feholdexcpt.c
+++ b/sysdeps/i386/fpu/feholdexcpt.c
@@ -23,7 +23,7 @@
#include <dl-procinfo.h>
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
/* Store the environment. Recall that fnstenv has a side effect of
masking all exceptions. Then clear all exceptions. */
@@ -45,4 +45,6 @@ feholdexcept (fenv_t *envp)
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/ia64/fpu/feholdexcpt.c b/sysdeps/ia64/fpu/feholdexcpt.c
index f2738ce..6b3d69a 100644
--- a/sysdeps/ia64/fpu/feholdexcpt.c
+++ b/sysdeps/ia64/fpu/feholdexcpt.c
@@ -20,7 +20,7 @@
#include <fenv.h>
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
fenv_t fpsr;
/* Save the current state. */
@@ -38,4 +38,6 @@ feholdexcept (fenv_t *envp)
/* Success. */
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/m68k/fpu/feholdexcpt.c b/sysdeps/m68k/fpu/feholdexcpt.c
index 4ebbb0c..db33c94 100644
--- a/sysdeps/m68k/fpu/feholdexcpt.c
+++ b/sysdeps/m68k/fpu/feholdexcpt.c
@@ -20,7 +20,7 @@
#include <fenv.h>
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
fexcept_t fpcr, fpsr;
@@ -42,4 +42,6 @@ feholdexcept (fenv_t *envp)
return 0;
}
-libm_hidden_def (feholdexcept);
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/mips/fpu/feholdexcpt.c b/sysdeps/mips/fpu/feholdexcpt.c
index 911bbe3..69e34e8 100644
--- a/sysdeps/mips/fpu/feholdexcpt.c
+++ b/sysdeps/mips/fpu/feholdexcpt.c
@@ -21,7 +21,7 @@
#include <fpu_control.h>
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
fpu_control_t cw;
@@ -36,4 +36,6 @@ feholdexcept (fenv_t *envp)
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/powerpc/fpu/feholdexcpt.c b/sysdeps/powerpc/fpu/feholdexcpt.c
index 080e587..f556d6d 100644
--- a/sysdeps/powerpc/fpu/feholdexcpt.c
+++ b/sysdeps/powerpc/fpu/feholdexcpt.c
@@ -21,7 +21,7 @@
#define _FPU_MASK_ALL (_FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM | _FPU_MASK_XM | _FPU_MASK_IM)
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
fenv_union_t old, new;
@@ -46,4 +46,6 @@ feholdexcept (fenv_t *envp)
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/powerpc/nofpu/feholdexcpt.c b/sysdeps/powerpc/nofpu/feholdexcpt.c
index dc14c07..5bb18a8 100644
--- a/sysdeps/powerpc/nofpu/feholdexcpt.c
+++ b/sysdeps/powerpc/nofpu/feholdexcpt.c
@@ -22,7 +22,7 @@
#include "soft-supp.h"
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
fenv_union_t u;
@@ -40,4 +40,6 @@ feholdexcept (fenv_t *envp)
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c b/sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c
index 7a59ecc..158f91e 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c
@@ -22,7 +22,7 @@
#include <sys/prctl.h>
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
fenv_union_t u;
INTERNAL_SYSCALL_DECL (err);
@@ -54,4 +54,6 @@ feholdexcept (fenv_t *envp)
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/s390/fpu/feholdexcpt.c b/sysdeps/s390/fpu/feholdexcpt.c
index 721d381..1cbe4b1 100644
--- a/sysdeps/s390/fpu/feholdexcpt.c
+++ b/sysdeps/s390/fpu/feholdexcpt.c
@@ -20,7 +20,7 @@
#include <fenv_libc.h>
#include <fpu_control.h>
-int feholdexcept (fenv_t *envp)
+int __feholdexcept (fenv_t *envp)
{
fexcept_t fpc;
/* Store the environment. */
@@ -32,4 +32,6 @@ int feholdexcept (fenv_t *envp)
_FPU_SETCW ((fpc & ~(FE_ALL_EXCEPT << FPC_EXCEPTION_MASK_SHIFT)));
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/sh/sh4/fpu/feholdexcpt.c b/sysdeps/sh/sh4/fpu/feholdexcpt.c
index 47b8c1e..b2d7ed2 100644
--- a/sysdeps/sh/sh4/fpu/feholdexcpt.c
+++ b/sysdeps/sh/sh4/fpu/feholdexcpt.c
@@ -20,7 +20,7 @@
#include <fpu_control.h>
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
fpu_control_t temp;
@@ -39,4 +39,6 @@ feholdexcept (fenv_t *envp)
/* Success. */
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/sparc/fpu/feholdexcpt.c b/sysdeps/sparc/fpu/feholdexcpt.c
index 0fef47a..4c9ac07 100644
--- a/sysdeps/sparc/fpu/feholdexcpt.c
+++ b/sysdeps/sparc/fpu/feholdexcpt.c
@@ -19,7 +19,7 @@
#include <fenv.h>
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
fenv_t tmp;
@@ -32,4 +32,6 @@ feholdexcept (fenv_t *envp)
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/x86_64/fpu/feholdexcpt.c b/sysdeps/x86_64/fpu/feholdexcpt.c
index 010521c..615b702 100644
--- a/sysdeps/x86_64/fpu/feholdexcpt.c
+++ b/sysdeps/x86_64/fpu/feholdexcpt.c
@@ -19,7 +19,7 @@
#include <fenv.h>
int
-feholdexcept (fenv_t *envp)
+__feholdexcept (fenv_t *envp)
{
unsigned int mxcsr;
@@ -36,4 +36,6 @@ feholdexcept (fenv_t *envp)
return 0;
}
-libm_hidden_def (feholdexcept)
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)