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

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