stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6.3] riscv: vmlinux.lds.S: Explicitly handle '.got' section
@ 2023-06-05 21:15 Nathan Chancellor
  2023-06-05 21:16 ` kernel test robot
  2023-06-06 10:40 ` Conor Dooley
  0 siblings, 2 replies; 4+ messages in thread
From: Nathan Chancellor @ 2023-06-05 21:15 UTC (permalink / raw)
  To: gregkh, sashal, palmer, conor
  Cc: paul.walmsley, aou, ndesaulniers, trix, stable, linux-riscv, llvm,
	patches, 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: <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>
---
 arch/riscv/kernel/vmlinux.lds.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
index 53a8ad65b255..db56c38f0e19 100644
--- 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);

---
base-commit: abfd9cf1c3d4d143a889b76af835078897e46c55
change-id: 20230605-6-3-riscv-got-orphan-warning-llvm-17-8c4b0b72282a

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* 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-05 21:16 ` kernel test robot
  2023-06-06 10:40 ` Conor Dooley
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-06-05 21:16 UTC (permalink / raw)
  To: Nathan Chancellor; +Cc: stable, oe-kbuild-all

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

Rule: 'Cc: stable@vger.kernel.org' or 'commit <sha1> upstream.'
Subject: [PATCH 6.3] riscv: vmlinux.lds.S: Explicitly handle '.got' section
Link: https://lore.kernel.org/stable/20230605-6-3-riscv-got-orphan-warning-llvm-17-v1-1-72c4f11e020f%40kernel.org

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

Please ignore this mail if the patch is not relevant for upstream.

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




^ permalink raw reply	[flat|nested] 4+ messages in thread

* 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-05 21:16 ` kernel test robot
@ 2023-06-06 10:40 ` Conor Dooley
  2023-06-07 18:32   ` Greg KH
  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: 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 6.3] riscv: vmlinux.lds.S: Explicitly handle '.got' section
  2023-06-06 10:40 ` Conor Dooley
@ 2023-06-07 18:32   ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2023-06-07 18:32 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Nathan Chancellor, sashal, palmer, conor, paul.walmsley, aou,
	ndesaulniers, trix, stable, linux-riscv, llvm, patches

On Tue, Jun 06, 2023 at 11:40:35AM +0100, Conor Dooley wrote:
> 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>

Now queued up,t hanks.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-07 18:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-05 21:15 [PATCH 6.3] riscv: vmlinux.lds.S: Explicitly handle '.got' section Nathan Chancellor
2023-06-05 21:16 ` kernel test robot
2023-06-06 10:40 ` Conor Dooley
2023-06-07 18:32   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).