diff --git a/SOURCES/binutils-s390x-prevent-GOT-rewrite.patch b/SOURCES/binutils-s390x-prevent-GOT-rewrite.patch new file mode 100644 index 0000000..db1d1bf --- /dev/null +++ b/SOURCES/binutils-s390x-prevent-GOT-rewrite.patch @@ -0,0 +1,43 @@ +--- binutils.orig/bfd/elf64-s390.c 2020-06-15 11:01:54.671940830 +0100 ++++ binutils-2.30/bfd/elf64-s390.c 2020-06-15 11:04:44.663343784 +0100 +@@ -2335,6 +2335,9 @@ elf_s390_relocate_section (bfd *output_b + && SYMBOL_REFERENCES_LOCAL (info, h)) + || resolved_to_zero) + { ++ Elf_Internal_Sym *isym; ++ asection *sym_sec; ++ + /* This is actually a static link, or it is a + -Bsymbolic link and the symbol is defined + locally, or the symbol was forced to be local +@@ -2356,6 +2359,10 @@ elf_s390_relocate_section (bfd *output_b + h->got.offset |= 1; + } + ++ /* When turning a GOT slot dereference into a direct ++ reference using larl we have to make sure that ++ the symbol is 1. properly aligned and 2. it is no ++ ABS symbol or will become one. */ + if ((h->def_regular + && bfd_link_pic (info) + && SYMBOL_REFERENCES_LOCAL (info, h)) +@@ -2370,8 +2377,17 @@ elf_s390_relocate_section (bfd *output_b + contents + rel->r_offset - 2) + & 0xff00f000) == 0xe300c000 + && bfd_get_8 (input_bfd, +- contents + rel->r_offset + 3) == 0x04))) +- ++ contents + rel->r_offset + 3) == 0x04)) ++ && (isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ input_bfd, r_symndx)) ++ && isym->st_shndx != SHN_ABS ++ && h != htab->elf.hdynamic ++ && h != htab->elf.hgot ++ && h != htab->elf.hplt ++ && !(isym->st_value & 1) ++ && (sym_sec = bfd_section_from_elf_index (input_bfd, ++ isym->st_shndx)) ++ && sym_sec->alignment_power) + { + unsigned short new_insn = + (0xc000 | (bfd_get_8 (input_bfd, diff --git a/SPECS/binutils.spec b/SPECS/binutils.spec index e1f4307..7402368 100644 --- a/SPECS/binutils.spec +++ b/SPECS/binutils.spec @@ -69,7 +69,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.30 -Release: 74%{?dist} +Release: 75%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -460,9 +460,14 @@ Patch73: binutils-gold-mismatched-section-flags.patch # Purpose: Stop objcopy's --set-section-flag option from accepting the # 'shared' flag on non-COFF binaries. -# Lifetime: 2.34 +# Lifetime: Fixed in 2.34 Patch74: binutils-objcopy-set-section-flags-shared.patch +# Purpose: Prevent the s/390 linker from rewriting the GOT access +# for certain symbols. +# Lifetime: Fixed in 2.32 +Patch75: binutils-s390x-prevent-GOT-rewrite.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -661,6 +666,7 @@ using libelf instead of BFD. %patch72 -p1 %patch73 -p1 %patch74 -p1 +%patch75 -p1 # We cannot run autotools as there is an exact requirement of autoconf-2.59. # FIXME - this is no longer true. Maybe try reinstating autotool use ? @@ -1098,6 +1104,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Mon Jun 15 2020 Nick Clifton - 2.30-75 +- Prevent the s/390 linker from rewriting the GOT access for certain symbol types. (#1846972) + * Tue Apr 07 2020 Nick Clifton - 2.30-74 - Stop the BFD library from issueing warning messages about allocated sections being found outside of loadable segments. (#1630115) - Fix linker testsuite failures for the aarch64 and s390x targets. (#1632775, #1809101)