Forum Discussion
Altera_Forum
Honored Contributor
15 years agoHi,
--- Quote Start --- I checked the definition of the function and the include path. Eventually I put the EXPORT_SYMBOL(__copy_from_user); line into the arch/nios2/mm/uaccess.c file. Don't know if it's only a workaround, because it seems strange that other users haven't encountered such errors. --- Quote End --- You mean that you don't have the description EXPORT_SYMBOL(__copy_from_user); in your 'uaccess.c' file ? Modules are loaded dynamically and the linker must resolve the locations. To do this, the kernel must expose the symbol's location, and you need the macro 'EXPORT_SYMBOL(symbol)' if you want to use the 'symbol' in your module. In fact, the symbols
EXPORT_SYMBOL(__copy_from_user);
EXPORT_SYMBOL(copy_from_user);
EXPORT_SYMBOL(__copy_to_user);
EXPORT_SYMBOL(copy_to_user);
EXPORT_SYMBOL(get_ds);
EXPORT_SYMBOL(get_fs);
EXPORT_SYMBOL(set_fs);
are exported in my 'arch/nios2/mm/uaccess.c'. The macro 'EXPORT_SYMBOL' exports symbols as follows
/* For every exported symbol, place a struct in the __ksymtab section */# define __EXPORT_SYMBOL(sym, sec)
extern typeof(sym) sym;
__CRC_SYMBOL(sym, sec)
static const char __kstrtab_##sym
__attribute__((section("__ksymtab_strings"), aligned(1)))
= MODULE_SYMBOL_PREFIX# sym;
static const struct kernel_symbol __ksymtab_##sym
__used
__attribute__((section("__ksymtab" sec), unused))
= { (unsigned long)&sym, __kstrtab_##sym }
# define EXPORT_SYMBOL(sym)
__EXPORT_SYMBOL(sym, "")
And it seems that Wind River guys did not test the module loadings at all. Please see this http://www.alteraforum.com/forum/showpost.php?p=78791&postcount=48 . Kazu