mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-18 14:48:17 +01:00
binman: Prevent entries in a section from overlapping
Currently, if the "offset" property is given for an entry, the section's running offset is completely ignored. This causes entries to overlap if the provided offset is less than the size of the entries earlier in the section. Avoid the overlap by only using the provided offset when it is greater than the running offset. The motivation for this change is the rule used by SPL to find U-Boot on sunxi boards: U-Boot starts 32 KiB after the start of SPL, unless SPL is larger than 32 KiB, in which case U-Boot immediately follows SPL. Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
parent
002be6806f
commit
841fdd8cb6
@ -465,6 +465,8 @@ class Entry(object):
|
|||||||
if self.offset_unset:
|
if self.offset_unset:
|
||||||
self.Raise('No offset set with offset-unset: should another '
|
self.Raise('No offset set with offset-unset: should another '
|
||||||
'entry provide this correct offset?')
|
'entry provide this correct offset?')
|
||||||
|
elif self.offset > offset:
|
||||||
|
offset = self.offset
|
||||||
self.offset = tools.align(offset, self.align)
|
self.offset = tools.align(offset, self.align)
|
||||||
needed = self.pad_before + self.contents_size + self.pad_after
|
needed = self.pad_before + self.contents_size + self.pad_after
|
||||||
needed = tools.align(needed, self.align_size)
|
needed = tools.align(needed, self.align_size)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user