From nobody Sat Jun 13 22:17:34 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 43CF442B759; Tue, 5 May 2026 10:56:12 +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=1777978574; cv=none; b=JgSSuv8vHWyK9JGVwe2zrWiT0SY41/d5zsq24lnMMa55PK43OocbvTAVaAqHihKu05A/nZmd7gw77jj1/mi6f5FHYiE1JMOjYswWmLjI493lL9VkXmBily+wEt2iJqw0xmD9BUHfDSsnWW0DHSyTjDaYgY6Ncf7zHzozaLf0g08= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777978574; c=relaxed/simple; bh=4odzzVjaVaCdthloSRlbbZk9dVGdzE18Zsedacnt0FY=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=ELhW6GeLLQDpiHZg+QhA+E6Ai3bqraamJNFBuY8SJDVYD51/02Dd6AfGozaGv4ue1j6zqOCbqzokYo8m3L4mkl41vGBQIkP7R4wtBAXZJwp8IB+o5Lzx0g8crcB+iy3OWrsDJJP3NkRCVi+PZBJS6acU57DOqc4tMycik3iaJwM= 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=sGxdCFK4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dizQZQ+7; 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="sGxdCFK4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dizQZQ+7" Date: Tue, 05 May 2026 10:56:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777978571; 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=mDEY7hP6+qvdRz/0p61+9oGPpKeDYCoOflpGWyC69uc=; b=sGxdCFK4h2cFnM0IvqvxPiVZ4epm33RghMIqh3Bk++T/MiiBWKqWZthgMAJRbpUmq+fCaZ KrAiMS0qtjJXsKxOE/NjzNWQiw4JwXnkdbaKQr+vE9uiWEJmv3kk9LW4MxtvGexaRk3dlZ 44CiWa0FistvonBUyIvT9yIe4xndyNuxRu62DcnTRrSfv7MSFzfrSPqNcua182cIeVyvu+ 2y5PK5vtgk0wyh0MfvQVKLubZEfe6EUmtdNixgzAo9o4M74VtN59VpSMwOVCGG679qTULu cVtEfEIvErMF/rjWhhh2w9DnoUSELdhsfxnrjkRmvcp5Xlgoz1IhlNVvmgznBg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777978571; 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=mDEY7hP6+qvdRz/0p61+9oGPpKeDYCoOflpGWyC69uc=; b=dizQZQ+7pQeLywkqp8R50yC7i2K4d1ZDDm/+BTwMRWyDKIPyeAwoMZhi4mFSQKQJ678zvD 5Mbu9+2NgA30S6Bg== 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: Add is_cold_func() helper 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: <177797856968.424702.437993098597075638.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: 6282e9f46b4fa3ac554852bb1aef17843fc47ee2 Gitweb: https://git.kernel.org/tip/6282e9f46b4fa3ac554852bb1aef17843= fc47ee2 Author: Josh Poimboeuf AuthorDate: Wed, 18 Mar 2026 15:33:58 -07:00 Committer: Josh Poimboeuf CommitterDate: Mon, 04 May 2026 21:16:05 -07:00 objtool: Add is_cold_func() helper Add an is_cold_func() helper. No functional changes intended. Acked-by: Song Liu Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 6 +++--- tools/objtool/include/objtool/elf.h | 5 +++++ tools/objtool/klp-diff.c | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 6c94eb3..93a054a 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2614,7 +2614,7 @@ static void mark_holes(struct objtool_file *file) if (insn->jump_dest) { struct symbol *dest_func =3D insn_func(insn->jump_dest); =20 - if (dest_func && dest_func->cold) + if (dest_func && is_cold_func(dest_func)) dest_func->ignore =3D true; } } @@ -4422,8 +4422,8 @@ static int create_prefix_symbol(struct objtool_file *= file, struct symbol *func) char name[SYM_NAME_LEN]; struct cfi_state *cfi; =20 - if (!is_func_sym(func) || is_prefix_func(func) || - func->cold || func->static_call_tramp) + if (!is_func_sym(func) || is_prefix_func(func) || is_cold_func(func) || + func->static_call_tramp) return 0; =20 if ((strlen(func->name) + sizeof("__pfx_") > SYM_NAME_LEN)) { diff --git a/tools/objtool/include/objtool/elf.h b/tools/objtool/include/ob= jtool/elf.h index ccc72a6..e452784 100644 --- a/tools/objtool/include/objtool/elf.h +++ b/tools/objtool/include/objtool/elf.h @@ -308,6 +308,11 @@ static inline bool is_prefix_func(struct symbol *sym) return sym->prefix; } =20 +static inline bool is_cold_func(struct symbol *sym) +{ + return sym->cold; +} + static inline bool is_reloc_sec(struct section *sec) { return sec->sh.sh_type =3D=3D SHT_RELA || sec->sh.sh_type =3D=3D SHT_REL; diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c index 7e58ef3..8728dda 100644 --- a/tools/objtool/klp-diff.c +++ b/tools/objtool/klp-diff.c @@ -1709,7 +1709,8 @@ static int create_klp_sections(struct elfs *e) unsigned long sympos; void *func_data; =20 - if (!is_func_sym(sym) || sym->cold || !sym->clone || !sym->clone->change= d) + if (!is_func_sym(sym) || is_cold_func(sym) || + !sym->clone || !sym->clone->changed) continue; =20 /* allocate klp_func_ext */