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.
This commit is contained in:
Joseph Myers 2015-01-07 19:01:20 +00:00
parent 882dfe184a
commit 8116321f65
21 changed files with 87 additions and 19 deletions

View File

@ -1,3 +1,46 @@
2015-01-07 Joseph Myers <joseph@codesourcery.com>
[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.
2015-01-07 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
* sysdeps/unix/sysv/linux/mips/pread.c (__libc_pread): Fix function

4
NEWS
View File

@ -16,8 +16,8 @@ Version 2.21
17582, 17583, 17584, 17585, 17589, 17594, 17601, 17608, 17616, 17625,
17630, 17633, 17634, 17635, 17647, 17653, 17657, 17658, 17664, 17665,
17668, 17682, 17717, 17719, 17722, 17723, 17724, 17725, 17732, 17733,
17744, 17745, 17746, 17747, 17775, 17777, 17780, 17781, 17782, 17793,
17796, 17797, 17806
17744, 17745, 17746, 17747, 17748, 17775, 17777, 17780, 17781, 17782,
17793, 17796, 17797, 17806
* Optimized strcpy, stpcpy, strchrnul and strrchr implementations for
AArch64. Contributed by ARM Ltd.

View File

@ -30,6 +30,7 @@ libm_hidden_proto (__fesetround)
libm_hidden_proto (feholdexcept)
libm_hidden_proto (__feholdexcept)
libm_hidden_proto (feupdateenv)
libm_hidden_proto (__feupdateenv)
libm_hidden_proto (fetestexcept)
libm_hidden_proto (feclearexcept)

View File

@ -34,6 +34,7 @@ __feupdateenv (const fenv_t *envp)
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);

View File

@ -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)

View File

@ -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);

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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)

View File

@ -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)

View File

@ -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);

View File

@ -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; }

View File

@ -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);