Skip to content

Commit b18cd8b

Browse files
galaknashif
authored andcommitted
Pull in RISC-V binutils-2.31.1 patches from https://github.com/riscv/riscv-binutils-gdb
Signed-off-by: Kumar Gala <[email protected]>
1 parent ba04589 commit b18cd8b

15 files changed

+3414
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 7d14370fd0026c9f3fd563dc4be6e97a410c0fb5 Mon Sep 17 00:00:00 2001
2+
From: Jim Wilson <[email protected]>
3+
Date: Fri, 27 Jul 2018 14:35:29 -0700
4+
Subject: [PATCH 01/15] RISC-V: Fix gas configure support for riscv*-*-*.
5+
6+
gas/
7+
* configure.tgt (riscv*): Accept as alias for riscv32*.
8+
---
9+
gas/ChangeLog | 4 ++++
10+
gas/configure.tgt | 2 +-
11+
2 files changed, 5 insertions(+), 1 deletion(-)
12+
13+
diff --git a/gas/ChangeLog b/gas/ChangeLog
14+
index bb4541900d..f3e42b66ec 100644
15+
--- a/gas/ChangeLog
16+
+++ b/gas/ChangeLog
17+
@@ -1,3 +1,7 @@
18+
+2018-07-27 Jim Wilson <[email protected]>
19+
+
20+
+ * configure.tgt (riscv*): Accept as alias for riscv32*.
21+
+
22+
2018-07-18 Nick Clifton <[email protected]>
23+
24+
2.31.1 Release point.
25+
diff --git a/gas/configure.tgt b/gas/configure.tgt
26+
index 3d0415c1aa..6df7dea31f 100644
27+
--- a/gas/configure.tgt
28+
+++ b/gas/configure.tgt
29+
@@ -89,8 +89,8 @@ case ${cpu} in
30+
pj*) cpu_type=pj endian=big ;;
31+
powerpc*le*) cpu_type=ppc endian=little ;;
32+
powerpc*) cpu_type=ppc endian=big ;;
33+
- riscv32*) cpu_type=riscv endian=little arch=riscv32 ;;
34+
riscv64*) cpu_type=riscv endian=little arch=riscv64 ;;
35+
+ riscv32* | riscv*) cpu_type=riscv endian=little arch=riscv32 ;;
36+
rs6000*) cpu_type=ppc ;;
37+
rl78*) cpu_type=rl78 ;;
38+
rx) cpu_type=rx ;;
39+
--
40+
2.20.1
41+

patches/binutils/2.31.1/0002-RISC-V-Set-insn-info-fields-correctly-when-disassemb.patch

Lines changed: 577 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From e4db752a05f39415a1a2d3eb7beb65a242751512 Mon Sep 17 00:00:00 2001
2+
From: Jim Wilson <[email protected]>
3+
Date: Thu, 2 Aug 2018 16:13:49 -0700
4+
Subject: [PATCH 03/15] RISC-V: Fix TLS and --gc-sections conflict.
5+
6+
bfd/
7+
* elfnn-riscv.c (riscv_elf_create_dynamic_sections): For .tdata.dyn,
8+
add SEC_LINKER_CREATED flag.
9+
---
10+
bfd/ChangeLog | 5 +++++
11+
bfd/elfnn-riscv.c | 3 ++-
12+
2 files changed, 7 insertions(+), 1 deletion(-)
13+
14+
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
15+
index 5ec906aa8e..2325c59daf 100644
16+
--- a/bfd/ChangeLog
17+
+++ b/bfd/ChangeLog
18+
@@ -1,3 +1,8 @@
19+
+2018-08-02 Jim Wilson <[email protected]>
20+
+
21+
+ * elfnn-riscv.c (riscv_elf_create_dynamic_sections): For .tdata.dyn,
22+
+ add SEC_LINKER_CREATED flag.
23+
+
24+
2018-07-18 Nick Clifton <[email protected]>
25+
26+
2.31.1 Release point.
27+
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
28+
index 934704a87e..4be3eceda8 100644
29+
--- a/bfd/elfnn-riscv.c
30+
+++ b/bfd/elfnn-riscv.c
31+
@@ -353,7 +353,8 @@ riscv_elf_create_dynamic_sections (bfd *dynobj,
32+
{
33+
htab->sdyntdata =
34+
bfd_make_section_anyway_with_flags (dynobj, ".tdata.dyn",
35+
- SEC_ALLOC | SEC_THREAD_LOCAL);
36+
+ (SEC_ALLOC | SEC_THREAD_LOCAL
37+
+ | SEC_LINKER_CREATED));
38+
}
39+
40+
if (!htab->elf.splt || !htab->elf.srelplt || !htab->elf.sdynbss
41+
--
42+
2.20.1
43+
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
From 786eb936fd461e09d6bac819ba7486e64b216244 Mon Sep 17 00:00:00 2001
2+
From: Jim Wilson <[email protected]>
3+
Date: Thu, 23 Aug 2018 13:26:48 -0700
4+
Subject: [PATCH 04/15] RISC-V: Reject empty rouding mode and fence operand.
5+
6+
gas/
7+
2018-08-23 Kito Cheng <[email protected]>
8+
* config/tc-riscv.c (arg_lookup): Checking
9+
length before look up.
10+
* testsuite/gas/riscv/fence-fail.d: New file.
11+
* testsuite/gas/riscv/fence-fail.l: Likewise.
12+
* testsuite/gas/riscv/fence-fail.s: Likewise.
13+
* testsuite/gas/riscv/rouding-fail.d: Likewise.
14+
* testsuite/gas/riscv/rouding-fail.l: Likewise.
15+
* testsuite/gas/riscv/rouding-fail.s: Likewise.
16+
---
17+
gas/ChangeLog | 11 +++++++++++
18+
gas/config/tc-riscv.c | 3 +++
19+
gas/testsuite/gas/riscv/fence-fail.d | 3 +++
20+
gas/testsuite/gas/riscv/fence-fail.l | 4 ++++
21+
gas/testsuite/gas/riscv/fence-fail.s | 4 ++++
22+
gas/testsuite/gas/riscv/rouding-fail.d | 3 +++
23+
gas/testsuite/gas/riscv/rouding-fail.l | 3 +++
24+
gas/testsuite/gas/riscv/rouding-fail.s | 3 +++
25+
8 files changed, 34 insertions(+)
26+
create mode 100644 gas/testsuite/gas/riscv/fence-fail.d
27+
create mode 100644 gas/testsuite/gas/riscv/fence-fail.l
28+
create mode 100644 gas/testsuite/gas/riscv/fence-fail.s
29+
create mode 100644 gas/testsuite/gas/riscv/rouding-fail.d
30+
create mode 100644 gas/testsuite/gas/riscv/rouding-fail.l
31+
create mode 100644 gas/testsuite/gas/riscv/rouding-fail.s
32+
33+
diff --git a/gas/ChangeLog b/gas/ChangeLog
34+
index f3e42b66ec..7014ef36b2 100644
35+
--- a/gas/ChangeLog
36+
+++ b/gas/ChangeLog
37+
@@ -1,3 +1,14 @@
38+
+2018-08-23 Kito Cheng <[email protected]>
39+
+
40+
+ * config/tc-riscv.c (arg_lookup): Checking
41+
+ length before look up.
42+
+ * testsuite/gas/riscv/fence-fail.d: New file.
43+
+ * testsuite/gas/riscv/fence-fail.l: Likewise.
44+
+ * testsuite/gas/riscv/fence-fail.s: Likewise.
45+
+ * testsuite/gas/riscv/rouding-fail.d: Likewise.
46+
+ * testsuite/gas/riscv/rouding-fail.l: Likewise.
47+
+ * testsuite/gas/riscv/rouding-fail.s: Likewise.
48+
+
49+
2018-07-27 Jim Wilson <[email protected]>
50+
51+
* configure.tgt (riscv*): Accept as alias for riscv32*.
52+
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
53+
index bdec30741b..4a3648a9ee 100644
54+
--- a/gas/config/tc-riscv.c
55+
+++ b/gas/config/tc-riscv.c
56+
@@ -618,6 +618,9 @@ arg_lookup (char **s, const char *const *array, size_t size, unsigned *regnop)
57+
const char *p = strchr (*s, ',');
58+
size_t i, len = p ? (size_t)(p - *s) : strlen (*s);
59+
60+
+ if (len == 0)
61+
+ return FALSE;
62+
+
63+
for (i = 0; i < size; i++)
64+
if (array[i] != NULL && strncmp (array[i], *s, len) == 0)
65+
{
66+
diff --git a/gas/testsuite/gas/riscv/fence-fail.d b/gas/testsuite/gas/riscv/fence-fail.d
67+
new file mode 100644
68+
index 0000000000..05b158fd75
69+
--- /dev/null
70+
+++ b/gas/testsuite/gas/riscv/fence-fail.d
71+
@@ -0,0 +1,3 @@
72+
+#as: -march=rv32i
73+
+#source: fence-fail.s
74+
+#error-output: fence-fail.l
75+
diff --git a/gas/testsuite/gas/riscv/fence-fail.l b/gas/testsuite/gas/riscv/fence-fail.l
76+
new file mode 100644
77+
index 0000000000..0d0912d5a9
78+
--- /dev/null
79+
+++ b/gas/testsuite/gas/riscv/fence-fail.l
80+
@@ -0,0 +1,4 @@
81+
+.*: Assembler messages:
82+
+.*: Error: illegal operands `fence ,'
83+
+.*: Error: illegal operands `fence w,'
84+
+.*: Error: illegal operands `fence ,w'
85+
diff --git a/gas/testsuite/gas/riscv/fence-fail.s b/gas/testsuite/gas/riscv/fence-fail.s
86+
new file mode 100644
87+
index 0000000000..9ce460ecfa
88+
--- /dev/null
89+
+++ b/gas/testsuite/gas/riscv/fence-fail.s
90+
@@ -0,0 +1,4 @@
91+
+target:
92+
+ fence ,
93+
+ fence w,
94+
+ fence ,w
95+
diff --git a/gas/testsuite/gas/riscv/rouding-fail.d b/gas/testsuite/gas/riscv/rouding-fail.d
96+
new file mode 100644
97+
index 0000000000..3544507e8b
98+
--- /dev/null
99+
+++ b/gas/testsuite/gas/riscv/rouding-fail.d
100+
@@ -0,0 +1,3 @@
101+
+#as: -march=rv32ifd
102+
+#source: rouding-fail.s
103+
+#error-output: rouding-fail.l
104+
diff --git a/gas/testsuite/gas/riscv/rouding-fail.l b/gas/testsuite/gas/riscv/rouding-fail.l
105+
new file mode 100644
106+
index 0000000000..ea46e7c2d5
107+
--- /dev/null
108+
+++ b/gas/testsuite/gas/riscv/rouding-fail.l
109+
@@ -0,0 +1,3 @@
110+
+.*: Assembler messages:
111+
+.*: Error: illegal operands `fadd.s fa1,fa1,fa1,'
112+
+.*: Error: illegal operands `fadd.d fa1,fa1,fa1,'
113+
diff --git a/gas/testsuite/gas/riscv/rouding-fail.s b/gas/testsuite/gas/riscv/rouding-fail.s
114+
new file mode 100644
115+
index 0000000000..d18f53efb5
116+
--- /dev/null
117+
+++ b/gas/testsuite/gas/riscv/rouding-fail.s
118+
@@ -0,0 +1,3 @@
119+
+target:
120+
+ fadd.s fa1,fa1,fa1,
121+
+ fadd.d fa1,fa1,fa1,
122+
--
123+
2.20.1
124+

0 commit comments

Comments
 (0)