Re: [PATCH 6.3] riscv: vmlinux.lds.S: Explicitly handle '.got' section

Conor Dooley
2023-06-06T10:41:17Z

[-- Attachment #1.1: Type: text/plain, Size: 1392 bytes --]

On Mon, Jun 05, 2023 at 02:15:08PM -0700, Nathan Chancellor wrote:
> 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: <internal>:(.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 <nathan@kernel.org>

Seems reasonable to me chief.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]