Allow objcopy to work without filling gaps with 0xff
authorSimon Glass <sjg@chromium.org>
Fri, 31 Jul 2015 15:31:23 +0000 (09:31 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 5 Aug 2015 14:42:40 +0000 (08:42 -0600)
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@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Makefile
config.mk

index 7ccd614e1c297c0fb4d34aeccfd1173699d4e222..1b03357507efa136a3c7520a76683c8f0f5c43ed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -780,8 +780,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 $< $@ \
index 6282919482bc8b8cc7c879e44e3814858573fa9a..b77d58903c8148db98b6b204c8d2b314397fd5a6 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -73,8 +73,6 @@ endif
 
 RELFLAGS := $(PLATFORM_RELFLAGS)
 
-OBJCOPYFLAGS += --gap-fill=0xff
-
 PLATFORM_CPPFLAGS += $(RELFLAGS)
 PLATFORM_CPPFLAGS += -pipe