From: Sam Ravnborg <sam@ravnborg.org>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Sam Ravnborg <sam@mars.ravnborg.org>, Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH 05/46] kbuild: warn about duplicate exported symbols
Date: Tue, 21 Mar 2006 17:20:54 +0100 [thread overview]
Message-ID: <1142958054501-git-send-email-sam@ravnborg.org> (raw)
In-Reply-To: <11429580542480-git-send-email-sam@ravnborg.org>
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>
---
scripts/mod/modpost.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
8e70c45887a6bbe40393342ea5b426b0dd836dff
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 976adf1..d901095 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -117,6 +117,7 @@ struct symbol {
unsigned int vmlinux:1; /* 1 if symbol is defined in vmlinux */
unsigned int kernel:1; /* 1 if symbol is from kernel
* (only for external modules) **/
+ unsigned int preloaded:1; /* 1 if symbol from Module.symvers */
char name[0];
};
@@ -186,9 +187,17 @@ static struct symbol *sym_add_exported(c
{
struct symbol *s = find_symbol(name);
- if (!s)
+ if (!s) {
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->kernel = 0;
return s;
@@ -706,7 +715,8 @@ static void read_dump(const char *fname,
mod->skip = 1;
}
s = sym_add_exported(symname, mod);
- s->kernel = kernel;
+ s->kernel = kernel;
+ s->preloaded = 1;
sym_update_crc(symname, mod, crc);
}
return;
--
1.0.GIT
next prev parent reply other threads:[~2006-03-21 16:30 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-21 16:17 [GIT PATCH] kbuild updates Sam Ravnborg
2006-03-21 16:20 ` [PATCH 01/46] kbuild: support building individual files for external modules Sam Ravnborg
2006-03-21 16:20 ` [PATCH 02/46] kbuild: use warn()/fatal() consistent in modpost Sam Ravnborg
2006-03-21 16:20 ` [PATCH 03/46] kbuild: apply CodingStyle to modpost.c Sam Ravnborg
2006-03-21 16:20 ` [PATCH 04/46] kbuild: improved modversioning support for external modules Sam Ravnborg
2006-03-21 16:20 ` Sam Ravnborg [this message]
2006-03-21 16:20 ` [PATCH 06/46] x86: align per-cpu section to configured cache bytes Sam Ravnborg
2006-03-21 16:20 ` [PATCH 07/46] kbuild: Accept various mips sub-types in SUBARCH Sam Ravnborg
2006-03-21 16:20 ` [PATCH 08/46] kbuild: avoid stale modules in $(MODVERDIR) for external modules Sam Ravnborg
2006-03-21 16:20 ` [PATCH 09/46] kbuild: run depmod when installing " Sam Ravnborg
2006-03-21 16:20 ` [PATCH 10/46] kbuild: check for section mismatch during modpost stage Sam Ravnborg
2006-03-21 16:20 ` [PATCH 11/46] kbuild: make cc-version available in kbuild files Sam Ravnborg
2006-03-21 16:20 ` [PATCH 12/46] kbuild: consolidate command line escaping Sam Ravnborg
2006-03-21 16:20 ` [PATCH 13/46] kbuild: fix mkmakefile Sam Ravnborg
2006-03-21 16:20 ` [PATCH 14/46] kbuild: remove a tab from an empty line Sam Ravnborg
2006-03-21 16:20 ` [PATCH 15/46] kbuild: remove checkconfig.pl Sam Ravnborg
2006-03-21 16:20 ` [PATCH 16/46] kbuild: fix comment in Kbuild.include Sam Ravnborg
2006-03-21 16:20 ` [PATCH 17/46] kbuild: do not segfault in modpost if MODVERDIR is not defined Sam Ravnborg
2006-03-21 16:20 ` [PATCH 18/46] kbuild: fix segfault in modpost Sam Ravnborg
2006-03-21 16:20 ` [PATCH 19/46] kbuild: include symbol names in section mismatch warnings Sam Ravnborg
2006-03-21 16:20 ` [PATCH 20/46] kbuild: fix a cscope bug (make cscope segfaults) Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1142958054501-git-send-email-sam@ravnborg.org \
--to=sam@ravnborg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@mars.ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.