aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-01-23 18:17:37 -0800
committerH.J. Lu <hjl.tools@gmail.com>2021-01-23 18:23:08 -0800
commit0da7136ac1a83080996247551286019066fbd0e3 (patch)
treeedbbc1fb4055c7ba14948ff96a64718f23a5f556
parentAutomatic date update in version.in (diff)
downloadbinutils-gdb-0da7136ac1a83080996247551286019066fbd0e3.tar.gz
binutils-gdb-0da7136ac1a83080996247551286019066fbd0e3.tar.bz2
binutils-gdb-0da7136ac1a83080996247551286019066fbd0e3.zip
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 <mark@klomp.org> 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. (cherry picked from commit 18454c151f5824564130ba626bd90e9de30444ef)
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/dwarf2.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4c629d4be6..32deed3fbb 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/27231
+ * dwarf2.c (read_rnglists): Advance rngs_ptr after
+ _bfd_safe_read_leb128 when parsing DW_RLE_offset_pair.
+
2021-01-01 Alan Modra <amodra@gmail.com>
Apply from master
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 977bf43a6a..1682be5a22 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -3252,9 +3252,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: