summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Edwards <cfsworks@gmail.com>2025-03-15 15:18:06 -0700
committerTom Rini <trini@konsulko.com>2025-04-02 14:33:50 -0600
commit86838a1ddc8a0e5b5f548a5051e5e68f90fb6660 (patch)
treea3c4267b47e68341567a33207d81790da2dd5aaa
parent8c39dc549b0de155c02a2b39f01dae19775f41a5 (diff)
makefile: Avoid objcopy --gap-fill for .hex/.srec
This flag only makes sense for `binary` output, because .hex/.srec are sparse formats and represent gaps without filler. While the GNU binutils version of objcopy does not seem to mind the extra flag being passed, llvm-objcopy considers this a fatal error. There is already a version of the objcopy command template in the Makefile that doesn't use --gap-fill, which is provided for EFI. So use this other version for all .hex/.srec outputs as well. Signed-off-by: Sam Edwards <CFSworks@gmail.com> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r--Makefile10
1 files changed, 5 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 0694c425438..9c353af17cd 100644
--- a/Makefile
+++ b/Makefile
@@ -1067,7 +1067,7 @@ quiet_cmd_objcopy = OBJCOPY $@
cmd_objcopy = $(OBJCOPY) --gap-fill=0xff $(OBJCOPYFLAGS) \
$(OBJCOPYFLAGS_$(@F)) $< $@
-# Provide a version which does not do this, for use by EFI
+# Provide a version which does not do this, for use by EFI and hex/srec
quiet_cmd_zobjcopy = OBJCOPY $@
cmd_zobjcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
@@ -1282,7 +1282,7 @@ OBJCOPYFLAGS_u-boot.hex := -O ihex
OBJCOPYFLAGS_u-boot.srec := -O srec
u-boot.hex u-boot.srec: u-boot FORCE
- $(call if_changed,objcopy)
+ $(call if_changed,zobjcopy)
OBJCOPYFLAGS_u-boot-elf.srec := $(OBJCOPYFLAGS_u-boot.srec)
@@ -1296,12 +1296,12 @@ OBJCOPYFLAGS_u-boot-elf.srec += --change-addresses=0x50000000
endif
u-boot-elf.srec: u-boot.elf FORCE
- $(call if_changed,objcopy)
+ $(call if_changed,zobjcopy)
OBJCOPYFLAGS_u-boot-spl.srec = $(OBJCOPYFLAGS_u-boot.srec)
spl/u-boot-spl.srec: spl/u-boot-spl FORCE
- $(call if_changed,objcopy)
+ $(call if_changed,zobjcopy)
%.scif: %.srec
$(Q)$(MAKE) $(build)=arch/arm/mach-renesas $@
@@ -1436,7 +1436,7 @@ OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex
OBJCOPYFLAGS_u-boot.ldr.srec := -I binary -O srec
u-boot.ldr.hex u-boot.ldr.srec: u-boot.ldr FORCE
- $(call if_changed,objcopy)
+ $(call if_changed,zobjcopy)
ifdef CONFIG_SPL_LOAD_FIT
MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \