diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2006-06-28 07:26:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-28 17:59:04 -0400 |
commit | f71d20e961474dde77e6558396efb93d6ac80a4b (patch) | |
tree | 669610f79521fd173c28fc47bef39ecd4cdf52ab /include/linux/module.h | |
parent | f5e54d6e53a20cef45af7499e86164f0e0d16bb2 (diff) |
[PATCH] Add EXPORT_UNUSED_SYMBOL and EXPORT_UNUSED_SYMBOL_GPL
Temporarily add EXPORT_UNUSED_SYMBOL and EXPORT_UNUSED_SYMBOL_GPL. These
will be used as a transition measure for symbols that aren't used in the
kernel and are on the way out. When a module uses such a symbol, a warning
is printk'd at modprobe time.
The main reason for removing unused exports is size: eacho export takes
roughly between 100 and 150 bytes of kernel space in the binary. This
patch gives users the option to immediately get this size gain via a config
option.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/module.h')
-rw-r--r-- | include/linux/module.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 9ebbb74b7b72..9e9dc7c24d95 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -203,6 +203,15 @@ void *__symbol_get_gpl(const char *symbol); | |||
203 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) \ | 203 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) \ |
204 | __EXPORT_SYMBOL(sym, "_gpl_future") | 204 | __EXPORT_SYMBOL(sym, "_gpl_future") |
205 | 205 | ||
206 | |||
207 | #ifdef CONFIG_UNUSED_SYMBOLS | ||
208 | #define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused") | ||
209 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl") | ||
210 | #else | ||
211 | #define EXPORT_UNUSED_SYMBOL(sym) | ||
212 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) | ||
213 | #endif | ||
214 | |||
206 | #endif | 215 | #endif |
207 | 216 | ||
208 | struct module_ref | 217 | struct module_ref |
@@ -261,6 +270,15 @@ struct module | |||
261 | unsigned int num_gpl_syms; | 270 | unsigned int num_gpl_syms; |
262 | const unsigned long *gpl_crcs; | 271 | const unsigned long *gpl_crcs; |
263 | 272 | ||
273 | /* unused exported symbols. */ | ||
274 | const struct kernel_symbol *unused_syms; | ||
275 | unsigned int num_unused_syms; | ||
276 | const unsigned long *unused_crcs; | ||
277 | /* GPL-only, unused exported symbols. */ | ||
278 | const struct kernel_symbol *unused_gpl_syms; | ||
279 | unsigned int num_unused_gpl_syms; | ||
280 | const unsigned long *unused_gpl_crcs; | ||
281 | |||
264 | /* symbols that will be GPL-only in the near future. */ | 282 | /* symbols that will be GPL-only in the near future. */ |
265 | const struct kernel_symbol *gpl_future_syms; | 283 | const struct kernel_symbol *gpl_future_syms; |
266 | unsigned int num_gpl_future_syms; | 284 | unsigned int num_gpl_future_syms; |
@@ -456,6 +474,8 @@ void module_remove_driver(struct device_driver *); | |||
456 | #define EXPORT_SYMBOL(sym) | 474 | #define EXPORT_SYMBOL(sym) |
457 | #define EXPORT_SYMBOL_GPL(sym) | 475 | #define EXPORT_SYMBOL_GPL(sym) |
458 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) | 476 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) |
477 | #define EXPORT_UNUSED_SYMBOL(sym) | ||
478 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) | ||
459 | 479 | ||
460 | /* Given an address, look for it in the exception tables. */ | 480 | /* Given an address, look for it in the exception tables. */ |
461 | static inline const struct exception_table_entry * | 481 | static inline const struct exception_table_entry * |