diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2002-12-01 02:12:47 -0800 |
|---|---|---|
| committer | James Bottomley <jejb@raven.il.steeleye.com> | 2002-12-01 02:12:47 -0800 |
| commit | 1504317a0d85ff9cbf729d9d4ff3886aacc7a695 (patch) | |
| tree | 5d5d7a3d18ee441a69461b14f7817d2addbf9268 /include | |
| parent | a110ac32ded0c9b2505e41259342f79c85a74b49 (diff) | |
[PATCH] v850 support
On the v850, the elf toolchain uses a `_' prefix for all user symbols
(I'm not sure why, since most toolchains seem to have dropped this sort
of thing).
The attached patch adds the ability to deal with this, if the macro
MODULE_SYMBOL_PREFIX is defined by <asm/module.h>. This only affects
places where symbol names come from the user, e.g., EXPORT_SYMBOL, or
the explicit symbol-names used in kernel/module.c itself.
[Tweaked a little by Rusty, original by Miles Bader]
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/module.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 24389ac2db19..7729a4e10fb9 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -32,6 +32,11 @@ #define MODULE_PARM_DESC(var,desc) #define print_modules() +/* v850 toolchain uses a `_' prefix for all user symbols */ +#ifndef MODULE_SYMBOL_PREFIX +#define MODULE_SYMBOL_PREFIX "" +#endif + #define MODULE_NAME_LEN (64 - sizeof(unsigned long)) struct kernel_symbol { @@ -90,13 +95,13 @@ struct exception_table /* Get/put a kernel symbol (calls must be symmetric) */ void *__symbol_get(const char *symbol); void *__symbol_get_gpl(const char *symbol); -#define symbol_get(x) ((typeof(&x))(__symbol_get(#x))) +#define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x))) /* For every exported symbol, place a struct in the __ksymtab section */ #define EXPORT_SYMBOL(sym) \ const struct kernel_symbol __ksymtab_##sym \ __attribute__((section("__ksymtab"))) \ - = { (unsigned long)&sym, #sym } + = { (unsigned long)&sym, MODULE_SYMBOL_PREFIX #sym } #define EXPORT_SYMBOL_NOVERS(sym) EXPORT_SYMBOL(sym) #define EXPORT_SYMBOL_GPL(sym) EXPORT_SYMBOL(sym) @@ -170,7 +175,7 @@ struct module #ifdef CONFIG_MODULE_UNLOAD void __symbol_put(const char *symbol); -#define symbol_put(x) __symbol_put(#x) +#define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) void symbol_put_addr(void *addr); /* We only need protection against local interrupts. */ |
