qsort: dwarf2.c
authorAlan Modra <amodra@gmail.com>
Mon, 14 Oct 2019 03:22:32 +0000 (13:52 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 14 Oct 2019 06:17:13 +0000 (16:47 +1030)
commit8025b0554c5a2e2fe56b769fd556fe13268b4879
treeed6b83bb9aa8e9e9c6eee67992c87e92b2a78ad2
parent3a3f4bf76a4790e81ee186ea76731a7f67dba1c8
qsort: dwarf2.c

This patch ensures qsort stability in line and function sorting done
in dwarf2.c.  For the line sequences we make use of an existing field
that isn't used until later, as a monotonic counter for the qsort.

* dwarf2.c (struct lookup_funcinfo): Add idx field.
(compare_lookup_funcinfos): Perform final sort on idx.
(build_lookup_funcinfo_table): Set idx.
(compare_sequences): Perform final sort on num_lines.
(build_line_info_table): Set num_lines and line_info_lookup earlier.
(sort_line_sequences): Set num_lines for sort.
bfd/ChangeLog
bfd/dwarf2.c