@@ -324,6 +324,11 @@
#define __no_sanitize_address
#endif
+#if __GNUC__ >= 5
+/* Avoid reordering a top level statement */
+#define __noreorder __attribute__((no_reorder))
+#endif
+
/*
* A trick to suppress uninitialized variable warning without generating any
* code
@@ -260,6 +260,9 @@ struct ftrace_likely_data {
#define __assume_aligned(a, ...)
#endif
+#ifndef __noreorder
+#define __noreorder
+#endif
/* Are two types/vars the same type (ignoring qualifiers)? */
#ifndef __same_type
@@ -161,7 +161,7 @@ extern bool initcall_debug;
*/
#define __define_initcall(fn, id) \
- static initcall_t __initcall_##fn##id __used \
+ static initcall_t __initcall_##fn##id __used __noreorder \
__attribute__((__section__(".initcall" #id ".init"))) = fn;
/*