linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@stackframe.org>
To: deller@gmx.de
Cc: linux-parisc@vger.kernel.org, Sven Schnelle <svens@stackframe.org>
Subject: [PATCH] parisc: strip debug information when building compressed images
Date: Wed, 31 Jul 2019 19:19:23 +0200	[thread overview]
Message-ID: <20190731171923.24155-1-svens@stackframe.org> (raw)

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.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
 arch/parisc/boot/compressed/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/parisc/boot/compressed/Makefile b/arch/parisc/boot/compressed/Makefile
index 2da8624e5cf6..2a81997b1079 100644
--- a/arch/parisc/boot/compressed/Makefile
+++ b/arch/parisc/boot/compressed/Makefile
@@ -55,8 +55,11 @@ $(obj)/misc.o: $(obj)/sizes.h
 CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER
 $(obj)/vmlinux.lds: $(obj)/sizes.h
 
+quiet_cmd_objcopy_strip_debug = OBJCOPY_STRIP_DEBUG $@
+      cmd_objcopy_strip_debug = $(OBJCOPY) --strip-debug $< $@
+
 $(obj)/vmlinux.bin: vmlinux
-	$(call if_changed,objcopy)
+	$(call if_changed,objcopy_strip_debug)
 
 vmlinux.bin.all-y := $(obj)/vmlinux.bin
 
-- 
2.20.1


             reply	other threads:[~2019-07-31 17:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 17:19 Sven Schnelle [this message]
2019-07-31 19:28 ` [PATCH] parisc: strip debug information when building compressed images Helge Deller
2019-07-31 19:36   ` Helge Deller
2019-07-31 19:55     ` Sven Schnelle
2019-07-31 20:07       ` Helge Deller
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=20190731171923.24155-1-svens@stackframe.org \
    --to=svens@stackframe.org \
    --cc=deller@gmx.de \
    --cc=linux-parisc@vger.kernel.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).