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

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