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;

Reply via email to