Re: Move nm.c cached line number info to bfd usrdata
authorAlan Modra <amodra@gmail.com>
Tue, 7 Mar 2023 22:49:38 +0000 (09:19 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 8 Mar 2023 00:54:55 +0000 (11:24 +1030)
commit160f20077865425a5874ed327540ab0bf33fb0d1
tree93ed7fe4f476be5978cf0b82058c642b804f1283
parentd64c8f7181fd21f90983f8d55369f6f9a2960c43
Re: Move nm.c cached line number info to bfd usrdata

Commit e3f450f3933d resulted in a nm -l segfault on object files
without undefined symbols.  Fix that, and be paranoid about bfd
section count changing.

* nm.c (struct lineno_cache): Add seccount.
(free_lineno_cache): Don't segfault on NULL lc->relocs.
(print_symbol): Stash section count when creating arrays.
binutils/nm.c