summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorManjukumar Matha <manjukumar.harthikote-matha@xilinx.com>2016-12-16 17:43:31 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-03 09:51:32 +0000
commit314c727daa52673c39c8ac4e95be28106be447f9 (patch)
tree54a23bd884b8a7c9043170ca39ba3694564dc119 /meta/recipes-devtools
parenta3fa5ce87619e81d7acfa43340dd18d8f2b2d7dc (diff)
downloadpoky-314c727daa52673c39c8ac4e95be28106be447f9.tar.gz
binutils-2.27.inc: Fix alignment frags for aarch64
There was bug with alignment frags for aarch64 in binutils. This is fixed in master of binutils. This patch backports the fix to binutils 2.27 version. (From OE-Core rev: f6f87019073d4f3caa7766aca89faa6781690fba) (From OE-Core rev: c2dcf53587957244e231e1489efa75062a7ceacc) Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.27.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils/0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch139
2 files changed, 140 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.27.inc b/meta/recipes-devtools/binutils/binutils-2.27.inc
index 75180eaf50..a7cdb6f1d4 100644
--- a/meta/recipes-devtools/binutils/binutils-2.27.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.27.inc
@@ -37,6 +37,7 @@ SRC_URI = "\
37 file://0015-binutils-mips-gas-pic-relax-linkonce.diff \ 37 file://0015-binutils-mips-gas-pic-relax-linkonce.diff \
38 file://0015-Refine-.cfi_sections-check-to-only-consider-compact-.patch \ 38 file://0015-Refine-.cfi_sections-check-to-only-consider-compact-.patch \
39 file://0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch \ 39 file://0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch \
40 file://0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch \
40 file://0001-ppc-apuinfo-for-spe-parsed-incorrectly.patch \ 41 file://0001-ppc-apuinfo-for-spe-parsed-incorrectly.patch \
41" 42"
42S = "${WORKDIR}/git" 43S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch b/meta/recipes-devtools/binutils/binutils/0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch
new file mode 100644
index 0000000000..f8b46be697
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch
@@ -0,0 +1,139 @@
1From 4a4286465b5d6c28968bc2b29ae08daca7f219a3 Mon Sep 17 00:00:00 2001
2From: Nick Clifton <nickc@redhat.com>
3Date: Fri, 18 Nov 2016 11:42:48 -0800
4Subject: [PATCH] Fix the generation of alignment frags in code sections for AArch64.
5
6PR gas/20364
7* config/tc-aarch64.c (s_ltorg): Change the mapping state after
8aligning the frag.
9(aarch64_init): Treat rs_align frags in code sections as
10containing code, not data.
11* testsuite/gas/aarch64/pr20364.s: New test.
12* testsuite/gas/aarch64/pr20364.d: New test driver.
13
14Backporting the patch from binutils mainline
15https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7ea12e5c3ad54da440c08f32da09534e63e515ca
16
17Upstream-Status: Backport
18
19Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
20---
21 gas/ChangeLog | 10 ++++++++++
22 gas/config/tc-aarch64.c | 10 +++++++---
23 gas/testsuite/gas/aarch64/pr20364.d | 13 +++++++++++++
24 gas/testsuite/gas/aarch64/pr20364.s | 28 ++++++++++++++++++++++++++++
25 4 files changed, 58 insertions(+), 3 deletions(-)
26 create mode 100644 gas/testsuite/gas/aarch64/pr20364.d
27 create mode 100644 gas/testsuite/gas/aarch64/pr20364.s
28
29diff --git a/gas/ChangeLog b/gas/ChangeLog
30index a39895a..fad06dc 100644
31--- a/gas/ChangeLog
32+++ b/gas/ChangeLog
33@@ -1,3 +1,13 @@
34+2016-08-05 Nick Clifton <nickc@redhat.com>
35+
36+ PR gas/20364
37+ * config/tc-aarch64.c (s_ltorg): Change the mapping state after
38+ aligning the frag.
39+ (aarch64_init): Treat rs_align frags in code sections as
40+ containing code, not data.
41+ * testsuite/gas/aarch64/pr20364.s: New test.
42+ * testsuite/gas/aarch64/pr20364.d: New test driver.
43+
44 2016-08-03 Tristan Gingold <gingold@adacore.com>
45
46 * configure: Regenerate.
47diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
48index ddc40f2..74933cb 100644
49--- a/gas/config/tc-aarch64.c
50+++ b/gas/config/tc-aarch64.c
51@@ -1736,13 +1736,13 @@ s_ltorg (int ignored ATTRIBUTE_UNUSED)
52 if (pool == NULL || pool->symbol == NULL || pool->next_free_entry == 0)
53 continue;
54
55- mapping_state (MAP_DATA);
56-
57 /* Align pool as you have word accesses.
58 Only make a frag if we have to. */
59 if (!need_pass_2)
60 frag_align (align, 0, 0);
61
62+ mapping_state (MAP_DATA);
63+
64 record_alignment (now_seg, align);
65
66 sprintf (sym_name, "$$lit_\002%x", pool->id);
67@@ -6373,11 +6373,15 @@ aarch64_init_frag (fragS * fragP, int max_chars)
68
69 switch (fragP->fr_type)
70 {
71- case rs_align:
72 case rs_align_test:
73 case rs_fill:
74 mapping_state_2 (MAP_DATA, max_chars);
75 break;
76+ case rs_align:
77+ /* PR 20364: We can get alignment frags in code sections,
78+ so do not just assume that we should use the MAP_DATA state. */
79+ mapping_state_2 (subseg_text_p (now_seg) ? MAP_INSN : MAP_DATA, max_chars);
80+ break;
81 case rs_align_code:
82 mapping_state_2 (MAP_INSN, max_chars);
83 break;
84diff --git a/gas/testsuite/gas/aarch64/pr20364.d b/gas/testsuite/gas/aarch64/pr20364.d
85new file mode 100644
86index 0000000..babcff1
87--- /dev/null
88+++ b/gas/testsuite/gas/aarch64/pr20364.d
89@@ -0,0 +1,13 @@
90+# Check that ".align <size>, <fill>" does not set the mapping state to DATA, causing unnecessary frag generation.
91+#name: PR20364
92+#objdump: -d
93+
94+.*: file format .*
95+
96+Disassembly of section \.vectors:
97+
98+0+000 <.*>:
99+ 0: d2800000 mov x0, #0x0 // #0
100+ 4: 94000000 bl 0 <plat_report_exception>
101+ 8: 17fffffe b 0 <bl1_exceptions>
102+
103diff --git a/gas/testsuite/gas/aarch64/pr20364.s b/gas/testsuite/gas/aarch64/pr20364.s
104new file mode 100644
105index 0000000..594ad7c
106--- /dev/null
107+++ b/gas/testsuite/gas/aarch64/pr20364.s
108@@ -0,0 +1,28 @@
109+ .macro vector_base label
110+ .section .vectors, "ax"
111+ .align 11, 0
112+ \label:
113+ .endm
114+
115+ .macro vector_entry label
116+ .section .vectors, "ax"
117+ .align 7, 0
118+ \label:
119+ .endm
120+
121+ .macro check_vector_size since
122+ .if (. - \since) > (32 * 4)
123+ .error "Vector exceeds 32 instructions"
124+ .endif
125+ .endm
126+
127+ .globl bl1_exceptions
128+
129+vector_base bl1_exceptions
130+
131+vector_entry SynchronousExceptionSP0
132+ mov x0, #0x0
133+ bl plat_report_exception
134+ b SynchronousExceptionSP0
135+ check_vector_size SynchronousExceptionSP0
136+
137--
1382.7.4
139