diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2012-11-05 00:10:00 -0500 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2012-12-19 00:10:23 -0500 |
commit | 3f5ec298e56587462d91320c9e49f3e38f2beb17 (patch) | |
tree | 4e9fb2010438ff1bce80dd5388057c878a5a1bf2 /arch/xtensa | |
parent | 599bf77a0d0b253dd94fd058275b05520c6d25db (diff) |
xtensa: clean up boot make rules
- remove duplicate rules for binary and packed image
- use predefined macros for ld/objcopy/gzip
- remove build-id section from bootable elf image
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/boot/Makefile | 10 | ||||
-rw-r--r-- | arch/xtensa/boot/boot-elf/Makefile | 26 | ||||
-rw-r--r-- | arch/xtensa/boot/boot-redboot/Makefile | 26 |
3 files changed, 33 insertions, 29 deletions
diff --git a/arch/xtensa/boot/Makefile b/arch/xtensa/boot/Makefile index 4018f8994196..4453859ebc78 100644 --- a/arch/xtensa/boot/Makefile +++ b/arch/xtensa/boot/Makefile | |||
@@ -31,3 +31,13 @@ $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \ | |||
31 | $(addprefix $(obj)/,$(host-progs)) | 31 | $(addprefix $(obj)/,$(host-progs)) |
32 | $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) | 32 | $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) |
33 | 33 | ||
34 | OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary | ||
35 | |||
36 | vmlinux.bin: vmlinux FORCE | ||
37 | $(call if_changed,objcopy) | ||
38 | |||
39 | vmlinux.bin.gz: vmlinux.bin FORCE | ||
40 | $(call if_changed,gzip) | ||
41 | |||
42 | boot-elf: vmlinux.bin | ||
43 | boot-redboot: vmlinux.bin.gz | ||
diff --git a/arch/xtensa/boot/boot-elf/Makefile b/arch/xtensa/boot/boot-elf/Makefile index f10992b89027..1fe01b78c124 100644 --- a/arch/xtensa/boot/boot-elf/Makefile +++ b/arch/xtensa/boot/boot-elf/Makefile | |||
@@ -4,9 +4,6 @@ | |||
4 | # for more details. | 4 | # for more details. |
5 | # | 5 | # |
6 | 6 | ||
7 | GZIP = gzip | ||
8 | GZIP_FLAGS = -v9fc | ||
9 | |||
10 | ifeq ($(BIG_ENDIAN),1) | 7 | ifeq ($(BIG_ENDIAN),1) |
11 | OBJCOPY_ARGS := -O elf32-xtensa-be | 8 | OBJCOPY_ARGS := -O elf32-xtensa-be |
12 | else | 9 | else |
@@ -20,18 +17,17 @@ boot-y := bootstrap.o | |||
20 | 17 | ||
21 | OBJS := $(addprefix $(obj)/,$(boot-y)) | 18 | OBJS := $(addprefix $(obj)/,$(boot-y)) |
22 | 19 | ||
23 | vmlinux.tmp: vmlinux | 20 | $(obj)/Image.o: vmlinux.bin $(OBJS) |
24 | $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \ | 21 | $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ |
25 | $^ $@ | 22 | --add-section image=vmlinux.bin \ |
26 | |||
27 | Image: vmlinux.tmp $(OBJS) arch/$(ARCH)/boot/boot-elf/boot.lds | ||
28 | $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ | ||
29 | --add-section image=vmlinux.tmp \ | ||
30 | --set-section-flags image=contents,alloc,load,load,data \ | 23 | --set-section-flags image=contents,alloc,load,load,data \ |
31 | $(OBJS) $@.tmp | 24 | $(OBJS) $@ |
32 | $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \ | ||
33 | -T arch/$(ARCH)/boot/boot-elf/boot.lds \ | ||
34 | -o arch/$(ARCH)/boot/$@.elf $@.tmp | ||
35 | 25 | ||
36 | zImage: Image | 26 | $(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds |
27 | $(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \ | ||
28 | -T $(obj)/boot.lds \ | ||
29 | --build-id=none \ | ||
30 | -o $@ $(obj)/Image.o | ||
31 | $(Q)$(kecho) ' Kernel: $@ is ready' | ||
37 | 32 | ||
33 | zImage: $(obj)/../Image.elf | ||
diff --git a/arch/xtensa/boot/boot-redboot/Makefile b/arch/xtensa/boot/boot-redboot/Makefile index 25a78c6b1530..8be8b9436981 100644 --- a/arch/xtensa/boot/boot-redboot/Makefile +++ b/arch/xtensa/boot/boot-redboot/Makefile | |||
@@ -4,8 +4,6 @@ | |||
4 | # for more details. | 4 | # for more details. |
5 | # | 5 | # |
6 | 6 | ||
7 | GZIP = gzip | ||
8 | GZIP_FLAGS = -v9fc | ||
9 | ifeq ($(BIG_ENDIAN),1) | 7 | ifeq ($(BIG_ENDIAN),1) |
10 | OBJCOPY_ARGS := -O elf32-xtensa-be | 8 | OBJCOPY_ARGS := -O elf32-xtensa-be |
11 | else | 9 | else |
@@ -21,17 +19,17 @@ LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a | |||
21 | 19 | ||
22 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | 20 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) |
23 | 21 | ||
24 | vmlinux.tmp: vmlinux | 22 | $(obj)/zImage.o: vmlinux.bin.gz $(OBJS) |
25 | $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \ | 23 | $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ |
26 | $^ $@ | 24 | --add-section image=vmlinux.bin.gz \ |
25 | --set-section-flags image=contents,alloc,load,load,data \ | ||
26 | $(OBJS) $@ | ||
27 | 27 | ||
28 | vmlinux.tmp.gz: vmlinux.tmp | 28 | $(obj)/zImage.elf: $(obj)/zImage.o $(LIBS) |
29 | $(GZIP) $(GZIP_FLAGS) $^ > $@ | 29 | $(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC) |
30 | 30 | ||
31 | zImage: vmlinux.tmp.gz $(OBJS) $(LIBS) | 31 | $(obj)/../zImage.redboot: $(obj)/zImage.elf |
32 | $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ | 32 | $(Q)$(OBJCOPY) -S -O binary $< $@ |
33 | --add-section image=vmlinux.tmp.gz \ | 33 | $(Q)$(kecho) ' Kernel: $@ is ready' |
34 | --set-section-flags image=contents,alloc,load,load,data \ | 34 | |
35 | $(OBJS) $@.tmp | 35 | zImage: $(obj)/../zImage.redboot |
36 | $(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC) | ||
37 | $(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/$@.redboot | ||