aboutsummaryrefslogtreecommitdiff
path: root/include/linux/init.h
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2018-03-20 02:25:07 +0000
committerAlex Shi <alex.shi@linaro.org>2018-03-20 02:25:07 +0000
commit031f431679b03ba7e791dd051fc13f51f806fcd7 (patch)
tree9018f8a4a6c04feaf0180cae915dfe804913ce34 /include/linux/init.h
parentf7901365aa48b20b25f8402e0fd1eea4ac6c55e7 (diff)
parent91db57e54eb9be1560454d6a370d67847b05735f (diff)
Merge remote-tracking branch 'rt-stable/v4.4-rt' into linux-linaro-lsk-v4.4-rtlsk-v4.4-18.03-rt
Diffstat (limited to 'include/linux/init.h')
-rw-r--r--include/linux/init.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/init.h b/include/linux/init.h
index aedb254abc37..3561ea30ed8c 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -4,6 +4,13 @@
#include <linux/compiler.h>
#include <linux/types.h>
+/* Built-in __init functions needn't be compiled with retpoline */
+#if defined(RETPOLINE) && !defined(MODULE)
+#define __noretpoline __attribute__((indirect_branch("keep")))
+#else
+#define __noretpoline
+#endif
+
/* These macros are used to mark some functions or
* initialized data (doesn't apply to uninitialized data)
* as `initialization' functions. The kernel can take this
@@ -39,7 +46,7 @@
/* These are for everybody (although not all archs will actually
discard it in modules) */
-#define __init __section(.init.text) __cold notrace
+#define __init __section(.init.text) __cold notrace __noretpoline
#define __initdata __section(.init.data)
#define __initconst __constsection(.init.rodata)
#define __exitdata __section(.exit.data)