From 9ce19c7e831838c455f29ba5780f25986232ac52 Mon Sep 17 00:00:00 2001 From: valeros Date: Fri, 4 Oct 2019 10:52:55 +0300 Subject: [PATCH] Skip debug sections when calculating sizedata --- platformio/builder/tools/piosize.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platformio/builder/tools/piosize.py b/platformio/builder/tools/piosize.py index 7bb538c5..814e7c42 100644 --- a/platformio/builder/tools/piosize.py +++ b/platformio/builder/tools/piosize.py @@ -33,6 +33,8 @@ def _get_file_location(env, elf_path, addr, sysenv): def _determine_section(sections, symbol_addr): for section, info in sections.items(): + if not _is_flash_section(info) and not _is_ram_section(info): + continue if symbol_addr in range(info["start_addr"], info["start_addr"] + info["size"]): return section return "unknown" @@ -55,7 +57,7 @@ def _is_ram_section(section): def _is_flash_section(section): - return section.get("type") == "SHT_PROGBITS" and "A" in section.get("flags") + return section.get("type", "") == "SHT_PROGBITS" and "A" in section.get("flags", "") def _is_valid_symbol(symbol_name, symbol_type, symbol_address):