
Hi Alper,
On Tue, 25 Aug 2020 at 12:01, Alper Nebi Yasak alpernebiyasak@gmail.com wrote:
Other relevant properties (pad-after, offset, size, align, align-size, align-end) already work since Pack() sets correct ranges for subentries' data (.offset, .size variables), but some padding here is necessary to align the data within this range to match the pad-before property.
Signed-off-by: Alper Nebi Yasak alpernebiyasak@gmail.com
tools/binman/etype/section.py | 2 +- tools/binman/ftest.py | 8 +++++++ tools/binman/test/165_pad_in_sections.dts | 26 +++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tools/binman/test/165_pad_in_sections.dts
diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index c5166a5b57..72600b1ef3 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -152,7 +152,7 @@ class Entry_section(Entry): for entry in self._entries.values(): data = entry.GetData() base = self.pad_before + (entry.offset or 0) - self._skip_at_start
pad = base - len(section_data)
pad = base - len(section_data) + (entry.pad_before or 0) if pad > 0: section_data += tools.GetBytes(self._pad_byte, pad) section_data += data
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 5f650b5f94..8edf85c89f 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -1269,6 +1269,14 @@ class TestFunctional(unittest.TestCase): U_BOOT_DATA + tools.GetBytes(ord('&'), 4)) self.assertEqual(expected, data)
- def testPadInSections(self):
Can you put this test last please? I'd like to keep the tests in rough order of .dts test files.
REgards, Simon