public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fallout from kbuild changes
@ 2007-07-20  1:01 Al Viro
  2007-07-20  6:40 ` Sam Ravnborg
  2007-07-20 14:09 ` Jeff Dike
  0 siblings, 2 replies; 5+ messages in thread
From: Al Viro @ 2007-07-20  1:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: jdike, sam, akpm, linux-kernel

	Change in 'kbuild: do section mismatch check on full vmlinux'
should've been replicated in arch/um/Makefile.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 5d5ed72..989224f 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -146,7 +146,7 @@ define cmd_vmlinux__
 	-Wl,-T,$(vmlinux-lds) $(vmlinux-init) \
 	-Wl,--start-group $(vmlinux-main) -Wl,--end-group \
 	-lutil \
-	$(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) \
+	$(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o \
 	FORCE ,$^) ; rm -f linux
 endef
 

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

* Re: [PATCH] fallout from kbuild changes
  2007-07-20  1:01 [PATCH] fallout from kbuild changes Al Viro
@ 2007-07-20  6:40 ` Sam Ravnborg
  2007-07-20  9:20   ` Al Viro
  2007-07-20 14:09 ` Jeff Dike
  1 sibling, 1 reply; 5+ messages in thread
From: Sam Ravnborg @ 2007-07-20  6:40 UTC (permalink / raw)
  To: Al Viro; +Cc: Linus Torvalds, jdike, akpm, linux-kernel

On Fri, Jul 20, 2007 at 02:01:16AM +0100, Al Viro wrote:
> 	Change in 'kbuild: do section mismatch check on full vmlinux'
> should've been replicated in arch/um/Makefile.

Thanks Al.

	Sam

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

* Re: [PATCH] fallout from kbuild changes
  2007-07-20  6:40 ` Sam Ravnborg
@ 2007-07-20  9:20   ` Al Viro
  2007-07-20 11:36     ` Sam Ravnborg
  0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2007-07-20  9:20 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Linus Torvalds, jdike, akpm, linux-kernel

BTW, the presense of vmlinux in the second modpost generates warnings
in two cases - i386 with CONFIG_RELOCATABLE and sparc32 (always).
The warnings tend to be bogus.  Do we really want them there now that
we should (in theory) get all useful stuff from vmlinux.o?  Other
targets get aways with that since they don't have relocs survive into
vmlinux...

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

* Re: [PATCH] fallout from kbuild changes
  2007-07-20  9:20   ` Al Viro
@ 2007-07-20 11:36     ` Sam Ravnborg
  0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2007-07-20 11:36 UTC (permalink / raw)
  To: Al Viro; +Cc: Linus Torvalds, jdike, akpm, linux-kernel

On Fri, Jul 20, 2007 at 10:20:29AM +0100, Al Viro wrote:
> BTW, the presense of vmlinux in the second modpost generates warnings
> in two cases - i386 with CONFIG_RELOCATABLE and sparc32 (always).
> The warnings tend to be bogus.  Do we really want them there now that
> we should (in theory) get all useful stuff from vmlinux.o?  Other
> targets get aways with that since they don't have relocs survive into
> vmlinux...

It was on my TODO list. For i386, x86_64 etc. we warn too much too in
the seconf modpost run.
Something like this is needed - I will push it during the weekend.

	Sam

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index c6fcc59..cebfe03 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -57,20 +57,20 @@ _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))
 # Step 2), invoke modpost
 #  Includes step 3,4
 quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
-      cmd_modpost = scripts/mod/modpost            \
-        $(if $(CONFIG_MODVERSIONS),-m)             \
-	$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,)  \
-	$(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
-	$(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
-	$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
-	$(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
+      cmd_modpost = scripts/mod/modpost                 \
+        $(if $(CONFIG_MODVERSIONS),-m)                  \
+        $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,)       \
+        $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile)   \
+        $(if $(KBUILD_EXTMOD),-I $(modulesymfile))      \
+        $(if $(KBUILD_EXTMOD),-o $(modulesymfile))      \
+        $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
 
 PHONY += __modpost
 __modpost: $(modules:.ko=.o) FORCE
 	$(call cmd,modpost) $(wildcard vmlinux) $(filter-out FORCE,$^)
 
 quiet_cmd_kernel-mod = MODPOST $@
-      cmd_kernel-mod = $(cmd_modpost) $@
+      cmd_kernel-mod = $(cmd_modpost) -s $@
 
 PHONY += vmlinux
 vmlinux.o: FORCE
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 04579a5..787e1d4 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -23,6 +23,8 @@ int have_vmlinux = 0;
 static int all_versions = 0;
 /* If we are modposting external module set to 1 */
 static int external_module = 0;
+/* Warn about section mismatch in vmlinux if set to 1 */
+static int vmlinux_section_warnings = 0;
 /* Only warn about unresolved symbols */
 static int warn_unresolved = 0;
 /* How a symbol is exported */
@@ -1256,8 +1258,10 @@ static void read_symbols(char *modname)
 		handle_modversions(mod, &info, sym, symname);
 		handle_moddevtable(mod, &info, sym, symname);
 	}
-	check_sec_ref(mod, modname, &info, init_section, init_section_ref_ok);
-	check_sec_ref(mod, modname, &info, exit_section, exit_section_ref_ok);
+	if (is_vmlinux(modname) && vmlinux_section_warnings) {
+		check_sec_ref(mod, modname, &info, init_section, init_section_ref_ok);
+		check_sec_ref(mod, modname, &info, exit_section, exit_section_ref_ok);
+	}
 
 	version = get_modinfo(info.modinfo, info.modinfo_len, "version");
 	if (version)
@@ -1625,7 +1629,7 @@ int main(int argc, char **argv)
 	int opt;
 	int err;
 
-	while ((opt = getopt(argc, argv, "i:I:mo:aw")) != -1) {
+	while ((opt = getopt(argc, argv, "i:I:mso:aw")) != -1) {
 		switch(opt) {
 			case 'i':
 				kernel_read = optarg;
@@ -1643,6 +1647,9 @@ int main(int argc, char **argv)
 			case 'a':
 				all_versions = 1;
 				break;
+			case 's':
+				vmlinux_section_warnings = 1;
+				break;
 			case 'w':
 				warn_unresolved = 1;
 				break;

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

* Re: [PATCH] fallout from kbuild changes
  2007-07-20  1:01 [PATCH] fallout from kbuild changes Al Viro
  2007-07-20  6:40 ` Sam Ravnborg
@ 2007-07-20 14:09 ` Jeff Dike
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Dike @ 2007-07-20 14:09 UTC (permalink / raw)
  To: Al Viro; +Cc: Linus Torvalds, sam, akpm, linux-kernel

On Fri, Jul 20, 2007 at 02:01:16AM +0100, Al Viro wrote:
> 	Change in 'kbuild: do section mismatch check on full vmlinux'
> should've been replicated in arch/um/Makefile.

ACK

	Jeff

-- 
Work email - jdike at linux dot intel dot com

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

end of thread, other threads:[~2007-07-20 14:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-20  1:01 [PATCH] fallout from kbuild changes Al Viro
2007-07-20  6:40 ` Sam Ravnborg
2007-07-20  9:20   ` Al Viro
2007-07-20 11:36     ` Sam Ravnborg
2007-07-20 14:09 ` Jeff Dike

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