symbolize.py: ignore error if ELF file is not found
When processing the memory map of a TA, it can happen that the ELF file
for a region is not found. One typical reason is a missing -d argument
on the command line (can easily happen when a TA uses shared libraries
for instance).
In the above case, the script crashes with no clear indication about
the cause. This commit fixes the crash by ignoring ELFs that are not
found. This is consistent with the general behavior of symbolize.py,
which is to always print out all the information it is fed and simply
augment it with debug information when possible.
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
diff --git a/scripts/symbolize.py b/scripts/symbolize.py
index 0eea9d7..a00962e 100755
--- a/scripts/symbolize.py
+++ b/scripts/symbolize.py
@@ -311,6 +311,8 @@
if elf_name in self._sections:
return
elf = self.get_elf(elf_name)
+ if not elf:
+ return
cmd = self.arch_prefix('objdump', elf)
if not elf or not cmd:
return