diff options
author | Simon Glass <sjg@chromium.org> | 2017-11-13 18:54:54 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-12-12 19:53:45 -0700 |
commit | b50e5611a6b5dff4bc2ae47d332ba0d046e2a782 (patch) | |
tree | ec72ed0ab95983e04c4d4697d3af70aac64ff33b /tools/binman/ftest.py | |
parent | cf71338ee7a1dc16f13a4f1b89f32c624210df45 (diff) |
binman: Add a function to read ELF symbols
In some cases we need to read symbols from U-Boot. At present we have a
a few cases which does this via 'nm' and 'grep'.
It is better to use objdump since that tells us the size of the symbols
and also whether it is weak or not.
Add a new module which reads ELF information from files. Update existing
uses of 'nm' to use this module.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r-- | tools/binman/ftest.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 9083143894..c8155788af 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -835,6 +835,13 @@ class TestFunctional(unittest.TestCase): data = self._DoReadFile('47_spl_bss_pad.dts') self.assertEqual(U_BOOT_SPL_DATA + (chr(0) * 10) + U_BOOT_DATA, data) + with open(self.TestFile('u_boot_ucode_ptr')) as fd: + TestFunctional._MakeInputFile('spl/u-boot-spl', fd.read()) + with self.assertRaises(ValueError) as e: + data = self._DoReadFile('47_spl_bss_pad.dts') + self.assertIn('Expected __bss_size symbol in spl/u-boot-spl', + str(e.exception)) + def testPackStart16Spl(self): """Test that an image with an x86 start16 region can be created""" data = self._DoReadFile('48_x86-start16-spl.dts') |