Re: [PATCH v7 02/10] module: allow symbol exports to be disabled

From
Ard Biesheuvel <hidden>
Date
2018-01-02 23:55:09
Also in
linux-arm-kernel, linux-mips, lkml, sparclinux
Reply to
Nicolas Pitre, 2018-01-02
On 2 January 2018 at 23:47, Nicolas Pitre [off-list ref] wrote:
On Tue, 2 Jan 2018, Ard Biesheuvel wrote:
quoted
To allow existing C code to be incorporated into the decompressor or
the UEFI stub, introduce a CPP macro that turns all EXPORT_SYMBOL_xxx
declarations into nops, and #define it in places where such exports
are undesirable. Note that this gets rid of a rather dodgy redefine
of linux/export.h's header guard.
[...]
quoted
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -83,6 +83,15 @@ extern struct module __this_module;
  */
 #define __EXPORT_SYMBOL(sym, sec)    === __KSYM_##sym ===

+#elif defined(__DISABLE_EXPORTS)
+
+/*
+ * Allow symbol exports to be disabled completely so that C code may
+ * be reused in other execution contexts such as the UEFI stub or the
+ * decompressor.
+ */
+#define __EXPORT_SYMBOL(sym, sec)
+
I think you should rather put this first thing in the #if sequence so to
override the defined(__KSYM_DEPS__) case too.  No need to create build
dependencies for module symbols that you're going to stub out
afterwards anyway.
I wasn't sure, so thanks for clearing that up.
Thread (19 messages) 19 messages, 3 authors, last reply 2018-01-05
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help