Message ID | 20221114114344.18650-6-jirislaby@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2097417wru; Mon, 14 Nov 2022 03:47:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf6duBkiQwYengceJx94vFxpXnCYkYZVsdThBLBXXF9GqtN8UtxnhFcLGlhRIawdxtpNuJC/ X-Received: by 2002:a17:906:c7c8:b0:78d:e7c0:a2b with SMTP id dc8-20020a170906c7c800b0078de7c00a2bmr10068354ejb.273.1668426421403; Mon, 14 Nov 2022 03:47:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668426421; cv=none; d=google.com; s=arc-20160816; b=xVgonshGByfQkDECS27yJjlblqa6utdNSgxJzxlwrYsbVt6JzqhK7E25M1VXpAtSba FdXCzEeJWnDFcEYbTV/0tNvck/am6EgGlxHS+jBFkqcmIYCd8RhiYZxpSK6j1vvslmHg ZLSNKcHU8A2Nd2WaUE5BHrkcHImh7/Eqk93fX4RF/8X3gNOFCXr1cfbFiWXaGCgXnLIE cLPQ5Ov+Gu9IClvFWOA/OcyO8cwpYzLPmAzScIYclDSfl9u7lv4mKkf/sp3htqAVEz+u +2WrrwU4crgp8VPHWqqZSrAM0xVlt6fMO/FYIPMwl/MD1HCGkNnfEt+LpUiR8uCrl/4I xy5g== 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=ELkyRF6TGPqmn4G6ouWytUXn7gtIL1VB9fkRYURslh4=; b=XnBUO7SwcxVmVeIboGuNxDpvpkb7OerUctYSO3tjqy5nNl/I/c1bfAbNKwPGwAzo71 tj7+ISjePlD5e5Zhat8QWeM1VjTa0/uSwFHhHDYTwFcEB6gBBp5K7vv7iuwQta0xQof7 CQNpzNhOzmr1SpxPwbzDPY1oODnLVynDJ51MBQAMyc8dkMvUEdSPl4f8abdrLS7/Dl5q p/JkFqOr3/GqQm1Ah/ud50HsD+kRv5MNB6+I4moFaRRIpKD9dL3NXZ71bIJqfs4GMU3H 7g0YXNs47P76R4gN5RsXdk63XeFrkkzhN33IPXnXeyMqIetzLzDXqeN/TkXnfSiItr9T Nr/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DK4Z5dms; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp34-20020a1709071b2200b007adb868f102si9973669ejc.476.2022.11.14.03.46.37; Mon, 14 Nov 2022 03:47:01 -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=DK4Z5dms; 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 S236627AbiKNLoZ (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Mon, 14 Nov 2022 06:44:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236489AbiKNLoT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 06:44:19 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AA701F2E0 for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 03:44:09 -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 ams.source.kernel.org (Postfix) with ESMTPS id 3C556B80E76 for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 11:44:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13334C433B5; Mon, 14 Nov 2022 11:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426246; bh=Kzg4cZoweNmjL16Z27jdyhSbNXbJfBWwbmh5FgksE4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DK4Z5dmsCCFNhlyXArZQesbHiS2bgahYRLOSN31NemV/F4+JLy9FW61lL3aPTJU08 ztNEYSFk/h8nQTukpozOw1OJA6azx2QRns8q64k0//yv3tIfJI2Dr5mPh4E/EM9DW4 EE67HZn5MhxxKJR6NjSVwNc6xIb0cZPO94fgAHh+rZxb42s2wM5ThzjPZ2f2cqvIzq RVpYj8edO6P6Ybl9IEzWG3R+delTThTe0Nap4N9Jbf3WCwHKnnO4+cDefEltib9TJo 1klr2NSQpW/v73V7ETanqEBpbiRJoxampbh8Emrhbm6XPccRBXc3I07Bj4mvoCx+9b 3DvXEcgM20hGQ== From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> To: linux-kernel@vger.kernel.org Cc: Jiri Slaby <jslaby@suse.cz>, Martin Liska <mliska@suse.cz> Subject: [PATCH 05/46] compiler.h: introduce __global_on_lto Date: Mon, 14 Nov 2022 12:43:03 +0100 Message-Id: <20221114114344.18650-6-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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749471903278994630?= X-GMAIL-MSGID: =?utf-8?q?1749471903278994630?= |
Series |
gcc-LTO support for the kernel
|
|
Commit Message
Jiri Slaby
Nov. 14, 2022, 11:43 a.m. UTC
From: Jiri Slaby <jslaby@suse.cz> __global_on_lto is defined as "globl" when gcc LTO is turned on (see later patches), and "local" otherwise. It is needed for top-level symbols which are referenced in assembly. It is because the assembly and the symbol can each end up in a different file with gcc LTO. And that leads to linker errors. So the symbols have to be global when gcc LTO is in charge. On the contrary, they can remain local on non-gcc-LTO builds. Cc: Martin Liska <mliska@suse.cz> Signed-off-by: Jiri Slaby <jslaby@suse.cz> --- include/linux/compiler.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 2305a3cbe99c..16e4c1de14c4 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -135,8 +135,10 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, #ifdef CONFIG_LTO_GCC # define __visible_on_lto __visible +# define __global_on_lto "globl" #else # define __visible_on_lto static +# define __global_on_lto "local" #endif #ifndef unreachable