gold: Skip address size and segment selector for DWARF5

The .debug_line secton in DWARF5 has a byte for address size and a byte
for segment selector after DWARF version.  Skip them for DWARF5.

	PR gold/27246
	* dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog):
	Skip address size and segment selector for DWARF5.

(cherry picked from commit 0318cca493)
This commit is contained in:
H.J. Lu 2021-01-28 04:21:15 -08:00
parent 5e7a8f40bd
commit 69caaa81ae
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2021-01-28 H.J. Lu <hongjiu.lu@intel.com>
PR gold/27246
* dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog):
Skip address size and segment selector for DWARF5.
2021-01-24 Nick Clifton <nickc@redhat.com>
This is the 2.36 release.

View File

@ -1658,6 +1658,10 @@ Sized_dwarf_line_info<size, big_endian>::read_header_prolog(
header_.version = elfcpp::Swap_unaligned<16, big_endian>::readval(lineptr);
lineptr += 2;
// Skip address size and segment selector for DWARF5.
if (header_.version >= 5)
lineptr += 2;
if (header_.offset_size == 4)
header_.prologue_length = elfcpp::Swap_unaligned<32, big_endian>::readval(lineptr);
else