linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
	bpf <bpf@vger.kernel.org>,
	linux-kbuild@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nicolas@fjasle.eu>,
	Zheng Yejian <zhengyejian1@huawei.com>,
	Martin Kelly <martin.kelly@crowdstrike.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>
Subject: Re: [POC][RFC][PATCH] build: Make weak functions visible in kallsyms
Date: Fri, 3 Jan 2025 12:00:45 +0100	[thread overview]
Message-ID: <20250103110045.GA22934@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <CAHk-=wiL8B2=fPaRwDPGgQhVs=3G=8Gy=QyR59L85L0GF67Gbg@mail.gmail.com>

On Thu, Dec 26, 2024 at 07:35:18PM -0800, Linus Torvalds wrote:

> Btw, does this actually happen when the compiler does the mcount thing for us?

Yeah, so the linker literally just drops the symbol name on the floor,
nothing else. So all the section information -- either compiler
generated like mcount locations, or manually inserted like alternatives
-- stick around for the 'dead' code.

The only time the toolchain has enough visibility to do the right thing
is when doing a full LTO build, at that point can the compiler see the
weak function is actually unused and do 'normal' DCE, including all the
resulting extra section stuff.

      parent reply	other threads:[~2025-01-03 11:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-26 21:49 [POC][RFC][PATCH] build: Make weak functions visible in kallsyms Steven Rostedt
2024-12-26 23:01 ` Linus Torvalds
2024-12-27  2:19   ` Steven Rostedt
2024-12-27  2:52     ` Masahiro Yamada
2024-12-27  3:03       ` Linus Torvalds
2024-12-27  2:58     ` Linus Torvalds
2024-12-27  3:35 ` Linus Torvalds
2024-12-27  3:45   ` Steven Rostedt
2024-12-27 18:09     ` Linus Torvalds
2024-12-27 19:19       ` Steven Rostedt
2025-01-03 11:00   ` Peter Zijlstra [this message]

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=20250103110045.GA22934@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bpf@vger.kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=martin.kelly@crowdstrike.com \
    --cc=masahiroy@kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.org \
    --cc=zhengyejian1@huawei.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).