[U-Boot] [PATCH v2 06/47] Allow objcopy to work without filling gaps with 0xff
Simon Glass
sjg at chromium.org
Fri Jul 31 17:31:23 CEST 2015
This is currently done for all targets, since 0xff is the default erased
value for most flash devices. In some cases this is not what we want (e.g.
for EFI images) so provide a command to do a vanilla objcopy.
Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
---
Changes in v2: None
Makefile | 8 +++++++-
config.mk | 2 --
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 394ed09..2a3119e 100644
--- a/Makefile
+++ b/Makefile
@@ -776,8 +776,14 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
endif
+# Normally we fill empty space with 0xff
quiet_cmd_objcopy = OBJCOPY $@
-cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
+cmd_objcopy = $(OBJCOPY) --gap-fill=0xff $(OBJCOPYFLAGS) \
+ $(OBJCOPYFLAGS_$(@F)) $< $@
+
+# Provide a version which does not do this, for use by EFI
+quiet_cmd_zobjcopy = OBJCOPY $@
+cmd_zobjcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
quiet_cmd_mkimage = MKIMAGE $@
cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
diff --git a/config.mk b/config.mk
index 6282919..b77d589 100644
--- a/config.mk
+++ b/config.mk
@@ -73,8 +73,6 @@ endif
RELFLAGS := $(PLATFORM_RELFLAGS)
-OBJCOPYFLAGS += --gap-fill=0xff
-
PLATFORM_CPPFLAGS += $(RELFLAGS)
PLATFORM_CPPFLAGS += -pipe
--
2.5.0.rc2.392.g76e840b
More information about the U-Boot
mailing list