diff options
Diffstat (limited to 'include/linux/compiler-gcc.h')
| -rw-r--r-- | include/linux/compiler-gcc.h | 27 | 
1 files changed, 15 insertions, 12 deletions
| diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index cd4bbe8242bd..bb78e5bdff26 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #ifndef __LINUX_COMPILER_H  #error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead."  #endif @@ -166,6 +167,8 @@  #if GCC_VERSION >= 40100  # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) + +#define __nostackprotector	__attribute__((__optimize__("no-stack-protector")))  #endif  #if GCC_VERSION >= 40300 @@ -201,17 +204,6 @@  #endif  #endif -#ifdef CONFIG_STACK_VALIDATION -#define annotate_unreachable() ({					\ -	asm("%c0:\t\n"							\ -	    ".pushsection .discard.unreachable\t\n"			\ -	    ".long %c0b - .\t\n"					\ -	    ".popsection\t\n" : : "i" (__LINE__));			\ -}) -#else -#define annotate_unreachable() -#endif -  /*   * Mark a position in code as unreachable.  This can be used to   * suppress control flow warnings after asm blocks that transfer @@ -235,6 +227,7 @@  #endif /* GCC_VERSION >= 40500 */  #if GCC_VERSION >= 40600 +  /*   * When used with Link Time Optimization, gcc can optimize away C functions or   * variables which are referenced only from assembly code.  __visible tells the @@ -242,7 +235,17 @@   * this.   */  #define __visible	__attribute__((externally_visible)) -#endif + +/* + * RANDSTRUCT_PLUGIN wants to use an anonymous struct, but it is only + * possible since GCC 4.6. To provide as much build testing coverage + * as possible, this is used for all GCC 4.6+ builds, and not just on + * RANDSTRUCT_PLUGIN builds. + */ +#define randomized_struct_fields_start	struct { +#define randomized_struct_fields_end	} __randomize_layout; + +#endif /* GCC_VERSION >= 40600 */  #if GCC_VERSION >= 40900 && !defined(__CHECKER__) |