From 251665fc5f2083d8ca987a30534918fec6b3b969 Mon Sep 17 00:00:00 2001 From: Matthew Gretton-Dann Date: Mon, 15 Nov 2010 10:03:05 +0000 Subject: PR gas/12198 * gas/config/tc-arm.c (arm_arch_v6m_only): New variable. (aeabi_set_public_attributes): Ensure we only set the Operating System Extension when we are on an M-profile core. * gas/testsuite/gas/arm/pr12198-1.d: New test. * gas/testsuite/gas/arm/pr12918-1.s: Likewise. * gas/testsuite/gas/arm/pr12198-2.d: Likewise. * gas/testsuite/gas/arm/pr12918-2.s: Likewise. * include/opcode/arm.h (ARM_AEXT_V6M_ONLY): New define. (ARM_AEXT_V6M): Rewrite in terms of ARM_AEXT_V6M_ONLY. (ARM_ARCH_V6M_ONLY): New define. --- gas/ChangeLog | 7 +++++++ gas/config/tc-arm.c | 7 +++++++ gas/testsuite/ChangeLog | 8 ++++++++ gas/testsuite/gas/arm/pr12198-1.d | 12 ++++++++++++ gas/testsuite/gas/arm/pr12198-1.s | 7 +++++++ gas/testsuite/gas/arm/pr12198-2.d | 13 +++++++++++++ gas/testsuite/gas/arm/pr12198-2.s | 8 ++++++++ 7 files changed, 62 insertions(+) create mode 100644 gas/testsuite/gas/arm/pr12198-1.d create mode 100644 gas/testsuite/gas/arm/pr12198-1.s create mode 100644 gas/testsuite/gas/arm/pr12198-2.d create mode 100644 gas/testsuite/gas/arm/pr12198-2.s (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 784d84d..455a591 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2010-11-15 Matthew Gretton-Dann + + PR gas/12198 + * config/tc-arm.c (arm_arch_v6m_only): New variable. + (aeabi_set_public_attributes): Ensure we only set the Operating System + Extension when we are on an M-profile core. + 2010-11-13 Richard Sandiford * config/tc-mips.c (macro_build): Remove gas_assert from 'o' case. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 9a87342..f4ebdc4 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -207,6 +207,7 @@ static const arm_feature_set arm_arch_any = ARM_ANY; static const arm_feature_set arm_arch_full = ARM_FEATURE (-1, -1); static const arm_feature_set arm_arch_t2 = ARM_ARCH_THUMB2; static const arm_feature_set arm_arch_none = ARM_ARCH_NONE; +static const arm_feature_set arm_arch_v6m_only = ARM_ARCH_V6M_ONLY; static const arm_feature_set arm_cext_iwmmxt2 = ARM_FEATURE (0, ARM_CEXT_IWMMXT2); @@ -23232,6 +23233,12 @@ aeabi_set_public_attributes (void) ARM_MERGE_FEATURE_SETS (flags, flags, *object_arch); } + /* We need to make sure that the attributes do not identify us as v6S-M + when the only v6S-M feature in use is the Operating System Extensions. */ + if (ARM_CPU_HAS_FEATURE (flags, arm_ext_os)) + if (!ARM_CPU_HAS_FEATURE (flags, arm_arch_v6m_only)) + ARM_CLEAR_FEATURE (flags, flags, arm_ext_os); + tmp = flags; arch = 0; for (p = cpu_arch_ver; p->val; p++) diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index b2f09dc..594a5c9 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2010-11-15 Matthew Gretton-Dann + + PR gas/12198 + * gas/arm/pr12198-1.d: New test. + * gas/arm/pr12918-1.s: Likewise. + * gas/arm/pr12198-2.d: Likewise. + * gas/arm/pr12918-2.s: Likewise. + 2010-11-13 Richard Sandiford * gas/mips/elf-rel28.s, gas/mips/elf-rel28-n32.d, diff --git a/gas/testsuite/gas/arm/pr12198-1.d b/gas/testsuite/gas/arm/pr12198-1.d new file mode 100644 index 0000000..c5f7718 --- /dev/null +++ b/gas/testsuite/gas/arm/pr12198-1.d @@ -0,0 +1,12 @@ +# name: PR12198 - Only select v6S-M when v6-M is selected (1) +# source: pr12198-1.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_THUMB_ISA_use: Thumb-1 + Tag_DIV_use: Not allowed diff --git a/gas/testsuite/gas/arm/pr12198-1.s b/gas/testsuite/gas/arm/pr12198-1.s new file mode 100644 index 0000000..15c8805 --- /dev/null +++ b/gas/testsuite/gas/arm/pr12198-1.s @@ -0,0 +1,7 @@ + .thumb + .global f + .type f, %function +f: + svc 0xab + bx lr + diff --git a/gas/testsuite/gas/arm/pr12198-2.d b/gas/testsuite/gas/arm/pr12198-2.d new file mode 100644 index 0000000..39465c8 --- /dev/null +++ b/gas/testsuite/gas/arm/pr12198-2.d @@ -0,0 +1,13 @@ +# name: PR12198 - Only select v6S-M when v6-M is selected (2) +# source: pr12198-2.s +# as: +# readelf: -A +# This test is only valid on EABI based ports. +# target: *-*-*eabi + +Attribute Section: aeabi +File Attributes + Tag_CPU_arch: v6S-M + Tag_CPU_arch_profile: Microcontroller + Tag_THUMB_ISA_use: Thumb-1 + Tag_DIV_use: Not allowed diff --git a/gas/testsuite/gas/arm/pr12198-2.s b/gas/testsuite/gas/arm/pr12198-2.s new file mode 100644 index 0000000..711cc7e --- /dev/null +++ b/gas/testsuite/gas/arm/pr12198-2.s @@ -0,0 +1,8 @@ + .thumb + .global f + .type f, %function +f: + svc 0xab + dsb + bx lr + -- cgit v1.1