From nobody Wed Dec 17 21:11:39 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59747C77B72 for ; Mon, 17 Apr 2023 10:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230195AbjDQKvS (ORCPT ); Mon, 17 Apr 2023 06:51:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230301AbjDQKut (ORCPT ); Mon, 17 Apr 2023 06:50:49 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3037B107; Mon, 17 Apr 2023 03:50:06 -0700 (PDT) Date: Mon, 17 Apr 2023 10:46:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1681728406; 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=L3cRL4xoLBwh2G97fXLQqe8IVnTzzLGQ4Y5MoSfBc5s=; b=rOL5U705iJEb1ShdBIQIqUzEZapRrZBO689JkOVsrGnHpPNRceGP+z2dqgEsY+dYtsCDUa FyCAJIActZMM24YFX6+GRSHpD4kvSCl0svEIaK63q1LWKLCAI/SXRJkvcqv0DoVLOVJp5O 50eeBXSJO0nhmbmTm8LkKgFyUrMKakn4OOW/o4yBeTiKcVXf+PYaRBR6LQ9QAhEadaFcdK NsTnxKmepP2jIa6xAzaQ1obo0KtiSS8JwFZXnnB/Tu5rc80CyDbfI10NTa539Ox0K9HfgK qNNtL+TAR0Zfd1p3/K8HBxGD4XJDSwfvWnwt/EjWVUHngblmog2adpkmAWUlgw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1681728406; 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=L3cRL4xoLBwh2G97fXLQqe8IVnTzzLGQ4Y5MoSfBc5s=; b=AboNt+p9+L2G8vEp723DBokzNWWDFj/HYLW05qL0SqwkSQkg/+YTCiZC+7+CFCfQnwvpYv rbrkH7r5P9elo3Bw== 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: Include weak functions in global_noreturns check Cc: kernel test robot , Josh Poimboeuf , "Peter Zijlstra (Intel)" , Miroslav Benes , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <168172840649.404.8270052350550677405.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the objtool/core branch of tip: Commit-ID: 1c47c8758a11345ac643fa68cb70b708a6668883 Gitweb: https://git.kernel.org/tip/1c47c8758a11345ac643fa68cb70b708a= 6668883 Author: Josh Poimboeuf AuthorDate: Wed, 12 Apr 2023 16:49:37 -07:00 Committer: Peter Zijlstra CommitterDate: Fri, 14 Apr 2023 17:31:26 +02:00 objtool: Include weak functions in global_noreturns check If a global function doesn't return, and its prototype has the __noreturn attribute, its weak counterpart must also not return so that it matches the prototype and meets call site expectations. To properly follow the compiled control flow at the call sites, change the global_noreturns check to include both global and weak functions. On the other hand, if a weak function isn't in global_noreturns, assume the prototype doesn't have __noreturn. Even if the weak function doesn't return, call sites treat it like a returnable function. Fixes the following warning: kernel/sched/build_policy.o: warning: objtool: do_idle() falls through to= next function play_idle_precise() Reported-by: kernel test robot Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lore.kernel.org/r/ede3460d63f4a65d282c86f1175bd2662c2286ba.16= 81342859.git.jpoimboe@kernel.org --- tools/objtool/check.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 8d073bf..ae0c942 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -236,14 +236,14 @@ static bool __dead_end_function(struct objtool_file *= file, struct symbol *func, if (!func) return false; =20 - if (func->bind =3D=3D STB_WEAK) - return false; - - if (func->bind =3D=3D STB_GLOBAL) + if (func->bind =3D=3D STB_GLOBAL || func->bind =3D=3D STB_WEAK) for (i =3D 0; i < ARRAY_SIZE(global_noreturns); i++) if (!strcmp(func->name, global_noreturns[i])) return true; =20 + if (func->bind =3D=3D STB_WEAK) + return false; + if (!func->len) return false;