Fix N^2 behavior in _bfd_dwarf2_find_symbol_bias
authorTom Tromey <tromey@adacore.com>
Thu, 15 Aug 2019 13:33:20 +0000 (07:33 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 19 Aug 2019 14:46:21 +0000 (08:46 -0600)
commit3eb185c97d8170b3f3a2b5edab4fbbd56f53f6f7
tree3d8534031d90c39c7fbae258959d25d3caf8288a
parentd292364e95fc9c8230b678d9026f285850074c02
Fix N^2 behavior in _bfd_dwarf2_find_symbol_bias

A customer reported a case where addr2line was very slow.  We tracked
this down to some N^2 behavior in _bfd_dwarf2_find_symbol_bias in the
unusual case where no function can be found.

This patch fixes the bug, and reduces the runtime for a particular
request from 127 seconds to 1 second.

bfd/ChangeLog
2019-08-19  Tom Tromey  <tromey@adacore.com>

* dwarf2.c (_bfd_dwarf2_find_symbol_bias): Create hash table
holding symbols.
bfd/ChangeLog
bfd/dwarf2.c