linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	<linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
	llvm@lists.linux.dev
Subject: Re: [PATCH 0/2] ftrace/recordmcount: Handle object files without section symbols
Date: Tue, 16 Aug 2022 10:04:23 -0400	[thread overview]
Message-ID: <20220816100423.5ee2e17c@gandalf.local.home> (raw)
In-Reply-To: <cover.1651047542.git.naveen.n.rao@linux.vnet.ibm.com>

On Wed, 27 Apr 2022 15:01:20 +0530
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> wrote:

> This solves a build issue on powerpc with binutils v2.36 and newer [1].
> Since commit d1bcae833b32f1 ("ELF: Don't generate unused section
> symbols") [2], binutils started dropping section symbols that it thought
> were unused. Due to this, in certain scenarios, recordmcount is unable 
> to find a non-weak symbol to generate a relocation record against.
> 
> Clang integrated assembler is also aggressive in dropping section 
> symbols [3].
> 
> In the past, there have been various workarounds to address this. See 
> commits 55d5b7dd6451b5 ("initramfs: fix clang build failure") and 
> 6e7b64b9dd6d96 ("elfcore: fix building with clang") and a recent patch:
> https://lore.kernel.org/linuxppc-dev/20220425174128.11455-1-naveen.n.rao@linux.vnet.ibm.com/T/#u
> 
> Fix this issue by using the weak symbol in the relocation record. This 
> can result in duplicate locations in the mcount table if those weak 
> functions are overridden, so have ftrace skip dupicate entries.
> 
> Objtool already follows this approach, so patch 2 updates recordmcount 
> to do the same. Patch 1 updates ftrace to skip duplicate entries.
> 
> - Naveen
> 
> 
> [1] https://github.com/linuxppc/issues/issues/388
> [2] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d1bcae833b32f1
> [3] https://github.com/ClangBuiltLinux/linux/issues/981
> 
>

There's been work to handle weak functions, but I'm not sure that work
handled the issues here. Are these patches still needed, or was there
another workaround to handle the problems this addressed?

-- Steve

  parent reply	other threads:[~2022-08-16 14:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  9:31 [PATCH 0/2] ftrace/recordmcount: Handle object files without section symbols Naveen N. Rao
2022-04-27  9:31 ` [PATCH 1/2] ftrace: Drop duplicate mcount locations Naveen N. Rao
2022-04-27 13:46   ` Steven Rostedt
2022-04-27  9:31 ` [PATCH 2/2] recordmcount: Handle sections with no non-weak symbols Naveen N. Rao
2022-04-27 13:54   ` Steven Rostedt
2022-04-28  7:45     ` Naveen N. Rao
2022-04-28 14:06       ` Steven Rostedt
2022-04-28 17:24         ` Naveen N. Rao
2022-04-28 17:31         ` Naveen N. Rao
2022-05-02 14:44         ` Christophe Leroy
2022-05-02 23:52           ` Steven Rostedt
2022-05-03 11:20             ` Christophe Leroy
2022-05-03 16:25               ` Steven Rostedt
2022-05-04 16:50                 ` Christophe Leroy
2022-05-04 17:06                   ` Steven Rostedt
2022-05-04 17:10                     ` Christophe Leroy
2022-08-16 14:04 ` Steven Rostedt [this message]
2022-08-16 17:05   ` [PATCH 0/2] ftrace/recordmcount: Handle object files without section symbols Naveen N. Rao

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=20220816100423.5ee2e17c@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=llvm@lists.linux.dev \
    --cc=mpe@ellerman.id.au \
    --cc=nathan@kernel.org \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ndesaulniers@google.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;
as well as URLs for NNTP newsgroup(s).