diff options
author | Nick Clifton <nickc@redhat.com> | 2017-03-29 12:27:44 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2017-03-29 12:27:44 +0100 |
commit | e643cb45bf85fa5c8c49a89ff177de246af4212e (patch) | |
tree | 7502fe7dfb9df55c6101f35cd641c008b9ec4510 /bfd/dwarf2.c | |
parent | 7cc0cd2903612a0730de6ba00181b9016e77ea3d (diff) | |
download | fsf-binutils-gdb-e643cb45bf85fa5c8c49a89ff177de246af4212e.zip fsf-binutils-gdb-e643cb45bf85fa5c8c49a89ff177de246af4212e.tar.gz fsf-binutils-gdb-e643cb45bf85fa5c8c49a89ff177de246af4212e.tar.bz2 |
Improve the speed of scanning PE binaries for line number information.
PR binutils/18025
* coff-bfd.h (struct coff_section_data): Add new fields:
saved_bias and bias.
* coffgen.c (coff_find_nearest_line_with_names): Cache the bias
computed for PE binaries.
* dwarf2.c (scan_unit_for_symbols): Only warn once about each
missing abbrev.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r-- | bfd/dwarf2.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 722ee0d..132a674 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -2738,12 +2738,19 @@ scan_unit_for_symbols (struct comp_unit *unit) continue; } - abbrev = lookup_abbrev (abbrev_number,unit->abbrevs); + abbrev = lookup_abbrev (abbrev_number, unit->abbrevs); if (! abbrev) { - _bfd_error_handler - (_("Dwarf Error: Could not find abbrev number %u."), - abbrev_number); + static unsigned int previous_failed_abbrev = -1U; + + /* Avoid multiple reports of the same missing abbrev. */ + if (abbrev_number != previous_failed_abbrev) + { + _bfd_error_handler + (_("Dwarf Error: Could not find abbrev number %u."), + abbrev_number); + previous_failed_abbrev = abbrev_number; + } bfd_set_error (bfd_error_bad_value); goto fail; } @@ -2760,7 +2767,7 @@ scan_unit_for_symbols (struct comp_unit *unit) func->tag = abbrev->tag; func->prev_func = unit->function_table; unit->function_table = func; - unit->number_of_functions++; + unit->number_of_functions++; BFD_ASSERT (!unit->cached); if (func->tag == DW_TAG_inlined_subroutine) @@ -2785,7 +2792,8 @@ scan_unit_for_symbols (struct comp_unit *unit) var->stack = 1; var->prev_var = unit->variable_table; unit->variable_table = var; - BFD_ASSERT (!unit->cached); + /* PR 18205: Missing debug information can cause this + var to be attached to an already cached unit. */ } /* No inline function in scope at this nesting level. */ |