aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-11-01 16:45:57 +0000
committerNick Clifton <nickc@redhat.com>2016-11-01 16:45:57 +0000
commite23eba971dd409b999dd83d8df0f842680c1c642 (patch)
tree0002ef536e33bff13648ee1f2c419349f4f91d75 /gas/testsuite
parent4e56efac8b4d5e251e8edc13febec93992bd6eb4 (diff)
downloadgdb-e23eba971dd409b999dd83d8df0f842680c1c642.zip
gdb-e23eba971dd409b999dd83d8df0f842680c1c642.tar.gz
gdb-e23eba971dd409b999dd83d8df0f842680c1c642.tar.bz2
Add support for RISC-V architecture.
bfd * Makefile.am: Add entries for riscv32-elf and riscv64-elf. * config.bdf: Likewise. * configure.ac: Likewise. * Makefile.in: Regenerate. * configure: Regenerate. * archures.c: Add bfd_riscv_arch. * reloc.c: Add riscv relocs. * targets.c: Add riscv_elf32_vec and riscv_elf64_vec. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf-bfd.h: Add RISCV_ELF_DATA to enum elf_target_id. * elfnn-riscv.c: New file. * elfxx-riscv.c: New file. * elfxx-riscv.h: New file. binutils* readelf.c (guess_is_rela): Add EM_RISCV. (get_machine_name): Likewise. (dump_relocations): Add support for riscv relocations. (get_machine_flags): Add support for riscv flags. (is_32bit_abs_reloc): Add R_RISCV_32. (is_64bit_abs_reloc): Add R_RISCV_64. (is_none_reloc): Add R_RISCV_NONE. * testsuite/binutils-all/objdump.exp (cpus_expected): Add riscv. Expect the debug_ranges test to fail. gas * Makefile.am: Add riscv files. * Makefile.in: Regenerate. * NEWS: Mention the support for this architecture. * configure.in: Define a default architecture. * configure: Regenerate. * configure.tgt: Add entries for riscv. * doc/as.texinfo: Likewise. * testsuite/gas/all/gas.exp: Expect the redef tests to fail. * testsuite/gas/elf/elf.exp: Expect the groupauto tests to fail. * config/tc-riscv.c: New file. * config/tc-riscv.h: New file. * doc/c-riscv.texi: New file. * testsuite/gas/riscv: New directory. * testsuite/gas/riscv/riscv.exp: New file. * testsuite/gas/riscv/t_insns.d: New file. * testsuite/gas/riscv/t_insns.s: New file. ld * Makefile.am: Add riscv files. * Makefile.in: Regenerate. * NEWS: Mention the support for this target. * configure.tgt: Add riscv entries. * emulparams/elf32lriscv-defs.sh: New file. * emulparams/elf32lriscv.sh: New file. * emulparams/elf64lriscv-defs.sh: New file. * emulparams/elf64lriscv.sh: New file. * emultempl/riscvelf.em: New file. opcodes * configure.ac: Add entry for bfd_riscv_arch. * configure: Regenerate. * disassemble.c (disassembler): Add support for riscv. (disassembler_usage): Likewise. * riscv-dis.c: New file. * riscv-opc.c: New file. include * dis-asm.h: Add prototypes for print_insn_riscv and print_riscv_disassembler_options. * elf/riscv.h: New file. * opcode/riscv-opc.h: New file. * opcode/riscv.h: New file.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/all/gas.exp8
-rw-r--r--gas/testsuite/gas/elf/elf.exp3
-rw-r--r--gas/testsuite/gas/riscv/riscv.exp23
-rw-r--r--gas/testsuite/gas/riscv/t_insns.d10
-rw-r--r--gas/testsuite/gas/riscv/t_insns.s2
5 files changed, 42 insertions, 4 deletions
diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp
index bfb13ed..eb225fc 100644
--- a/gas/testsuite/gas/all/gas.exp
+++ b/gas/testsuite/gas/all/gas.exp
@@ -159,10 +159,10 @@ case $target_triplet in {
# These targets fail redef2 because they disallow redefined
# symbols on relocs.
setup_xfail "m68hc1*-*-*" "m6811-*-*" "m6812-*-*" "rl78-*-*"
- setup_xfail "rx-*-*" "vax*-*-*" "xgate*-*-*" "z8k-*-*"
+ setup_xfail "riscv*-*-*" "rx-*-*" "vax*-*-*" "xgate*-*-*" "z8k-*-*"
run_dump_test redef2
setup_xfail "m68hc1*-*-*" "m6811-*-*" "m6812-*-*" "rl78-*-*"
- setup_xfail "rx-*-*" "vax*-*-*" "xgate*-*-*" "z8k-*-*"
+ setup_xfail "riscv*-*-*" "rx-*-*" "vax*-*-*" "xgate*-*-*" "z8k-*-*"
# rs6000-aix disallows redefinition via .comm.
setup_xfail "*-*-aix*"
# SOM uses a different syntax for .comm
@@ -277,8 +277,8 @@ if { ![istarget *c30*-*-*]
&& ![istarget hppa*-*-*] } then {
# The vax fails because VMS can apparently actually handle this
# case in relocs, so gas doesn't handle it itself.
- # msp430 and mn10[23]00 emit two relocs to handle the difference of two symbols.
- setup_xfail "mn10200-*-*" "mn10300*-*-*" "msp430*-*-*" "vax*-*-vms*"
+ # msp430, mn10[23]00 and riscv emit two relocs to handle the difference of two symbols.
+ setup_xfail "mn10200-*-*" "mn10300*-*-*" "msp430*-*-*" "riscv*-*-*" "vax*-*-vms*"
do_930509a
}
diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp
index d57665e..df9f4ba 100644
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -120,12 +120,14 @@ if { [is_elf_format] } then {
run_dump_test "group2"
case $target_triplet in {
{ hppa64*-*-hpux* } { }
+ { riscv*-*-* } { }
default {
run_dump_test "groupautoa"
}
}
case $target_triplet in {
{ hppa64*-*-hpux* } { }
+ { riscv*-*-* } { }
{ xtensa*-*-* } { }
default {
run_dump_test "groupautob"
@@ -144,6 +146,7 @@ if { [is_elf_format] } then {
{ mn10300-*-* } { }
{ msp43*-*-* } { }
{ rl78-*-* } { }
+ { riscv*-*-* } { }
{ rx-*-* } { }
default {
# The next test can fail if the target does not convert fixups
diff --git a/gas/testsuite/gas/riscv/riscv.exp b/gas/testsuite/gas/riscv/riscv.exp
new file mode 100644
index 0000000..27d73cd
--- /dev/null
+++ b/gas/testsuite/gas/riscv/riscv.exp
@@ -0,0 +1,23 @@
+# Expect script for RISC-V assembler tests.
+# Copyright (C) 2011-2016 Free Software Foundation, Inc.
+#
+# This file is part of the GNU Binutils.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+if [istarget riscv*-*-*] {
+ run_dump_test "t_insns"
+}
diff --git a/gas/testsuite/gas/riscv/t_insns.d b/gas/testsuite/gas/riscv/t_insns.d
new file mode 100644
index 0000000..720f0db
--- /dev/null
+++ b/gas/testsuite/gas/riscv/t_insns.d
@@ -0,0 +1,10 @@
+#as:
+#objdump: -dr
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ ]+0:[ ]+00000013[ ]+nop
diff --git a/gas/testsuite/gas/riscv/t_insns.s b/gas/testsuite/gas/riscv/t_insns.s
new file mode 100644
index 0000000..9945688
--- /dev/null
+++ b/gas/testsuite/gas/riscv/t_insns.s
@@ -0,0 +1,2 @@
+target:
+ nop