This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb/binutils-2_26-branch] [Patch ARM] Fix build attributes for armv8-a in case of assembler files that contain no directives.
- From: Richard Earnshaw <rearnsha at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 17 Dec 2015 15:26:05 -0000
- Subject: [binutils-gdb/binutils-2_26-branch] [Patch ARM] Fix build attributes for armv8-a in case of assembler files that contain no directives.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=049ec137129f7ef459467f3b098d33bf633c50bd
commit 049ec137129f7ef459467f3b098d33bf633c50bd
Author: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Date: Thu Dec 17 10:55:54 2015 +0000
[Patch ARM] Fix build attributes for armv8-a in case of assembler files that contain no directives.
There is currently a problem in the way in which we produce
build attributes for simple assembler files that have armv8-a
instructions.
In these case we need to generate TAG_ISA_THUMB_Use to be Thumb-2
and set the architecture profile to be 'A' rather than not
setting architecture profile to be 'A' and setting TAG_ISA_THUMB_Use
to be Thumb-1.
This is a pre-requisite for any v8-m patches that have been posted.
arm-none-eabi gas testsuite run. no regressions.
2015-12-17 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* gas/config/tc-arm.c (aeabi_set_public_attributes): Adjust
TAG_ARCH_profile for armv8-a.
* gas/testsuite/gas/arm/armv8a-automatic-hlt.d: New test.
* gas/testsuite/gas/arm/armv8a-automatic-hlt.s: New test.
* gas/testsuite/gas/arm/armv8a-automatic-lda.d: New test.
* gas/testsuite/gas/arm/armv8a-automatic-lda.s: New test.
Diff:
---
gas/config/tc-arm.c | 3 ++-
gas/testsuite/gas/arm/armv8a-automatic-hlt.d | 8 ++++++++
gas/testsuite/gas/arm/armv8a-automatic-hlt.s | 6 ++++++
gas/testsuite/gas/arm/armv8a-automatic-lda.d | 8 ++++++++
gas/testsuite/gas/arm/armv8a-automatic-lda.s | 4 ++++
include/opcode/arm.h | 5 +++--
6 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 3b0a021..3bd4bc9 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -25548,7 +25548,8 @@ aeabi_set_public_attributes (void)
aeabi_set_attribute_int (Tag_CPU_arch, arch);
/* Tag_CPU_arch_profile. */
- if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7a))
+ if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7a)
+ || ARM_CPU_HAS_FEATURE (flags, arm_ext_v8))
profile = 'A';
else if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7r))
profile = 'R';
diff --git a/gas/testsuite/gas/arm/armv8a-automatic-hlt.d b/gas/testsuite/gas/arm/armv8a-automatic-hlt.d
new file mode 100644
index 0000000..6e8c1db
--- /dev/null
+++ b/gas/testsuite/gas/arm/armv8a-automatic-hlt.d
@@ -0,0 +1,8 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v8
+ Tag_CPU_arch_profile: Application
+ Tag_THUMB_ISA_use: Thumb-2
diff --git a/gas/testsuite/gas/arm/armv8a-automatic-hlt.s b/gas/testsuite/gas/arm/armv8a-automatic-hlt.s
new file mode 100644
index 0000000..29dd4ff
--- /dev/null
+++ b/gas/testsuite/gas/arm/armv8a-automatic-hlt.s
@@ -0,0 +1,6 @@
+ .thumb
+ .syntax unified
+ hlt
+ stlexd r0, r2, [r3]
+ sevl
+ hlt 0xf
diff --git a/gas/testsuite/gas/arm/armv8a-automatic-lda.d b/gas/testsuite/gas/arm/armv8a-automatic-lda.d
new file mode 100644
index 0000000..6e8c1db
--- /dev/null
+++ b/gas/testsuite/gas/arm/armv8a-automatic-lda.d
@@ -0,0 +1,8 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v8
+ Tag_CPU_arch_profile: Application
+ Tag_THUMB_ISA_use: Thumb-2
diff --git a/gas/testsuite/gas/arm/armv8a-automatic-lda.s b/gas/testsuite/gas/arm/armv8a-automatic-lda.s
new file mode 100644
index 0000000..8e1ca0c
--- /dev/null
+++ b/gas/testsuite/gas/arm/armv8a-automatic-lda.s
@@ -0,0 +1,4 @@
+ .thumb
+ .syntax unified
+ lda r0, [r0]
+ stl r0, [r1]
diff --git a/include/opcode/arm.h b/include/opcode/arm.h
index 41f0564..0cb4d57 100644
--- a/include/opcode/arm.h
+++ b/include/opcode/arm.h
@@ -258,9 +258,10 @@
#define ARM_ANY ARM_FEATURE (-1, -1, 0) /* Any basic core. */
#define ARM_FEATURE_ALL ARM_FEATURE (-1, -1, -1)/* All CPU and FPU features. */
#define FPU_ANY_HARD ARM_FEATURE_COPROC (FPU_FPA | FPU_VFP_HARD | FPU_MAVERICK)
-#define ARM_ARCH_THUMB2 ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2 | ARM_EXT_V7 \
+#define ARM_ARCH_THUMB2 ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2 | ARM_EXT_V7 \
| ARM_EXT_V7A | ARM_EXT_V7R \
- | ARM_EXT_V7M | ARM_EXT_DIV)
+ | ARM_EXT_V7M | ARM_EXT_DIV \
+ | ARM_EXT_V8)
/* v7-a+sec. */
#define ARM_ARCH_V7A_SEC ARM_FEATURE_CORE_LOW (ARM_AEXT_V7A | ARM_EXT_SEC)
/* v7-a+mp+sec. */