linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Sven Schnelle <svens@stackframe.org>
Cc: linux-parisc@vger.kernel.org
Subject: Re: [PATCH] parisc: strip debug information when building compressed images
Date: Wed, 31 Jul 2019 22:07:57 +0200	[thread overview]
Message-ID: <5b9ccfca-f28b-f0f6-de1e-56778d2a98fa@gmx.de> (raw)
In-Reply-To: <20190731195550.GC23520@t470p.stackframe.org>

On 31.07.19 21:55, Sven Schnelle wrote:
> Hi Helge,
> 
> On Wed, Jul 31, 2019 at 09:36:01PM +0200, Helge Deller wrote:
>> * Helge Deller <deller@gmx.de>:
>>> * Sven Schnelle <svens@stackframe.org>:
>>>> When compiling the kernel with debug information i got the following error:
>>>>
>>>> hppa-linux-gnu-ld: section .text LMA [0000000000e78000,0000000000e7b41f] overlaps section .rodata.compressed LMA [00000000000e0078,00000000015ad43d]
>>>> make[3]: *** [/home/svens/parisc-linux/src/arch/parisc/boot/compressed/Makefile:28: arch/parisc/boot/compressed/vmlinux] Error 1
>>>> make[2]: *** [/home/svens/parisc-linux/src/arch/parisc/boot/Makefile:17: arch/parisc/boot/compressed/vmlinux] Error 2
>>>> make[2]: Target 'arch/parisc/boot/bzImage' not remade because of errors.
>>>>
>>>> While this might also be fixed by adjusting the linker script, i think we
>>>> should strip the debug information when generating the compressed image. This
>>>> reduces the size of vmlinuz/lifimage from ~69MB to 6.6MB when full debug
>>>> information is enabled.
>>>
>>> I think keeping debug info is good.
>>> Can you test this patch instead?
>>> It converts a 141MB vmlinux boot file (with debug info) to a 32M vmlinuz for me.
>>>
>>> Ideally I would prefer something like
>>>    . = MIN_OR_HIGHER_THAN_CURRENT_ADDR((SZ_end - SZparisc_kernel_start + KERNEL_BINARY_TEXT_START));
>>> to avoid the ifdef, but I'm missing the linker script expert knowledge...
>>
>> Here is an updated patch without ifdefs:
>> Helge
>>
>> diff --git a/arch/parisc/boot/compressed/vmlinux.lds.S b/arch/parisc/boot/compressed/vmlinux.lds.S
>> index bfd7872739a3..2ac3a643f2eb 100644
>> --- a/arch/parisc/boot/compressed/vmlinux.lds.S
>> +++ b/arch/parisc/boot/compressed/vmlinux.lds.S
>> @@ -48,8 +48,8 @@ SECTIONS
>>   		*(.rodata.compressed)
>>   	}
>>
>> -	/* 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);
> 
> With full debug and a 64 Bit Build i get now (vmlinux is 128M):
> 
>    LD      vmlinux
>    SORTEX  vmlinux
>    SYSMAP  System.map
> /sbin/palo -f ./palo.conf
> palo version 2.00 http://www.parisc-linux.org - Mon, 01 Jan 2018 21:07:58 +0100
> uncompressing Linux kernel................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
> Decompression error:
> uncompressed image too long - wouldn't fit into destination

You are using the built-in palo gzip decompression function.
Please don't use it, it is an old (not bug-free) implementation which got replaced
by the kernel self-decompressor.
My palo.conf in the build dir has:
--init-tape=lifimage
--recoverykernel=vmlinuz

and set
CONFIG_PARISC_SELF_EXTRACT=y
in .config.

Helge

  reply	other threads:[~2019-07-31 20:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 17:19 [PATCH] parisc: strip debug information when building compressed images Sven Schnelle
2019-07-31 19:28 ` Helge Deller
2019-07-31 19:36   ` Helge Deller
2019-07-31 19:55     ` Sven Schnelle
2019-07-31 20:07       ` Helge Deller [this message]
2019-07-31 20:19         ` Sven Schnelle
2019-07-31 19:37   ` James Bottomley
2019-07-31 19:40     ` Helge Deller
2019-07-31 19:45       ` James Bottomley

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=5b9ccfca-f28b-f0f6-de1e-56778d2a98fa@gmx.de \
    --to=deller@gmx.de \
    --cc=linux-parisc@vger.kernel.org \
    --cc=svens@stackframe.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).