]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/compiler-gcc.h
task_struct: only use anon struct under randstruct plugin
[mirror_ubuntu-bionic-kernel.git] / include / linux / compiler-gcc.h
index 673fbf904fe546146cbef9424fc5cb7f66730bfd..555a455e898aaa319617d533c2225abaf2423964 100644 (file)
 #if defined(RANDSTRUCT_PLUGIN) && !defined(__CHECKER__)
 #define __randomize_layout __attribute__((randomize_layout))
 #define __no_randomize_layout __attribute__((no_randomize_layout))
+/* This anon struct can add padding, so only enable it under randstruct. */
+#define randomized_struct_fields_start struct {
+#define randomized_struct_fields_end   } __randomize_layout;
 #endif
 
 #endif /* GCC_VERSION >= 40500 */
  */
 #define __visible      __attribute__((externally_visible))
 
-/*
- * 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 */