Fix the linker's handling of DWARF-5 line number tables.
authorMark Wielaard <mark@klomp.org>
Tue, 25 Aug 2020 14:33:00 +0000 (15:33 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 25 Aug 2020 14:33:00 +0000 (15:33 +0100)
commitc3757b583d2448a5996e83e374fb96ac7938da35
treed4bb1bd641b824dea293b0e2052c9b3788b5bbf0
parentb04aa1fc8c9d4a79e6293a3a1df7507052afedf3
Fix the linker's handling of DWARF-5 line number tables.

When building with gcc with -gdwarf-5 ld tests (including ld-elf/dwarf.exp)
fail because they try to read the .debug_ranges section. But DWARF5
introduces a new .debug_rnglists section that encodes the address ranges
more efficiently. Implement reading the debug_rnglists in bfd/dwarf2.c.
Which makes all tests pass again and fixes several gcc testsuite tests
when defaulting to DWARF5.

*  dwarf2.c (struct dwarf2_debug_file): Add dwarf_rnglists_buffer
and dwarf_rnglists_size fields.
(dwarf_debug_sections): Add debug_rnglists.
(dwarf_debug_section_enum): Likewise.
(read_debug_rnglists): New function.
(read_rangelist): New function to call either read_ranges or
read_rnglists. Rename original function to...
(read_ranges): ...this.
(read_rnglists): New function.
bfd/ChangeLog
bfd/dwarf2.c