diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-02-13 20:16:30 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-02-13 20:25:14 +0100 |
commit | 7eb1636c7067a15446f2313d3bf5092fcca94908 (patch) | |
tree | a14f32f9578a9abfe2cda4ffb1c4d2056bbc2219 | |
parent | e83de66f3f85f5a53474e85f01ce066ec7f31f5a (diff) | |
download | barebox-7eb1636c7067a15446f2313d3bf5092fcca94908.tar.gz barebox-7eb1636c7067a15446f2313d3bf5092fcca94908.tar.xz |
Revert "images: Drop unnecessary fix_size"
This reverts commit 5c0e16591d9471a345b77a41fde76de34f301f6b.
The fix_size scripts is not necessary for newer ARM toolchains,
it is however necessary for the older ARM toolchains (gcc-5 and older).
The original reason to drop fix_size was that it doesn't work on MIPS.
With this patch we add the -i flag so that we ignore unknown images
and can succesfully build MIPS images.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/lib/pbl.lds.S | 2 | ||||
-rw-r--r-- | images/Makefile | 3 | ||||
-rw-r--r-- | scripts/fix_size.c | 7 |
3 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/lib/pbl.lds.S b/arch/arm/lib/pbl.lds.S index e7a94f912e..53c9ce0fe6 100644 --- a/arch/arm/lib/pbl.lds.S +++ b/arch/arm/lib/pbl.lds.S @@ -95,6 +95,6 @@ SECTIONS .image_end : { *(.__image_end) } - _barebox_image_size = __piggydata_end - BASE; + _barebox_image_size = __image_end - BASE; _barebox_pbl_size = __bss_start - BASE; } diff --git a/images/Makefile b/images/Makefile index eeea172d63..4e82dc92ee 100644 --- a/images/Makefile +++ b/images/Makefile @@ -44,7 +44,8 @@ quiet_cmd_objcopy_bin = OBJCOPYB $@ cmd_objcopy_bin = \ - $(OBJCOPY) -O binary $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ + $(OBJCOPY) -O binary $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ && \ + $(objtree)/scripts/fix_size -i -f $@ pbl-lds := $(obj)/pbl.lds extra-y += $(pbl-lds) diff --git a/scripts/fix_size.c b/scripts/fix_size.c index 7014a3faf6..cb074e3cbc 100644 --- a/scripts/fix_size.c +++ b/scripts/fix_size.c @@ -68,11 +68,12 @@ int main(int argc, char**argv) } if (strcmp(magic, "barebox")) { - fprintf(stderr, "invalid magic\n"); - if (ignore_unknown) + if (ignore_unknown) { ret = 0; - else + } else { + fprintf(stderr, "invalid magic\n"); ret = 1; + } goto err; } |