[PATCH] kbuild: fix false section mismatch warning referring to .init.text.2

From: Sam Ravnborg
Date: Fri Jan 18 2008 - 13:54:51 EST


The following section mismatch warning are false:
WARNING: vmlinux.o(.text.head+0x247): Section mismatch: reference to .init.text.1:start_kernel (between 'is386' and 'check_x87')

The problem was that modpost did not see a section named
".init.text.1" as an init section and thus it warned.

This patch fixes this so we no loneg see this warning.
Thanks to report from: Toralf Förster

Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
Cc: Toralf Förster <toralf.foerster@xxxxxx>
Cc: WANG Cong <xiyou.wangcong@xxxxxxxxx>
---
scripts/mod/modpost.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 93ac52a..b5f1cff 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -736,8 +736,8 @@ static int secref_whitelist(const char *modname, const char *tosec,

/* Check for pattern 3 */
if ((strcmp(fromsec, ".text.head") == 0) &&
- ((strcmp(tosec, ".init.data") == 0) ||
- (strcmp(tosec, ".init.text") == 0)))
+ ((strncmp(tosec, ".init.data", strlen(".init.data")) == 0) ||
+ (strncmp(tosec, ".init.text", strlen(".init.text")) == 0)))
return 1;

/* Check for pattern 4 */
--
1.5.4.rc3.14.g44397

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/