mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Magnus Damm <magnus@valinux.co.jp>
Cc: linux-kernel@vger.kernel.org, fastboot@lists.osdl.org,
	ebiederm@xmission.com
Subject: Re: [PATCH] CONFIG_RELOCATABLE modpost fix
Date: Tue, 8 Aug 2006 17:16:57 +0200	[thread overview]
Message-ID: <20060808151657.GA18059@mars.ravnborg.org> (raw)
In-Reply-To: <20060808083307.391.45887.sendpatchset@cherry.local>

On Tue, Aug 08, 2006 at 05:32:11PM +0900, Magnus Damm wrote:
> CONFIG_RELOCATABLE modpost fix
> 
> Run modpost on vmlinux regardless of CONFIG_MODULES. The modpost code is also
> extended to ignore references from ".pci_fixup" to ".init.text".
I've splitted the patch in two parts.
First is this one (I slightly modified your version and removed trailing
whitespaces).

	Sam

commit 1f43a633dc485f90fddf667270179058a07b9d77
Author: Magnus Damm <magnus@valinux.co.jp>
Date:   Tue Aug 8 17:32:11 2006 +0900

    kbuild: ignore references from ".pci_fixup" to ".init.text"
    
    The modpost code is extended to ignore references
    from ".pci_fixup" to ".init.text".
    
    Signed-off-by: Magnus Damm <magnus@valinux.co.jp>

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index dfde0e8..5028d46 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -581,8 +581,8 @@ static int strrcmp(const char *s, const 
  *   fromsec = .data
  *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one
  **/
-static int secref_whitelist(const char *tosec, const char *fromsec,
-			    const char *atsym)
+static int secref_whitelist(const char *modname, const char *tosec,
+			    const char *fromsec, const char *atsym)
 {
 	int f1 = 1, f2 = 1;
 	const char **s;
@@ -618,8 +618,15 @@ static int secref_whitelist(const char *
 	for (s = pat2sym; *s; s++)
 		if (strrcmp(atsym, *s) == 0)
 			f1 = 1;
+	if (f1 && f2)
+		return 1;
 
-	return f1 && f2;
+	/* Whitelist all references from .pci_fixup section if vmlinux */
+	if (is_vmlinux(modname)) {
+		if ((strcmp(fromsec, ".pci_fixup") == 0) &&
+		    (strcmp(tosec, ".init.text") == 0))
+		return 1;
+	}
 }
 
 /**
@@ -726,7 +733,8 @@ static void warn_sec_mismatch(const char
 
 	/* check whitelist - we may ignore it */
 	if (before &&
-	    secref_whitelist(secname, fromsec, elf->strtab + before->st_name))
+	    secref_whitelist(modname, secname, fromsec,
+			     elf->strtab + before->st_name))
 		return;
 
 	if (before && after) {


  reply	other threads:[~2006-08-08 15:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-08  8:32 Magnus Damm
2006-08-08 15:16 ` Sam Ravnborg [this message]
2006-08-09  1:12   ` Magnus Damm
2006-08-08 18:39 ` Sam Ravnborg
2006-08-08 19:59   ` Eric W. Biederman
2006-08-08 22:05     ` Sam Ravnborg
2006-08-09  1:32   ` Magnus Damm
2006-08-09  6:29     ` Sam Ravnborg
2006-08-09  7:06       ` Magnus Damm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060808151657.GA18059@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=ebiederm@xmission.com \
    --cc=fastboot@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus@valinux.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome