[backport][binutils][arm][4/5] Set context table for '.arch_extension'
Mihail Ionescu
mihail.ionescu@foss.arm.com
Fri Jan 17 17:55:00 GMT 2020
Hi,
This is a backport for binutils 2.33.
This patch fixes .arch_extension behaviour.
Currently, context table for '.arch_extension' is only set while
"-march" processing, but it is not set while .arch processing,
so following code is rejected
.syntax unified
.thumb
.arch armv8.1-m.main
.arch_extension mve.fp
unless -march=armv8.1-m.main is given.
gas/ChangeLog:
2020-01-17 Mihail Ionescu <mihail.ionescu@arm.com>
Backport from trunk
2019-12-10 Vladimir Murzin <vladimir.murzin@arm.com>
* config/tc-arm.c (s_arm_arch): Set selected_ctx_ext_table.
* testsuite/gas/arm/mve-arch-ext.s: New.
* testsuite/gas/arm/mve-arch-ext.d: New.
Is it ok for 2.33?
Regards,
Mihail
############### Attachment also inlined for ease of reply ###############
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index ec2cee3f56cfa6e639192423c59de1bbe17ae8e0..d926cb586fb31659c34bbcf73bbdf94fe8f30741 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -32254,6 +32254,7 @@ s_arm_arch (int ignored ATTRIBUTE_UNUSED)
if (streq (opt->name, name))
{
selected_arch = opt->value;
+ selected_ctx_ext_table = opt->ext_table;
selected_ext = arm_arch_none;
selected_cpu = selected_arch;
strcpy (selected_cpu_name, opt->name);
diff --git a/gas/testsuite/gas/arm/mve-arch-ext.d b/gas/testsuite/gas/arm/mve-arch-ext.d
new file mode 100644
index 0000000000000000000000000000000000000000..0c55b38db6e6fa46a1bd2ad92e4c32b1dc3de735
--- /dev/null
+++ b/gas/testsuite/gas/arm/mve-arch-ext.d
@@ -0,0 +1,7 @@
+# name: MVE context sensitive .arch_extension under no -march
+# objdump: -dr --prefix-addresses --show-raw-insn -marmv8.1-m.main
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0[0-9a-f]+ <[^>]+> ea52 136f asrl r2, r3, #5
diff --git a/gas/testsuite/gas/arm/mve-arch-ext.s b/gas/testsuite/gas/arm/mve-arch-ext.s
new file mode 100644
index 0000000000000000000000000000000000000000..bbbb9ee1282c2003c9253374a280c7a52eae8466
--- /dev/null
+++ b/gas/testsuite/gas/arm/mve-arch-ext.s
@@ -0,0 +1,6 @@
+.syntax unified
+.thumb
+.arch armv8.1-m.main
+.arch_extension mve
+
+asrl r2, r3, #5
-------------- next part --------------
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index ec2cee3f56cfa6e639192423c59de1bbe17ae8e0..d926cb586fb31659c34bbcf73bbdf94fe8f30741 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -32254,6 +32254,7 @@ s_arm_arch (int ignored ATTRIBUTE_UNUSED)
if (streq (opt->name, name))
{
selected_arch = opt->value;
+ selected_ctx_ext_table = opt->ext_table;
selected_ext = arm_arch_none;
selected_cpu = selected_arch;
strcpy (selected_cpu_name, opt->name);
diff --git a/gas/testsuite/gas/arm/mve-arch-ext.d b/gas/testsuite/gas/arm/mve-arch-ext.d
new file mode 100644
index 0000000000000000000000000000000000000000..0c55b38db6e6fa46a1bd2ad92e4c32b1dc3de735
--- /dev/null
+++ b/gas/testsuite/gas/arm/mve-arch-ext.d
@@ -0,0 +1,7 @@
+# name: MVE context sensitive .arch_extension under no -march
+# objdump: -dr --prefix-addresses --show-raw-insn -marmv8.1-m.main
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0[0-9a-f]+ <[^>]+> ea52 136f asrl r2, r3, #5
diff --git a/gas/testsuite/gas/arm/mve-arch-ext.s b/gas/testsuite/gas/arm/mve-arch-ext.s
new file mode 100644
index 0000000000000000000000000000000000000000..bbbb9ee1282c2003c9253374a280c7a52eae8466
--- /dev/null
+++ b/gas/testsuite/gas/arm/mve-arch-ext.s
@@ -0,0 +1,6 @@
+.syntax unified
+.thumb
+.arch armv8.1-m.main
+.arch_extension mve
+
+asrl r2, r3, #5
More information about the Binutils
mailing list