summaryrefslogtreecommitdiff
path: root/tools/binman/elf_test.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-18 07:24:01 -0600
committerSimon Glass <sjg@chromium.org>2023-07-20 14:10:58 -0600
commite1ad57e7ef6e17fb6f55bf70fff61bfd93703b78 (patch)
treedc1b6d25358b3b217d2d9bc970482dc128e4c9bf /tools/binman/elf_test.py
parent073fc36c17cfa283e8aff3aec522a9614e915542 (diff)
binman: Correct handling of zero bss size
Fix the check for the __bss_size symbol, since it may be 0. Unfortunately there was no test coverage for this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/elf_test.py')
-rw-r--r--tools/binman/elf_test.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py
index 2fb3f6f28ff..cc95b424b33 100644
--- a/tools/binman/elf_test.py
+++ b/tools/binman/elf_test.py
@@ -371,6 +371,11 @@ class TestElf(unittest.TestCase):
elf.GetSymbolOffset(fname, 'embed')
self.assertIn('__image_copy_start', str(e.exception))
+ def test_get_symbol_address(self):
+ fname = self.ElfTestFile('embed_data')
+ addr = elf.GetSymbolAddress(fname, 'region_size')
+ self.assertEqual(0, addr)
+
if __name__ == '__main__':
unittest.main()