kbuild: warn about duplicate exported symbols
In modpost introduce a check for symbols exported twice. This check caught only one victim (inet_bind_bucket_create) for which a patch is already sent to netdev. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
parent
040fcc819a
commit
8e70c45887
1 changed files with 13 additions and 3 deletions
|
@ -117,6 +117,7 @@ struct symbol {
|
||||||
unsigned int vmlinux:1; /* 1 if symbol is defined in vmlinux */
|
unsigned int vmlinux:1; /* 1 if symbol is defined in vmlinux */
|
||||||
unsigned int kernel:1; /* 1 if symbol is from kernel
|
unsigned int kernel:1; /* 1 if symbol is from kernel
|
||||||
* (only for external modules) **/
|
* (only for external modules) **/
|
||||||
|
unsigned int preloaded:1; /* 1 if symbol from Module.symvers */
|
||||||
char name[0];
|
char name[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -186,9 +187,17 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod)
|
||||||
{
|
{
|
||||||
struct symbol *s = find_symbol(name);
|
struct symbol *s = find_symbol(name);
|
||||||
|
|
||||||
if (!s)
|
if (!s) {
|
||||||
s = new_symbol(name, mod);
|
s = new_symbol(name, mod);
|
||||||
|
} else {
|
||||||
|
if (!s->preloaded) {
|
||||||
|
warn("%s: duplicate symbol '%s' previous definition "
|
||||||
|
"was in %s%s\n", mod->name, name,
|
||||||
|
s->module->name,
|
||||||
|
is_vmlinux(s->module->name) ?"":".ko");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
s->preloaded = 0;
|
||||||
s->vmlinux = is_vmlinux(mod->name);
|
s->vmlinux = is_vmlinux(mod->name);
|
||||||
s->kernel = 0;
|
s->kernel = 0;
|
||||||
return s;
|
return s;
|
||||||
|
@ -706,7 +715,8 @@ static void read_dump(const char *fname, unsigned int kernel)
|
||||||
mod->skip = 1;
|
mod->skip = 1;
|
||||||
}
|
}
|
||||||
s = sym_add_exported(symname, mod);
|
s = sym_add_exported(symname, mod);
|
||||||
s->kernel = kernel;
|
s->kernel = kernel;
|
||||||
|
s->preloaded = 1;
|
||||||
sym_update_crc(symname, mod, crc);
|
sym_update_crc(symname, mod, crc);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue