Thread (5 messages) 5 messages, 2 authors, 2007-03-23

Re: [PATCH] lguest: clean rest of linkage warnings (bar one)

From: Sam Ravnborg <hidden>
Date: 2007-03-23 19:04:27
Also in: lkml
Subsystem: kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Nathan Chancellor, Nicolas Schier, Linus Torvalds

On Fri, Mar 23, 2007 at 06:25:39PM +1100, Rusty Russell wrote:
On Thu, 2007-03-22 at 12:45 +0100, Sam Ravnborg wrote:
quoted
On Thu, Mar 22, 2007 at 09:09:42PM +1100, Rusty Russell wrote:
quoted
It also fixes the remaining warnings, except one.  The code in
modpost.c which needs to be taught that it's legal to link from
.paravirtprobe to .init.text is horrible, and I'm pretty sure I'd just
make it worse.
If you drop me a sample of the exact warning I will add this one too.
Current kbuild.git contains a lot of fixes in this area so I refer to
do so on top of that tree.
WARNING: vmlinux - Section mismatch: reference to .init.text: from .paravirtprobe between '__start_paravirtprobe' (at offset 0xc0464c7c) and '__stop_paravirtprobe'

Sam, you're always so polite and damn helpful: I'm pretty sure that
violates the core tenets of Linux etiquette.
I get this strange feeling that you are planning to ask me to do much more....

Anyway I have added following path to kbuild.git.
Two small unrelated changes sneaked in (deleting a wrong part of a 
comment and adding an empty line)

It should apply on top of latest -mm

	Sam
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 06a16ac..1e578fd 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -626,7 +626,6 @@ static int strrcmp(const char *s, const char *sub)
  *   tosec   = .init.text
  *   fromsec = .text
  *   atsym = kernel_init
- *   Some symbols belong to init section but still it is ok to reference
  *
  * Pattern 7:
  *  Logos used in drivers/video/logo reside in __initdata but the
@@ -643,6 +642,13 @@ static int strrcmp(const char *s, const char *sub)
  *  The pattern is:
  *  tosec    = .init.text
  *  fromsec  = __ksymtab*
+ *
+ * Pattern 9:
+ *  Symbols contained in .paravirtprobe amy safely reference
+ *  .init.text.
+ *  The pattern is:
+ *  tosec   = .init.text
+ *  fromsec  = .paravirtprobe
  **/
 static int secref_whitelist(const char *modname, const char *tosec,
 			    const char *fromsec, const char *atsym,
@@ -720,10 +726,17 @@ static int secref_whitelist(const char *modname, const char *tosec,
 	    (strncmp(fromsec, ".text", strlen(".text")) == 0) &&
 	    (strncmp(refsymname, "logo_", strlen("logo_")) == 0))
 		return 1;
+
 	/* Check for pattern 8 */
 	if ((strcmp(tosec, ".init.text") == 0) &&
 	    (strncmp(fromsec, "__ksymtab", strlen("__ksymtab")) == 0))
 		return 1;
+
+	/* Check for pattern 9 */
+	if ((strcmp(tosec, ".init.text") == 0) &&
+	    (strcmp(fromsec, ".paravirtprobe") == 0))
+		return 1;
+
 	return 0;
 }
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help