From 18454c151f5824564130ba626bd90e9de30444ef Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 23 Jan 2021 18:17:37 -0800 Subject: [PATCH] DWARF-5: Fix parsing DWARF-5 line number tables Advance rngs_ptr when parsing DW_RLE_offset_pair, which was missing in commit c3757b583d2448a5996e83e374fb96ac7938da35 Author: Mark Wielaard Date: Tue Aug 25 15:33:00 2020 +0100 Fix the linker's handling of DWARF-5 line number tables. PR binutils/27231 * dwarf2.c (read_rnglists): Advance rngs_ptr after _bfd_safe_read_leb128 when parsing DW_RLE_offset_pair. --- bfd/ChangeLog | 6 ++++++ bfd/dwarf2.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a5e2304bd94..9d23a8a0836 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2021-01-23 H.J. Lu + + PR binutils/27231 + * dwarf2.c (read_rnglists): Advance rngs_ptr after + _bfd_safe_read_leb128 when parsing DW_RLE_offset_pair. + 2021-01-20 Alan Modra * elf32-ppc.c: Delete outdated comment. diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index d1770ae4fdb..292d60c33d4 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -3265,9 +3265,11 @@ read_rnglists (struct comp_unit *unit, struct arange *arange, low_pc = base_address; low_pc += _bfd_safe_read_leb128 (abfd, rngs_ptr, &bytes_read, FALSE, rngs_end); + rngs_ptr += bytes_read; high_pc = base_address; high_pc += _bfd_safe_read_leb128 (abfd, rngs_ptr, &bytes_read, FALSE, rngs_end); + rngs_ptr += bytes_read; break; case DW_RLE_start_end: -- 2.30.2