From: Andi Kleen <ak@linux.intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jessica Yu <jeyu@kernel.org>, Kees Cook <keescook@chromium.org>,
Nicolas Pitre <nico@linaro.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Wanlong Gao <wanlong.gao@gmail.com>,
Luis de Bethencourt <luisbg@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: Re: [PATCH 1/2] modpost: don't add warnings for LTO-generated symbols
Date: Mon, 5 Feb 2018 08:22:11 -0800 [thread overview]
Message-ID: <20180205162211.GM30338@tassilo.jf.intel.com> (raw)
In-Reply-To: <CAK8P3a3gNstYGm5KqAZ5T7kQL0raUC0OOrcLwYD3wc+thwmEkw@mail.gmail.com>
On Mon, Feb 05, 2018 at 04:59:32PM +0100, Arnd Bergmann wrote:
> On Mon, Feb 5, 2018 at 4:50 PM, Andi Kleen <ak@linux.intel.com> wrote:
> > On Mon, Feb 05, 2018 at 04:12:52PM +0100, Arnd Bergmann wrote:
> >> WARNING: vmlinux.o(.data+0x12e0): Section mismatch in reference from the variable pfkey_net_ops.lto_priv.2992 to the function .init.text:pfkey_net_init.lto_priv.2977()
> >> The variable pfkey_net_ops.lto_priv.2992 references
> >> the function __init pfkey_net_init.lto_priv.2977()
> >> If the reference is valid then annotate the
> >> variable with __init* or __refdata (see linux/init.h) or name the variable:
> >> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
> >
> > A better fix would be to ensure modpost always runs on already LD_FINALed
> > objects, so it never sees LTO.
> >
> > Otherwise you would need to teach modpost about the LTO symbol table
> > and some other magic. I did that once, but it turned out to be very
> > ugly.
>
> I'm not sure I understand what that means. Do you mean that with LD_FINAL,
> those symbol references are completely eliminated so we don't need to worry
> about them any more?
Yes there should not be any .lto_priv references after LDFINAL, it will
be just like any other ELF object. We also need to do the same
thing before objtool.
>
> I got about a dozen section mismatch errors with LTO in cases where the
> calling function gets a specialized version of a structure, and my oneline
> patch above addresses them all.
Not sure I follow here. .lto_priv should be anything LTO, not just
some specific optimizations.
-Andi
next prev parent reply other threads:[~2018-02-05 16:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-05 15:12 [PATCH 0/2] LTO: two more fixes Arnd Bergmann
2018-02-05 15:12 ` [PATCH 1/2] modpost: don't add warnings for LTO-generated symbols Arnd Bergmann
2018-02-05 15:50 ` Andi Kleen
2018-02-05 15:59 ` Arnd Bergmann
2018-02-05 16:22 ` Andi Kleen [this message]
2018-02-05 20:30 ` Arnd Bergmann
2018-02-05 15:12 ` [PATCH 2/2] x86: make __ibp_barrier visible Arnd Bergmann
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=20180205162211.GM30338@tassilo.jf.intel.com \
--to=ak@linux.intel.com \
--cc=arnd@arndb.de \
--cc=jeyu@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luisbg@kernel.org \
--cc=nico@linaro.org \
--cc=rdunlap@infradead.org \
--cc=wanlong.gao@gmail.com \
--cc=yamada.masahiro@socionext.com \
/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