2e9b04
--- binutils.orig/binutils/objcopy.c	2021-02-18 11:35:48.062479490 +0000
2e9b04
+++ binutils-2.30/binutils/objcopy.c	2021-02-18 11:36:52.207071148 +0000
2e9b04
@@ -2224,6 +2224,11 @@ merge_gnu_build_notes (bfd *          ab
2e9b04
 	  goto done;
2e9b04
 	}
2e9b04
 
2e9b04
+      if (start > end)
2e9b04
+	/* This can happen with PPC64LE binaries where empty notes are
2e9b04
+	   encoded as start = end + 4.  */
2e9b04
+	start = end;
2e9b04
+
2e9b04
       if (is_open_note (pnote))
2e9b04
 	{
2e9b04
 	  if (start)
2e9b04
--- binutils.orig/binutils/objcopy.c	2021-02-22 10:44:20.107263089 +0000
2e9b04
+++ binutils-2.35.1/binutils/objcopy.c	2021-02-22 16:07:12.134344229 +0000
2e9b04
@@ -2243,23 +2243,8 @@ merge_gnu_build_notes (bfd *          ab
2e9b04
 	  break;
2e9b04
 
2e9b04
 	case 8:
2e9b04
-	  if (! is_64bit (abfd))
2e9b04
-	    {
2e9b04
-	      start = bfd_get_32 (abfd, pnote->note.descdata);
2e9b04
-	      end = bfd_get_32 (abfd, pnote->note.descdata + 4);
2e9b04
-	    }
2e9b04
-	  else
2e9b04
-	    {
2e9b04
-	      start = bfd_get_64 (abfd, pnote->note.descdata);
2e9b04
-	      /* FIXME: For version 1 and 2 notes we should try to
2e9b04
-		 calculate the end address by finding a symbol whose
2e9b04
-		 value is START, and then adding in its size.
2e9b04
-
2e9b04
-		 For now though, since v1 and v2 was not intended to
2e9b04
-		 handle gaps, we chose an artificially large end
2e9b04
-		 address.  */
2e9b04
-	      end = (bfd_vma) -1;
2e9b04
-	    }
2e9b04
+	  start = bfd_get_32 (abfd, pnote->note.descdata);
2e9b04
+	  end = bfd_get_32 (abfd, pnote->note.descdata + 4);
2e9b04
 	  break;
2e9b04
 
2e9b04
 	case 16: