Re: [PATCH] ignore smp_locks section warnings from init/exit code

Sam Ravnborg
2006-06-08T18:36:00Z

On Wed, Jun 07, 2006 at 10:11:49PM -0400, Jeff Dike wrote:
> On Wed, Jun 07, 2006 at 04:23:26PM -0700, Randy.Dunlap wrote:
> > I currently only see this in an __exit section.
> > Here is a patch that fixes it for me.
>
> Cool, something equivalent makes the UML link a lot quieter. I had to
> add ".plt" and ".bss". I'm guessing mine are false positives as well,
> but have no idea how to check that.

The check is there to catch situations where a function is marked
__init but referenced after a potential discard of the it sections.
So if there is no-one discarding the .plt section then we should be all
safe.

Browsing the um code I could not see how .plt was thought used so I
added it to the ignorelist in modpost.

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 94047bc..a70f5dd 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -822,6 +822,7 @@ static int init_section_ref_ok(const cha
".pdr",
"__param",
".smp_locks",
+ ".plt", /* seen on ARCH=um build on x86_64. Harmless */
NULL
};
/* Start of section names */
@@ -894,6 +895,7 @@ static int exit_section_ref_ok(const cha
".eh_frame",
".stab",
".smp_locks",
+ ".plt", /* seen on ARCH=um build on x86_64. Harmless */
NULL
};
/* Start of section names */

As for .bss this is a much more generic section - so for now this is not
added. Can you explain why there is a reference to do_mount_root from
.bss or is this a bug in modpost pointing out something wrong?

With the above patch we are down to two section mismatch warnings for
a defconfig build on x86_64.

Sam