[PATCH] parisc: strip debug information when building compressed images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux