From: Michael Ellerman <mpe@ellerman.id.au> To: <linuxppc-dev@lists.ozlabs.org> Cc: <masahiroy@kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arch@vger.kernel.org>, <schwab@linux-m68k.org>, ardb@kernel.org, <nathan@kernel.org> Subject: [PATCH 3/3] powerpc/vmlinux.lds: Don't discard .comment Date: Fri, 6 Jan 2023 00:23:49 +1100 [thread overview] Message-ID: <20230105132349.384666-3-mpe@ellerman.id.au> (raw) In-Reply-To: <20230105132349.384666-1-mpe@ellerman.id.au> 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@ellerman.id.au> --- arch/powerpc/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index a4c6efadc90c..958e77a24f85 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -411,7 +411,7 @@ SECTIONS DISCARDS /DISCARD/ : { *(*.EMB.apuinfo) - *(.glink .iplt .plt .comment) + *(.glink .iplt .plt) *(.gnu.version*) *(.gnu.attributes) *(.eh_frame) -- 2.39.0
WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au> To: <linuxppc-dev@lists.ozlabs.org> Cc: linux-arch@vger.kernel.org, masahiroy@kernel.org, linux-kernel@vger.kernel.org, nathan@kernel.org, schwab@linux-m68k.org, ardb@kernel.org Subject: [PATCH 3/3] powerpc/vmlinux.lds: Don't discard .comment Date: Fri, 6 Jan 2023 00:23:49 +1100 [thread overview] Message-ID: <20230105132349.384666-3-mpe@ellerman.id.au> (raw) In-Reply-To: <20230105132349.384666-1-mpe@ellerman.id.au> 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@ellerman.id.au> --- arch/powerpc/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index a4c6efadc90c..958e77a24f85 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -411,7 +411,7 @@ SECTIONS DISCARDS /DISCARD/ : { *(*.EMB.apuinfo) - *(.glink .iplt .plt .comment) + *(.glink .iplt .plt) *(.gnu.version*) *(.gnu.attributes) *(.eh_frame) -- 2.39.0
next prev parent reply other threads:[~2023-01-05 13:24 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-05 13:23 [PATCH 1/3] powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT Michael Ellerman 2023-01-05 13:23 ` Michael Ellerman 2023-01-05 13:23 ` [PATCH 2/3] powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds Michael Ellerman 2023-01-05 13:23 ` Michael Ellerman 2023-01-05 13:23 ` Michael Ellerman [this message] 2023-01-05 13:23 ` [PATCH 3/3] powerpc/vmlinux.lds: Don't discard .comment Michael Ellerman 2023-01-08 12:49 ` [PATCH 1/3] powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT Michael Ellerman 2023-01-08 12:49 ` Michael Ellerman
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230105132349.384666-3-mpe@ellerman.id.au \ --to=mpe@ellerman.id.au \ --cc=ardb@kernel.org \ --cc=linux-arch@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linuxppc-dev@lists.ozlabs.org \ --cc=masahiroy@kernel.org \ --cc=nathan@kernel.org \ --cc=schwab@linux-m68k.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.