13ae24
--- binutils.orig/gas/write.c	2018-07-06 11:49:29.149532896 +0100
13ae24
+++ binutils-2.30/gas/write.c	2018-07-06 11:49:37.550441810 +0100
13ae24
@@ -1963,7 +1963,7 @@ maybe_generate_build_notes (void)
13ae24
     if (sym->bsym != NULL
13ae24
 	&& sym->bsym->flags & BSF_SECTION_SYM
13ae24
 	&& sym->bsym->section != NULL
13ae24
-	/* Skip linkonce sections - we cannot these section symbols as they may disappear.  */
13ae24
+	/* Skip linkonce sections - we cannot use these section symbols as they may disappear.  */
13ae24
 	&& (sym->bsym->section->flags & (SEC_CODE | SEC_LINK_ONCE)) == SEC_CODE
13ae24
 	/* Not all linkonce sections are flagged...  */
13ae24
 	&& strncmp (S_GET_NAME (sym), ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) != 0)
13ae24
@@ -1993,10 +1993,10 @@ maybe_generate_build_notes (void)
13ae24
 	memcpy (note + 12, "GA$?3a1", 8);
13ae24
 
13ae24
 	/* Create a relocation to install the start address of the note...  */
13ae24
-	create_note_reloc (sec, sym, 20, desc_reloc, 0, note);
13ae24
+	create_note_reloc (sec, sym, total_size + 20, desc_reloc, 0, note);
13ae24
 
13ae24
 	/* ...and another one to install the end address.  */
13ae24
-	create_note_reloc (sec, sym, desc2_offset, desc_reloc,
13ae24
+	create_note_reloc (sec, sym, total_size + desc2_offset, desc_reloc,
13ae24
 			   bfd_get_section_size (sym->bsym->section),
13ae24
 			   note);
13ae24