From: H.J. Lu Date: Thu, 28 Jan 2021 12:21:15 +0000 (-0800) Subject: gold: Skip address size and segment selector for DWARF5 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0318cca4934fc5d85e83351842985ad2a3475146;p=binutils-gdb.git 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. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 64f7b78a00b..5180c02f260 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2021-01-28 H.J. Lu + + PR gold/27246 + * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog): + Skip address size and segment selector for DWARF5. + 2021-01-19 Alan Modra PR 27203 diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc index 487376965db..f0e6b89bde2 100644 --- a/gold/dwarf_reader.cc +++ b/gold/dwarf_reader.cc @@ -1658,6 +1658,10 @@ Sized_dwarf_line_info::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