objtool: Don't alias undefined symbols

Objtool is mistakenly aliasing all undefined symbols.  That's obviously
wrong, though it has no consequence since objtool happens to only use
sym->alias for defined symbols.  Fix it regardless.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/bc401173a7717757eee672fc1ca5a20451d77b86.1763671318.git.jpoimboe@kernel.org
This commit is contained in:
Josh Poimboeuf 2025-11-20 12:52:17 -08:00 committed by Peter Zijlstra
parent 2c2acca2ea
commit 16f366c5a6
1 changed files with 2 additions and 2 deletions

View File

@ -492,8 +492,8 @@ static int elf_add_symbol(struct elf *elf, struct symbol *sym)
sym->len = sym->sym.st_size;
__sym_for_each(iter, &sym->sec->symbol_tree, sym->offset, sym->offset) {
if (iter->offset == sym->offset && iter->type == sym->type &&
iter->len == sym->len)
if (!is_undef_sym(iter) && iter->offset == sym->offset &&
iter->type == sym->type && iter->len == sym->len)
iter->alias = sym;
}