mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] ftrace: Do not reference symbols in sections without size
Date: Mon, 15 Feb 2021 18:05:04 -0600	[thread overview]
Message-ID: <20210216000504.axm3k4xho47c6drz@treble> (raw)
In-Reply-To: <20210215164446.530f6311@gandalf.local.home>

On Mon, Feb 15, 2021 at 04:44:46PM -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> 
> Starting with binutils 2.36, sections were being removed if they had weak
> functions that were optimized out. Unfortunately, these weak functions would
> leave references to mcount/fentry calls, that would make recordmcount fail
> to find the symbol that matched the call to fentry.

Binutils 2.36 isn't removing sections, just section *symbols*.

> Before returning the symbol of the section to create the mcount location,
> check if that section size is greater than zero. If it has no size, skip
> referencing that mcount call location.

How does this even work?  The .text.unlikely section isn't empty:

  # readelf -SW kernel/kexec_file.o
  
  Section Headers:
    [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
    [ 0]                   NULL            0000000000000000 000000 000000 00      0   0  0
    [ 1] .text             PROGBITS        0000000000000000 000040 001acf 00  AX  0   0  1
    [ 2] .rela.text        RELA            0000000000000000 0049e0 001b30 18   I 27   1  8
    [ 3] .data             PROGBITS        0000000000000000 001b20 000e80 00  WA  0   0 32
    [ 4] .rela.data        RELA            0000000000000000 006510 0010e0 18   I 27   3  8
    [ 5] .bss              NOBITS          0000000000000000 0029a0 000060 00  WA  0   0 32
    [ 6] .rodata           PROGBITS        0000000000000000 0029a0 000b80 00   A  0   0 32
    [ 7] .rodata.str1.1    PROGBITS        0000000000000000 003520 0001c6 01 AMS  0   0  1
    [ 8] .text.unlikely    PROGBITS        0000000000000000 0036e6 000038 00  AX  0   0  1

-- 
Josh


  reply	other threads:[~2021-02-16  0:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 21:44 Steven Rostedt
2021-02-16  0:05 ` Josh Poimboeuf [this message]
2021-02-16  1:06   ` Steven Rostedt
2021-02-16  2:00     ` Steven Rostedt
2021-02-16 11:04       ` Greg Kroah-Hartman
2021-02-16 14:51         ` Steven Rostedt
2021-02-16 15:45           ` Josh Poimboeuf
2021-02-16 15:54             ` Greg Kroah-Hartman
2021-02-16 17:53               ` Steven Rostedt

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=20210216000504.axm3k4xho47c6drz@treble \
    --to=jpoimboe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.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

all inboxes | Powered by JetHome®