From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79D71C4332F for ; Sat, 19 Nov 2022 02:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UAwjP4DBkc9K2nOTNQ3XF4kRSM2VJUeZ2pE981BChjk=; b=DAlWjlU/BWxm7y AZC1gEAsUQ14aAe0RPJwVIK5HTlleeCdpwxjaj+V44cGNdd5ZFoT31eH5scvnpG1y0ds4Oy9vDNcY Ro0xnsCnxHUwc14W0Z8k7L+03aTXv7vdcC+2OE0F6je+2LxM8HWwAgVmOUA7XN/q2Qf8iu2xaOC4G 1w6zLWipQIpog6TwvP9OkslduWkzcltAQk0ymg7AHpsq3cJA1u+zQyrjRsOZbQZL/dC13MfpPE6dY 6R0zJmVnbymQlh7Vt5sX3Nj4rtMghDcJSzZANu9MMi64q7Y/t3EZ6yWzEGkGpgEeUuhoJJsYIS+Pv UFg5DObLDiUZnf6DUIfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1owDR2-00AIUx-K3; Sat, 19 Nov 2022 02:18:24 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1owDP7-00AHW6-3j for linux-riscv@lists.infradead.org; Sat, 19 Nov 2022 02:16:26 +0000 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 8625C624B7; Sat, 19 Nov 2022 02:16:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 450FCC433D6; Sat, 19 Nov 2022 02:16:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668824184; bh=EvpqbbdWIVH0UKqd9qoZTrteR9XJoF2FBQM3I4Pa6bg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y3GclB+PMn2qC0+FWoi3p08gE8auQXM5wWTH0abXcqkr5qgBYVu5z7LrG0e+JN57v 5q4RGESFb5PfjeZQr0hK4zo2c4Xq1svmW+unO9TxGvdXRjB+oDHwntM4oIYx//MZJW pKVRkEgNLRyvHxL05s3On4O2yAZ0/Ihlx3NsqI8dKJWqmGQiKBtkgR97SUttsk8JYg LMtiuO/Xp9MQGstDoUfpgxf2RpxIa8YZaMYKM8kAvFErvYhwtsC9+6zBZEnmDqb3Ok Og0r6BPIRdWONKJglnAplxKNv5Izu6wUKZvHEqNxCUiAljmq7oUB64n/ck4oUyAtxJ /wdnYUNPafbgA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , Conor Dooley , Palmer Dabbelt , Sasha Levin , paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, jszhang@kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH AUTOSEL 4.19 7/8] RISC-V: vdso: Do not add missing symbols to version section in linker script Date: Fri, 18 Nov 2022 21:16:08 -0500 Message-Id: <20221119021610.1775469-7-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221119021610.1775469-1-sashal@kernel.org> References: <20221119021610.1775469-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221118_181625_276757_F816E9C1 X-CRM114-Status: GOOD ( 10.30 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Nathan Chancellor [ Upstream commit fcae44fd36d052e956e69a64642fc03820968d78 ] Recently, ld.lld moved from '--undefined-version' to '--no-undefined-version' as the default, which breaks the compat vDSO build: ld.lld: error: version script assignment of 'LINUX_4.15' to symbol '__vdso_gettimeofday' failed: symbol not defined ld.lld: error: version script assignment of 'LINUX_4.15' to symbol '__vdso_clock_gettime' failed: symbol not defined ld.lld: error: version script assignment of 'LINUX_4.15' to symbol '__vdso_clock_getres' failed: symbol not defined These symbols are not present in the compat vDSO or the regular vDSO for 32-bit but they are unconditionally included in the version section of the linker script, which is prohibited with '--no-undefined-version'. Fix this issue by only including the symbols that are actually exported in the version section of the linker script. Link: https://github.com/ClangBuiltLinux/linux/issues/1756 Signed-off-by: Nathan Chancellor Tested-by: Conor Dooley Link: https://lore.kernel.org/r/20221108171324.3377226-1-nathan@kernel.org/ Signed-off-by: Palmer Dabbelt Signed-off-by: Sasha Levin --- arch/riscv/kernel/vdso/Makefile | 3 +++ arch/riscv/kernel/vdso/vdso.lds.S | 2 ++ 2 files changed, 5 insertions(+) diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile index 1dd134fc0d84..ba833b79051f 100644 --- a/arch/riscv/kernel/vdso/Makefile +++ b/arch/riscv/kernel/vdso/Makefile @@ -17,6 +17,9 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso)) obj-y += vdso.o vdso-syms.o CPPFLAGS_vdso.lds += -P -C -U$(ARCH) +ifneq ($(filter vgettimeofday, $(vdso-syms)),) +CPPFLAGS_vdso.lds += -DHAS_VGETTIMEOFDAY +endif # Disable gcov profiling for VDSO code GCOV_PROFILE := n diff --git a/arch/riscv/kernel/vdso/vdso.lds.S b/arch/riscv/kernel/vdso/vdso.lds.S index cd1d47e0724b..8910712f6fb2 100644 --- a/arch/riscv/kernel/vdso/vdso.lds.S +++ b/arch/riscv/kernel/vdso/vdso.lds.S @@ -70,9 +70,11 @@ VERSION LINUX_4.15 { global: __vdso_rt_sigreturn; +#ifdef HAS_VGETTIMEOFDAY __vdso_gettimeofday; __vdso_clock_gettime; __vdso_clock_getres; +#endif __vdso_getcpu; __vdso_flush_icache; local: *; -- 2.35.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv