summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2015-07-31 09:31:23 -0600
committerSimon Glass <[email protected]>2015-08-05 08:42:40 -0600
commite020c88a3cd7018112af18a7d3f73fca8a3beb1e (patch)
treed13154c05a6cd6663fc6dd28b2b715a27cdae597
parent5efa28139cac60683387415df479f6413988aa65 (diff)
Allow objcopy to work without filling gaps with 0xff
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
-rw-r--r--Makefile8
-rw-r--r--config.mk2
2 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 7ccd614e1c2..1b03357507e 100644
--- 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 $< $@ \
diff --git a/config.mk b/config.mk
index 6282919482b..b77d58903c8 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