* tc-arm.c (aeabi_set_public_attributes): Correctly set
authorRichard Earnshaw <richard.earnshaw@arm.com>
Mon, 5 Dec 2011 15:43:53 +0000 (15:43 +0000)
committerRichard Earnshaw <richard.earnshaw@arm.com>
Mon, 5 Dec 2011 15:43:53 +0000 (15:43 +0000)
Tag_ARM_ISA_use and Tag_Thumb_ISA_use.

* gas/arm/attr-any-armv4t.d: New test.
* gas/arm/attr-any-armv4t.s: New file.
* gas/arm/attr-any-thumbv6.d: New test.
* gas/arm/attr-any-thumbv6.s: New file.

gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/attr-any-armv4t.d [new file with mode: 0644]
gas/testsuite/gas/arm/attr-any-armv4t.s [new file with mode: 0644]
gas/testsuite/gas/arm/attr-any-thumbv6.d [new file with mode: 0644]
gas/testsuite/gas/arm/attr-any-thumbv6.s [new file with mode: 0644]

index 2d0b419b355f70d7bf8bd551680ac2d2d82c1c5b..cb38a196be59ed5becdc481718d1c251a2f67bf8 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-05  Richard Earnshaw  <rearnsha@arm.com>
+
+       * tc-arm.c (aeabi_set_public_attributes): Correctly set
+       Tag_ARM_ISA_use and Tag_Thumb_ISA_use.
+
 2011-11-30  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
 
        * config/tc-arm.c (arm_cpu_option_table): Add name_len field.
index 9111019c4396225d307c4b5c05e6cd8099843ff6..e5216893effd0559bc83daa0bbd97b0870e27555 100644 (file)
@@ -23666,7 +23666,14 @@ aeabi_set_public_attributes (void)
   ARM_MERGE_FEATURE_SETS (flags, arm_arch_used, thumb_arch_used);
   ARM_MERGE_FEATURE_SETS (flags, flags, *mfpu_opt);
   ARM_MERGE_FEATURE_SETS (flags, flags, selected_cpu);
-  /*Allow the user to override the reported architecture.  */
+
+  if (ARM_CPU_HAS_FEATURE (arm_arch_used, arm_arch_any))
+    ARM_MERGE_FEATURE_SETS (flags, flags, arm_ext_v1);
+
+  if (ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_arch_any))
+    ARM_MERGE_FEATURE_SETS (flags, flags, arm_ext_v4t);
+
+  /* Allow the user to override the reported architecture.  */
   if (object_arch)
     {
       ARM_CLEAR_FEATURE (flags, flags, arm_arch_any);
index deb43601788e4a91d86f005d317b353d42895686..187928867aa16ceb0822486d20e49836803dca1f 100644 (file)
@@ -1,3 +1,10 @@
+2011-12-05  Richard Earnshaw  <rearnsha@arm.com>
+
+       * gas/arm/attr-any-armv4t.d: New test.
+       * gas/arm/attr-any-armv4t.s: New file.
+       * gas/arm/attr-any-thumbv6.d: New test.
+       * gas/arm/attr-any-thumbv6.s: New file.
+
 2011-11-30  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
 
        * gas/arm/cmdline-bad-arch.d: New test case.
diff --git a/gas/testsuite/gas/arm/attr-any-armv4t.d b/gas/testsuite/gas/arm/attr-any-armv4t.d
new file mode 100644 (file)
index 0000000..14be589
--- /dev/null
@@ -0,0 +1,13 @@
+# name: attributes for 'any' cpu v4t ARM insn
+# source: attr-any-armv4t.s
+# as:
+# readelf: -A
+# This test is only valid on EABI based ports.
+# target: *-*-*eabi
+
+Attribute Section: aeabi
+File Attributes
+  Tag_CPU_arch: v4T
+  Tag_ARM_ISA_use: Yes
+  Tag_THUMB_ISA_use: Thumb-1
+  Tag_DIV_use: Not allowed
diff --git a/gas/testsuite/gas/arm/attr-any-armv4t.s b/gas/testsuite/gas/arm/attr-any-armv4t.s
new file mode 100644 (file)
index 0000000..290e531
--- /dev/null
@@ -0,0 +1 @@
+       bx      lr
diff --git a/gas/testsuite/gas/arm/attr-any-thumbv6.d b/gas/testsuite/gas/arm/attr-any-thumbv6.d
new file mode 100644 (file)
index 0000000..be8ec46
--- /dev/null
@@ -0,0 +1,12 @@
+# name: attributes for 'any' cpu v6 thumb insn
+# source: attr-any-thumbv6.s
+# as:
+# readelf: -A
+# This test is only valid on EABI based ports.
+# target: *-*-*eabi
+
+Attribute Section: aeabi
+File Attributes
+  Tag_CPU_arch: v6
+  Tag_THUMB_ISA_use: Thumb-1
+  Tag_DIV_use: Not allowed
diff --git a/gas/testsuite/gas/arm/attr-any-thumbv6.s b/gas/testsuite/gas/arm/attr-any-thumbv6.s
new file mode 100644 (file)
index 0000000..ed019c8
--- /dev/null
@@ -0,0 +1,2 @@
+       .thumb
+       cpy     r0, r1