kbuild: disable modpost warnings for linkonce sections
authorAndi Kleen <andi@firstfloor.org>
Thu, 8 May 2008 11:41:11 +0000 (13:41 +0200)
committerSam Ravnborg <sam@ravnborg.org>
Sun, 11 May 2008 08:10:51 +0000 (10:10 +0200)
Disable modpost warnings for linkonce sections

My build gives lots of warnings like

WARNING: sound/core/snd.o (.gnu.linkonce.wi.mpspec_def.h.30779716): unexpected section name.
The (.[number]+) following section name are ld generated and not expected.
Did you forget to use "ax"/"aw" in a .S file?
Note that for example <linux/init.h> contains
section definitions for use in .S files.

But for .linkonce. duplicated sections are actually ok and expected.
So just disable the warning for this case.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
scripts/mod/modpost.c

index 757294b..508c589 100644 (file)
@@ -721,7 +721,7 @@ static int check_section(const char *modname, const char *sec)
                /* consume all digits */
                while (*e && e != sec && isdigit(*e))
                        e--;
-               if (*e == '.') {
+               if (*e == '.' && !strstr(sec, ".linkonce")) {
                        warn("%s (%s): unexpected section name.\n"
                             "The (.[number]+) following section name are "
                             "ld generated and not expected.\n"