From: Al Viro <viro@ftp.linux.org.uk>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>, Keith Ownes <kaos@ocs.com.au>
Subject: Re: kbuild - status on section mismatch warnings
Date: Sun, 5 Mar 2006 20:06:59 +0000 [thread overview]
Message-ID: <20060305200659.GD27946@ftp.linux.org.uk> (raw)
In-Reply-To: <20060305193012.GA14838@mars.ravnborg.org>
On Sun, Mar 05, 2006 at 08:30:12PM +0100, Sam Ravnborg wrote:
> During the last weeks I have worked on improved support for section
> mismatch checks.
>
> When a function is marked __init then the implementation will be placed
> in a section named .init.text - that section will be discarded by
> vmlinux when the module is initialised.
> So therefore any references to function marked __init are subject to
> references to functions that may suddenly disappear.
Now try x86 with sd.o non-modular. And see
__init foo()
{
....
switch(n) {
....
....
}
}
compiling essentially into
if (n < lower || n > upper)
goto Ldefault;
addr = const_array_of_labels[n - lower];
goto addr;
with const_array_of_labels sitting in .rodata and its contents pointing
inside foo(), i.e. into .init.text. And yes, .init.text is discarded,
while .rodata is left intact. Since the only reference to that array
disappears along with .init.text *and* section where array goes into is
hardwired into gcc, we
a) are actually OK and
b) can't do anything about that false positive, AFAICS.
next prev parent reply other threads:[~2006-03-05 20:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-05 19:30 kbuild - status on section mismatch warnings Sam Ravnborg
2006-03-05 20:06 ` Al Viro [this message]
2006-03-05 21:58 ` Sam Ravnborg
2006-03-05 22:04 ` Ben Dooks
2006-03-05 22:39 ` Sam Ravnborg
2006-03-05 23:52 ` Al Viro
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=20060305200659.GD27946@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=akpm@osdl.org \
--cc=kaos@ocs.com.au \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox