aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Forissier <jerome.forissier@linaro.org>2018-06-20 09:43:33 +0200
committerJérôme Forissier <jerome.forissier@linaro.org>2018-06-20 11:06:45 +0200
commitb48154273bf197b8389a5bb71816ee9693aa56dc (patch)
tree6bed4964903bad74b2a785d17fe01ca228fc82ba
parentafefa2ccd2023d5bd4c7b5116f0f4358ca94bb4d (diff)
scripts/symbolize.py: ignore undefined symbols
With the introduction of dynamically linked TAs, symbolize.py may encounter undefined (external) symbols when it parses the output of the nm command looking for a symbol's address. The current code is not prepared for that and will raise an exception. Fix the issue by ignoring lines that have an unexpected format. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
-rwxr-xr-xscripts/symbolize.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/symbolize.py b/scripts/symbolize.py
index bbdd9b2a..abed7ba6 100755
--- a/scripts/symbolize.py
+++ b/scripts/symbolize.py
@@ -200,8 +200,12 @@ class Symbolizer(object):
addr, size, _, name = line.split()
except:
# Size is missing
- addr, _, name = line.split()
- size = '0'
+ try:
+ addr, _, name = line.split()
+ size = '0'
+ except:
+ # E.g., undefined (external) symbols (line = "U symbol")
+ continue
iaddr = int(addr, 16)
isize = int(size, 16)
if iaddr == ireladdr: