| OLD | NEW |
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging | 5 import logging |
| 6 | 6 |
| 7 import models | 7 import models |
| 8 | 8 |
| 9 # About linker maps: | 9 # About linker maps: |
| 10 # * "Discarded input sections" include symbols merged with other symbols | 10 # * "Discarded input sections" include symbols merged with other symbols |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 line = next(self._lines) | 154 line = next(self._lines) |
| 155 # These bytes are already accounted for. | 155 # These bytes are already accounted for. |
| 156 if name == '** common': | 156 if name == '** common': |
| 157 continue | 157 continue |
| 158 address = int(address_str[2:], 16) | 158 address = int(address_str[2:], 16) |
| 159 size = int(size_str[2:], 16) | 159 size = int(size_str[2:], 16) |
| 160 path = None | 160 path = None |
| 161 sym = models.Symbol(section_name, size, address=address, | 161 sym = models.Symbol(section_name, size, address=address, |
| 162 full_name=name, object_path=path) | 162 full_name=name, object_path=path) |
| 163 syms.append(sym) | 163 syms.append(sym) |
| 164 if merge_symbol_start_address > 0: |
| 165 merge_symbol_start_address += size |
| 164 else: | 166 else: |
| 165 # A normal symbol entry. | 167 # A normal symbol entry. |
| 166 subsection_name, address_str, size_str, path = ( | 168 subsection_name, address_str, size_str, path = ( |
| 167 self._ParsePossiblyWrappedParts(line, 4)) | 169 self._ParsePossiblyWrappedParts(line, 4)) |
| 168 size = int(size_str[2:], 16) | 170 size = int(size_str[2:], 16) |
| 169 assert subsection_name.startswith(section_name), ( | 171 assert subsection_name.startswith(section_name), ( |
| 170 'subsection name was: ' + subsection_name) | 172 'subsection name was: ' + subsection_name) |
| 171 mangled_name = subsection_name[prefix_len:] | 173 mangled_name = subsection_name[prefix_len:] |
| 172 name = None | 174 name = None |
| 173 address_str2 = None | 175 address_str2 = None |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 address=section_end_address, | 237 address=section_end_address, |
| 236 full_name=( | 238 full_name=( |
| 237 '** symbol gap %d (end of section)' % symbol_gap_count)) | 239 '** symbol gap %d (end of section)' % symbol_gap_count)) |
| 238 syms.append(sym) | 240 syms.append(sym) |
| 239 logging.debug('Symbol count for %s: %d', section_name, | 241 logging.debug('Symbol count for %s: %d', section_name, |
| 240 len(syms) - sym_count_at_start) | 242 len(syms) - sym_count_at_start) |
| 241 except: | 243 except: |
| 242 logging.error('Problem line: %r', line) | 244 logging.error('Problem line: %r', line) |
| 243 logging.error('In section: %r', section_name) | 245 logging.error('In section: %r', section_name) |
| 244 raise | 246 raise |
| OLD | NEW |