[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e2hv6jkitxvbtaqj377dvpwtn5tyaoux53ofkkegxcn3fapbcx@kfqxactn4ogj>
Date: Wed, 4 Jun 2025 17:04:33 -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 29/62] objtool: Mark prefix functions
On Mon, May 26, 2025 at 12:43:55PM +0200, Peter Zijlstra wrote:
> > +++ b/tools/objtool/elf.c
> > @@ -442,6 +442,11 @@ static void elf_add_symbol(struct elf *elf, struct symbol *sym)
> > elf_hash_add(symbol, &sym->hash, sym->idx);
> > elf_hash_add(symbol_name, &sym->name_hash, str_hash(sym->name));
> >
> > + if (is_func_sym(sym) && sym->len == 16 &&
>
> Where did that 'sym->len == 16' thing come from? I mean, they are, but
> the old code didn't assert that.
>
> I would rather objtool issue a warn if not 16, but still consider these
> as prefix.
Ok:
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 9a1fc0392b7f..2953aa8d2b81 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -442,10 +442,12 @@ static void elf_add_symbol(struct elf *elf, struct symbol *sym)
elf_hash_add(symbol, &sym->hash, sym->idx);
elf_hash_add(symbol_name, &sym->name_hash, str_hash(sym->name));
- if (is_func_sym(sym) && sym->len == 16 &&
- (strstarts(sym->name, "__pfx") || strstarts(sym->name, "__cfi_")))
+ if (is_func_sym(sym) &&
+ (strstarts(sym->name, "__pfx_") || strstarts(sym->name, "__cfi_"))) {
+ if (sym->len != 16)
+ WARN("%s size %d != 16", sym->name, sym->len);
sym->prefix = 1;
-
+ }
if (is_func_sym(sym) && strstr(sym->name, ".cold"))
sym->cold = 1;
Powered by blists - more mailing lists