summaryrefslogtreecommitdiff
path: root/tools/buildman/builder.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-07-11 19:04:11 -0600
committerTom Rini <trini@konsulko.com>2022-08-05 11:47:56 -0400
commitf2e6775cddd59f2edec0727da14c35a8c8d14716 (patch)
tree6d9c1faf879637a3a441e79fbc708e49ac511002 /tools/buildman/builder.py
parent811c8e17117880badf0ea218dda44c06a3e02a2e (diff)
downloadu-boot-f2e6775cddd59f2edec0727da14c35a8c8d14716.tar.gz
buildman: Allow lines without a symbol
The 'nm' tool can produce lines without a symbol, for example: 00000004 t Silently skip these and anything else without three fields. Drop the warning since there is nothing the user can do about it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/buildman/builder.py')
-rw-r--r--tools/buildman/builder.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 33f9373b8f..76252b9079 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -669,17 +669,15 @@ class Builder:
"""
sym = {}
for line in fd.readlines():
- try:
- if line.strip():
- size, type, name = line[:-1].split()
- except:
- tprint("Invalid line in file '%s': '%s'" % (fname, line[:-1]))
- continue
- if type in 'tTdDbB':
- # function names begin with '.' on 64-bit powerpc
- if '.' in name[1:]:
- name = 'static.' + name.split('.')[0]
- sym[name] = sym.get(name, 0) + int(size, 16)
+ line = line.strip()
+ parts = line.split()
+ if line and len(parts) == 3:
+ size, type, name = line.split()
+ if type in 'tTdDbB':
+ # function names begin with '.' on 64-bit powerpc
+ if '.' in name[1:]:
+ name = 'static.' + name.split('.')[0]
+ sym[name] = sym.get(name, 0) + int(size, 16)
return sym
def _ProcessConfig(self, fname):