[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dqetdbtdhkipt5ighko7omvupe34zo76jky6digezrlra2madv@5hrau7wxbcvm>
Date: Wed, 4 Jun 2025 16:56:54 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Petr Mladek <pmladek@...e.com>, Miroslav Benes <mbenes@...e.cz>,
Joe Lawrence <joe.lawrence@...hat.com>, live-patching@...r.kernel.org, Song Liu <song@...nel.org>,
laokz <laokz@...mail.com>, Jiri Kosina <jikos@...nel.org>,
Marcos Paulo de Souza <mpdesouza@...e.com>, Weinan Liu <wnliu@...gle.com>,
Fazla Mehrab <a.mehrab@...edance.com>, Chen Zhongjin <chenzhongjin@...wei.com>,
Puranjay Mohan <puranjay@...nel.org>
Subject: Re: [PATCH v2 28/62] objtool: Fix weak symbol hole detection for
.cold functions
On Mon, May 26, 2025 at 12:38:22PM +0200, Peter Zijlstra wrote:
> On Fri, May 09, 2025 at 01:16:52PM -0700, Josh Poimboeuf wrote:
> > When ignore_unreachable_insn() looks for weak function holes which jump
> > to their .cold functions, it assumes the parent function comes before
> > the corresponding .cold function in the symbol table. That's not
> > necessarily the case with -ffunction-sections.
> >
> > Mark all the holes beforehand (including .cold functions) so the
> > ordering of the discovery doesn't matter.
>
> One of the things I have a 'todo' entry on, is rewriting all sections
> that reference any one of these instructions.
>
> That is, things like fentry, alternatives, retpoline, static_call,
> jump_label. Everything that can cause runtime code patching.
>
> Once we are sure none of those sections will contain references to this
> dead code, we can go and wipe the actual code. Perhaps fill it with a
> UD1 instruction with some identifying immediate.
Yeah, that would be nice.
--
Josh
Powered by blists - more mailing lists