linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Stefan Agner <stefan@agner.ch>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Russell King - ARM Linux <linux@armlinux.org.uk>
Subject: Re: Linker error `.exit.text' referenced in section `.alt.smp.init'
Date: Tue, 28 May 2019 09:32:35 +0200	[thread overview]
Message-ID: <CAK8P3a1rBt8JLjaDqL-0FnFhUR=f5nsqF8tJhYzOjHyTf18+dg@mail.gmail.com> (raw)
In-Reply-To: <2072571511d5c77bb9ac53168e44e90b@agner.ch>

On Tue, May 28, 2019 at 9:12 AM Stefan Agner <stefan@agner.ch> wrote:
>
> Hi,
>
> Cross compiling Linux v5.2-rc2 with CONFIG_DNS_RESOLVER=y using gcc 8.2
> I noticed the following build error:
>
> ...
>   GEN     .version
>   CHK     include/generated/compile.h
>   UPD     include/generated/compile.h
>   CC      init/version.o
>   AR      init/built-in.a
>   LD      vmlinux.o
>   MODPOST vmlinux.o
>   MODINFO modules.builtin.modinfo
> `.exit.text' referenced in section `.alt.smp.init' of
> net/dns_resolver/dns_key.o: defined in discarded section `.exit.text' of
> net/dns_resolver/dns_key.o
>
> make: *** [Makefile:1052: vmlinux] Error 1
>
> It seems that Masami noticed this a while back:
> https://lore.kernel.org/lkml/20180911231012.fdc45840f3d91860daa2e180@kernel.org/T/#u
>
> Anybody else seen this?
>
> When I remove put_cred in exit_dns_resolver the kernel links fine...

I've seen two or thre of these in total. This only happens on 32-bit ARM
when a function that needs SMP patching gets inlined into an __exit
function. In this case, it's the atomic_dec_and_test().

The last one I fixed was https://lkml.org/lkml/2019/4/15/625
I think I've seen the one in the dns_resolver before but couldn't
reproduce it recently.

I used to have a patch that completely avoided dropping .exit when
SMP patching was active, but I think we can fix them up as they happen,
as I have built thousands of randconfig kernels without hitting this.

The easiestwork around here  would be to drop the __exit annotation
and add a comment. We could also move put_cred out-of-line and
make it non-__exit, or add an extern wrapper for it.

      Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-05-28  7:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-28  7:12 Linker error `.exit.text' referenced in section `.alt.smp.init' Stefan Agner
2019-05-28  7:32 ` Arnd Bergmann [this message]
2019-05-28 11:41   ` Stefan Agner
2019-05-28 11:53     ` Russell King - ARM Linux admin

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='CAK8P3a1rBt8JLjaDqL-0FnFhUR=f5nsqF8tJhYzOjHyTf18+dg@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=mhiramat@kernel.org \
    --cc=stefan@agner.ch \
    /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;
as well as URLs for NNTP newsgroup(s).