xref: /linux/arch/xtensa/boot/boot-elf/Makefile (revision 65898b375659f2556da9ac22ea5649407f6f6447)
14bedea94SChris Zankel#
24bedea94SChris Zankel# This file is subject to the terms and conditions of the GNU General Public
34bedea94SChris Zankel# License.  See the file "COPYING" in the main directory of this archive
44bedea94SChris Zankel# for more details.
54bedea94SChris Zankel#
64bedea94SChris Zankel
74bedea94SChris Zankelifeq ($(BIG_ENDIAN),1)
84bedea94SChris ZankelOBJCOPY_ARGS    := -O elf32-xtensa-be
94bedea94SChris Zankelelse
104bedea94SChris ZankelOBJCOPY_ARGS    := -O elf32-xtensa-le
114bedea94SChris Zankelendif
124bedea94SChris Zankel
134bedea94SChris Zankelexport OBJCOPY_ARGS
1436dffadbSChris Zankelexport CPPFLAGS_boot.lds += -P -C
15e85e335fSMax Filippovexport KBUILD_AFLAGS += -mtext-section-literals
164bedea94SChris Zankel
174bedea94SChris Zankelboot-y		:= bootstrap.o
184bedea94SChris Zankel
194bedea94SChris ZankelOBJS		:= $(addprefix $(obj)/,$(boot-y))
204bedea94SChris Zankel
21*65898b37SMax Filippov$(obj)/Image.o: $(obj)/../vmlinux.bin $(OBJS)
223f5ec298SMax Filippov	$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
23*65898b37SMax Filippov		--add-section image=$< \
244bedea94SChris Zankel		--set-section-flags image=contents,alloc,load,load,data \
253f5ec298SMax Filippov		$(OBJS) $@
264bedea94SChris Zankel
273f5ec298SMax Filippov$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
28d503ac53SMasahiro Yamada	$(Q)$(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) \
293f5ec298SMax Filippov		-T $(obj)/boot.lds \
303f5ec298SMax Filippov		--build-id=none \
313f5ec298SMax Filippov		-o $@ $(obj)/Image.o
323f5ec298SMax Filippov	$(Q)$(kecho) '  Kernel: $@ is ready'
334bedea94SChris Zankel
349a736fcbSMax Filippovall Image: $(obj)/../Image.elf
35