From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CE163AE65 for ; Wed, 7 Jun 2023 20:32:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC52EC4339B; Wed, 7 Jun 2023 20:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686169977; bh=5ATivHTZCPFlrJw9nus5w68adzQee6zZmftqZTtFVqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ivs87vyf1ZiTXmF1eF54C3svw5nncyGMUr6VgB+jP/7wvcJ/9mpn/UOeGKtPfrMb3 cy7ZoBD99XqDCS0IKxXdJKVjkeJa2aK1H6MmrfLDE1k3BBt6ntNvSUKY9QGFxOxeOz TubSrPIhfiR92BTLFtgZzIjUAKpUEmOkrY953DmQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "paul.walmsley@sifive.com, aou@eecs.berkeley.edu, ndesaulniers@google.com, trix@redhat.com, stable@vger.kernel.org, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, patches@lists.linux.dev, Nathan Chancellor" , Conor Dooley , Nathan Chancellor Subject: [PATCH 6.3 285/286] riscv: vmlinux.lds.S: Explicitly handle .got section Date: Wed, 7 Jun 2023 22:16:24 +0200 Message-ID: <20230607200932.590767678@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230607200922.978677727@linuxfoundation.org> References: <20230607200922.978677727@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Nathan Chancellor This patch is for linux-6.3.y only, it has no direct mainline equivalent. LLVM 17 will now use the GOT for extern weak symbols when using the medany model, which causes a linker orphan section warning on linux-6.3.y: ld.lld: warning: :(.got) is being placed in '.got' This is not an issue in mainline because handling of the .got section was added by commit 39b33072941f ("riscv: Introduce CONFIG_RELOCATABLE") and further extended by commit 26e7aacb83df ("riscv: Allow to downgrade paging mode from the command line") in 6.4-rc1. Neither of these changes are suitable for stable, so add explicit handling of the .got section in a standalone change to align 6.3 and mainline, which addresses the warning. This is only an issue for 6.3 because commit f4b71bff8d85 ("riscv: select ARCH_WANT_LD_ORPHAN_WARN for !XIP_KERNEL") landed in 6.3-rc1, so earlier releases will not see this warning because it will not be enabled. Closes: https://github.com/ClangBuiltLinux/linux/issues/1865 Link: https://github.com/llvm/llvm-project/commit/a178ba9fbd0a27057dc2fa4cb53c76caa013caac Signed-off-by: Nathan Chancellor Reviewed-by: Conor Dooley Signed-off-by: Greg Kroah-Hartman --- arch/riscv/kernel/vmlinux.lds.S | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/riscv/kernel/vmlinux.lds.S +++ b/arch/riscv/kernel/vmlinux.lds.S @@ -129,6 +129,8 @@ SECTIONS *(.sdata*) } + .got : { *(.got*) } + #ifdef CONFIG_EFI .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); } __pecoff_data_raw_size = ABSOLUTE(. - __pecoff_text_end);