diff options
author | Wu Zhangjin <wuzhangjin@gmail.com> | 2009-12-10 09:55:13 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-01-12 12:19:29 -0500 |
commit | d4d9a553d7b96e18fcfbd0b8fb5f803b3a27e4e6 (patch) | |
tree | 999e955a181d5b1a3c6bd62796b3b0bc899fc541 /arch/mips/boot/compressed/Makefile | |
parent | abbdc3d88aa2d5c937b21044c336bcd056c1732f (diff) |
MIPS: Cleanup and Fixup of compressed kernel support
o Remove the .initrd section. The initrd section was already handled
when vmlinux was linked.
o Discard .MIPS.options, .options, .pdr, .reginfo, .comment and .note
sections. If .MIPS.options is not removed, kernels compiled with gcc
3.4.6 will not boot.
o Clean up the file format.
o Remove several other unneeded sections.
Tested with GCC 3.4.6 and 4.4.1 with and without initrd.
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/785/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/boot/compressed/Makefile')
-rw-r--r-- | arch/mips/boot/compressed/Makefile | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index e27f40bbd4e..671d3448fad 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile | |||
@@ -56,7 +56,7 @@ $(obj)/piggy.o: $(obj)/vmlinux.$(suffix_y) $(obj)/dummy.o | |||
56 | LDFLAGS_vmlinuz := $(LDFLAGS) -Ttext $(VMLINUZ_LOAD_ADDRESS) -T | 56 | LDFLAGS_vmlinuz := $(LDFLAGS) -Ttext $(VMLINUZ_LOAD_ADDRESS) -T |
57 | vmlinuz: $(src)/ld.script $(obj-y) $(obj)/piggy.o | 57 | vmlinuz: $(src)/ld.script $(obj-y) $(obj)/piggy.o |
58 | $(call if_changed,ld) | 58 | $(call if_changed,ld) |
59 | $(Q)$(OBJCOPY) $(OBJCOPYFLAGS) -R .comment -R .stab -R .stabstr -R .initrd -R .sysmap $@ | 59 | $(Q)$(OBJCOPY) $(OBJCOPYFLAGS) $@ |
60 | 60 | ||
61 | # | 61 | # |
62 | # Some DECstations need all possible sections of an ECOFF executable | 62 | # Some DECstations need all possible sections of an ECOFF executable |
@@ -84,14 +84,11 @@ vmlinuz.ecoff: $(obj)/../elf2ecoff $(VMLINUZ) | |||
84 | $(obj)/../elf2ecoff: $(src)/../elf2ecoff.c | 84 | $(obj)/../elf2ecoff: $(src)/../elf2ecoff.c |
85 | $(Q)$(HOSTCC) -o $@ $^ | 85 | $(Q)$(HOSTCC) -o $@ $^ |
86 | 86 | ||
87 | drop-sections = .reginfo .mdebug .comment .note .pdr .options .MIPS.options | 87 | OBJCOPYFLAGS_vmlinuz.bin := $(OBJCOPYFLAGS) -O binary |
88 | strip-flags = $(addprefix --remove-section=,$(drop-sections)) | ||
89 | |||
90 | OBJCOPYFLAGS_vmlinuz.bin := $(OBJCOPYFLAGS) -O binary $(strip-flags) | ||
91 | vmlinuz.bin: vmlinuz | 88 | vmlinuz.bin: vmlinuz |
92 | $(call if_changed,objcopy) | 89 | $(call if_changed,objcopy) |
93 | 90 | ||
94 | OBJCOPYFLAGS_vmlinuz.srec := $(OBJCOPYFLAGS) -S -O srec $(strip-flags) | 91 | OBJCOPYFLAGS_vmlinuz.srec := $(OBJCOPYFLAGS) -S -O srec |
95 | vmlinuz.srec: vmlinuz | 92 | vmlinuz.srec: vmlinuz |
96 | $(call if_changed,objcopy) | 93 | $(call if_changed,objcopy) |
97 | 94 | ||