parisc: Fix build of compressed kernel even with debug enabled [Linux 4.14.137]

This Linux kernel change "parisc: Fix build of compressed kernel even with debug enabled" is included in the Linux 4.14.137 release. This change is authored by Helge Deller <deller [at] gmx.de> on Thu Aug 1 13:33:39 2019 +0200. The commit for this change in Linux stable tree is 45842c3 (patch) which is from upstream commit 3fe6c87. The same Linux upstream change may have been applied to various maintained Linux releases and you can find all Linux releases containing changes from upstream 3fe6c87.

parisc: Fix build of compressed kernel even with debug enabled

commit 3fe6c873af2f2247544debdbe51ec29f690a2ccf upstream.

With debug info enabled (CONFIG_DEBUG_INFO=y) the resulting vmlinux may get
that huge that we need to increase the start addresss for the decompression
text section otherwise one will face a linker error.

Reported-by: Sven Schnelle <[email protected]>
Tested-by: Sven Schnelle <[email protected]>
Cc: [email protected] # v4.14+
Signed-off-by: Helge Deller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

There are 4 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 arch/parisc/boot/compressed/vmlinux.lds.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/parisc/boot/compressed/vmlinux.lds.S b/arch/parisc/boot/compressed/vmlinux.lds.S
index a4ce331..b658f77 100644
--- a/arch/parisc/boot/compressed/vmlinux.lds.S
+++ b/arch/parisc/boot/compressed/vmlinux.lds.S
@@ -40,8 +40,8 @@ SECTIONS
 #endif
    _startcode_end = .;

-   /* bootloader code and data starts behind area of extracted kernel */
-   . = (SZ_end - SZparisc_kernel_start + KERNEL_BINARY_TEXT_START);
+   /* bootloader code and data starts at least behind area of extracted kernel */
+   . = MAX(ABSOLUTE(.), (SZ_end - SZparisc_kernel_start + KERNEL_BINARY_TEXT_START));

    /* align on next page boundary */
    . = ALIGN(4096);

Leave a Reply

Your email address will not be published. Required fields are marked *