public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.6.23-rc1: i386 section mismatch warnings
@ 2007-07-24  1:18 Jeff Garzik
  2007-07-24  1:45 ` Al Viro
  2007-07-24  6:08 ` Sam Ravnborg
  0 siblings, 2 replies; 8+ messages in thread
From: Jeff Garzik @ 2007-07-24  1:18 UTC (permalink / raw)
  To: Linux Kernel Mailing List

make allmodconfig on i386:

WARNING: vmlinux(.text+0xc0101183): Section mismatch: reference to 
.init.text:start_kernel (between 'is386' and 'check_x87')
WARNING: vmlinux(.text+0xc02cfcdb): Section mismatch: reference to 
.init.text:kernel_init (between 'rest_init' and 'kthreadd_setup')
WARNING: vmlinux(.text+0xc02d5ed2): Section mismatch: reference to 
.init.text: (between 'iret_exc' and '_etext')
WARNING: vmlinux(.text+0xc02d5ede): Section mismatch: reference to 
.init.text: (between 'iret_exc' and '_etext')
WARNING: vmlinux(.text+0xc02d5eea): Section mismatch: reference to 
.init.text: (between 'iret_exc' and '_etext')
WARNING: vmlinux(.text+0xc02d5ef6): Section mismatch: reference to 
.init.text: (between 'iret_exc' and '_etext')
WARNING: vmlinux(.text+0xc02cfda4): Section mismatch: reference to 
.init.text:__alloc_bootmem_node (between 'alloc_node_mem_map' and 
'zone_wait_table_init')
WARNING: vmlinux(.text+0xc02cfe4e): Section mismatch: reference to 
.init.text:__alloc_bootmem_node (between 'zone_wait_table_init' and 
'vgacon_scrollback_startup')
WARNING: vmlinux(.text+0xc02d64c6): Section mismatch: reference to 
.init.text: (between 'iret_exc' and '_etext')
WARNING: vmlinux(.text+0xc02cfea7): Section mismatch: reference to 
.init.text:__alloc_bootmem (between 'vgacon_scrollback_startup' and 
'fb_find_logo')
WARNING: vmlinux(.text+0xc02cfecb): Section mismatch: reference to 
.init.data:logo_linux_mono (between 'fb_find_logo' and 'schedule')
WARNING: vmlinux(.text+0xc02cfed5): Section mismatch: reference to 
.init.data:logo_linux_clut224 (between 'fb_find_logo' and 'schedule')
WARNING: vmlinux(.text+0xc02cfeda): Section mismatch: reference to 
.init.data:logo_linux_vga16 (between 'fb_find_logo' and 'schedule')
WARNING: vmlinux(.text+0xc02d6612): Section mismatch: reference to 
.init.text: (between 'iret_exc' and '_etext')

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

* Re: 2.6.23-rc1: i386 section mismatch warnings
  2007-07-24  1:18 2.6.23-rc1: i386 section mismatch warnings Jeff Garzik
@ 2007-07-24  1:45 ` Al Viro
  2007-07-24  7:48   ` Gabriel C
  2007-07-24  6:08 ` Sam Ravnborg
  1 sibling, 1 reply; 8+ messages in thread
From: Al Viro @ 2007-07-24  1:45 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Linux Kernel Mailing List

On Mon, Jul 23, 2007 at 09:18:38PM -0400, Jeff Garzik wrote:
> make allmodconfig on i386:
> 
> WARNING: vmlinux(.text+0xc0101183): Section mismatch: reference to 

Ignore.  vmlinux.o ones are interesting; so are ones in modules.
vmlinux ones are either duplicates of vmlinux.o or false positives.

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

* Re: 2.6.23-rc1: i386 section mismatch warnings
  2007-07-24  1:18 2.6.23-rc1: i386 section mismatch warnings Jeff Garzik
  2007-07-24  1:45 ` Al Viro
@ 2007-07-24  6:08 ` Sam Ravnborg
  1 sibling, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2007-07-24  6:08 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Linux Kernel Mailing List

On Mon, Jul 23, 2007 at 09:18:38PM -0400, Jeff Garzik wrote:
> make allmodconfig on i386:
> 
> WARNING: vmlinux(.text+0xc0101183): Section mismatch: reference to 
> .init.text:start_kernel (between 'is386' and 'check_x87')
> WARNING: vmlinux(.text+0xc02cfcdb): Section mismatch: reference to 
> .init.text:kernel_init (between 'rest_init' and 'kthreadd_setup')
> WARNING: vmlinux(.text+0xc02d5ed2): Section mismatch: reference to 
> .init.text: (between 'iret_exc' and '_etext')
> WARNING: vmlinux(.text+0xc02d5ede): Section mismatch: reference to 
> .init.text: (between 'iret_exc' and '_etext')
> WARNING: vmlinux(.text+0xc02d5eea): Section mismatch: reference to 
> .init.text: (between 'iret_exc' and '_etext')
> WARNING: vmlinux(.text+0xc02d5ef6): Section mismatch: reference to 
> .init.text: (between 'iret_exc' and '_etext')
> WARNING: vmlinux(.text+0xc02cfda4): Section mismatch: reference to 
> .init.text:__alloc_bootmem_node (between 'alloc_node_mem_map' and 
> 'zone_wait_table_init')
> WARNING: vmlinux(.text+0xc02cfe4e): Section mismatch: reference to 
> .init.text:__alloc_bootmem_node (between 'zone_wait_table_init' and 
> 'vgacon_scrollback_startup')
> WARNING: vmlinux(.text+0xc02d64c6): Section mismatch: reference to 
> .init.text: (between 'iret_exc' and '_etext')
> WARNING: vmlinux(.text+0xc02cfea7): Section mismatch: reference to 
> .init.text:__alloc_bootmem (between 'vgacon_scrollback_startup' and 
> 'fb_find_logo')
> WARNING: vmlinux(.text+0xc02cfecb): Section mismatch: reference to 
> .init.data:logo_linux_mono (between 'fb_find_logo' and 'schedule')
> WARNING: vmlinux(.text+0xc02cfed5): Section mismatch: reference to 
> .init.data:logo_linux_clut224 (between 'fb_find_logo' and 'schedule')
> WARNING: vmlinux(.text+0xc02cfeda): Section mismatch: reference to 
> .init.data:logo_linux_vga16 (between 'fb_find_logo' and 'schedule')
> WARNING: vmlinux(.text+0xc02d6612): Section mismatch: reference to 
> .init.text: (between 'iret_exc' and '_etext')

The above warnings happens because during final link we stuff
a lot of different sections down in a smaller number of sections.
So modpost does not know that the references are actually OK.

The fix is simply to avoid doing section mismatch check on vmlinux
when processing the modules and I have this in kbuild.git.
I expect this to be merged during -rc1 (was sent in the merge window
but did not get applied).

As a general rule just ignore all section mismatch warnings that originate
from vmlinux. The others needs to be fixed and there seem to be enough
to deal with :-(

	Sam

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

* Re: 2.6.23-rc1: i386 section mismatch warnings
  2007-07-24  1:45 ` Al Viro
@ 2007-07-24  7:48   ` Gabriel C
  2007-07-24  8:08     ` Sam Ravnborg
  2007-07-25 21:15     ` Sam Ravnborg
  0 siblings, 2 replies; 8+ messages in thread
From: Gabriel C @ 2007-07-24  7:48 UTC (permalink / raw)
  To: Al Viro; +Cc: Jeff Garzik, Linux Kernel Mailing List

Al Viro wrote:
> On Mon, Jul 23, 2007 at 09:18:38PM -0400, Jeff Garzik wrote:
>> make allmodconfig on i386:
>>
>> WARNING: vmlinux(.text+0xc0101183): Section mismatch: reference to 
> 
> Ignore.  vmlinux.o ones are interesting; so are ones in modules.
> vmlinux ones are either duplicates of vmlinux.o or false positives.

allyesconfig has a lot Section mismatch warnings , are these false positive too ?


http://lkml.org/lkml/2007/7/22/312

Regards,

Gabriel C

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

* Re: 2.6.23-rc1: i386 section mismatch warnings
  2007-07-24  7:48   ` Gabriel C
@ 2007-07-24  8:08     ` Sam Ravnborg
  2007-07-24 12:30       ` Sam Ravnborg
  2007-07-25 21:15     ` Sam Ravnborg
  1 sibling, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2007-07-24  8:08 UTC (permalink / raw)
  To: Gabriel C; +Cc: Al Viro, Jeff Garzik, Linux Kernel Mailing List

On Tue, Jul 24, 2007 at 09:48:48AM +0200, Gabriel C wrote:
> Al Viro wrote:
> > On Mon, Jul 23, 2007 at 09:18:38PM -0400, Jeff Garzik wrote:
> >> make allmodconfig on i386:
> >>
> >> WARNING: vmlinux(.text+0xc0101183): Section mismatch: reference to 
> > 
> > Ignore.  vmlinux.o ones are interesting; so are ones in modules.
> > vmlinux ones are either duplicates of vmlinux.o or false positives.
> 
> allyesconfig has a lot Section mismatch warnings , are these false positive too ?
> 
> 
> http://lkml.org/lkml/2007/7/22/312

The first group are to be solved.
The last group can be ignored.

I have saved your original mail but not yet looked into any of them.
I assume that a few hours work can bring down the list considerably but
I was sidetracked by a book (HP7) ;-)

	Sam

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

* Re: 2.6.23-rc1: i386 section mismatch warnings
  2007-07-24  8:08     ` Sam Ravnborg
@ 2007-07-24 12:30       ` Sam Ravnborg
  0 siblings, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2007-07-24 12:30 UTC (permalink / raw)
  To: Gabriel C; +Cc: Al Viro, Jeff Garzik, Linux Kernel Mailing List

On Tue, Jul 24, 2007 at 10:08:47AM +0200, Sam Ravnborg wrote:
> On Tue, Jul 24, 2007 at 09:48:48AM +0200, Gabriel C wrote:
> > Al Viro wrote:
> > > On Mon, Jul 23, 2007 at 09:18:38PM -0400, Jeff Garzik wrote:
> > >> make allmodconfig on i386:
> > >>
> > >> WARNING: vmlinux(.text+0xc0101183): Section mismatch: reference to 
> > > 
> > > Ignore.  vmlinux.o ones are interesting; so are ones in modules.
> > > vmlinux ones are either duplicates of vmlinux.o or false positives.
> > 
> > allyesconfig has a lot Section mismatch warnings , are these false positive too ?
> > 
> > 
> > http://lkml.org/lkml/2007/7/22/312
> 
> The first group are to be solved.
> The last group can be ignored.
> 
> I have saved your original mail but not yet looked into any of them.
> I assume that a few hours work can bring down the list considerably but
> I was sidetracked by a book (HP7) ;-)

Took a closer look at the warnings.
modpost gets confused on the weired section mames: .init.text.1, .init.text.3 etc.

See for example:

WARNING: vmlinux.o(.data+0x4b38): Section mismatch: reference to .init.text.3:powernow_cpu_init (between 'powernow_driver' and 'minimum
                                                                 ^^^^^^^^^^^^

This is easy to ignore but anyone that knows why we suddenly have a number following
the section name in a few cases?

	Sam

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

* Re: 2.6.23-rc1: i386 section mismatch warnings
  2007-07-24  7:48   ` Gabriel C
  2007-07-24  8:08     ` Sam Ravnborg
@ 2007-07-25 21:15     ` Sam Ravnborg
  2007-07-25 23:49       ` Gabriel C
  1 sibling, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2007-07-25 21:15 UTC (permalink / raw)
  To: Gabriel C; +Cc: Al Viro, Jeff Garzik, Linux Kernel Mailing List

On Tue, Jul 24, 2007 at 09:48:48AM +0200, Gabriel C wrote:
> Al Viro wrote:
> > On Mon, Jul 23, 2007 at 09:18:38PM -0400, Jeff Garzik wrote:
> >> make allmodconfig on i386:
> >>
> >> WARNING: vmlinux(.text+0xc0101183): Section mismatch: reference to 
> > 
> > Ignore.  vmlinux.o ones are interesting; so are ones in modules.
> > vmlinux ones are either duplicates of vmlinux.o or false positives.
> 
> allyesconfig has a lot Section mismatch warnings , are these false positive too ?
> 
> 
> http://lkml.org/lkml/2007/7/22/312

Fixed in latest kbuild.git. See the following two patches.

	Sam

>From 2f5ee619045d923de9137b6a263a99cc2428391a Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Wed, 25 Jul 2007 21:46:40 +0200
Subject: [PATCH 6/8] kbuild: rearrange a few function in modpost

This is a preparational patch that just move
two functions and add one (for now unused) function.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/mod/modpost.c |   80 +++++++++++++++++++++++++++++-------------------
 1 files changed, 48 insertions(+), 32 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 87e3ee5..c903a16 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -586,6 +586,54 @@ static int strrcmp(const char *s, const char *sub)
         return memcmp(s + slen - sublen, sub, sublen);
 }
 
+/*
+ * Functions used only during module init is marked __init and is stored in
+ * a .init.text section. Likewise data is marked __initdata and stored in
+ * a .init.data section.
+ * If this section is one of these sections return 1
+ * See include/linux/init.h for the details
+ */
+static int init_section(const char *name)
+{
+	if (strcmp(name, ".init") == 0)
+		return 1;
+	if (strncmp(name, ".init.", strlen(".init.")) == 0)
+		return 1;
+	return 0;
+}
+
+/*
+ * Functions used only during module exit is marked __exit and is stored in
+ * a .exit.text section. Likewise data is marked __exitdata and stored in
+ * a .exit.data section.
+ * If this section is one of these sections return 1
+ * See include/linux/init.h for the details
+ **/
+static int exit_section(const char *name)
+{
+	if (strcmp(name, ".exit.text") == 0)
+		return 1;
+	if (strcmp(name, ".exit.data") == 0)
+		return 1;
+	return 0;
+
+}
+
+/*
+ * Data sections are named like this:
+ * .data | .data.rel | .data.rel.*
+ * Return 1 if the specified section is a data section
+ */
+static int data_section(const char *name)
+{
+	if ((strcmp(name, ".data") == 0) ||
+	    (strcmp(name, ".data.rel") == 0) ||
+	    (strncmp(name, ".data.rel.", strlen(".data.rel.")) == 0))
+		return 1;
+	else
+		return 0;
+}
+
 /**
  * Whitelist to allow certain references to pass with no warning.
  *
@@ -1108,21 +1156,6 @@ static int initexit_section_ref_ok(const char *name)
 	return 0;
 }
 
-/**
- * Functions used only during module init is marked __init and is stored in
- * a .init.text section. Likewise data is marked __initdata and stored in
- * a .init.data section.
- * If this section is one of these sections return 1
- * See include/linux/init.h for the details
- **/
-static int init_section(const char *name)
-{
-	if (strcmp(name, ".init") == 0)
-		return 1;
-	if (strncmp(name, ".init.", strlen(".init.")) == 0)
-		return 1;
-	return 0;
-}
 
 /*
  * Identify sections from which references to a .init section is OK.
@@ -1180,23 +1213,6 @@ static int init_section_ref_ok(const char *name)
 }
 
 /*
- * Functions used only during module exit is marked __exit and is stored in
- * a .exit.text section. Likewise data is marked __exitdata and stored in
- * a .exit.data section.
- * If this section is one of these sections return 1
- * See include/linux/init.h for the details
- **/
-static int exit_section(const char *name)
-{
-	if (strcmp(name, ".exit.text") == 0)
-		return 1;
-	if (strcmp(name, ".exit.data") == 0)
-		return 1;
-	return 0;
-
-}
-
-/*
  * Identify sections from which references to a .exit section is OK.
  */
 static int exit_section_ref_ok(const char *name)
-- 
1.5.1.rc3.g84b7-dirty

>From 83cda2bb37cb8476cd84659d9698ab48553be974 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Wed, 25 Jul 2007 21:52:31 +0200
Subject: [PATCH 7/8] kbuild: be more foregiving on init section naming

In the whitelist function of modpost now use the same
check to identify init_section as in other places of modpost.
This has the effect that we now recognize sections named
.init.text.19 as init sections and we no longer warn
when we see these.

At the same time make surrounding code readable by dropping
use of temporary flags.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/mod/modpost.c |   36 ++++++++++--------------------------
 1 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index c903a16..3db4edc 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -658,8 +658,8 @@ static int data_section(const char *name)
  *   These functions may often be marked __init and we do not want to
  *   warn here.
  *   the pattern is identified by:
- *   tosec   = .init.text | .exit.text | .init.data
- *   fromsec = .data | .data.rel | .data.rel.*
+ *   tosec   = init or exit section
+ *   fromsec = data section
  *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console, *_timer
  *
  * Pattern 3:
@@ -680,7 +680,6 @@ static int secref_whitelist(const char *modname, const char *tosec,
 			    const char *fromsec, const char *atsym,
 			    const char *refsymname)
 {
-	int f1 = 1, f2 = 1;
 	const char **s;
 	const char *pat2sym[] = {
 		"driver",
@@ -707,31 +706,16 @@ static int secref_whitelist(const char *modname, const char *tosec,
 		return 1;
 
 	/* Check for pattern 1 */
-	if (strcmp(tosec, ".init.data") != 0)
-		f1 = 0;
-	if (strncmp(fromsec, ".data", strlen(".data")) != 0)
-		f1 = 0;
-	if (strncmp(atsym, "__param", strlen("__param")) != 0)
-		f1 = 0;
-
-	if (f1)
-		return f1;
+	if ((strcmp(tosec, ".init.data") == 0) &&
+	    (strncmp(fromsec, ".data", strlen(".data")) == 0) &&
+	    (strncmp(atsym, "__param", strlen("__param")) == 0))
+		return 1;
 
 	/* Check for pattern 2 */
-	if ((strcmp(tosec, ".init.text") != 0) &&
-	    (strcmp(tosec, ".exit.text") != 0) &&
-	    (strcmp(tosec, ".init.data") != 0))
-		f2 = 0;
-	if ((strcmp(fromsec, ".data") != 0) &&
-	    (strcmp(fromsec, ".data.rel") != 0) &&
-	    (strncmp(fromsec, ".data.rel.", strlen(".data.rel.")) != 0))
-		f2 = 0;
-
-	for (s = pat2sym; *s; s++)
-		if (strrcmp(atsym, *s) == 0)
-			f1 = 1;
-	if (f1 && f2)
-		return 1;
+	if ((init_section(tosec) || exit_section(tosec)) && data_section(fromsec))
+		for (s = pat2sym; *s; s++)
+			if (strrcmp(atsym, *s) == 0)
+				return 1;
 
 	/* Check for pattern 3 */
 	if ((strcmp(fromsec, ".text.head") == 0) &&
-- 
1.5.1.rc3.g84b7-dirty


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

* Re: 2.6.23-rc1: i386 section mismatch warnings
  2007-07-25 21:15     ` Sam Ravnborg
@ 2007-07-25 23:49       ` Gabriel C
  0 siblings, 0 replies; 8+ messages in thread
From: Gabriel C @ 2007-07-25 23:49 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Al Viro, Jeff Garzik, Linux Kernel Mailing List

Sam Ravnborg wrote:
> On Tue, Jul 24, 2007 at 09:48:48AM +0200, Gabriel C wrote:
>> Al Viro wrote:
>>> On Mon, Jul 23, 2007 at 09:18:38PM -0400, Jeff Garzik wrote:
>>>> make allmodconfig on i386:
>>>>
>>>> WARNING: vmlinux(.text+0xc0101183): Section mismatch: reference to 
>>> Ignore.  vmlinux.o ones are interesting; so are ones in modules.
>>> vmlinux ones are either duplicates of vmlinux.o or false positives.
>> allyesconfig has a lot Section mismatch warnings , are these false positive too ?
>>
>>
>> http://lkml.org/lkml/2007/7/22/312
> 
> Fixed in latest kbuild.git. See the following two patches.
>

One left on vmlinux.o :) and some on vmlinux.

...

WARNING: vmlinux.o(.text+0x183): Section mismatch: reference to .init.text.1:start_kernel (between 'is386' and 'check_x87')

...

This is on current git head with the 2 patches and allyesconfig. 

 
> 	Sam
> 


Gabriel

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

end of thread, other threads:[~2007-07-25 23:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-24  1:18 2.6.23-rc1: i386 section mismatch warnings Jeff Garzik
2007-07-24  1:45 ` Al Viro
2007-07-24  7:48   ` Gabriel C
2007-07-24  8:08     ` Sam Ravnborg
2007-07-24 12:30       ` Sam Ravnborg
2007-07-25 21:15     ` Sam Ravnborg
2007-07-25 23:49       ` Gabriel C
2007-07-24  6:08 ` Sam Ravnborg

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