binman: Respect pad-before property of section subentries

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>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Alper Nebi Yasak
2020-08-31 12:58:19 +03:00
committed by Simon Glass
parent 8001d0b162
commit 3fdeb14d95
3 changed files with 35 additions and 1 deletions

View File

@@ -3483,5 +3483,13 @@ class TestFunctional(unittest.TestCase):
expected = (U_BOOT_DATA + U_BOOT_DATA)
self.assertEqual(expected, data)
def testPadInSections(self):
"""Test pad-before, pad-after for entries in sections"""
data = self._DoReadFile('166_pad_in_sections.dts')
expected = (U_BOOT_DATA + tools.GetBytes(ord('!'), 12) +
U_BOOT_DATA + tools.GetBytes(ord('!'), 6) +
U_BOOT_DATA)
self.assertEqual(expected, data)
if __name__ == "__main__":
unittest.main()