From nobody Fri Dec 19 17:50:22 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 9DCF4C433FE for ; Mon, 14 Nov 2022 11:45:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235943AbiKNLpt (ORCPT ); Mon, 14 Nov 2022 06:45:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236666AbiKNLpQ (ORCPT ); Mon, 14 Nov 2022 06:45:16 -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 2F055222BA for ; Mon, 14 Nov 2022 03:44:42 -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 AD35E61029 for ; Mon, 14 Nov 2022 11:44:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10ED3C433D7; Mon, 14 Nov 2022 11:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426281; bh=Vpg6dWTArUNw6H1lp7TcQixC3uvVmofgAH+VJ8M/i8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q0s1lYPlaouNk03bC26jwsoY4uhDQn4c/yiJljQW+qknmxh2wfkw8UMc4xzmdLbwb 8EK/BGDTUVjnZgsMyONGcULwuWqCX3z31MbWTfr51XDNW9qiS3m8STiTX5QB16N2E/ vGQ3IL2EqJ1dc3MJ6AVlp6V/yqwWHyZCn/hTlDsL+x1v9O9ZO6RGXaD6SUr8lX5cwH Qoy/f7mfPdppxhBeD0rz6ra4XwgbgfkzkVaAatAIY7IUdoMD5hruELQaEXTVWdoTQN fC8SpRDcxbqjzrelOgX31DQsloDxNfNW+OWanKD/bo0A1q3yV72l6aAXPdpjh+L4bL JKJd/i3tYjV5Q== From: "Jiri Slaby (SUSE)" To: linux-kernel@vger.kernel.org Cc: Andi Kleen , Martin Liska , Jiri Slaby Subject: [PATCH 19/46] export, lto: Mark __kstrtab* in EXPORT_SYMBOL() as global and __visible Date: Mon, 14 Nov 2022 12:43:17 +0100 Message-Id: <20221114114344.18650-20-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 __kstrtab_*[] and __kstrtabns_*[] symbols as global and __visible. Signed-off-by: Andi Kleen Signed-off-by: Martin Liska Signed-off-by: Jiri Slaby --- include/linux/export.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/export.h b/include/linux/export.h index 3f31ced0d977..3cb5f85327da 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -85,11 +85,13 @@ struct kernel_symbol { */ #define ___EXPORT_SYMBOL(sym, sec, ns) \ extern typeof(sym) sym; \ - extern const char __kstrtab_##sym[]; \ - extern const char __kstrtabns_##sym[]; \ + extern const char __visible __kstrtab_##sym[]; \ + extern const char __visible __kstrtabns_##sym[]; \ asm(" .section \"__ksymtab_strings\",\"aMS\",%progbits,1 \n" \ + " .globl __kstrtab_" #sym " \n" \ "__kstrtab_" #sym ": \n" \ " .asciz \"" #sym "\" \n" \ + " .globl __kstrtabns_" #sym " \n" \ "__kstrtabns_" #sym ": \n" \ " .asciz \"" ns "\" \n" \ " .previous \n"); \ --=20 2.38.1