diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2013-05-23 23:37:00 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2013-05-23 23:37:00 +0200 |
commit | f9e888643115b4b2f28853ebd1733f4410fb8839 (patch) | |
tree | 58c69f6cef623679080e8933b6c79880bfbd7cb8 /sysdeps/generic | |
parent | d78eef6ebc008f784f501ce208bef12c6eafda27 (diff) | |
parent | b934acf0e93c5a220551ed6e686bb9d45a24a8cc (diff) |
Merge branch 'baseline' into refs/top-bases/tschwinge/Roger_Whittaker
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/bp-checks.h | 84 | ||||
-rw-r--r-- | sysdeps/generic/frame.h | 4 | ||||
-rw-r--r-- | sysdeps/generic/ldconfig.h | 9 | ||||
-rw-r--r-- | sysdeps/generic/ldsodefs.h | 13 | ||||
-rw-r--r-- | sysdeps/generic/malloc-sysdep.h | 3 | ||||
-rw-r--r-- | sysdeps/generic/math-tests.h (renamed from sysdeps/generic/bp-sym.h) | 27 |
6 files changed, 38 insertions, 102 deletions
diff --git a/sysdeps/generic/bp-checks.h b/sysdeps/generic/bp-checks.h deleted file mode 100644 index cfff9155ec..0000000000 --- a/sysdeps/generic/bp-checks.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Bounded-pointer checking macros for C. - Copyright (C) 2000-2013 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Greg McGary <greg@mcgary.org> - - 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 _bp_checks_h_ -#define _bp_checks_h_ 1 - -#if __BOUNDED_POINTERS__ - -# define BOUNDS_VIOLATED (__builtin_trap (), 0) - -/* Verify that pointer's value >= low. Return pointer value. */ -# define CHECK_BOUNDS_LOW(ARG) \ - (((__ptrvalue (ARG) < __ptrlow (ARG)) && BOUNDS_VIOLATED), \ - __ptrvalue (ARG)) - -/* Verify that pointer's value < high. Return pointer value. */ -# define CHECK_BOUNDS_HIGH(ARG) \ - (((__ptrvalue (ARG) > __ptrhigh (ARG)) && BOUNDS_VIOLATED), \ - __ptrvalue (ARG)) - -# define _CHECK_N(ARG, N, COND) \ - (((COND) \ - && (__ptrvalue (ARG) < __ptrlow (ARG) \ - || __ptrvalue (ARG) + (N) > __ptrhigh (ARG)) \ - && BOUNDS_VIOLATED), \ - __ptrvalue (ARG)) - -extern void *__unbounded __ubp_memchr (const void *__unbounded, int, unsigned); - -# define _CHECK_STRING(ARG, COND) \ - (((COND) \ - && (__ptrvalue (ARG) < __ptrlow (ARG) \ - || !__ubp_memchr (__ptrvalue (ARG), '\0', \ - (__ptrhigh (ARG) - __ptrvalue (ARG)))) \ - && BOUNDS_VIOLATED), \ - __ptrvalue (ARG)) - -/* Check bounds of a pointer seated to an array of N objects. */ -# define CHECK_N(ARG, N) _CHECK_N ((ARG), (N), 1) -/* Same as CHECK_N, but tolerate ARG == NULL. */ -# define CHECK_N_NULL_OK(ARG, N) _CHECK_N ((ARG), (N), __ptrvalue (ARG)) - -/* Check bounds of a pointer seated to a single object. */ -# define CHECK_1(ARG) CHECK_N ((ARG), 1) -/* Same as CHECK_1, but tolerate ARG == NULL. */ -# define CHECK_1_NULL_OK(ARG) CHECK_N_NULL_OK ((ARG), 1) - -/* Check for NUL-terminator within string's bounds. */ -# define CHECK_STRING(ARG) _CHECK_STRING ((ARG), 1) -/* Same as CHECK_STRING, but tolerate ARG == NULL. */ -# define CHECK_STRING_NULL_OK(ARG) _CHECK_STRING ((ARG), __ptrvalue (ARG)) - -#else /* !__BOUNDED_POINTERS__ */ - -/* Do nothing if not compiling with -fbounded-pointers. */ - -# define BOUNDS_VIOLATED -# define CHECK_BOUNDS_LOW(ARG) (ARG) -# define CHECK_BOUNDS_HIGH(ARG) (ARG) -# define CHECK_1(ARG) (ARG) -# define CHECK_1_NULL_OK(ARG) (ARG) -# define CHECK_N(ARG, N) (ARG) -# define CHECK_N_NULL_OK(ARG, N) (ARG) -# define CHECK_STRING(ARG) (ARG) - -#endif /* !__BOUNDED_POINTERS__ */ - -#endif /* _bp_checks_h_ */ diff --git a/sysdeps/generic/frame.h b/sysdeps/generic/frame.h index e6dfc72f31..cae84ef3e2 100644 --- a/sysdeps/generic/frame.h +++ b/sysdeps/generic/frame.h @@ -18,6 +18,6 @@ struct layout { - void *__unbounded next; - void *__unbounded return_address; + void *next; + void *return_address; }; diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h index 57a9a468ad..ca3f0e430f 100644 --- a/sysdeps/generic/ldconfig.h +++ b/sysdeps/generic/ldconfig.h @@ -36,6 +36,7 @@ #define FLAG_X8664_LIBX32 0x0800 #define FLAG_ARM_LIBHF 0x0900 #define FLAG_AARCH64_LIB64 0x0a00 +#define FLAG_ARM_LIBSF 0x0b00 /* Name of auxiliary cache. */ #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache" @@ -83,12 +84,6 @@ extern int opt_verbose; extern int opt_format; /* Prototypes for a few program-wide used functions. */ -extern void *xmalloc (size_t n) - __attribute_malloc__ __attribute_alloc_size (1); -extern void *xcalloc (size_t n, size_t s) - __attribute_malloc__ __attribute_alloc_size (1, 2); -extern void *xrealloc (void *o, size_t n) - __attribute_malloc__ __attribute_alloc_size (2); -extern char *xstrdup (const char *) __attribute_malloc__; +#include <programs/xmalloc.h> #endif /* ! _LDCONFIG_H */ diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index f963b19cde..f4bfc0da0c 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -539,7 +539,7 @@ struct rtld_global_ro EXTERN uintptr_t _dl_sysinfo; #endif -#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO +#ifdef NEED_DL_SYSINFO_DSO /* The vsyscall page is a virtual DSO pre-mapped by the kernel. This points to its ELF header. */ EXTERN const ElfW(Ehdr) *_dl_sysinfo_dso; @@ -1007,6 +1007,17 @@ extern int _dl_addr_inside_object (struct link_map *l, const ElfW(Addr) addr) /* Show show of an object. */ extern void _dl_show_scope (struct link_map *new, int from); +extern struct link_map *_dl_find_dso_for_object (const ElfW(Addr) addr) + internal_function; +rtld_hidden_proto (_dl_find_dso_for_object) + +/* Initialization which is normally done by the dynamic linker. */ +extern void _dl_non_dynamic_init (void) internal_function; + +/* Used by static binaries to check the auxiliary vector. */ +extern void _dl_aux_init (ElfW(auxv_t) *av) internal_function; + + __END_DECLS #endif /* ldsodefs.h */ diff --git a/sysdeps/generic/malloc-sysdep.h b/sysdeps/generic/malloc-sysdep.h index 3f7892b150..18980bc826 100644 --- a/sysdeps/generic/malloc-sysdep.h +++ b/sysdeps/generic/malloc-sysdep.h @@ -16,6 +16,9 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#include <stdbool.h> +#include <unistd.h> + /* Force an unmap when the heap shrinks in a secure exec. This ensures that the old data pages immediately cease to be accessible. */ static inline bool diff --git a/sysdeps/generic/bp-sym.h b/sysdeps/generic/math-tests.h index 089912a687..76f738ee99 100644 --- a/sysdeps/generic/bp-sym.h +++ b/sysdeps/generic/math-tests.h @@ -1,7 +1,6 @@ -/* Bounded-pointer symbol modifier. - Copyright (C) 2000-2013 Free Software Foundation, Inc. +/* Configuration for math tests. Generic version. + Copyright (C) 2013 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Greg McGary <greg@mcgary.org> The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,9 +16,21 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#define BP_SYM(name) _BP_SYM (name) -#if __BOUNDED_POINTERS__ -# define _BP_SYM(name) __BP_##name -#else -# define _BP_SYM(name) name +/* Indicate whether to run tests involving sNaN values for the float, double, + and long double C data types, respectively. All are run unless + overridden. */ +#ifndef SNAN_TESTS_float +# define SNAN_TESTS_float 1 #endif +#ifndef SNAN_TESTS_double +# define SNAN_TESTS_double 1 +#endif +#ifndef SNAN_TESTS_long_double +# define SNAN_TESTS_long_double 1 +#endif + +/* Return nonzero value if to run tests involving sNaN values for X. */ +#define SNAN_TESTS(x) \ + (sizeof (x) == sizeof (float) ? SNAN_TESTS_float \ + : sizeof (x) == sizeof (double) ? SNAN_TESTS_double \ + : SNAN_TESTS_long_double) |