public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: binutils@sourceware.org
Subject: Commit: Remove support for old v1&v2 GNU build notes
Date: Wed, 24 Feb 2021 10:07:30 +0000	[thread overview]
Message-ID: <87blc93hjx.fsf@redhat.com> (raw)

Hi Guys,

  I am applying the patch below to remove support for the old v1 and v2
  style GNU build notes.  These notes are no longer used and supporting
  them was causing a few problems when processing 32-bit binaries.

Cheers
  Nick

binutils/ChangeLog
2021-02-24  Nick Clifton  <nickc@redhat.com>

	* objcopy.c (merge_gnu_build_notes): Remove support for v1/v2 GNU
	build notes.
	* readelf.c (print_gnu_build_attribute_description): Likewise.

diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 90ae0bd46b..041aceaeef 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -2246,23 +2246,8 @@ merge_gnu_build_notes (bfd *          abfd,
 	  break;
 
 	case 8:
-	  if (! is_64bit (abfd))
-	    {
-	      start = bfd_get_32 (abfd, pnote->note.descdata);
-	      end = bfd_get_32 (abfd, pnote->note.descdata + 4);
-	    }
-	  else
-	    {
-	      start = bfd_get_64 (abfd, pnote->note.descdata);
-	      /* FIXME: For version 1 and 2 notes we should try to
-		 calculate the end address by finding a symbol whose
-		 value is START, and then adding in its size.
-
-		 For now though, since v1 and v2 was not intended to
-		 handle gaps, we chose an artificially large end
-		 address.  */
-	      end = (bfd_vma) -1;
-	    }
+	  start = bfd_get_32 (abfd, pnote->note.descdata);
+	  end = bfd_get_32 (abfd, pnote->note.descdata + 4);
 	  break;
 
 	case 16:
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 9510a8d1ad..811c529986 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -19907,17 +19907,8 @@ print_gnu_build_attribute_description (Elf_Internal_Note *  pnote,
       break;
 
     case 8:
-      if (is_32bit_elf)
-	{
-	  /* FIXME: We should check that version 3+ notes are being used here...  */
-	  start = byte_get ((unsigned char *) pnote->descdata, 4);
-	  end = byte_get ((unsigned char *) pnote->descdata + 4, 4);
-	}
-      else
-	{
-	  start = byte_get ((unsigned char *) pnote->descdata, 8);
-	  end = 0;
-	}
+      start = byte_get ((unsigned char *) pnote->descdata, 4);
+      end = byte_get ((unsigned char *) pnote->descdata + 4, 4);
       break;
 
     case 16:


                 reply	other threads:[~2021-02-24 10:07 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=87blc93hjx.fsf@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@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).