From nobody Sat Jun 13 22:18:11 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89A9F421880; Tue, 5 May 2026 10:56:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777978607; cv=none; b=L0RKHt5u6BSkR0Up475lasrWp+FbTGLQ5riZDsPaWhtNFwXFC6xKoCQDvLwD0idR2CSPKjaKFLlmbCpZKlMxI/UsUVvgApXHhRlcziiGV9LM+WhvR1+QNVqzH/VhocD0ryyrW9kerVMxSM4gUL12dqRJgbPbNB5tXWXF9X9Ys8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777978607; c=relaxed/simple; bh=idJ7ufSYhDNgMpddbtqFBBqtx1w8ckT8c5SplEvcfbU=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=jzuujL9+aavtUQto6eWR9j1TNoyYZD2JYwBtE9tkfBZxIJEtjhDqPvdgN86CUWKv4s7wMEogsVWTLi5tx+bgsiW+r0YboF2vw7tx9PgQ3tdM693nUjLlsT+1JbP7E4KG2mtj8pz0A8irncd7B5wuXkcFlzRKTc4NJexHysnsqnA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LrjcUSyf; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2zhWm+9w; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LrjcUSyf"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2zhWm+9w" Date: Tue, 05 May 2026 10:56:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777978604; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6rj/OZ1sCd64HyHWNweTipM822y565RwM90PDKfAu94=; b=LrjcUSyfjQtHOa7u/bteE+11Ydmyv6qSL4sanOZ8OqV56cIPowaBrHsy4Yhc1/uL7D8vS6 4JGgeOGc77SEwXUrn/6Jf658NsFDGAeQM6LXOuENOh77A6w+gFLMlOxVI+dAP7zPo02VX6 L5DqpM+H/LtVhOKFfmfgkbhuKX6SB4wTYCsN6ytByqvugb3zzzOo/cTdLQ7Tm0bvKlKhco jMfW1h1C58k5+6cFZi8JaC+VynjwKamIciVb5RGsDSOGk8Pf1cAxCjpQZ47CwsDgui4Cp7 08fI0LeS1OCekYdEdLbVn7Gtn4704CDILmqdtLDGJkUYadAXpsMkwTRiR2/4hg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777978604; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6rj/OZ1sCd64HyHWNweTipM822y565RwM90PDKfAu94=; b=2zhWm+9wW1QJjtGFuZhQOp8r8ddJM+HwfoRkzB40H0YJ8ERtRIon2nM4ifO3uBiky8ekM4 bpOqApSQPEDCorCQ== From: "tip-bot2 for Josh Poimboeuf" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] objtool/klp: Fix --debug-checksum for duplicate symbol names Cc: Song Liu , Miroslav Benes , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177797860298.424702.3176296657304193219.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the objtool/core branch of tip: Commit-ID: def5b60dcd2256efab0e66f598419b17c425b8f5 Gitweb: https://git.kernel.org/tip/def5b60dcd2256efab0e66f598419b17c= 425b8f5 Author: Josh Poimboeuf AuthorDate: Mon, 30 Mar 2026 21:31:47 -07:00 Committer: Josh Poimboeuf CommitterDate: Mon, 04 May 2026 21:16:00 -07:00 objtool/klp: Fix --debug-checksum for duplicate symbol names find_symbol_by_name() only returns the first match, so --debug-checksum=3D silently ignores any subsequent duplicately named functions after the first. Fix that, along with a new for_each_sym_by_name() helper. Acked-by: Song Liu Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 15 ++++++++++----- tools/objtool/include/objtool/elf.h | 5 +++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 9b11cf3..e3604b1 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3677,18 +3677,23 @@ static int checksum_debug_init(struct objtool_file = *file) =20 s =3D dup; while (*s) { - struct symbol *func; + bool found =3D false; + struct symbol *sym; char *comma; =20 comma =3D strchr(s, ','); if (comma) *comma =3D '\0'; =20 - func =3D find_symbol_by_name(file->elf, s); - if (!func || !is_func_sym(func)) + for_each_sym_by_name(file->elf, s, sym) { + if (!is_func_sym(sym)) + continue; + sym->debug_checksum =3D 1; + found =3D true; + } + + if (!found) WARN("--debug-checksum: can't find '%s'", s); - else - func->debug_checksum =3D 1; =20 if (!comma) break; diff --git a/tools/objtool/include/objtool/elf.h b/tools/objtool/include/ob= jtool/elf.h index b142984..00b0402 100644 --- a/tools/objtool/include/objtool/elf.h +++ b/tools/objtool/include/objtool/elf.h @@ -489,6 +489,11 @@ static inline void set_sym_next_reloc(struct reloc *re= loc, struct reloc *next) #define for_each_sym_continue(elf, sym) \ list_for_each_entry_continue(sym, &elf->symbols, global_list) =20 +#define for_each_sym_by_name(elf, _name, sym) \ + elf_hash_for_each_possible(elf, symbol_name, sym, name_hash, \ + str_hash_demangled(_name)) \ + if (strcmp(sym->name, _name)) {} else + #define for_each_sym_by_demangled_name(elf, name, sym) \ elf_hash_for_each_possible(elf, symbol_name, sym, name_hash, \ str_hash(name)) \