DWARF calculate the number of indexed addresses.
authorMark Wielaard <mark@klomp.org>
Tue, 15 May 2018 08:34:29 +0000 (08:34 +0000)
committerMark Wielaard <mark@gcc.gnu.org>
Tue, 15 May 2018 08:34:29 +0000 (08:34 +0000)
commit01ec978cec1f5c790a4881acef1dfc824ab67f26
tree7d20c11e108ec76106ab8a2dc22906511d9a6d0a
parenta8c80d03d4e0fab9cf4edb7bd5acb7edafd2438c
DWARF calculate the number of indexed addresses.

The length in the .debug_addr unit header was calculated using the number
of elements in the addr_index_table. This is wrong because the entries in
the table are refcounted and only those with a refcount > 0 are actually
put in the index. Add a helper function count_index_addrs to get the
correct number of addresses in the index.

gcc/ChangeLog:

* dwarf2out.c (count_index_addrs): New function.
(dwarf2out_finish): Use count_index_addrs to calculate addrs_length.

From-SVN: r260251
gcc/ChangeLog
gcc/dwarf2out.c