Re: [PATCH v2 48/53] objtool: Add insn_sym() helper
From: Song Liu
Date: Fri May 01 2026 - 08:12:03 EST
On Fri, May 1, 2026 at 5:09 AM Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> Alternative replacement instructions awkwardly have insn->sym set to the
> function they get patched to rather than the symbol (or rather lack
> thereof) they belong to in the file.
>
> This makes it difficult to know where a given instruction actually
> lives.
>
> Add a new insn_sym() helper which preserves the existing semantic of
> insn->sym. Rename insn->sym to insn->_sym, which contains the actual
> ELF binary symbol (or NULL, for alternative replacements) an instruction
> lives in.
>
> The private insn->_sym value will be needed for a subsequent patch.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
Acked-by: Song Liu <song@xxxxxxxxxx>