--- busybox/insmod.c.orig 2002-09-16 09:30:10 +0400 +++ busybox/insmod.c 2003-11-09 23:29:40 +0300 @@ -607,6 +607,8 @@ static enum obj_reloc arch_apply_relocat static void arch_create_got (struct obj_file *f); +static int obj_gpl_license(struct obj_file *f, const char **license); + #ifdef BB_FEATURE_NEW_MODULE_INTERFACE static int arch_init_module (struct obj_file *f, struct new_module *); #endif @@ -1709,6 +1711,7 @@ add_symbols_from( struct new_module_symbol *s; size_t i; int used = 0; + int gpl = obj_gpl_license(f, NULL) == 0; for (i = 0, s = syms; i < nsyms; ++i, ++s) { @@ -1717,6 +1720,19 @@ add_symbols_from( We will also create a false dependency on the module. */ struct obj_symbol *sym; + /* GPL licensed modules can use symbols exported with + * EXPORT_SYMBOL_GPL, so ignore any GPLONLY_ prefix on the + * exported names. Non-GPL modules never see any GPLONLY_ + * symbols so they cannot fudge it by adding the prefix on + * their references. + */ + if (strncmp((char *)s->name, "GPLONLY_", 8) == 0) { + if (gpl) + ((char *)s->name) += 8; + else + continue; + } + sym = obj_find_symbol(f, (char *) s->name); if (sym && !ELFW(ST_BIND) (sym->info) == STB_LOCAL) { sym = obj_add_symbol(f, (char *) s->name, -1,