aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/modpost.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-01-28 16:22:33 -0500
committerSam Ravnborg <sam@mars.ravnborg.org>2006-02-19 03:51:18 -0500
commit8e70c45887a6bbe40393342ea5b426b0dd836dff (patch)
tree4fb8c40ca679a4f02321497642a2cf303dd80c43 /scripts/mod/modpost.c
parent040fcc819a2e7783a570f4bdcdd1f2a7f5f06837 (diff)
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>
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r--scripts/mod/modpost.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 976adf152db3..d901095ea8b7 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -117,6 +117,7 @@ struct symbol {
117 unsigned int vmlinux:1; /* 1 if symbol is defined in vmlinux */ 117 unsigned int vmlinux:1; /* 1 if symbol is defined in vmlinux */
118 unsigned int kernel:1; /* 1 if symbol is from kernel 118 unsigned int kernel:1; /* 1 if symbol is from kernel
119 * (only for external modules) **/ 119 * (only for external modules) **/
120 unsigned int preloaded:1; /* 1 if symbol from Module.symvers */
120 char name[0]; 121 char name[0];
121}; 122};
122 123
@@ -186,9 +187,17 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod)
186{ 187{
187 struct symbol *s = find_symbol(name); 188 struct symbol *s = find_symbol(name);
188 189
189 if (!s) 190 if (!s) {
190 s = new_symbol(name, mod); 191 s = new_symbol(name, mod);
191 192 } else {
193 if (!s->preloaded) {
194 warn("%s: duplicate symbol '%s' previous definition "
195 "was in %s%s\n", mod->name, name,
196 s->module->name,
197 is_vmlinux(s->module->name) ?"":".ko");
198 }
199 }
200 s->preloaded = 0;
192 s->vmlinux = is_vmlinux(mod->name); 201 s->vmlinux = is_vmlinux(mod->name);
193 s->kernel = 0; 202 s->kernel = 0;
194 return s; 203 return s;
@@ -706,7 +715,8 @@ static void read_dump(const char *fname, unsigned int kernel)
706 mod->skip = 1; 715 mod->skip = 1;
707 } 716 }
708 s = sym_add_exported(symname, mod); 717 s = sym_add_exported(symname, mod);
709 s->kernel = kernel; 718 s->kernel = kernel;
719 s->preloaded = 1;
710 sym_update_crc(symname, mod, crc); 720 sym_update_crc(symname, mod, crc);
711 } 721 }
712 return; 722 return;