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