[lkml]   [2002]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] default to "don't export symbols"

I'd like to get comments and testing on the appended patch.

I spend some time finding and fixing modules which still relied
on the old behavior of "default to exporting all symbols if unsure" and
made the export their symbols explicitly.

As of now, all modules should explicit their symbols explicitly, so they
won't be affected by the appended change. "should" as in "I tried to
compile as much as possible modular on i386 and didn't get any unresolved

To find clean this up further, I'm proposing the following:

o the appended change, which will make "EXPORT_NO_SYMBOLS" the default
for all objects which are not listed in $(export-objs). In case I
missed some module, this will cause depmod complaining about unresolved
symbols which thus should be exported explicitly.

o make "EXPORT_NO_SYMBOLS" default for all objects, except of course
those which explicitly export symbols via EXPORT_SYMBOL()

o cleanup all the EXPORT_NO_SYMBOLS in the sources, as they are default
now anyway.

The second step will be another tiny patch to module.h, and the third one
is basically a small grep script.


[What the patch actually does is add an empty but allocated section
"__ksymtab" to the object file, which modutils recognizes as an
indication to not export symbols. It won't use any kernel memory.]

Pull from

(Merging changesets omitted for clarity)

ChangeSet@1.557, 2002-05-09 13:51:22-05:00,
Don't implicitly export all symbols

In the old days, we used to export all symbols from a module by default.
We still do so, unless
o either exported symbols are explicitly listed in EXPORT_SYMBOL()
is given.

This patches changes the default of 'export all symbols' to 'export no
symbols' for all files which are not listed in $(export-objs) in
the relevant Makefile.

module.h | 2 ++
1 files changed, 2 insertions(+)


diff -Nru a/include/linux/module.h b/include/linux/module.h
--- a/include/linux/module.h Thu May 9 13:51:55 2002
+++ b/include/linux/module.h Thu May 9 13:51:55 2002
@@ -370,6 +370,8 @@
#define EXPORT_SYMBOL_NOVERS(var) error this_object_must_be_defined_as_export_objs_in_the_Makefile
#define EXPORT_SYMBOL_GPL(var) error this_object_must_be_defined_as_export_objs_in_the_Makefile

+__asm__(".section __ksymtab,\"a\"\n.previous");

#define __EXPORT_SYMBOL(sym, str) \

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:22    [W:0.029 / U:1.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site