diff options
Diffstat (limited to 'gas/config/tc-arm.c')
-rw-r--r-- | gas/config/tc-arm.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index f692cff..412e8ab 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -17703,9 +17703,9 @@ md_assemble (char *str) /* Many Thumb-2 instructions also have Thumb-1 variants, so explicitly set those bits when Thumb-2 32-bit instructions are seen. ie. anything other than bl/blx and v6-M instructions. - This is overly pessimistic for relaxable instructions. */ - if (((inst.size == 4 && (inst.instruction & 0xf800e800) != 0xf000e800) - || inst.relax) + The impact of relaxable instructions will be considered later after we + finish all relaxation. */ + if ((inst.size == 4 && (inst.instruction & 0xf800e800) != 0xf000e800) && !(ARM_CPU_HAS_FEATURE (*opcode->tvariant, arm_ext_msr) || ARM_CPU_HAS_FEATURE (*opcode->tvariant, arm_ext_barrier))) ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used, @@ -20539,6 +20539,11 @@ md_convert_frag (bfd *abfd, segT asec ATTRIBUTE_UNUSED, fragS *fragp) fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; fragp->fr_fix += fragp->fr_var; + + /* Set whether we use thumb-2 ISA based on final relaxation results. */ + if (thumb_mode && fragp->fr_var == 4 && no_cpu_selected () + && !ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_arch_t2)) + ARM_MERGE_FEATURE_SETS (arm_arch_used, thumb_arch_used, arm_ext_v6t2); } /* Return the size of a relaxable immediate operand instruction. @@ -25125,7 +25130,7 @@ aeabi_set_attribute_string (int tag, const char *value) } /* Set the public EABI object attributes. */ -static void +void aeabi_set_public_attributes (void) { int arch; |