coreboot-kgpe-d16/util/cbfstool
Sol Boucher 057256541b cbfstool: Fix ability to add files at offsets near the end of empty spaces
Because cbfs_add_entry_at() previously *assumed* it would have to create a
trailing empty entry, it was impossible to add files at exact offsets close
enough to the end of an existing empty entry that they occupied the remainder
of its space. This addresses the problem by skipping the step of creating the
trailing empty entry if doing so would place it at the start offset of whatever
already followed the original empty section.

BUG=chromium:473511
TEST=Run the following commands:
$ ./cbfstool test.image create -s 0x100000 -m arm
$ dd if=/dev/zero of=twok.bin bs=1 count=2048
$ ./cbfstool test.image add -t 0x50 -f twok.bin -n at_end -b 0xff7c0
$ ./cbfstool test.image add -t 0x50 -f twok.bin -n near_end -b 0xfef80
$ ./cbfstool test.image print
There shouldn't be any assertions, and the output should be:
test.image: 1024 kB, bootblocksize 0, romsize 1048576, offset 0x40
alignment: 64 bytes, architecture: arm

Name                           Offset     Type         Size
(empty)                        0x40       null         1044184
near_end                       0xfef40    raw          2048
at_end                         0xff780    raw          2048
BRANCH=None

Change-Id: Ic8a6c3dfa4f82346a067c0804afb6c5a5e89e6c8
Signed-off-by: Sol Boucher <solb@chromium.org>
Original-Commit-Id: 1bbd353fddc818f725e488e8f2fb6e967033539d
Original-Change-Id: I15d25df80787a8e34c2237262681720203509c72
Original-Signed-off-by: Sol Boucher <solb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/263809
Original-Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Original-Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/9938
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-04-25 12:16:57 +02:00
..
lzma cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
EXAMPLE cbfstool: Update example file. 2013-02-04 11:12:15 +01:00
Makefile cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
Makefile.inc cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
cbfs-mkpayload.c cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
cbfs-mkstage.c cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
cbfs-payload-linux.c cbfstool:linux_trampoline: config CS and DS segment descriptors 2014-09-04 23:34:32 +02:00
cbfs.h cbfstool: add filetypes for FSP, MRC, SPC and MRC_CACHE 2015-03-30 21:45:11 +02:00
cbfs_image.c cbfstool: Fix ability to add files at offsets near the end of empty spaces 2015-04-25 12:16:57 +02:00
cbfs_image.h cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
cbfstool.c cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
coff.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
common.c cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
common.h cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
compress.c cbfstool: Propogate compression errors back to the caller. 2014-09-25 20:26:04 +02:00
elf.h cbfstool: Add relocation codes for arm mode 2015-03-17 16:53:50 +01:00
elfheaders.c cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
elfparsing.h cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
fit.c cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
fit.h cbfstool: Add update-fit command 2013-03-27 01:25:12 +01:00
fv.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
linux.h cbfstool:linux_trampoline: config CS and DS segment descriptors 2014-09-04 23:34:32 +02:00
linux_trampoline.c cbfstool:linux_trampoline: config CS and DS segment descriptors 2014-09-04 23:34:32 +02:00
linux_trampoline.h cbfstool:linux_trampoline: config CS and DS segment descriptors 2014-09-04 23:34:32 +02:00
rmodtool.c util: add rmodtool for parsing ELF files to rmodules 2014-03-20 21:34:39 +01:00
rmodule.c cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
rmodule.h util: add rmodtool for parsing ELF files to rmodules 2014-03-20 21:34:39 +01:00
swab.h Various fixes to cbfstool. 2011-10-24 20:29:29 +02:00
xdr.c cbfstool: add bputs() to store a byte stream to a buffer 2014-03-11 19:43:17 +01:00