diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-01-28 04:21:15 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-01-28 04:21:31 -0800 |
commit | 0318cca4934fc5d85e83351842985ad2a3475146 (patch) | |
tree | 943eef8b6298ce3260f8b6fe2098c8477be71302 /gold/dwarf_reader.cc | |
parent | 47918cca26dac0c38196148ce09e0936c70c1bf5 (diff) | |
download | fsf-binutils-gdb-0318cca4934fc5d85e83351842985ad2a3475146.zip fsf-binutils-gdb-0318cca4934fc5d85e83351842985ad2a3475146.tar.gz fsf-binutils-gdb-0318cca4934fc5d85e83351842985ad2a3475146.tar.bz2 |
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.
Diffstat (limited to 'gold/dwarf_reader.cc')
-rw-r--r-- | gold/dwarf_reader.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc index 4873769..f0e6b89 100644 --- a/gold/dwarf_reader.cc +++ b/gold/dwarf_reader.cc @@ -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 |