From 2c04e7867a2ea9b982ef6b4f9db1492408dfddc8 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Jun 12 2017 11:02:53 +0000 Subject: Import FSF binutils patch to fix aligning code fragments in AArch64 assembler. Resolves: #1460420 --- diff --git a/binutils-2.27-aarch64-frag-alignment-filling.patch b/binutils-2.27-aarch64-frag-alignment-filling.patch new file mode 100644 index 0000000..f5042f1 --- /dev/null +++ b/binutils-2.27-aarch64-frag-alignment-filling.patch @@ -0,0 +1,35 @@ +--- binutils.orig/gas/config/tc-aarch64.c 2017-06-12 11:34:40.150362276 +0100 ++++ binutils-2.27/gas/config/tc-aarch64.c 2017-06-12 11:36:06.709352650 +0100 +@@ -1736,13 +1736,13 @@ s_ltorg (int ignored ATTRIBUTE_UNUSED) + if (pool == NULL || pool->symbol == NULL || pool->next_free_entry == 0) + continue; + +- mapping_state (MAP_DATA); +- + /* Align pool as you have word accesses. + Only make a frag if we have to. */ + if (!need_pass_2) + frag_align (align, 0, 0); + ++ mapping_state (MAP_DATA); ++ + record_alignment (now_seg, align); + + sprintf (sym_name, "$$lit_\002%x", pool->id); +@@ -6373,11 +6373,15 @@ aarch64_init_frag (fragS * fragP, int ma + + switch (fragP->fr_type) + { +- case rs_align: + case rs_align_test: + case rs_fill: + mapping_state_2 (MAP_DATA, max_chars); + break; ++ case rs_align: ++ /* PR 20364: We can get alignment frags in code sections, ++ so do not just assume that we should use the MAP_DATA state. */ ++ mapping_state_2 (subseg_text_p (now_seg) ? MAP_INSN : MAP_DATA, max_chars); ++ break; + case rs_align_code: + mapping_state_2 (MAP_INSN, max_chars); + break; diff --git a/binutils.spec b/binutils.spec index 49b9e14..e533a46 100644 --- a/binutils.spec +++ b/binutils.spec @@ -43,7 +43,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.27 -Release: 23%{?dist} +Release: 24%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -106,6 +106,8 @@ Patch27: binutils-2.28-gas-comp_dir.patch Patch28: binutils-2.28-dynamic-section-warning.patch # Fix buffer overflow bug in gas. Patch29: binutils-2.27-gas-buffer-overflow.patch +# Fix the mapping state when aligning AArch64 code fragments. +Patch30: binutils-2.27-aarch64-frag-alignment-filling.patch Provides: bundled(libiberty) @@ -260,6 +262,7 @@ using libelf instead of BFD. %patch27 -p1 %patch28 -p1 %patch29 -p1 +%patch30 -p1 # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -626,6 +629,10 @@ exit 0 %endif # %{isnative} %changelog +* Mon Jun 12 2017 Nick Clifton 2.27-24 +- Import FSF binutils patch to fix aligning code fragments in AArch64 assembler. + (#1460420) + * Mon May 15 2017 Fedora Release Engineering - 2.27-23 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild