From nobody Sat Feb 7 04:47:01 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 D092742DFF9; Thu, 5 Feb 2026 16:14:01 +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=1770308042; cv=none; b=mycsR5eb/jojgdOj5w5VRmCed5WTnE4fn2/8LgVifIK1xejg3A0b3y+7Nb4TxILyCIUI3b3HFtwfvga2hNMssJY/XDPztJ7bhBLOrMCxmK1FOWTOQwMCEnp9Glg8CW/WVRyjRhBN6P2KwSxpLHGfAG0UFH5T7uf/Tx/OybExqy4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770308042; c=relaxed/simple; bh=7mLyDq9yFUWa08JtKtWnS+m5qmYIB+5L33nq3/rKvvY=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=lOqc5htmVH15gaFk0kk18TzGNNdq2l6nfph+SwjDQyAi5t/pbIz2eBh7l8IEB3HdGHbw2c7mil5C1C2ukwAbcc3NdVNOi/RS8TVOkZXJXkNFTEux2G3YykhZFG5yXcQ0qx3pV5niQ4YsdVuzaD/sSBGKQOQwXkma/dOtXWi9iGo= 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=ML37cw8U; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=0Aq2BOF6; 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="ML37cw8U"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0Aq2BOF6" Date: Thu, 05 Feb 2026 16:13:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1770308040; 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: in-reply-to:in-reply-to:references:references; bh=cK90Is/3z/v9eXCoCDxnUJ+slka4BR7mBbtpRv0f6/s=; b=ML37cw8UlfeBP7tedAAHVHSUr5vqv9dNheB3Dr2lfnw7IEC7uMgkkdnk0k7DJWwgsZyO9Q 4cI1EbYxagC2SCrz5aLlXlLS9YA6XjodoUMP1t5jhBVaUDl6hgWXRS1kvNy0/9TDKyxeIW bSCrfQOBZoVhqYM4vtdPMZz4w0q9Ex3CmPAelPO8UL7Qd+U1+AkCa+KhZde654hoRoTzE6 /0V6WG04coyh9YuV6v9wpXGgxgTtNKBjtMWPSfw0k5lgDaeWR/duM1BiM9j4sw3GJI7Doc mB3haD2ZM2MhV/Zzw8VqrBFLIP6Ve7u8bHWOtP3w2IcPXTvi+upe1iqd6/0uRA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1770308040; 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: in-reply-to:in-reply-to:references:references; bh=cK90Is/3z/v9eXCoCDxnUJ+slka4BR7mBbtpRv0f6/s=; b=0Aq2BOF6GLl+Go555up2psb8GxtY5DJY+vVQbnXAIFCBB9a27+NI52hG8d2sUkqXKuYiou /tZqecyJHqGsyoCw== 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/urgent] objtool/klp: Fix symbol correlation for orphaned local symbols Cc: Song Liu , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177030803937.2495410.5916359410799013375.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/urgent branch of tip: Commit-ID: 18328546dd59b6adc111cf84a0ee4cdd3a867611 Gitweb: https://git.kernel.org/tip/18328546dd59b6adc111cf84a0ee4cdd3= a867611 Author: Josh Poimboeuf AuthorDate: Mon, 02 Feb 2026 10:01:08 -08:00 Committer: Josh Poimboeuf CommitterDate: Thu, 05 Feb 2026 08:00:45 -08:00 objtool/klp: Fix symbol correlation for orphaned local symbols When compiling with CONFIG_LTO_CLANG_THIN, vmlinux.o has __irf_[start|end] before the first FILE entry: $ readelf -sW vmlinux.o Symbol table '.symtab' contains 597706 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 NOTYPE LOCAL DEFAULT 18 __irf_start 2: 0000000000000200 0 NOTYPE LOCAL DEFAULT 18 __irf_end 3: 0000000000000000 0 SECTION LOCAL DEFAULT 17 .text 4: 0000000000000000 0 SECTION LOCAL DEFAULT 18 .init.ramfs This causes klp-build warnings like: vmlinux.o: warning: objtool: no correlation: __irf_start vmlinux.o: warning: objtool: no correlation: __irf_end The problem is that Clang LTO is stripping the initramfs_data.o FILE symbol, causing those two symbols to be orphaned and not noticed by klp-diff's correlation logic. Add a loop to correlate any symbols found before the first FILE symbol. Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffin= g object files") Reported-by: Song Liu Acked-by: Song Liu Link: https://patch.msgid.link/e21ec1141fc749b5f538d7329b531c1ab63a6d1a.177= 0055235.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf --- tools/objtool/klp-diff.c | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c index 1e649a3..9f1f401 100644 --- a/tools/objtool/klp-diff.c +++ b/tools/objtool/klp-diff.c @@ -364,11 +364,40 @@ static int correlate_symbols(struct elfs *e) struct symbol *file1_sym, *file2_sym; struct symbol *sym1, *sym2; =20 - /* Correlate locals */ - for (file1_sym =3D first_file_symbol(e->orig), - file2_sym =3D first_file_symbol(e->patched); ; - file1_sym =3D next_file_symbol(e->orig, file1_sym), - file2_sym =3D next_file_symbol(e->patched, file2_sym)) { + file1_sym =3D first_file_symbol(e->orig); + file2_sym =3D first_file_symbol(e->patched); + + /* + * Correlate any locals before the first FILE symbol. This has been + * seen when LTO inexplicably strips the initramfs_data.o FILE symbol + * due to the file only containing data and no code. + */ + for_each_sym(e->orig, sym1) { + if (sym1 =3D=3D file1_sym || !is_local_sym(sym1)) + break; + + if (dont_correlate(sym1)) + continue; + + for_each_sym(e->patched, sym2) { + if (sym2 =3D=3D file2_sym || !is_local_sym(sym2)) + break; + + if (sym2->twin || dont_correlate(sym2)) + continue; + + if (strcmp(sym1->demangled_name, sym2->demangled_name)) + continue; + + sym1->twin =3D sym2; + sym2->twin =3D sym1; + break; + } + } + + /* Correlate locals after the first FILE symbol */ + for (; ; file1_sym =3D next_file_symbol(e->orig, file1_sym), + file2_sym =3D next_file_symbol(e->patched, file2_sym)) { =20 if (!file1_sym && file2_sym) { ERROR("FILE symbol mismatch: NULL !=3D %s", file2_sym->name);