All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Subject: Re: Help needed to fix section mismatch warnings
Date: Thu, 10 Jan 2008 11:19:18 -0800	[thread overview]
Message-ID: <20080110111918.42e4fa0b.randy.dunlap@oracle.com> (raw)
In-Reply-To: <20080109222542.422c90e0.randy.dunlap@oracle.com>

On Wed, 9 Jan 2008 22:25:42 -0800 Randy Dunlap wrote:

> On Sun, 6 Jan 2008 15:07:28 +0100 Sam Ravnborg wrote:
> 
> 
> > This is the current list of warnings
> 
> Sam,
> 
> Several of these are due to driver variable names not matching
> the whitelisted names in modpost.  I have patches for the ones
> that I have identified so far.  And I have patches for a few of
> the others that are true section mismatch problems (total of 8
> patches ready for now).
> 
> The whitelisted names will always be a (small) problem.
> Can __init_refok be used in these cases.. or some other new
> attribute, instead of forever adding to the whitelist or
> modifying variable names?

Sam (or anyone :),

I guess that I'm a little confused.  Instead of changing
variable names to match the modpost whitelist, I tested adding
__init_refok or __initdata_refok to these (driver) structs that
generated the modpost warnings.

Example:  drivers/char/tpm/tpm_infineon.c

--- linux-2.6.24-rc7-git1.orig/drivers/char/tpm/tpm_infineon.c
+++ linux-2.6.24-rc7-git1/drivers/char/tpm/tpm_infineon.c
@@ -611,7 +611,7 @@ static __devexit void tpm_inf_pnp_remove
 	}
 }
 
-static struct pnp_driver tpm_inf_pnp = {
+static struct pnp_driver __init_refok tpm_inf_pnp = {
 	.name = "tpm_inf_pnp",
 	.driver = {
 		.owner = THIS_MODULE,

This has a build warning with my toolchain:

  CC      drivers/char/tpm/tpm_infineon.o
linux-2.6.24-rc7-git1/drivers/char/tpm/tpm_infineon.c:614: warning: 'noinline' attribute ignored
{standard input}: Assembler messages:
{standard input}:2315: Warning: setting incorrect section attributes for .text.init.refok

but otherwise no section mismatch warning.

OTOH, using __initdata_refok has no build warning and no section
mismatch warning... but it (__initdata_refok) doesn't make sense
to me.  Should it (make sense/be used)?
Is there a __refok that should be used here, instead of having
to modify variable names?


> > WARNING: vmlinux.o(.data+0x7e9b8): Section mismatch: reference to .init.text:tpm_inf_pnp_probe (between 'tpm_inf_pnp' and 'cn_idx')

Thanks,
---
~Randy

  reply	other threads:[~2008-01-10 19:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-06 14:07 Help needed to fix section mismatch warnings Sam Ravnborg
2008-01-10  6:25 ` Randy Dunlap
2008-01-10 19:19   ` Randy Dunlap [this message]
2008-01-11 18:59     ` Sam Ravnborg
2008-01-10 19:38   ` Sam Ravnborg
2008-01-19 19:52 ` Randy Dunlap
2008-01-19 21:22   ` Sam Ravnborg
2008-01-19 21:45     ` Sam Ravnborg

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=20080110111918.42e4fa0b.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.