| Index: tools/binary_size/libsupersize/linker_map_parser.py
|
| diff --git a/tools/binary_size/libsupersize/linker_map_parser.py b/tools/binary_size/libsupersize/linker_map_parser.py
|
| index 5c6eca40740c49c91c3196cbabcea0f191da0659..759be4a172c31087553223fe528455c0bcef3d63 100644
|
| --- a/tools/binary_size/libsupersize/linker_map_parser.py
|
| +++ b/tools/binary_size/libsupersize/linker_map_parser.py
|
| @@ -13,6 +13,7 @@ class MapFileParser(object):
|
| # https://github.com/gittup/binutils/blob/HEAD/gold/mapfile.cc
|
|
|
| def __init__(self):
|
| + self._common_symbols = []
|
| self._symbols = []
|
| self._section_sizes = {}
|
| self._lines = None
|
| @@ -28,8 +29,8 @@ class MapFileParser(object):
|
| """
|
| self._lines = iter(lines)
|
| logging.info('Parsing common symbols')
|
| - self._ParseCommonSymbols()
|
| - logging.debug('.bss common entries: %d', len(self._symbols))
|
| + self._common_symbols = self._ParseCommonSymbols()
|
| + logging.debug('.bss common entries: %d', len(self._common_symbols))
|
| logging.info('Parsing section symbols')
|
| self._ParseSections()
|
| return self._section_sizes, self._symbols
|
| @@ -56,6 +57,7 @@ class MapFileParser(object):
|
| # ff_cos_131072 0x40000 obj/third_party/<snip>
|
| # ff_cos_131072_fixed
|
| # 0x20000 obj/third_party/<snip>
|
| + ret = []
|
| self._SkipToLineWithPrefix('Common symbol')
|
| next(self._lines) # Skip past blank line
|
|
|
| @@ -65,9 +67,9 @@ class MapFileParser(object):
|
| if not parts:
|
| break
|
| name, size_str, path = parts
|
| - self._symbols.append(
|
| - models.Symbol('.bss', int(size_str[2:], 16), name=name,
|
| - object_path=path))
|
| + ret.append(models.Symbol('.bss', int(size_str[2:], 16), name=name,
|
| + object_path=path))
|
| + return ret
|
|
|
| def _ParseSections(self):
|
| # .text 0x0028c600 0x22d3468
|
| @@ -113,6 +115,8 @@ class MapFileParser(object):
|
| if (section_name in ('.bss', '.rodata', '.text') or
|
| section_name.startswith('.data')):
|
| logging.info('Parsing %s', section_name)
|
| + if section_name == '.bss':
|
| + syms.extend(self._common_symbols)
|
| prefix_len = len(section_name) + 1 # + 1 for the trailing .
|
| merge_symbol_start_address = 0
|
| sym_count_at_start = len(syms)
|
|
|