Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5392602rwb; Mon, 14 Nov 2022 04:08:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf4FzmziN8EgEdobj0mZAUnb2jQTTQD4vURCJsfhYZepsYVevfdmJsFMrg6ZMCzZmeXzm++o X-Received: by 2002:aa7:8a4a:0:b0:562:e571:3f0e with SMTP id n10-20020aa78a4a000000b00562e5713f0emr13333976pfa.72.1668427722098; Mon, 14 Nov 2022 04:08:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668427722; cv=none; d=google.com; s=arc-20160816; b=Suz9AkaH6n0bg4PqVXoCLV7pOUpo32n+NMxKJPRHFDfzS27ka7irlmBPYGr4gfGTJF FpVZ5qw0L+Yyy10r0sdvY1s41yB4D7gtYR2kcHubjG+9zm81Hnq+uN3dL5t0osgTUeEI dZFoI2ZY9iM3Fz2Dn7qiM3Dcp6sX1aHWKe0uTGKD6rpb4VJW9TynOEs97wUn8+x7Cbx8 JJFBqsh/AvxnWWXBMnDD9mpOdamsDD+EdhWRUwJG+v+ZNiu1jJgYra35UGT1N1F1hReP XoEK32WNihBwD12ZckykBmVzZdoWrh0Mxy9rmCtubaJea25yyttHfUwxBkEhl4XF0plU BsXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l9itMAHWD+AmLhvdGvFlrmw7rsop1qK9OCe8z9z2xZQ=; b=wyfkmkb+IVrTFKbBU6qBOA46IjfpaiI4eSnj4Nb+KGviVS4ZS97VA19gnTLpt33KHY 89PbDwUeKNLoR9BU2qmmOh0VrliD/JzXlNT1JUibPePbNCD3Hu09Q3+If+ofEmOGCaFV l3yXp6NgkNh9R7ond11E+9t5/HuTVLawM/8xn+N9eXC3NzBrEU4OQifu3SF3H1nwEYFr YfMD6ZXUItGA8+P7c4GpmttKbt4cfYXOvLylGbQOQ1iWG7BYuRJnpzmalKZRFo4N2OVc iIOJKhSQRqP/SdxKvxIhqy08k6owhELmEWXVPCs+E98+wmMTiR2mkmZe7TfYMjUz8HGw ISMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NVMO3KRk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h185-20020a6383c2000000b0045c59e9a8a9si9693812pge.322.2022.11.14.04.08.23; Mon, 14 Nov 2022 04:08:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NVMO3KRk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236700AbiKNLoy (ORCPT + 88 others); Mon, 14 Nov 2022 06:44:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236626AbiKNLoZ (ORCPT ); Mon, 14 Nov 2022 06:44:25 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E87821807 for ; Mon, 14 Nov 2022 03:44:18 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 170CC6106D for ; Mon, 14 Nov 2022 11:44:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8743BC433D7; Mon, 14 Nov 2022 11:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426257; bh=rN/KT1Epf0fvqNeXEc1oWJfGIaRJw5s06AqXjEWOiHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NVMO3KRkZoQJ0VQ15+L8MX3UIZgB6LL180PhW7aAbxYsAXZOM3YZXmueMCaXNu3FE +tC8/fnpZwvQGQxMGr2LWQHorJ2d8P5C79kfc2FIlVi0md18cXDAZSyLuSvXEyQxcZ OaFpogWZTE0C+CdZ9ef90IfWCESKNhhnYrbRlQuYrRYCy5v3ggm2jwQ0eoXJ0m0AbP d+rNs7VkLxZwEjOfDXy6mJrLBxvZWtnM1gyERvo387/zZK/OcLiTH5DikylrNCXtgg fKxZsBnUGs90tFM0PiNwCscaye2ymTpjnLRT690iTuiLZDm7lcAw2CPEY1kV5jKzR/ JMxzRXbASSaEw== From: "Jiri Slaby (SUSE)" To: linux-kernel@vger.kernel.org Cc: Andi Kleen , Peter Zijlstra , Josh Poimboeuf , Jason Baron , Steven Rostedt , Ard Biesheuvel , Martin Liska , Jiri Slaby Subject: [PATCH 10/46] static_call, lto: Mark func_a() as __visible_on_lto Date: Mon, 14 Nov 2022 12:43:08 +0100 Message-Id: <20221114114344.18650-11-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114114344.18650-1-jirislaby@kernel.org> References: <20221114114344.18650-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen Symbols referenced from assembler (either directly or e.f. from DEFINE_STATIC_KEY()) need to be global and visible in gcc LTO because they could end up in a different object file than the assembler. This can lead to linker errors without this patch. So mark func_a() as __visible_on_lto as it was static. [js] use __visible_on_lto Cc: Peter Zijlstra Cc: Josh Poimboeuf Cc: Jason Baron Cc: Steven Rostedt Cc: Ard Biesheuvel Signed-off-by: Andi Kleen Signed-off-by: Martin Liska Signed-off-by: Jiri Slaby --- kernel/static_call_inline.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/static_call_inline.c b/kernel/static_call_inline.c index dc5665b62814..6933b4437597 100644 --- a/kernel/static_call_inline.c +++ b/kernel/static_call_inline.c @@ -501,7 +501,7 @@ early_initcall(static_call_init); #ifdef CONFIG_STATIC_CALL_SELFTEST -static int func_a(int x) +__visible_on_lto int sc_func_a(int x) { return x+1; } @@ -511,7 +511,7 @@ static int func_b(int x) return x+2; } -DEFINE_STATIC_CALL(sc_selftest, func_a); +DEFINE_STATIC_CALL(sc_selftest, sc_func_a); static struct static_call_data { int (*func)(int); @@ -520,7 +520,7 @@ static struct static_call_data { } static_call_data [] __initdata = { { NULL, 2, 3 }, { func_b, 2, 4 }, - { func_a, 2, 3 } + { sc_func_a, 2, 3 } }; static int __init test_static_call_init(void) -- 2.38.1