Skip to contentSkip to conversation

mips: add new target vmlinux.strip

PATCH New Geoff Levand 1 participant 1 message Jul 14, 2006 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 mips: add new target vmlinux.strip

Adds a new make target 'vmlinux.strip', a stripped elf boot image. This target reduces image load time with bootloaders that load elf images.

arch/mips/Makefile +4 -0
Index: 2.6.16/arch/mips/Makefile
===================================================================
@@ -834,6 +834,9 @@
 vmlinux.bin: $(vmlinux-32)
 	+@$(call makeboot,$@)
 
+vmlinux.strip: $(vmlinux-32)
+	+@$(call makeboot,$@)
+
 vmlinux.ecoff vmlinux.rm200: $(vmlinux-32)
 	+@$(call makeboot,$@)
 
@@ -846,6 +849,7 @@
 	       vmlinux.rm200
 
 define archhelp
+	@echo '* vmlinux.strip            - stripped elf boot image'
 	@echo '* vmlinux.ecoff            - ECOFF boot image'
 	@echo '* vmlinux.srec             - SREC boot image'
 endef
arch/mips/boot/Makefile +6 -0
Index: 2.6.16/arch/mips/boot/Makefile
===================================================================
@@ -23,6 +23,9 @@
 drop-sections	= .reginfo .mdebug .comment .note .pdr .options .MIPS.options
 strip-flags	= $(addprefix --remove-section=,$(drop-sections))
 
+quiet_cmd_stripvm = STRIP   $@
+      cmd_stripvm = $(STRIP) -s -R .comment $< -o $@
+
 VMLINUX = vmlinux
 
 all: vmlinux.ecoff vmlinux.srec addinitrd
@@ -36,6 +39,9 @@
 vmlinux.bin: $(VMLINUX)
 	$(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $(obj)/vmlinux.bin
 
+vmlinux.strip: $(VMLINUX)
+	$(call if_changed,stripvm)
+
 vmlinux.srec: $(VMLINUX)
 	$(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $(obj)/vmlinux.srec