Avoid PLT call to fegetenv on s390

This commit is contained in:
Andreas Schwab 2010-02-09 22:34:17 -08:00 committed by Ulrich Drepper
parent 0cbcca89ba
commit 7eb22e757e
11 changed files with 36 additions and 6 deletions

View File

@ -1,3 +1,15 @@
2010-02-08 Andreas Schwab <schwab@redhat.com>
* include/fenv.h: Add hidden proto for fegetenv.
* math/fegetenv.c: Add hidden alias.
* sysdeps/i386/fpu/fegetenv.c: Likewise.
* sysdeps/ia64/fpu/fegetenv.c: Likewise.
* sysdeps/powerpc/fpu/fegetenv.c: Likewise.
* sysdeps/sh/sh4/fpu/fegetenv.c: Likewise.
* sysdeps/sparc/fpu/fegetenv.c: Likewise.
* sysdeps/x86_64/fpu/fegetenv.c: Likewise
* sysdeps/s390/fpu/fegetenv.c: Likewise. Remove unused headers.
2010-02-05 H.J. Lu <hongjiu.lu@intel.com>
[BZ #11230]

View File

@ -13,6 +13,7 @@ extern int __fesetenv (__const fenv_t *__envp);
extern int __feupdateenv (__const fenv_t *__envp);
libm_hidden_proto (feraiseexcept)
libm_hidden_proto (fegetenv)
libm_hidden_proto (fesetenv)
libm_hidden_proto (fesetround)
libm_hidden_proto (feholdexcept)

View File

@ -1,5 +1,5 @@
/* Malloc implementation for multiple threads without lock contention.
Copyright (C) 1996-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Copyright (C) 1996-2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Wolfram Gloger <wg@malloc.de>
and Doug Lea <dl@cs.oswego.edu>, 2001.
@ -4850,7 +4850,8 @@ _int_free(mstate av, mchunkptr p)
free_perturb (chunk2mem(p), size - SIZE_SZ);
set_fastchunks(av);
fb = &fastbin (av, fastbin_index(size));
unsigned int idx = fastbin_index(size);
fb = &fastbin (av, idx);
#ifdef ATOMIC_FASTBINS
mchunkptr fd;
@ -4864,6 +4865,12 @@ _int_free(mstate av, mchunkptr p)
errstr = "double free or corruption (fasttop)";
goto errout;
}
if (old != NULL && (chunksize(old) > request2size(MAX_FAST_SIZE)
|| fastbin_index(chunksize(old)) != idx))
{
errstr = "invalid fastbin entry (free)";
goto errout;
}
p->fd = fd = old;
}
while ((old = catomic_compare_and_exchange_val_rel (fb, p, fd)) != fd);
@ -4875,6 +4882,12 @@ _int_free(mstate av, mchunkptr p)
errstr = "double free or corruption (fasttop)";
goto errout;
}
if (*fb != NULL && (chunksize(*fb) > request2size(MAX_FAST_SIZE)
|| fastbin_index(chunksize(*fb)) != idx))
{
errstr = "invalid fastbin entry (free)";
goto errout;
}
p->fd = *fb;
*fb = p;

View File

@ -32,6 +32,7 @@ __fegetenv (fenv_t *envp)
strong_alias (__fegetenv, __old_fegetenv)
compat_symbol (libm, BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2_1);
#endif
libm_hidden_ver (__fegetenv, fegetenv)
versioned_symbol (libm, BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2_2);
stub_warning (fegetenv)

View File

@ -40,4 +40,5 @@ strong_alias (__fegetenv, __old_fegetenv)
compat_symbol (libm, BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2_1);
#endif
libm_hidden_ver (__fegetenv, fegetenv)
versioned_symbol (libm, BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2_2);

View File

@ -27,3 +27,4 @@ fegetenv (fenv_t *envp)
return 0;
}
libm_hidden_def (fegetenv)

View File

@ -35,4 +35,5 @@ strong_alias (__fegetenv, __old_fegetenv)
compat_symbol (libm, BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2_1);
#endif
libm_hidden_ver (__fegetenv, fegetenv)
versioned_symbol (libm, BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2_2);

View File

@ -20,10 +20,6 @@
#include <fenv_libc.h>
#include <fpu_control.h>
#include <stddef.h>
#include <asm/ptrace.h>
#include <sys/ptrace.h>
#include <unistd.h>
int
fegetenv (fenv_t *envp)
@ -33,3 +29,4 @@ fegetenv (fenv_t *envp)
/* Success. */
return 0;
}
libm_hidden_def (fegetenv)

View File

@ -29,3 +29,4 @@ fegetenv (fenv_t *envp)
return 0;
}
libm_hidden_def (fegetenv)

View File

@ -34,4 +34,5 @@ strong_alias (__fegetenv, __old_fegetenv)
compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
#endif
libm_hidden_ver (__fegetenv, fegetenv)
versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);

View File

@ -28,3 +28,4 @@ fegetenv (fenv_t *envp)
/* Success. */
return 0;
}
libm_hidden_def (fegetenv)