summaryrefslogtreecommitdiff
path: root/include/linux/indirect_call_wrapper.h
diff options
context:
space:
mode:
authorBrian Vazquez <brianvv@google.com>2021-02-04 21:18:38 +0300
committerJakub Kicinski <kuba@kernel.org>2021-02-05 05:06:26 +0300
commit0053859496baa17c7675526936677c9213bf5a0d (patch)
tree76a83470560642f832c69a81caab936caac78a30 /include/linux/indirect_call_wrapper.h
parent7e3ce05e7f650371061d0b9eec1e1cf74ed6fca0 (diff)
downloadlinux-0053859496baa17c7675526936677c9213bf5a0d.tar.xz
net: add EXPORT_INDIRECT_CALLABLE wrapper
When a static function is annotated with INDIRECT_CALLABLE_SCOPE and CONFIG_RETPOLINE is set, the static keyword is removed. Sometimes the function needs to be exported but EXPORT_SYMBOL can't be used because if CONFIG_RETPOLINE is not set, we will attempt to export a static symbol. This patch introduces a new indirect call wrapper: EXPORT_INDIRECT_CALLABLE. This basically does EXPORT_SYMBOL when CONFIG_RETPOLINE is set, but does nothing when it's not. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Brian Vazquez <brianvv@google.com> Link: https://lore.kernel.org/r/20210204181839.558951-1-brianvv@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/indirect_call_wrapper.h')
-rw-r--r--include/linux/indirect_call_wrapper.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/indirect_call_wrapper.h b/include/linux/indirect_call_wrapper.h
index 54c02c84906a..a8345c8a613d 100644
--- a/include/linux/indirect_call_wrapper.h
+++ b/include/linux/indirect_call_wrapper.h
@@ -36,6 +36,7 @@
#define INDIRECT_CALLABLE_DECLARE(f) f
#define INDIRECT_CALLABLE_SCOPE
+#define EXPORT_INDIRECT_CALLABLE(f) EXPORT_SYMBOL(f)
#else
#define INDIRECT_CALL_1(f, f1, ...) f(__VA_ARGS__)
@@ -44,6 +45,7 @@
#define INDIRECT_CALL_4(f, f4, f3, f2, f1, ...) f(__VA_ARGS__)
#define INDIRECT_CALLABLE_DECLARE(f)
#define INDIRECT_CALLABLE_SCOPE static
+#define EXPORT_INDIRECT_CALLABLE(f)
#endif
/*