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

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