linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Steven Rostedt <rostedt@goodmis.org>,
	Segher Boessenkool <segher@kernel.crashing.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] recordmcount: Support empty section from recent binutils
Date: Mon, 29 Nov 2021 18:56:43 +0100	[thread overview]
Message-ID: <0b901c6f-9d42-11f6-4e44-df3bb1587456@csgroup.eu> (raw)
In-Reply-To: <20211129124355.52474d90@gandalf.local.home>



Le 29/11/2021 à 18:43, Steven Rostedt a écrit :
> On Fri, 26 Nov 2021 08:43:23 +0000
> LEROY Christophe <christophe.leroy@csgroup.eu> wrote:
> 
>> Le 24/11/2021 à 15:43, Christophe Leroy a écrit :
>>> Looks like recent binutils (2.36 and over ?) may empty some section,
>>> leading to failure like:
>>>
>>> 	Cannot find symbol for section 11: .text.unlikely.
>>> 	kernel/kexec_file.o: failed
>>> 	make[1]: *** [scripts/Makefile.build:287: kernel/kexec_file.o] Error 1
>>>
>>> In order to avoid that, ensure that the section has a content before
>>> returning it's name in has_rel_mcount().
>>
>> This patch doesn't work, on PPC32 I get the following message with this
>> patch applied:
>>
>> [    0.000000] ftrace: No functions to be traced?
>>
>> Without the patch I get:
>>
>> [    0.000000] ftrace: allocating 22381 entries in 66 pages
>> [    0.000000] ftrace: allocated 66 pages with 2 groups
> 
> Because of this report, I have not applied this patch (even though I was
> about to push it to Linus).
> 
> I'm pulling it from my queue until this gets resolved.
> 

I have no idea on how to fix that for the moment.

With GCC 10 (binutils 2.36) an objdump -x on kernel/kexec_file.o gives:

0000000000000000 l    d  .text.unlikely	0000000000000000 .text.unlikely
0000000000000000  w    F .text.unlikely	0000000000000038 
.arch_kexec_apply_relocations_add
0000000000000038  w    F .text.unlikely	0000000000000038 
.arch_kexec_apply_relocations


With GCC 11 (binutils 2.37) the same gives:

0000000000000000  w    F .text.unlikely	0000000000000038 
.arch_kexec_apply_relocations_add
0000000000000038  w    F .text.unlikely	0000000000000038 
.arch_kexec_apply_relocations


The problem is that recordmcount drops weak symbols, and it doesn't find 
any non-weak symbol in .text.unlikely

Explication given at 
https://elixir.bootlin.com/linux/v5.16-rc2/source/scripts/recordmcount.h#L506

I have no idea on what to do.

Thanks
Christophe

  reply	other threads:[~2021-11-29 17:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 14:43 [PATCH] recordmcount: Support empty section from recent binutils Christophe Leroy
2021-11-26  8:43 ` LEROY Christophe
2021-11-29 17:43   ` Steven Rostedt
2021-11-29 17:56     ` Christophe Leroy [this message]
2022-03-28 22:31       ` Joel Stanley
2022-03-30  9:51         ` Christophe Leroy

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=0b901c6f-9d42-11f6-4e44-df3bb1587456@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=segher@kernel.crashing.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;
as well as URLs for NNTP newsgroup(s).