mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 14:10:43 +00:00
binman: Allow zero-length entries to overlap
Some binary blobs unfortunately obtain their position in the image from other binary blobs, such as Intel's 'descriptor'. In this case we cannot rely on packing to work. It is not possible to produce a valid image in any case, due to the missing blobs. Allow zero-length overlaps so that this does not cause any problems. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
2f5c3a4d1d
commit
8200d8871a
3 changed files with 23 additions and 1 deletions
|
@ -226,7 +226,7 @@ class Entry_section(Entry):
|
|||
"at %#x (%d)" %
|
||||
(entry.offset, entry.offset, self._skip_at_start,
|
||||
self._skip_at_start))
|
||||
if entry.offset < offset:
|
||||
if entry.offset < offset and entry.size:
|
||||
entry.Raise("Offset %#x (%d) overlaps with previous entry '%s' "
|
||||
"ending at %#x (%d)" %
|
||||
(entry.offset, entry.offset, prev_name, offset, offset))
|
||||
|
|
|
@ -3421,6 +3421,10 @@ class TestFunctional(unittest.TestCase):
|
|||
err = stderr.getvalue()
|
||||
self.assertRegex(err, "Image 'main-section'.*missing.*: intel-ifwi")
|
||||
|
||||
def testPackOverlap(self):
|
||||
"""Test that zero-size overlapping regions are ignored"""
|
||||
self._DoTestFile('160_pack_overlap_zero.dts')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
18
tools/binman/test/160_pack_overlap_zero.dts
Normal file
18
tools/binman/test/160_pack_overlap_zero.dts
Normal file
|
@ -0,0 +1,18 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
binman {
|
||||
u-boot {
|
||||
};
|
||||
|
||||
fill {
|
||||
size = <0>;
|
||||
offset = <3>;
|
||||
};
|
||||
};
|
||||
};
|
Loading…
Reference in a new issue