提交 be5f95c8 编写于 作者: M Michael Ellerman

powerpc/vmlinux.lds: Don't discard .comment

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 99cb0d91 ("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: 83a092cf ("powerpc: Link warning for orphan sections")
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230105132349.384666-3-mpe@ellerman.id.au
上级 07b050f9
...@@ -411,7 +411,7 @@ SECTIONS ...@@ -411,7 +411,7 @@ SECTIONS
DISCARDS DISCARDS
/DISCARD/ : { /DISCARD/ : {
*(*.EMB.apuinfo) *(*.EMB.apuinfo)
*(.glink .iplt .plt .comment) *(.glink .iplt .plt)
*(.gnu.version*) *(.gnu.version*)
*(.gnu.attributes) *(.gnu.attributes)
*(.eh_frame) *(.eh_frame)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册