]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
DWARF-5: Ignore empty range in DWARF-5 line number tables
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 24 Jan 2021 15:00:34 +0000 (07:00 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 24 Jan 2021 15:07:26 +0000 (07:07 -0800)
The DWARF5 spec does indeed explicitly say: "A bounded range entry whose
beginning and ending address offsets are equal (including zero) indicates
an empty range and may be ignored."

Since arange_add already ignores empty ranges, remove the whole check
which is equivalent to the check plus explicit continue.

PR binutils/27231
* dwarf2.c (read_rnglists): Ignore empty range when parsing line
number tables.

(cherry picked from commit 940d0202fd472b09d370fb483bf5a8ae99c9c830)

bfd/ChangeLog
bfd/dwarf2.c

index 32deed3fbb2dfb4ad75e2bfd0f4d8151f8f145ae..6a2e70291d4630edb82343f2a8aa4a2fdfeec2ee 100644 (file)
@@ -1,3 +1,9 @@
+2021-01-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/27231
+       * dwarf2.c (read_rnglists): Ignore empty range when parsing line
+       number tables.
+
 2021-01-23  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR binutils/27231
index 1682be5a225ed4a1945b9674f159de7e21126b43..767e97311996bb44d2e0646ba2be8a8ecbab105c 100644 (file)
@@ -3276,9 +3276,6 @@ read_rnglists (struct comp_unit *unit, struct arange *arange,
          return FALSE;
        }
 
-      if ((low_pc == 0 && high_pc == 0) || low_pc == high_pc)
-       return FALSE;
-
       if (!arange_add (unit, arange, low_pc, high_pc))
        return FALSE;
     }