From c5c55ee47e6064d11e9cce9807c5632dad79afeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20=C3=98ye=20Amundsen?= Date: Mon, 12 Apr 2021 09:08:31 +0200 Subject: [PATCH] scripts: size_report: fix bug where key is used as a dict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When printing the unassigned values the 'sym' variable is used as a dict from which we try to get the 'name' value. However, 'symbols['unassigned']' gives a list of keys, so we get an 'TypeError' when trying to access ['name'] of a string (the key). Fix this issue by iterating over the values from the 'symbols['unassigned']' dict instead. Signed-off-by: Håkon Øye Amundsen --- scripts/footprint/size_report | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/footprint/size_report b/scripts/footprint/size_report index c24f8a666e8..670c38d9db1 100755 --- a/scripts/footprint/size_report +++ b/scripts/footprint/size_report @@ -601,7 +601,7 @@ def main(): symbols = get_symbols(elf, addr_ranges) - for sym in symbols['unassigned']: + for sym in symbols['unassigned'].values(): print("WARN: Symbol '{0}' is not in RAM or ROM".format(sym['name'])) symbol_dict = None