MIPS: Reduce kernel image size for !CONFIG_DEBUG_ZBOOT
PATCH 1/1 MIPS: Reduce kernel image size for !CONFIG_DEBUG_ZBOOT
!CONFIG_DEBUG_ZBOOT doesn't need puts() and puthex(), remove them and the according strings for !CONFIG_DEBUG_ZBOOT, as a result, it saves about 1280 bytes.
--- arch/mips/boot/compressed/Makefile | 3 ++- arch/mips/boot/compressed/decompress.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletions(-)
arch/mips/boot/compressed/Makefile +2 -1
@@ -28,9 +28,10 @@ KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ targets := head.o decompress.o dbg.o uart-16550.o uart-alchemy.o # decompressor objects (linked with vmlinuz) -vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/dbg.o +vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o ifdef CONFIG_DEBUG_ZBOOT +vmlinuzobjs-y += $(obj)/dbg.o vmlinuzobjs-$(CONFIG_SYS_SUPPORTS_ZBOOT_UART16550) += $(obj)/uart-16550.o vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY) += $(obj)/uart-alchemy.o endif
arch/mips/boot/compressed/decompress.c +5 -0
@@ -27,8 +27,13 @@ unsigned long free_mem_end_ptr;extern unsigned char __image_begin, __image_end;/* debug interfaces */ +#ifdef CONFIG_DEBUG_ZBOOT extern void puts (const char *s);extern void puthex (unsigned long long val); +#else +#define puts (s) do {} while (0) +#define puthex (val) do {} while (0) +#endif void error (char *x) {
Signature · 1 line
1.7.1
Quoted 2 lines · Wu Zhangjin
!CONFIG_DEBUG_ZBOOT doesn't need
puts()andputhex(), remove them and the according strings for !CONFIG_DEBUG_ZBOOT, as a result, it saves
^^^^^ --> corresponding
Quoted 46 lines
about 1280 bytes.
Signed-off-by Wu Zhangjin <[email protected]>---
arch/mips/boot/compressed/Makefile | 3 ++-arch/mips/boot/compressed/decompress.c| 5 +++++2 files changed, 7 insertions(+), 1 deletions(-)arch/mips/boot/compressed/Makefile +0
-0@@ -28,9 +28,10 @@ KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \targets := head.o decompress.o dbg.o uart-16550.o uart-alchemy.o
# decompressor objects (linked with vmlinuz)arch/mips/boot/compressed/Makefile +1
-1-vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/dbg.o +vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.oifdef
CONFIG_DEBUG_ZBOOT
+vmlinuzobjs-y += $(obj)/dbg.o vmlinuzobjs-$(CONFIG_SYS_SUPPORTS_ZBOOT_UART16550) += $(obj)/uart-16550.o vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY) += $(obj)/uart-alchemy.o endifarch/mips/boot/compressed/decompress.c +5
-1@@ -27,8 +27,13 @@ unsigned long free_mem_end_ptr; extern unsigned char __image_begin, __image_end; /* debug interfaces */ +#ifdef CONFIG_DEBUG_ZBOOT extern void puts(const char *s); extern void puthex(unsigned long long val); +#else +#define puts (s) do {} while (0) +#define puthex (val) do {} while (0) +#endif void error(char *x) { --1.7.1