X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=Makefile;h=57fa6ec359ad05dd16352e9e45b3ccae14d1a6b6;hb=64a144dcea038df2b58dd3120a880e89164af09f;hp=09b597d45051f9899abbb517a98d67297a19237c;hpb=e391b1e64b0bd65709a28a4764afe4f32d408243;p=u-boot diff --git a/Makefile b/Makefile index 09b597d450..57fa6ec359 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ VERSION = 2017 PATCHLEVEL = 05 SUBLEVEL = -EXTRAVERSION = -rc1 +EXTRAVERSION = NAME = # *DOCUMENTATION* @@ -348,7 +348,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump AWK = awk PERL = perl -PYTHON = python +PYTHON ?= python DTC = dtc CHECK = sparse @@ -747,6 +747,9 @@ BOARD_SIZE_CHECK = endif # Statically apply RELA-style relocations (currently arm64 only) +# This is useful for arm64 where static relocation needs to be performed on +# the raw binary, but certain simulators only accept an ELF file (but don't +# do the relocation). ifneq ($(CONFIG_STATIC_RELA),) # $(1) is u-boot ELF, $(2) is u-boot bin, $(3) is text base DO_STATIC_RELA = \ @@ -1180,17 +1183,17 @@ OBJCOPYFLAGS_u-boot-img-spl-at-end.bin := -I binary -O binary \ u-boot-img-spl-at-end.bin: u-boot.img spl/u-boot-spl.bin FORCE $(call if_changed,pad_cat) -# Create a new ELF from a raw binary file. This is useful for arm64 -# where static relocation needs to be performed on the raw binary, -# but certain simulators only accept an ELF file (but don't do the -# relocation). -# FIXME refactor dts/Makefile to share target/arch detection +# Create a new ELF from a raw binary file. +ifndef PLATFORM_ELFENTRY + PLATFORM_ELFENTRY = "_start" +endif +quiet_cmd_u-boot-elf ?= LD $@ + cmd_u-boot-elf ?= $(LD) u-boot-elf.o -o $@ \ + --defsym=$(PLATFORM_ELFENTRY)=$(CONFIG_SYS_TEXT_BASE) \ + -Ttext=$(CONFIG_SYS_TEXT_BASE) u-boot.elf: u-boot.bin - @$(OBJCOPY) -B aarch64 -I binary -O elf64-littleaarch64 \ - $< u-boot-elf.o - @$(LD) u-boot-elf.o -o $@ \ - --defsym=_start=$(CONFIG_SYS_TEXT_BASE) \ - -Ttext=$(CONFIG_SYS_TEXT_BASE) + $(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o + $(call if_changed,u-boot-elf) # Rule to link u-boot # May be overridden by arch/$(ARCH)/config.mk