Commit c80d3fdd authored by Nick Clifton's avatar Nick Clifton
Browse files

Fix bug generating relocations for notes created by the assembler.

	* write.c (maybe_generate_build_notes): Bias reloc offsets by the
	number of notes already generated.
parent 0b2e4394
2018-07-06 Nick Clifton <nickc@redhat.com>
* write.c (maybe_generate_build_notes): Bias reloc offsets by the
number of notes already generated.
2018-07-05 Nick Clifton <nickc@redhat.com> 2018-07-05 Nick Clifton <nickc@redhat.com>
* po/ru.po: Updated Russian translation. * po/ru.po: Updated Russian translation.
......
...@@ -2008,7 +2008,7 @@ maybe_generate_build_notes (void) ...@@ -2008,7 +2008,7 @@ maybe_generate_build_notes (void)
if (sym->bsym != NULL if (sym->bsym != NULL
&& sym->bsym->flags & BSF_SECTION_SYM && sym->bsym->flags & BSF_SECTION_SYM
&& sym->bsym->section != NULL && sym->bsym->section != NULL
/* Skip linkonce sections - we cannot these section symbols as they may disappear. */ /* Skip linkonce sections - we cannot use these section symbols as they may disappear. */
&& (sym->bsym->section->flags & (SEC_CODE | SEC_LINK_ONCE)) == SEC_CODE && (sym->bsym->section->flags & (SEC_CODE | SEC_LINK_ONCE)) == SEC_CODE
/* Not all linkonce sections are flagged... */ /* Not all linkonce sections are flagged... */
&& strncmp (S_GET_NAME (sym), ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) != 0) && strncmp (S_GET_NAME (sym), ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) != 0)
...@@ -2038,10 +2038,10 @@ maybe_generate_build_notes (void) ...@@ -2038,10 +2038,10 @@ maybe_generate_build_notes (void)
memcpy (note + 12, "GA$3a1", 8); memcpy (note + 12, "GA$3a1", 8);
/* Create a relocation to install the start address of the note... */ /* 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. */ /* ...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), bfd_get_section_size (sym->bsym->section),
note); note);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment