]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - binutils/ChangeLog
objdump: don't add an extra entry to syms array
authorAlan Modra <amodra@gmail.com>
Sun, 14 Feb 2021 06:10:01 +0000 (16:40 +1030)
committerAlan Modra <amodra@gmail.com>
Sun, 14 Feb 2021 12:24:12 +0000 (22:54 +1030)
commit1944212b426d2e13cc4bb24aa1a850bbc572e624
tree2eeb87749918f031c33dc4a8a64c2a3f5e077e6e
parent0d0a0d86c841a95226d9cc7c247c770c38fdc81b
objdump: don't add an extra entry to syms array

Space for a NULL is there in every backend bfd_get_symtab_upper_bound
or bfd_get_dynamic_symtab_upper_bound when the symbol count is non-zero,
and placed as a terminator by bfd_canonicalize_symtab.  Many backends
even return a single NULL entry array for zero symbol count, and while
there are a few that return a NULL array for no symbols, that case is
handled fine in objdump.  So don't have objdump add yet another NULL
entry.

* objdump.c (slurp_symtab): Don't add an extra entry for NULL
to the symbol array.
(slurp_dynamic_symtab): Likewise.
(dump_bfd): Formatting.  Copy terminating NULL from extra_syms.
binutils/ChangeLog
binutils/objdump.c