aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2012-11-05 00:10:00 -0500
committerChris Zankel <chris@zankel.net>2012-12-19 00:10:23 -0500
commit3f5ec298e56587462d91320c9e49f3e38f2beb17 (patch)
tree4e9fb2010438ff1bce80dd5388057c878a5a1bf2 /arch/xtensa
parent599bf77a0d0b253dd94fd058275b05520c6d25db (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/Makefile10
-rw-r--r--arch/xtensa/boot/boot-elf/Makefile26
-rw-r--r--arch/xtensa/boot/boot-redboot/Makefile26
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
34OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary
35
36vmlinux.bin: vmlinux FORCE
37 $(call if_changed,objcopy)
38
39vmlinux.bin.gz: vmlinux.bin FORCE
40 $(call if_changed,gzip)
41
42boot-elf: vmlinux.bin
43boot-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
7GZIP = gzip
8GZIP_FLAGS = -v9fc
9
10ifeq ($(BIG_ENDIAN),1) 7ifeq ($(BIG_ENDIAN),1)
11OBJCOPY_ARGS := -O elf32-xtensa-be 8OBJCOPY_ARGS := -O elf32-xtensa-be
12else 9else
@@ -20,18 +17,17 @@ boot-y := bootstrap.o
20 17
21OBJS := $(addprefix $(obj)/,$(boot-y)) 18OBJS := $(addprefix $(obj)/,$(boot-y))
22 19
23vmlinux.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
27Image: 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
36zImage: 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
33zImage: $(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
7GZIP = gzip
8GZIP_FLAGS = -v9fc
9ifeq ($(BIG_ENDIAN),1) 7ifeq ($(BIG_ENDIAN),1)
10OBJCOPY_ARGS := -O elf32-xtensa-be 8OBJCOPY_ARGS := -O elf32-xtensa-be
11else 9else
@@ -21,17 +19,17 @@ LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
21 19
22LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) 20LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
23 21
24vmlinux.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
28vmlinux.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
31zImage: 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 35zImage: $(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