diff options
author | Simon Glass <sjg@chromium.org> | 2019-04-25 21:58:39 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2019-05-08 12:44:07 +0800 |
commit | 9481c80f55260fa2b2c37445fb2a30811b136ed3 (patch) | |
tree | 7ac1d0265c52f660145b4d628ff887fbd374a157 /tools/binman/ftest.py | |
parent | 0b96f6ecbe8f68232adeb4340883aaeee5d63bd5 (diff) |
binman: Allow sections to have an offset
At present sections are always placed automatically. Even if an 'offset'
property is provided it is ignored. Update the logic to support an offset
for sections.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r-- | tools/binman/ftest.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 75658c9a366..daea1ea1382 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -1783,6 +1783,24 @@ class TestFunctional(unittest.TestCase): data = self._DoReadFile('100_intel_refcode.dts') self.assertEqual(REFCODE_DATA, data[:len(REFCODE_DATA)]) + def testSectionOffset(self): + """Tests use of a section with an offset""" + data, _, map_data, _ = self._DoReadFileDtb('101_sections_offset.dts', + map=True) + self.assertEqual('''ImagePos Offset Size Name +00000000 00000000 00000038 main-section +00000004 00000004 00000010 section@0 +00000004 00000000 00000004 u-boot +00000018 00000018 00000010 section@1 +00000018 00000000 00000004 u-boot +0000002c 0000002c 00000004 section@2 +0000002c 00000000 00000004 u-boot +''', map_data) + self.assertEqual(data, + 4 * chr(0x26) + U_BOOT_DATA + 12 * chr(0x21) + + 4 * chr(0x26) + U_BOOT_DATA + 12 * chr(0x61) + + 4 * chr(0x26) + U_BOOT_DATA + 8 * chr(0x26)) + if __name__ == "__main__": unittest.main() |