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

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