public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] Fix: readelf: loc_offset XX too big
Date: Wed, 19 Apr 2023 10:49:05 +0000 (GMT)	[thread overview]
Message-ID: <20230419104905.2FB953858002@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=28ab94f51dcdee056d96e57ad04c27c22cf854ea

commit 28ab94f51dcdee056d96e57ad04c27c22cf854ea
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Apr 19 11:48:24 2023 +0100

    Fix: readelf: loc_offset XX too big
    
      PR 30355
      * dwarf.c (read_and_display_attr_value): Correctly handle DW_loclistx attributes that index a version 5 .debug_loclists section.

Diff:
---
 binutils/ChangeLog | 9 ++++++++-
 binutils/dwarf.c   | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index f705b6c4622..22ca79cfb96 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,8 +1,15 @@
+2023-04-19  Nick Clifton  <nickc@redhat.com>
+
+	PR 30355
+	* dwarf.c (read_and_display_attr_value): Correctly handle
+	DW_loclistx attributes that index a version 5 .debug_loclists
+	section.
+
 2023-04-17  Nick Clifton  <nickc@redhat.com>
 
 	PR 30142
 	* rescoff.c (write_coff_file): Add the SEC_READONLY flag to the
-	.rsrc section. 
+	.rsrc section.
 
 2023-04-11  Nick Clifton  <nickc@redhat.com>
 
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 86893c59dc7..1001a11db40 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -2725,7 +2725,7 @@ read_and_display_attr_value (unsigned long attribute,
 		  if (idx != (uint64_t) -1)
 		    idx += (offset_size == 8) ? 20 : 12;
 		}
-	      else if (debug_info_p == NULL)
+	      else if (debug_info_p == NULL || dwarf_version > 4)
 		{
 		  idx = fetch_indexed_value (uvalue, loclists, 0);
 		}

                 reply	other threads:[~2023-04-19 10:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230419104905.2FB953858002@sourceware.org \
    --to=nickc@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    /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).