summaryrefslogtreecommitdiff
path: root/tools/binman/bsection.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/binman/bsection.py')
-rw-r--r--tools/binman/bsection.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/tools/binman/bsection.py b/tools/binman/bsection.py
index 4bf206878dc..52ac31a4672 100644
--- a/tools/binman/bsection.py
+++ b/tools/binman/bsection.py
@@ -253,10 +253,26 @@ class Section(object):
for entry in entries:
self._entries[entry._node.name] = entry
+ def _ExpandEntries(self):
+ """Expand any entries that are permitted to"""
+ exp_entry = None
+ for entry in self._entries.values():
+ if exp_entry:
+ exp_entry.ExpandToLimit(entry.offset)
+ exp_entry = None
+ if entry.expand_size:
+ exp_entry = entry
+ if exp_entry:
+ exp_entry.ExpandToLimit(self._size)
+
def CheckEntries(self):
- """Check that entries do not overlap or extend outside the section"""
+ """Check that entries do not overlap or extend outside the section
+
+ This also sorts entries, if needed and expands
+ """
if self._sort:
self._SortEntries()
+ self._ExpandEntries()
offset = 0
prev_name = 'None'
for entry in self._entries.values():
@@ -419,3 +435,7 @@ class Section(object):
return None
return entry.data
source_entry.Raise("Cannot find entry for node '%s'" % node.name)
+
+ def ExpandSize(self, size):
+ if size != self._size:
+ self._size = size