This is a note to let you know that I've just added the patch titled powerpc/vmlinux.lds: Don't discard .comment to the 5.4-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: powerpc-vmlinux.lds-don-t-discard-.comment.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From be5f95c8779e19779dd81927c8574fec5aaba36c Mon Sep 17 00:00:00 2001 From: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Date: Thu, 5 Jan 2023 22:42:59 +1100 Subject: powerpc/vmlinux.lds: Don't discard .comment From: Michael Ellerman <mpe@xxxxxxxxxxxxxx> commit be5f95c8779e19779dd81927c8574fec5aaba36c upstream. Although the powerpc linker script mentions .comment in the DISCARD section, that has never actually caused it to be discarded, because the earlier ELF_DETAILS macro (previously STABS_DEBUG) explicitly includes .comment. However commit 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv") introduced an earlier use of DISCARD as part of the RO_DATA macro. With binutils < 2.36 that causes the DISCARD directives later in the script to be applied earlier, causing .comment to actually be discarded. It's confusing to explicitly include and discard .comment, and even more so if the behaviour depends on the toolchain version. So don't discard .comment in order to maintain the existing behaviour in all cases. Fixes: 83a092cf95f2 ("powerpc: Link warning for orphan sections") Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20230105132349.384666-3-mpe@xxxxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/powerpc/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -395,7 +395,7 @@ SECTIONS DISCARDS /DISCARD/ : { *(*.EMB.apuinfo) - *(.glink .iplt .plt .comment) + *(.glink .iplt .plt) *(.gnu.version*) *(.gnu.attributes) *(.eh_frame) Patches currently in stable-queue which might be from mpe@xxxxxxxxxxxxxx are queue-5.4/powerpc-vmlinux.lds-don-t-discard-.rela-for-relocatable-builds.patch queue-5.4/powerpc-vmlinux.lds-define-runtime_discard_exit.patch queue-5.4/powerpc-vmlinux.lds-don-t-discard-.comment.patch