Blame SOURCES/binutils-ppc64le-note-merge.patch

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