* Re: [PATCH 6.3] riscv: vmlinux.lds.S: Explicitly handle '.got' section
2023-06-05 21:15 [PATCH 6.3] riscv: vmlinux.lds.S: Explicitly handle '.got' section Nathan Chancellor
@ 2023-06-06 10:40 ` Conor Dooley
2023-06-07 18:32 ` Greg KH
2023-06-07 18:41 ` Patch "riscv: vmlinux.lds.S: Explicitly handle '.got' section" has been added to the 6.3-stable tree gregkh
1 sibling, 1 reply; 4+ messages in thread
From: Conor Dooley @ 2023-06-06 10:40 UTC (permalink / raw)
To: Nathan Chancellor
Cc: gregkh, sashal, palmer, conor, paul.walmsley, aou, ndesaulniers,
trix, stable, linux-riscv, llvm, patches
[-- 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 --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 4+ messages in thread
* Patch "riscv: vmlinux.lds.S: Explicitly handle '.got' section" has been added to the 6.3-stable tree
2023-06-05 21:15 [PATCH 6.3] riscv: vmlinux.lds.S: Explicitly handle '.got' section Nathan Chancellor
2023-06-06 10:40 ` Conor Dooley
@ 2023-06-07 18:41 ` gregkh
1 sibling, 0 replies; 4+ messages in thread
From: gregkh @ 2023-06-07 18:41 UTC (permalink / raw)
To: aou, conor.dooley, conor, gregkh, linux-riscv, llvm, nathan,
ndesaulniers, palmer, patches, paul.walmsley, sashal, trix
Cc: stable-commits
This is a note to let you know that I've just added the patch titled
riscv: vmlinux.lds.S: Explicitly handle '.got' section
to the 6.3-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
riscv-vmlinux.lds.s-explicitly-handle-.got-section.patch
and it can be found in the queue-6.3 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
From nathan@kernel.org Wed Jun 7 20:32:10 2023
From: Nathan Chancellor <nathan@kernel.org>
Date: Mon, 05 Jun 2023 14:15:08 -0700
Subject: riscv: vmlinux.lds.S: Explicitly handle '.got' section
To: gregkh@linuxfoundation.org, sashal@kernel.org, palmer@dabbelt.com, conor@kernel.org
Cc: 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 <nathan@kernel.org>
Message-ID: <20230605-6-3-riscv-got-orphan-warning-llvm-17-v1-1-72c4f11e020f@kernel.org>
From: Nathan Chancellor <nathan@kernel.org>
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>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
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);
Patches currently in stable-queue which might be from nathan@kernel.org are
queue-6.3/riscv-vmlinux.lds.s-explicitly-handle-.got-section.patch
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 4+ messages in thread