Blame SOURCES/binutils-objcopy-version-note.patch

8c00d6
--- binutils.orig/binutils/objcopy.c	2019-08-06 09:42:51.065854915 +0100
8c00d6
+++ binutils-2.30/binutils/objcopy.c	2019-08-06 09:47:36.293974283 +0100
8c00d6
@@ -2161,12 +2161,10 @@ merge_gnu_build_notes (bfd * abfd, asect
8c00d6
   attribute_type_byte = version_1_seen ? 1 : 3;
8c00d6
   val_start = attribute_type_byte + 1;
8c00d6
 
8c00d6
-  /* The first note should be the first version note.  */
8c00d6
-  if (pnotes[0].note.namedata[attribute_type_byte] != GNU_BUILD_ATTRIBUTE_VERSION)
8c00d6
-    {
8c00d6
-      err = _("bad GNU build attribute notes: first note not version note");
8c00d6
-      goto done;
8c00d6
-    }
8c00d6
+  /* We used to require that the first note be a version note,
8c00d6
+     but this is no longer enforced.  Due to the problems with
8c00d6
+     linking sections with the same name (eg .gnu.build.note.hot)
8c00d6
+     we cannot guarantee that the first note will be a version note.  */
8c00d6
 
8c00d6
   /* Now merge the notes.  The rules are:
8c00d6
      1. Preserve the ordering of the notes.
8c00d6
@@ -2184,7 +2182,7 @@ merge_gnu_build_notes (bfd * abfd, asect
8c00d6
 	description field of the note must be changed to contain the starting
8c00d6
 	address to which it refers.
8c00d6
      6. Notes with the same start and end address can be deleted.  */
8c00d6
-  for (pnote = pnotes + 1; pnote < pnotes_end; pnote ++)
8c00d6
+  for (pnote = pnotes; pnote < pnotes_end; pnote ++)
8c00d6
     {
8c00d6
       int                      note_type;
8c00d6
       objcopy_internal_note *  back;