public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Alan Modra <amodra@gmail.com>
Cc: Binutils <binutils@sourceware.org>,
	Mark Wielaard <mark@klomp.org>,  Nick Clifton <nickc@redhat.com>
Subject: [PATCH] DWARF-5: Ignore empty range in DWARF-5 line number tables
Date: Sun, 24 Jan 2021 06:11:11 -0800	[thread overview]
Message-ID: <CAMe9rOoqWybHS3T-F7tzzquv5iBrE1dr=Ee7wK11mGgnre10hg@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOpxdo2xRQ6NBajDxTE7h0Su1LOikrxS-KAwf=KJ61oidA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1058 bytes --]

On Sun, Jan 24, 2021 at 3:58 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Sat, Jan 23, 2021 at 8:16 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Sat, Jan 23, 2021 at 5:34 PM Alan Modra <amodra@gmail.com> wrote:
> > >
> > > On Sat, Jan 23, 2021 at 03:29:35PM -0800, H.J. Lu wrote:
> > > > 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.
> > >
> > > OK everywhere.
> > >
> >
> > This patch is also needed to skip empty ranges in DWARF-5 line
> > number tables generated by GCC 11.
> >
> > OK for master?
>
> Here is the real patch.  OK for master and 2.36/2.35 branches?
>

Here is the patch I am checking in.

-- 
H.J.

[-- Attachment #2: 0001-DWARF-5-Ignore-empty-range-in-DWARF-5-line-number-ta.patch --]
[-- Type: text/x-patch, Size: 1093 bytes --]

From b9c5c7f2a7b82dae504c0ffc9a00d82162ec4ba2 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Sat, 23 Jan 2021 20:09:38 -0800
Subject: [PATCH] DWARF-5: Ignore empty range in DWARF-5 line number tables

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
should be equivalent to the check plus explicit continue.

	PR binutils/27231
	* dwarf2.c (read_rnglists): Ignore empty range when parsing line
	number tables.
---
 bfd/dwarf2.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 292d60c33d4..240138d5982 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -3289,9 +3289,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;
     }
-- 
2.29.2


  reply	other threads:[~2021-01-24 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-23 23:29 [PATCH] dwarf5: Fix parsing " H.J. Lu
2021-01-23 23:29 ` H.J. Lu
2021-01-24  1:34   ` Alan Modra
2021-01-24  4:16     ` [PATCH] DWARF-5: Skip empty range in " H.J. Lu
2021-01-24 11:58       ` H.J. Lu
2021-01-24 14:11         ` H.J. Lu [this message]
2021-01-23 23:40 ` [PATCH] dwarf5: Fix parsing " Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMe9rOoqWybHS3T-F7tzzquv5iBrE1dr=Ee7wK11mGgnre10hg@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=mark@klomp.org \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).