Fix the generation of relocations for assembler created notes.

This commit is contained in:
Nick Clifton 2018-07-06 11:54:35 +01:00
parent 9cd6949c58
commit 33b2466cb6
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,24 @@
--- binutils.orig/gas/write.c 2018-07-06 11:49:29.149532896 +0100
+++ binutils-2.30/gas/write.c 2018-07-06 11:49:37.550441810 +0100
@@ -1963,7 +1963,7 @@ maybe_generate_build_notes (void)
if (sym->bsym != NULL
&& sym->bsym->flags & BSF_SECTION_SYM
&& 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
/* Not all linkonce sections are flagged... */
&& strncmp (S_GET_NAME (sym), ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) != 0)
@@ -1993,10 +1993,10 @@ maybe_generate_build_notes (void)
memcpy (note + 12, "GA$3a1", 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);

View File

@ -69,7 +69,7 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.30
Release: 25%{?dist}
Release: 26%{?dist}
License: GPLv3+
URL: https://sourceware.org/binutils
@ -292,6 +292,10 @@ Patch37: binutils-fix-testsuite-failures.patch
# Lifetime: Fixed in 2.31.
Patch38: binutils-PowerPC-IEEE-long-double-warnings.patch
# Purpose: Fix the generation of relocations for assembler generated notes.
# Lifetime: Fixed in 2.31.
Patch39: binutils-missing-notes.patch
#----------------------------------------------------------------------------
Provides: bundled(libiberty)
@ -454,6 +458,7 @@ using libelf instead of BFD.
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
@ -861,6 +866,9 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Fri Jul 6 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2.30-26
- Fix the generation of relocations for assembler created notes.
* Wed Jul 4 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2.30-25
- Minor spec cleanups and fixes