del os.environ['MAKEFLAGS']
tools.Run('make', '-C', target_dir, '-f',
os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir,
- 'bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr')
+ 'bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr',
+ 'u_boot_binman_syms', 'u_boot_binman_syms.bin')
class TestElf(unittest.TestCase):
"""Test a symbol which extends outside the entry area is detected"""
entry = FakeEntry(10)
section = FakeSection()
- elf_fname = os.path.join(binman_dir, 'test', 'u_boot_binman_syms')
+ elf_fname = self.ElfTestFile('u_boot_binman_syms')
with self.assertRaises(ValueError) as e:
syms = elf.LookupAndWriteSymbols(elf_fname, entry, section)
self.assertIn('entry_path has offset 4 (size 8) but the contents size '
"""
entry = FakeEntry(20)
section = FakeSection(sym_value=None)
- elf_fname = os.path.join(binman_dir, 'test', 'u_boot_binman_syms')
+ elf_fname = self.ElfTestFile('u_boot_binman_syms')
syms = elf.LookupAndWriteSymbols(elf_fname, entry, section)
self.assertEqual(tools.GetBytes(255, 16) + tools.GetBytes(ord('a'), 4),
entry.data)
tout.Init(tout.DEBUG)
entry = FakeEntry(20)
section = FakeSection()
- elf_fname = os.path.join(binman_dir, 'test', 'u_boot_binman_syms')
+ elf_fname = self.ElfTestFile('u_boot_binman_syms')
with test_util.capture_sys_output() as (stdout, stderr):
syms = elf.LookupAndWriteSymbols(elf_fname, entry, section)
self.assertTrue(len(stdout.getvalue()) > 0)
Filename of ELF file to use as SPL
"""
# TODO(sjg@chromium.org): Drop this when all Elf files use ElfTestFile()
- if src_fname in ['bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr']:
+ if src_fname in ['bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr',
+ 'u_boot_binman_syms']:
fname = cls.ElfTestFile(src_fname)
else:
fname = cls.TestFile(src_fname)
def testSymbols(self):
"""Test binman can assign symbols embedded in U-Boot"""
- elf_fname = self.TestFile('u_boot_binman_syms')
+ elf_fname = self.ElfTestFile('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_offset'].address, addr)
self._SetupSplElf('u_boot_binman_syms')
data = self._DoReadFile('053_symbols.dts')
- sym_values = struct.pack('<LQL', 0x24 + 0, 0x24 + 24, 0x24 + 20)
+ sym_values = struct.pack('<LQL', 0, 24, 20)
expected = (sym_values + U_BOOT_SPL_DATA[16:] +
tools.GetBytes(0xff, 1) + U_BOOT_DATA + sym_values +
U_BOOT_SPL_DATA[16:])
#
VPATH := $(SRC)
-CFLAGS := -march=i386 -m32 -nostdlib -I ../../../include
+CFLAGS := -march=i386 -m32 -nostdlib -I $(SRC)../../../include \
+ -Wl,--no-dynamic-linker
LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds
-LDS_BINMAN := -T u_boot_binman_syms.lds
+LDS_BINMAN := -T $(SRC)u_boot_binman_syms.lds
LDS_BINMAN_BAD := -T u_boot_binman_syms_bad.lds
TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data \