This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Commit: Fix note generation relocs
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Fri, 06 Jul 2018 11:46:02 +0100
- Subject: Commit: Fix note generation relocs
Hi Guys,
I am applying the patch below to the mainline and 2.31 branch.
It fixes a bug with the new note generation code, which had
forgotten to bias the offsets for the relocs by the number of
notes already generated.
Cheers
Nick
gas/ChangeLog
2018-07-06 Nick Clifton <nickc@redhat.com>
* write.c (maybe_generate_build_notes): Bias reloc offsets by the
number of notes already generated.
diff --git a/gas/write.c b/gas/write.c
index 39c894a8e6..1c0ee38f56 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -2038,10 +2038,10 @@ maybe_generate_build_notes (void)
memcpy (note + 12, "GA$^A3a1", 8);
/* Create a relocation to install the start address of the note... */
- create_note_reloc (sec, sym, 20, desc_reloc, 0, note);
+ create_note_reloc (sec, sym, total_size + 20, desc_reloc, 0, note);
/* ...and another one to install the end address. */
- create_note_reloc (sec, sym, desc2_offset, desc_reloc,
+ create_note_reloc (sec, sym, total_size + desc2_offset, desc_reloc,
bfd_get_section_size (sym->bsym->section),
note);