Skip to content

Commit cba42e2

Browse files
committed
[ot] python/qemu: ot.eflash.gen: fix a bug when storing an ELF file
When an ELF file is used to store an app in the flash image, and not binary physical file exists, the binary data is automatically generated but no match should be attempted between the ELF metadata and the generated binary content. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
1 parent 3fca6e4 commit cba42e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/qemu/ot/eflash/gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def store_rom_ext(self, bank: int, dfp: BinaryIO,
301301
elif elfpath and not no_header:
302302
self._log.warning('Discarding ELF as input binary file is invalid')
303303
elfpath = None
304-
if elfpath and not no_header:
304+
if elfpath and isfile(dfp.name) and not no_header:
305305
elftime = stat(elfpath).st_mtime
306306
bintime = stat(dfp.name).st_mtime
307307
if bintime < elftime:

0 commit comments

Comments
 (0)