diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2013-09-01 19:29:18 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2013-09-01 19:29:18 +0200 |
commit | cbb58c37bb81d176f106a4de3c7f3b02dee2ff66 (patch) | |
tree | c746d229279f84aac0fe3afe537813fb281f7f78 /sysdeps/generic | |
parent | ffeaf5a2df0d177a7780fd7c6f5e7595caba766a (diff) | |
parent | d5860b5273bc00632c65b43cb931d3238db0ab57 (diff) |
Merge branch 'baseline' into refs/top-bases/tschwinge/Roger_Whittaker
Conflicts:
sysdeps/mach/hurd/i386/init-first.c
sysdeps/unix/sysv/linux/ldsodefs.h
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/dl-procinfo.h | 2 | ||||
-rw-r--r-- | sysdeps/generic/framestate.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/ldsodefs.h | 9 | ||||
-rw-r--r-- | sysdeps/generic/libc-mmap.h | 26 | ||||
-rw-r--r-- | sysdeps/generic/math-tests.h | 36 | ||||
-rw-r--r-- | sysdeps/generic/math_private.h | 63 | ||||
-rw-r--r-- | sysdeps/generic/sigset-cvt-mask.h | 4 | ||||
-rw-r--r-- | sysdeps/generic/symbol-hacks.h | 7 |
8 files changed, 126 insertions, 23 deletions
diff --git a/sysdeps/generic/dl-procinfo.h b/sysdeps/generic/dl-procinfo.h index 90c87d942a..a184a5918a 100644 --- a/sysdeps/generic/dl-procinfo.h +++ b/sysdeps/generic/dl-procinfo.h @@ -21,7 +21,7 @@ #define _DL_PROCINFO_H 1 /* We cannot provide a general printing function. */ -#define _dl_procinfo(word) -1 +#define _dl_procinfo(type, word) -1 /* There are no hardware capabilities defined. */ #define _dl_hwcap_string(idx) "" diff --git a/sysdeps/generic/framestate.c b/sysdeps/generic/framestate.c index b3a6fcabcc..e224ab5e0c 100644 --- a/sysdeps/generic/framestate.c +++ b/sysdeps/generic/framestate.c @@ -44,7 +44,7 @@ __frame_state_for (void *pc, struct frame_state *frame_state) #ifndef __USING_SJLJ_EXCEPTIONS__ frame_state_for = fallback_frame_state_for; #else - frame_state_for = abort; + frame_state_for = abort; #endif } diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index bb088db500..51e61a1215 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -128,6 +128,11 @@ typedef struct link_map *lookup_t; | ((PROT_WRITE | PROT_EXEC) << (PF_W | PF_X) * 4) \ | ((PROT_READ | PROT_WRITE | PROT_EXEC) << ((PF_R | PF_W | PF_X) * 4))) +/* The filename itself, or the main program name, if available. */ +#define DSO_FILENAME(name) ((name)[0] ? (name) \ + : (rtld_progname ?: "<main program>")) + +#define RTLD_PROGNAME (rtld_progname ?: "<program name unknown>") /* For the version handling we need an array with only names and their hash values. */ @@ -550,6 +555,10 @@ struct rtld_global_ro EXTERN struct link_map *_dl_sysinfo_map; #endif + /* Mask for more hardware capabilities that are available on some + platforms. */ + EXTERN uint64_t _dl_hwcap2; + #ifdef SHARED /* We add a function table to _rtld_global which is then used to call the function instead of going through the PLT. The result diff --git a/sysdeps/generic/libc-mmap.h b/sysdeps/generic/libc-mmap.h new file mode 100644 index 0000000000..0ddd20d42a --- /dev/null +++ b/sysdeps/generic/libc-mmap.h @@ -0,0 +1,26 @@ +/* Internal logic for dealing with mmap quirks. + Copyright (C) 2013 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LIBC_MMAP_H +#define _LIBC_MMAP_H 1 + +/* Using MAP_FIXED with mmap sometimes requires larger alignment. */ +#include <sys/shm.h> +#define MAP_FIXED_ALIGNMENT SHMLBA + +#endif diff --git a/sysdeps/generic/math-tests.h b/sysdeps/generic/math-tests.h index da8747a944..89b2260d0f 100644 --- a/sysdeps/generic/math-tests.h +++ b/sysdeps/generic/math-tests.h @@ -40,3 +40,39 @@ #ifndef SNAN_TESTS_TYPE_CAST # define SNAN_TESTS_TYPE_CAST 1 #endif + +/* Indicate whether to run tests involving a given rounding mode for a + given floating-point type, given that fesetround succeeds for that + mode. All are run if fesetround succeeds unless overridden. */ +#ifndef ROUNDING_TESTS_float +# define ROUNDING_TESTS_float(MODE) 1 +#endif +#ifndef ROUNDING_TESTS_double +# define ROUNDING_TESTS_double(MODE) 1 +#endif +#ifndef ROUNDING_TESTS_long_double +# define ROUNDING_TESTS_long_double(MODE) 1 +#endif + +#define ROUNDING_TESTS(TYPE, MODE) \ + (sizeof (TYPE) == sizeof (float) ? ROUNDING_TESTS_float (MODE) \ + : sizeof (TYPE) == sizeof (double) ? ROUNDING_TESTS_double (MODE) \ + : ROUNDING_TESTS_long_double (MODE)) + +/* Indicate whether to run tests of floating-point exceptions for a + given floating-point type, given that the exception macros are + defined. All are run unless overridden. */ +#ifndef EXCEPTION_TESTS_float +# define EXCEPTION_TESTS_float 1 +#endif +#ifndef EXCEPTION_TESTS_double +# define EXCEPTION_TESTS_double 1 +#endif +#ifndef EXCEPTION_TESTS_long_double +# define EXCEPTION_TESTS_long_double 1 +#endif + +#define EXCEPTION_TESTS(TYPE) \ + (sizeof (TYPE) == sizeof (float) ? EXCEPTION_TESTS_float \ + : sizeof (TYPE) == sizeof (double) ? EXCEPTION_TESTS_double \ + : EXCEPTION_TESTS_long_double) diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h index 9d6ecade68..c0fc03d38d 100644 --- a/sysdeps/generic/math_private.h +++ b/sysdeps/generic/math_private.h @@ -446,8 +446,8 @@ default_libc_feholdexcept_setround (fenv_t *e, int r) # define libc_feholdexcept_setroundl default_libc_feholdexcept_setround #endif -#ifndef libc_feholdexcept_setround_53bit -# define libc_feholdexcept_setround_53bit libc_feholdexcept_setround +#ifndef libc_feholdsetround_53bit +# define libc_feholdsetround_53bit libc_feholdsetround #endif #ifndef libc_fetestexcept @@ -492,8 +492,8 @@ default_libc_feupdateenv (fenv_t *e) # define libc_feupdateenvl default_libc_feupdateenv #endif -#ifndef libc_feupdateenv_53bit -# define libc_feupdateenv_53bit libc_feupdateenv +#ifndef libc_feresetround_53bit +# define libc_feresetround_53bit libc_feresetround #endif static __always_inline int @@ -553,35 +553,62 @@ default_libc_feupdateenv_test (fenv_t *e, int ex) # define libc_feresetround_noexl libc_fesetenvl #endif +#if HAVE_RM_CTX +/* Set/Restore Rounding Modes only when necessary. If defined, these functions + set/restore floating point state only if the state needed within the lexical + block is different from the current state. This saves a lot of time when + the floating point unit is much slower than the fixed point units. */ + +# ifndef libc_feresetround_noex_ctx +# define libc_feresetround_noex_ctx libc_fesetenv_ctx +# endif +# ifndef libc_feresetround_noexf_ctx +# define libc_feresetround_noexf_ctx libc_fesetenvf_ctx +# endif +# ifndef libc_feresetround_noexl_ctx +# define libc_feresetround_noexl_ctx libc_fesetenvl_ctx +# endif + +# ifndef libc_feholdsetround_53bit_ctx +# define libc_feholdsetround_53bit_ctx libc_feholdsetround_ctx +# endif + +# ifndef libc_feresetround_53bit_ctx +# define libc_feresetround_53bit_ctx libc_feresetround_ctx +# endif + +# define SET_RESTORE_ROUND_GENERIC(RM,ROUNDFUNC,CLEANUPFUNC) \ + struct rm_ctx ctx __attribute__((cleanup(CLEANUPFUNC ## _ctx))); \ + ROUNDFUNC ## _ctx (&ctx, (RM)) +#else +# define SET_RESTORE_ROUND_GENERIC(RM, ROUNDFUNC, CLEANUPFUNC) \ + fenv_t __libc_save_rm __attribute__((cleanup(CLEANUPFUNC))); \ + ROUNDFUNC (&__libc_save_rm, (RM)) +#endif + /* Save and restore the rounding mode within a lexical block. */ #define SET_RESTORE_ROUND(RM) \ - fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround))); \ - libc_feholdsetround (&__libc_save_rm, (RM)) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround, libc_feresetround) #define SET_RESTORE_ROUNDF(RM) \ - fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetroundf))); \ - libc_feholdsetroundf (&__libc_save_rm, (RM)) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetroundf, libc_feresetroundf) #define SET_RESTORE_ROUNDL(RM) \ - fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetroundl))); \ - libc_feholdsetroundl (&__libc_save_rm, (RM)) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetroundl, libc_feresetroundl) /* Save and restore the rounding mode within a lexical block, and also the set of exceptions raised within the block may be discarded. */ #define SET_RESTORE_ROUND_NOEX(RM) \ - fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_noex))); \ - libc_feholdsetround (&__libc_save_rm, (RM)) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround, libc_feresetround_noex) #define SET_RESTORE_ROUND_NOEXF(RM) \ - fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_noexf))); \ - libc_feholdsetroundf (&__libc_save_rm, (RM)) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetroundf, libc_feresetround_noexf) #define SET_RESTORE_ROUND_NOEXL(RM) \ - fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_noexl))); \ - libc_feholdsetroundl (&__libc_save_rm, (RM)) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetroundl, libc_feresetround_noexl) /* Like SET_RESTORE_ROUND, but also set rounding precision to 53 bits. */ #define SET_RESTORE_ROUND_53BIT(RM) \ - fenv_t __libc_save_rm __attribute__((cleanup(libc_feupdateenv_53bit))); \ - libc_feholdexcept_setround_53bit (&__libc_save_rm, (RM)) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround_53bit, \ + libc_feresetround_53bit) #define __nan(str) \ (__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str)) diff --git a/sysdeps/generic/sigset-cvt-mask.h b/sysdeps/generic/sigset-cvt-mask.h index 91d1f8e5b8..bc42bdc6fb 100644 --- a/sysdeps/generic/sigset-cvt-mask.h +++ b/sysdeps/generic/sigset-cvt-mask.h @@ -29,7 +29,7 @@ sigset_set_old_mask (sigset_t *set, int mask) *set = (unsigned int) mask; else { - register unsigned int __sig; + unsigned int __sig; if (__sigemptyset (set) < 0) return -1; @@ -52,7 +52,7 @@ sigset_get_old_mask (const sigset_t *set) else { unsigned int mask = 0; - register unsigned int sig; + unsigned int sig; for (sig = 1; sig < NSIG && sig <= sizeof (mask) * 8; sig++) if (__sigismember (set, sig)) diff --git a/sysdeps/generic/symbol-hacks.h b/sysdeps/generic/symbol-hacks.h index bc7b4c4441..9eaf014ff2 100644 --- a/sysdeps/generic/symbol-hacks.h +++ b/sysdeps/generic/symbol-hacks.h @@ -1 +1,6 @@ -/* Fortunately nothing to do. */ +/* Some compiler optimizations may transform loops into memset/memmove + calls and without proper declaration it may generate PLT calls. */ +#if !defined __ASSEMBLER__ && !defined NOT_IN_libc && defined SHARED +asm ("memmove = __GI_memmove"); +asm ("memset = __GI_memset"); +#endif |