def testRegexSymbols(self): fname = os.path.join(binman_dir, 'test', 'u_boot_ucode_ptr') syms = elf.GetSymbols(fname, ['ucode']) self.assertIn('.ucode', syms) syms = elf.GetSymbols(fname, ['missing']) self.assertNotIn('.ucode', syms) syms = elf.GetSymbols(fname, ['missing', 'ucode']) self.assertIn('.ucode', syms)
def testRegexSymbols(self): """Test that we can obtain from the ELF file by regular expression""" fname = os.path.join(binman_dir, 'test', 'u_boot_ucode_ptr') syms = elf.GetSymbols(fname, ['ucode']) self.assertIn('.ucode', syms) syms = elf.GetSymbols(fname, ['missing']) self.assertNotIn('.ucode', syms) syms = elf.GetSymbols(fname, ['missing', 'ucode']) self.assertIn('.ucode', syms)
def testRegexSymbols(self): """Test that we can obtain from the ELF file by regular expression""" fname = self.ElfTestFile('u_boot_ucode_ptr') syms = elf.GetSymbols(fname, ['ucode']) self.assertIn('.ucode', syms) syms = elf.GetSymbols(fname, ['missing']) self.assertNotIn('.ucode', syms) syms = elf.GetSymbols(fname, ['missing', 'ucode']) self.assertIn('.ucode', syms)
def testSymbols(self): """Test binman can assign symbols embedded in U-Boot""" elf_fname = self.TestFile('u_boot_binman_syms') syms = elf.GetSymbols(elf_fname, ['binman', 'image']) addr = elf.GetSymbolAddress(elf_fname, '__image_copy_start') self.assertEqual(syms['_binman_u_boot_spl_prop_pos'].address, addr) with open(self.TestFile('u_boot_binman_syms')) as fd: TestFunctional._MakeInputFile('spl/u-boot-spl', fd.read()) data = self._DoReadFile('53_symbols.dts') sym_values = struct.pack('<LQL', 0x24 + 0, 0x24 + 24, 0x24 + 20) expected = (sym_values + U_BOOT_SPL_DATA[16:] + chr(0xff) + U_BOOT_DATA + sym_values + U_BOOT_SPL_DATA[16:]) self.assertEqual(expected, data)
def testAllSymbols(self): fname = os.path.join(binman_dir, 'test', 'u_boot_ucode_ptr') syms = elf.GetSymbols(fname, []) self.assertIn('.ucode', syms)
def testAllSymbols(self): """Test that we can obtain a symbol from the ELF file""" fname = os.path.join(binman_dir, 'test', 'u_boot_ucode_ptr') syms = elf.GetSymbols(fname, []) self.assertIn('.ucode', syms)
def testAllSymbols(self): """Test that we can obtain a symbol from the ELF file""" fname = self.ElfTestFile('u_boot_ucode_ptr') syms = elf.GetSymbols(fname, []) self.assertIn('.ucode', syms)