From nobody Sat Jun 13 22:03:16 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 928EE47F2D9; Tue, 5 May 2026 10:56:33 +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=1777978595; cv=none; b=VrS/5dtngkd0m22D9kaPENknPa15lTm/z2tRrIrPLyPgigd4+AnRcR3QZcRarHxWFUKT94KrzYVzyIn3IFRamf3mh3ntyVdKlGk9qjsJVzYKJ0XAdNQ7hkKc3kx2vAnHs44NOMQ4GCcRFFsrO3G141bYqhIqTPvGHP9gSL4+JGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777978595; c=relaxed/simple; bh=h3fS++uaVp8l6X/e359X6qQqF3glc4nd5BPf/X73hYM=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=umKkgQYP25wFvaMrqjqgjTIfnMJTJ/2Kw7XUjx7vG80crQj7ajQnTGO9BCMb0BArZJu67vhIAZWYEoI3oXqY7oLAp/iO7lCVTby54ObFprNgM3YFit/GUGFmzIaVJ7YwU8VqDpu7qRhcwtUgY8b9kgmJkMRugLZTP5lFogbI7UQ= 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=AjnJ1HGP; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ghjPZ5qw; 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="AjnJ1HGP"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ghjPZ5qw" Date: Tue, 05 May 2026 10:56:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777978592; 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=vt1Z9XFEP4HLS20NY1JBhXmGZS2S3n2k5+sLmC1NJ4U=; b=AjnJ1HGPGK7xXJAxB0j4zvznC/bfTp3uFB3uWtjIJHAyLoyah/FL+pQ+jQTEec9DKqtLCs qk4/QqOcfITWdQcO9qO/RnPbVP6BtL7AvWKjYRiK5HpZ9aYH27AYqSH60VX5KI8OYBz0/1 5sREc1R1/mdLiIESpNuJ4YUjK4vxAnHkXQDzpBzGpk2i+o5QTvHuKU8hALJwzDwFCwchU3 fFt99AY4CNGLYd/E/pRX85lA1dBKaiwL1PhWUQKLzVnL1zwgp7S4kUi51HNcZzMBxTmMla JfHbV3vsk1Ho/kD03SzXh8gB37ZCLKjLH1DHUL19ZDzxvARK6Lgey4Mn2Ytmtw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777978592; 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=vt1Z9XFEP4HLS20NY1JBhXmGZS2S3n2k5+sLmC1NJ4U=; b=ghjPZ5qw1daKZ+VgshlVxBKFAKovwYdw4Ox/LF/pcjk+ZMK8qWVba4Hzkys91qBIWcBBYH Yso7n+s1T4r4V0Ag== 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: Don't correlate .rodata.cst* constant pool objects Cc: Song Liu , 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: <177797859099.424702.4891144056023287591.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: 51e1dfce24c8f4b1cdfa614a43ee195088901eca Gitweb: https://git.kernel.org/tip/51e1dfce24c8f4b1cdfa614a43ee19508= 8901eca Author: Josh Poimboeuf AuthorDate: Wed, 29 Apr 2026 17:35:48 -07:00 Committer: Josh Poimboeuf CommitterDate: Mon, 04 May 2026 21:16:02 -07:00 objtool/klp: Don't correlate .rodata.cst* constant pool objects Clang aggregates UBSAN type descriptors into shared anonymous .data..L__unnamed_* sections. This data is used by UBSAN trap handlers. When a changed function has an UBSAN bounds check, klp-diff clones the entire UBSAN data section associated with the TU. Relocations within the cloned section that reference named rodata objects in .rodata.cst* (like 'exponent', 'pirq_ali_set.irqmap') become KLP relocations because those objects now get correlated. That results in a .klp.rela.vmlinux..data section which can easily have thousands of KLP relocs, most of which are completely superfluous, used by functions which aren't cloned to the patch module. The .rodata.cst* sections are SHF_MERGE constant pool sections containing small fixed-size data (lookup tables, bitmasks) that is only read by value. Pointer identity is never relevant for these objects, so correlating them is unnecessary. Exclude .rodata.cst* objects from correlation so they get cloned as local data instead of generating KLP relocations. It might be possible to someday treat UBSAN data sections as special sections, and only extract the few needed entries. But this works for now. Acked-by: Song Liu Signed-off-by: Josh Poimboeuf --- tools/objtool/klp-diff.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c index bf37c65..ca87bcb 100644 --- a/tools/objtool/klp-diff.c +++ b/tools/objtool/klp-diff.c @@ -373,6 +373,21 @@ static bool is_initcall_sym(struct symbol *sym) } =20 /* + * Some .rodata is anonymous and can't be correlated due to there being no + * symbol names. + * + * The .rodata.cst* sections aren't technically anonymous, they're SHF_MER= GE + * constant pool sections containing small fixed-size data (lookup tables, + * bitmasks) which are only read by value, so pointer equivalence isn't ne= eded. + * They are typically referenced by UBSAN data sections. + */ +static bool is_anonymous_rodata(struct symbol *sym) +{ + return is_rodata_sec(sym->sec) && + (!is_object_sym(sym) || strstarts(sym->sec->name, ".rodata.cst")); +} + +/* * These symbols should never be correlated, so their local patched versio= ns * are used instead of linking to the originals. */ @@ -386,7 +401,7 @@ static bool dont_correlate(struct symbol *sym) is_uncorrelated_static_local(sym) || is_local_label(sym) || is_string_sec(sym->sec) || - (is_rodata_sec(sym->sec) && !is_object_sym(sym)) || + is_anonymous_rodata(sym) || is_initcall_sym(sym) || is_addressable_sym(sym) || is_special_section(sym->sec) ||