Skip to content

Commit

Permalink
xtensa: move vmlinux.bin[.gz] to boot subdirectory
Browse files Browse the repository at this point in the history
vmlinux.bin and vmlinux.bin.gz are always rebuilt in the kernel build
process. Add them to 'targets' and move them to the boot subdirectory
where their rules are. Update make rules that refer to them.

Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
  • Loading branch information
Max Filippov committed Jul 28, 2020
1 parent 10b6059 commit 65898b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions arch/xtensa/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ BIG_ENDIAN := $(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
export BIG_ENDIAN

subdir-y := lib
targets += vmlinux.bin vmlinux.bin.gz

# Subdirs for the boot loader(s)

Expand All @@ -35,19 +36,19 @@ boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y))

OBJCOPYFLAGS = --strip-all -R .comment -R .notes -O binary

vmlinux.bin: vmlinux FORCE
$(obj)/vmlinux.bin: vmlinux FORCE
$(call if_changed,objcopy)

vmlinux.bin.gz: vmlinux.bin FORCE
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)

boot-elf: vmlinux.bin
boot-redboot: vmlinux.bin.gz
boot-elf: $(obj)/vmlinux.bin
boot-redboot: $(obj)/vmlinux.bin.gz

UIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS)
UIMAGE_COMPRESSION = gzip

$(obj)/uImage: vmlinux.bin.gz FORCE
$(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
$(call if_changed,uimage)
$(Q)$(kecho) ' Kernel: $@ is ready'

Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/boot/boot-elf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ boot-y := bootstrap.o

OBJS := $(addprefix $(obj)/,$(boot-y))

$(obj)/Image.o: vmlinux.bin $(OBJS)
$(obj)/Image.o: $(obj)/../vmlinux.bin $(OBJS)
$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section image=vmlinux.bin \
--add-section image=$< \
--set-section-flags image=contents,alloc,load,load,data \
$(OBJS) $@

Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/boot/boot-redboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a

LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)

$(obj)/zImage.o: vmlinux.bin.gz $(OBJS)
$(obj)/zImage.o: $(obj)/../vmlinux.bin.gz $(OBJS)
$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section image=vmlinux.bin.gz \
--add-section image=$< \
--set-section-flags image=contents,alloc,load,load,data \
$(OBJS) $@

Expand Down

0 comments on commit 65898b3

Please sign in to comment.