mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Bogus "has no CRC" in external module builds
@ 2004-04-29 18:45 Pavel Roskin
  2004-08-15 19:18 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Roskin @ 2004-04-29 18:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sam Ravnborg

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1289 bytes --]

Hello!

The recent fixes for the external module build have fixed the major
breakage, but they left one annoyance unfixed.  If CONFIG_MODVERSIONS is
disabled, a warning is printed for every exported symbol that is has no
CRC.  For instance, I see this when compiling the standalone Orinoco
driver on Linux 2.6.6-rc3:

*** Warning: "__orinoco_down" [/usr/local/src/orinoco/spectrum_cs.ko] has
no CRC!
*** Warning: "hermes_struct_init" [/usr/local/src/orinoco/spectrum_cs.ko]
has no CRC!
*** Warning: "free_orinocodev" [/usr/local/src/orinoco/spectrum_cs.ko] has
no CRC!
[further warnings skipped]

I have found that the "-i" option for modpost is used for external builds,
whereas the internal modules use "-o".  The "-i" option causes read_dump()
in modpost.c to be called.  This function sets "modversions" variable
under some conditions that I don't understand.  The comment before the
modversions declarations says: "Are we using CONFIG_MODVERSIONS?"

Apparently modpost fails to answer this question.  I think it's better to
use an explicit option rather than a kludge.

The attached patch adds a new option "-m" that is specified if and only if
CONFIG_MODVERSIONS is enabled.  The patch has been successfully tested
both with and without CONFIG_MODVERSIONS.

-- 
Regards,
Pavel Roskin

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1375 bytes --]

--- linux.orig/scripts/Makefile.modpost
+++ linux/scripts/Makefile.modpost
@@ -51,8 +51,8 @@
 #  Includes step 3,4
 quiet_cmd_modpost = MODPOST
       cmd_modpost = scripts/modpost \
-	$(if $(KBUILD_EXTMOD),-i,-o) $(symverfile) \
-	$(filter-out FORCE,$^)
+	$(if $(CONFIG_MODVERSIONS),-m) $(if $(KBUILD_EXTMOD),-i,-o) \
+	$(symverfile) $(filter-out FORCE,$^)
 
 .PHONY: __modpost
 __modpost: $(wildcard vmlinux) $(modules:.ko=.o) FORCE
--- linux.orig/scripts/modpost.c
+++ linux/scripts/modpost.c
@@ -342,7 +342,6 @@ handle_modversions(struct module *mod, s
 			crc = (unsigned int) sym->st_value;
 			add_exported_symbol(symname + strlen(CRC_PFX),
 					    mod, &crc);
-			modversions = 1;
 		}
 		break;
 	case SHN_UNDEF:
@@ -648,7 +647,6 @@ read_dump(const char *fname)
 
 		if (!(mod = find_module(modname))) {
 			if (is_vmlinux(modname)) {
-				modversions = 1;
 				have_vmlinux = 1;
 			}
 			mod = new_module(NOFAIL(strdup(modname)));
@@ -695,11 +693,14 @@ main(int argc, char **argv)
 	char *dump_read = NULL, *dump_write = NULL;
 	int opt;
 
-	while ((opt = getopt(argc, argv, "i:o:")) != -1) {
+	while ((opt = getopt(argc, argv, "i:mo:")) != -1) {
 		switch(opt) {
 			case 'i':
 				dump_read = optarg;
 				break;
+			case 'm':
+				modversions = 1;
+				break;
 			case 'o':
 				dump_write = optarg;
 				break;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-15 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-29 18:45 [PATCH] Bogus "has no CRC" in external module builds Pavel Roskin
2004-08-15 19:18 ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®