| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 merge_size = address - merge_symbol_start_address | 211 merge_size = address - merge_symbol_start_address |
| 212 merge_symbol_start_address = 0 | 212 merge_symbol_start_address = 0 |
| 213 if merge_size > 0: | 213 if merge_size > 0: |
| 214 # merge_size == 0 for the initial symbol generally. | 214 # merge_size == 0 for the initial symbol generally. |
| 215 logging.debug('Merge symbol of size %d found at:\n %r', | 215 logging.debug('Merge symbol of size %d found at:\n %r', |
| 216 merge_size, syms[-1]) | 216 merge_size, syms[-1]) |
| 217 # Set size=0 so that it will show up as padding. | 217 # Set size=0 so that it will show up as padding. |
| 218 sym = models.Symbol( | 218 sym = models.Symbol( |
| 219 section_name, 0, | 219 section_name, 0, |
| 220 address=address, | 220 address=address, |
| 221 name='** symbol gap %d' % symbol_gap_count, | 221 name='** symbol gap %d' % symbol_gap_count) |
| 222 object_path=path) | |
| 223 symbol_gap_count += 1 | 222 symbol_gap_count += 1 |
| 224 syms.append(sym) | 223 syms.append(sym) |
| 225 | 224 |
| 226 sym = models.Symbol(section_name, size, address=address, | 225 sym = models.Symbol(section_name, size, address=address, |
| 227 name=name or mangled_name, object_path=path) | 226 name=name or mangled_name, object_path=path) |
| 228 syms.append(sym) | 227 syms.append(sym) |
| 229 section_end_address = section_address + section_size | 228 section_end_address = section_address + section_size |
| 230 if section_name != '.bss' and ( | 229 if section_name != '.bss' and ( |
| 231 syms[-1].end_address < section_end_address): | 230 syms[-1].end_address < section_end_address): |
| 232 # Set size=0 so that it will show up as padding. | 231 # Set size=0 so that it will show up as padding. |
| 233 sym = models.Symbol( | 232 sym = models.Symbol( |
| 234 section_name, 0, | 233 section_name, 0, |
| 235 address=section_end_address, | 234 address=section_end_address, |
| 236 name='** symbol gap %d (end of section)' % symbol_gap_count) | 235 name='** symbol gap %d (end of section)' % symbol_gap_count) |
| 237 syms.append(sym) | 236 syms.append(sym) |
| 238 logging.debug('Symbol count for %s: %d', section_name, | 237 logging.debug('Symbol count for %s: %d', section_name, |
| 239 len(syms) - sym_count_at_start) | 238 len(syms) - sym_count_at_start) |
| 240 except: | 239 except: |
| 241 logging.error('Problem line: %r', line) | 240 logging.error('Problem line: %r', line) |
| 242 logging.error('In section: %r', section_name) | 241 logging.error('In section: %r', section_name) |
| 243 raise | 242 raise |
| OLD | NEW |