Commit d57259b95078accec01e58a63f783010b782ece4
Committed by
Daniel Schwierzeck
1 parent
dd9999d5f4
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
u-boot.elf: remove hard-coded arm64 flags
This is needed in order to allow building it for other archs. Move relocation comment to a better place. Remove no longer needed dts FIXME. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Showing 2 changed files with 11 additions and 7 deletions Side-by-side Diff
Makefile
... | ... | @@ -747,6 +747,9 @@ |
747 | 747 | endif |
748 | 748 | |
749 | 749 | # Statically apply RELA-style relocations (currently arm64 only) |
750 | +# This is useful for arm64 where static relocation needs to be performed on | |
751 | +# the raw binary, but certain simulators only accept an ELF file (but don't | |
752 | +# do the relocation). | |
750 | 753 | ifneq ($(CONFIG_STATIC_RELA),) |
751 | 754 | # $(1) is u-boot ELF, $(2) is u-boot bin, $(3) is text base |
752 | 755 | DO_STATIC_RELA = \ |
753 | 756 | |
... | ... | @@ -1180,14 +1183,9 @@ |
1180 | 1183 | u-boot-img-spl-at-end.bin: u-boot.img spl/u-boot-spl.bin FORCE |
1181 | 1184 | $(call if_changed,pad_cat) |
1182 | 1185 | |
1183 | -# Create a new ELF from a raw binary file. This is useful for arm64 | |
1184 | -# where static relocation needs to be performed on the raw binary, | |
1185 | -# but certain simulators only accept an ELF file (but don't do the | |
1186 | -# relocation). | |
1187 | -# FIXME refactor dts/Makefile to share target/arch detection | |
1186 | +# Create a new ELF from a raw binary file. | |
1188 | 1187 | u-boot.elf: u-boot.bin |
1189 | - @$(OBJCOPY) -B aarch64 -I binary -O elf64-littleaarch64 \ | |
1190 | - $< u-boot-elf.o | |
1188 | + @$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o | |
1191 | 1189 | @$(LD) u-boot-elf.o -o $@ \ |
1192 | 1190 | --defsym=_start=$(CONFIG_SYS_TEXT_BASE) \ |
1193 | 1191 | -Ttext=$(CONFIG_SYS_TEXT_BASE) |
arch/arm/config.mk
... | ... | @@ -30,6 +30,12 @@ |
30 | 30 | |
31 | 31 | PLATFORM_CPPFLAGS += -D__ARM__ |
32 | 32 | |
33 | +ifdef CONFIG_ARM64 | |
34 | +PLATFORM_ELFFLAGS += -B aarch64 -O elf64-littleaarch64 | |
35 | +else | |
36 | +PLATFORM_ELFFLAGS += -B arm -O elf32-littlearm | |
37 | +endif | |
38 | + | |
33 | 39 | # Choose between ARM/Thumb instruction sets |
34 | 40 | ifeq ($(CONFIG_$(SPL_)SYS_THUMB_BUILD),y) |
35 | 41 | AFLAGS_IMPLICIT_IT := $(call as-option,-Wa$(comma)-mimplicit-it=always) |