[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <udmorf6ait6y2xeplz2wfid3xnyga3ahwv7gd7dl46c456auq3@54ym6kszzudy>
Date: Wed, 4 Jun 2025 17:36:15 -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 52/62] objtool/klp: Introduce klp diff subcommand for
diffing object files
On Mon, May 26, 2025 at 08:22:59PM +0200, Peter Zijlstra wrote:
> On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
>
> > Without '-ffunction-sections -fdata-sections', reliable object diffing
> > would be infeasible due to toolchain limitations:
> >
> > - For intra-file+intra-section references, the compiler might
> > occasionally generated hard-coded instruction offsets instead of
> > relocations.
> >
> > - Section-symbol-based references can be ambiguous:
> >
> > - Overlapping or zero-length symbols create ambiguity as to which
> > symbol is being referenced.
> >
> > - A reference to the end of a symbol (e.g., checking array bounds)
> > can be misinterpreted as a reference to the next symbol, or vice
> > versa.
> >
> > A potential future alternative to '-ffunction-sections -fdata-sections'
> > would be to introduce a toolchain option that forces symbol-based
> > (non-section) relocations.
>
> Urgh.. So the first issue we can fix with objtool, but the ambiguous
> cases are indeed very hard to fix up in post.
>
> Did you already talk to toolchain people about this?
For now, I want to stick with -ffunction-sections -fdata-sections, as
that's what kpatch has done for 10+ years and it works well. That's the
only option we have for current compilers anyway.
The above mentioned possibility of diffing without -ffunction-sections
-fdata-sections is theoretical, and needs more exploration. If it
indeed works then we can try to get toolchain support for that.
--
Josh
Powered by blists - more mailing lists