diff options
author | Jim Wilson <jimw@sifive.com> | 2020-01-22 16:45:04 -0800 |
---|---|---|
committer | Jim Wilson <jimw@sifive.com> | 2020-01-22 16:45:04 -0800 |
commit | 403d1bd91dffc9e6f5029faaa9cce7c07f268d52 (patch) | |
tree | 1a525aaec23a2bd690a82baaed978513c1e5261b /gas | |
parent | 3401347452ff7d23e148fdb07e4d49a57304ac14 (diff) | |
download | gdb-403d1bd91dffc9e6f5029faaa9cce7c07f268d52.zip gdb-403d1bd91dffc9e6f5029faaa9cce7c07f268d52.tar.gz gdb-403d1bd91dffc9e6f5029faaa9cce7c07f268d52.tar.bz2 |
RISC-V: Change -march parsing.
bfd/
2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
* bfd/elfnn-riscv.c (riscv_skip_prefix): New.
(riscv_prefix_cmp): Likewise.
(riscv_non_std_ext_p): Deleted.
(riscv_std_sv_ext_p): Likewise.
(riscv_non_std_sv_ext_p): Likewise.
(riscv_merge_non_std_and_sv_ext): Rename to...
(riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
(riscv_merge_arch_attr_info): Replace 3 calls to
riscv_merge_non_std_and_sv_ext with single call to
riscv_merge_multi_letter_ext.
* bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
encounter a 'z' prefix.
(riscv_get_prefix_class): New function, return prefix class based
on first few characters of input string.
(riscv_parse_config): New structure to factor out minor differences
in extension class parsing behaviour.
(riscv_parse_sv_or_non_std_ext): Rename to...
(riscv_parse_prefixed_ext): and parameterise with
riscv_parse_config.
(riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
(riscv_multi_letter_ext_valid_p): New.
(riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
(riscv_parse_subset): Delegate all non-single-letter parsing work
to riscv_parse_prefixed_ext.
* bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
(riscv_get_prefix_class): Declare.
gas/
2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
* testsuite/gas/riscv/march-ok-s.d: sx is no longer valid and
s exts must be known, so rename *ok* to *fail*.
* testsuite/gas/riscv/march-ok-sx.d: Likewise.
* testsuite/gas/riscv/march-ok-s-with-version: Likewise.
* testsuite/gas/riscv/march-fail-s.l: Expected error messages for
above change.
* testsuite/gas/riscv/march-fail-sx.l: Likewise.
* testsuite/gas/riscv/march-fail-sx-with-version.l: Likewise.
Change-Id: Ic4d91a13d055a10d30ab28752a380a669b59f29c
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 11 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-s-with-version | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-s-with-version.d (renamed from gas/testsuite/gas/riscv/march-ok-s-with-version.d) | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-s-with-version.l | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-s.d (renamed from gas/testsuite/gas/riscv/march-ok-s.d) | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-s.l | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-sx.d (renamed from gas/testsuite/gas/riscv/march-ok-sx.d) | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-sx.l | 2 |
8 files changed, 23 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 8a18aa7..ad880aa 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,14 @@ +2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com> + + * testsuite/gas/riscv/march-ok-s.d: sx is no longer valid and + s exts must be known, so rename *ok* to *fail*. + * testsuite/gas/riscv/march-ok-sx.d: Likewise. + * testsuite/gas/riscv/march-ok-s-with-version: Likewise. + * testsuite/gas/riscv/march-fail-s.l: Expected error messages for + above change. + * testsuite/gas/riscv/march-fail-sx.l: Likewise. + * testsuite/gas/riscv/march-fail-sx-with-version.l: Likewise. + 2020-01-22 H.J. Lu <hongjiu.lu@intel.com> PR gas/25438 diff --git a/gas/testsuite/gas/riscv/march-fail-s-with-version b/gas/testsuite/gas/riscv/march-fail-s-with-version new file mode 100644 index 0000000..a514d4a --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-s-with-version @@ -0,0 +1,2 @@ +Assembler messages: +.*: Invalid or unknown s ISA extension: 'sfoo'
\ No newline at end of file diff --git a/gas/testsuite/gas/riscv/march-ok-s-with-version.d b/gas/testsuite/gas/riscv/march-fail-s-with-version.d index 6296a15..9881c2a 100644 --- a/gas/testsuite/gas/riscv/march-ok-s-with-version.d +++ b/gas/testsuite/gas/riscv/march-fail-s-with-version.d @@ -1,5 +1,6 @@ #as: -march=rv32isfoo3p4 #objdump: -dr #source: empty.s +#error_output: march-fail-s-with-version.l .*: file format elf32-littleriscv diff --git a/gas/testsuite/gas/riscv/march-fail-s-with-version.l b/gas/testsuite/gas/riscv/march-fail-s-with-version.l new file mode 100644 index 0000000..6b1f957 --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-s-with-version.l @@ -0,0 +1,2 @@ +Assembler messages: +.*: Invalid or unknown s ISA extension: 'sfoo' diff --git a/gas/testsuite/gas/riscv/march-ok-s.d b/gas/testsuite/gas/riscv/march-fail-s.d index 7daa0a1..ebc8377 100644 --- a/gas/testsuite/gas/riscv/march-ok-s.d +++ b/gas/testsuite/gas/riscv/march-fail-s.d @@ -1,5 +1,6 @@ #as: -march=rv32isfoo #objdump: -dr #source: empty.s +#error_output: march-fail-s.l .*: file format elf32-littleriscv diff --git a/gas/testsuite/gas/riscv/march-fail-s.l b/gas/testsuite/gas/riscv/march-fail-s.l new file mode 100644 index 0000000..6b1f957 --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-s.l @@ -0,0 +1,2 @@ +Assembler messages: +.*: Invalid or unknown s ISA extension: 'sfoo' diff --git a/gas/testsuite/gas/riscv/march-ok-sx.d b/gas/testsuite/gas/riscv/march-fail-sx.d index e2172f2..144a85c 100644 --- a/gas/testsuite/gas/riscv/march-ok-sx.d +++ b/gas/testsuite/gas/riscv/march-fail-sx.d @@ -1,5 +1,6 @@ -#as: -march=rv32isfoo_sxbar +#as: -march=rv32i_sxbar #objdump: -dr #source: empty.s +#error_output: march-fail-sx.l .*: file format elf32-littleriscv diff --git a/gas/testsuite/gas/riscv/march-fail-sx.l b/gas/testsuite/gas/riscv/march-fail-sx.l new file mode 100644 index 0000000..b8ead71 --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-sx.l @@ -0,0 +1,2 @@ +Assembler messages: +.*: Invalid or unknown s ISA extension: 'sxbar' |