From patchwork Tue Jan 31 09:36:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13122613 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 9E3FCC636CD for ; Tue, 31 Jan 2023 09:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230494AbjAaJg5 (ORCPT ); Tue, 31 Jan 2023 04:36:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232045AbjAaJg4 (ORCPT ); Tue, 31 Jan 2023 04:36:56 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7D292ED7C; Tue, 31 Jan 2023 01:36:51 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id D500DCE1BDB; Tue, 31 Jan 2023 09:36:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44056C433D2; Tue, 31 Jan 2023 09:36:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675157808; bh=GavFmW+1c8ztCVeGwDutDoxHL37vN4T5JEoOXRXcG/c=; h=From:To:Cc:Subject:Date:From; b=MYUxqJEHhG2PVvygty4+eT+DQJwk+ibpguGCqWoCRG4+eOid1YCReeKvC8mKIZQhk 5FJXELMy6JtDWeOmUrNvevujG0i7RRlSzsyY+9wP6Qm8mbNGGsqWXxi3Qxna6enJ/b J1l2t2uf97D0dFgE6DrGpv9Wa5PlwOm6rr647iD0acBP3Hhco5WMI6/c4TiR/xQ/7J ZB6Eh2OhV5hW8sLCVuZiJzEHO8Y4YPCZBbNzkzFYIq5gi9VEjV3JBPh1IJaFrJjpY9 Kxjoyl1Iw7QI8BrT3l5JdFSi2BBiwuoUooBKwhn8ZOtQzDGlp44vA3FrWU3iL8+Yba Bny4Al+KU+xOA== From: Arnd Bergmann To: Peter Zijlstra Cc: Arnd Bergmann , Steven Rostedt , Masami Hiramatsu , Mark Rutland , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Josh Poimboeuf , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH] ftrace,kcfi: Define ftrace_stub_graph conditionally Date: Tue, 31 Jan 2023 10:36:30 +0100 Message-Id: <20230131093643.3850272-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-kernel@vger.kernel.org From: Arnd Bergmann When CONFIG_FUNCTION_GRAPH_TRACER is disabled, __kcfi_typeid_ftrace_stub_graph is missing, causing a link failure: ld.lld: error: undefined symbol: __kcfi_typeid_ftrace_stub_graph referenced by arch/x86/kernel/ftrace_64.o:(__cfi_ftrace_stub_graph) in archive vmlinux.a Mark the reference to it as conditional on the same symbol, as is done on arm64. Fixes: 883bbbffa5a4 ("ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph()") See-also: 2598ac6ec493 ("arm64: ftrace: Define ftrace_stub_graph only with FUNCTION_GRAPH_TRACER") Signed-off-by: Arnd Bergmann --- arch/x86/kernel/ftrace_64.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/ftrace_64.S b/arch/x86/kernel/ftrace_64.S index 1265ad519249..fb4f1e01b64a 100644 --- a/arch/x86/kernel/ftrace_64.S +++ b/arch/x86/kernel/ftrace_64.S @@ -136,10 +136,12 @@ SYM_TYPED_FUNC_START(ftrace_stub) RET SYM_FUNC_END(ftrace_stub) +#ifdef CONFIG_FUNCTION_GRAPH_TRACER SYM_TYPED_FUNC_START(ftrace_stub_graph) CALL_DEPTH_ACCOUNT RET SYM_FUNC_END(ftrace_stub_graph) +#endif #ifdef CONFIG_DYNAMIC_FTRACE