This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Commit: Fix note generation relocs
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 6 Jul 2018 05:20:05 -0700
- Subject: Re: Commit: Fix note generation relocs
- References: <878t6o3amt.fsf@redhat.com>
On Fri, Jul 6, 2018 at 3:46 AM, Nick Clifton <nickc@redhat.com> wrote:
> 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);
>
>
A testcase?
--
H.J.