From 7f78eb340a4b3f46d842058cd26aad7ffa438c16 Mon Sep 17 00:00:00 2001 From: Jiong Wang Date: Tue, 26 Aug 2014 16:18:36 +0100 Subject: [PATCH] [ARM] Update selected_cpu based on info got during parsing gas/ * config/tc-arm.c (aeabi_set_public_attributes): Update intended_arch based on the info we got during parsing. (arm_handle_align): Make sure the p2align expanding logic under thumb unchanged. gas/testsuite/ * gas/arm/blx-bl-convert.d: New testcase. * gas/arm/blx-bl-convert.l: Warning expectation. * gas/arm/blx-bl-convert.s: Source file. --- gas/ChangeLog | 7 +++++++ gas/config/tc-arm.c | 9 +++++++-- gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/arm/blx-bl-convert.d | 21 +++++++++++++++++++++ gas/testsuite/gas/arm/blx-bl-convert.l | 4 ++++ gas/testsuite/gas/arm/blx-bl-convert.s | 20 ++++++++++++++++++++ 6 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 gas/testsuite/gas/arm/blx-bl-convert.d create mode 100644 gas/testsuite/gas/arm/blx-bl-convert.l create mode 100644 gas/testsuite/gas/arm/blx-bl-convert.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 5d08734920c..43f89194d1a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2014-08-26 Jiong Wang + + * config/tc-arm.c (aeabi_set_public_attributes): Update selected_cpu + based on the info we got during parsing. + (arm_handle_align): Make sure the p2align expanding logic under thumb + unchanged. + 2014-08-26 Maciej W. Rozycki * config/tc-mips.c (macro) : Remove duplicate code and diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 560b4cff5d3..0e6cb7a9ef9 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -20848,7 +20848,8 @@ arm_handle_align (fragS * fragP) if (fragP->tc_frag_data.thumb_mode & (~ MODE_RECORDED)) { - if (ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6t2)) + if (ARM_CPU_HAS_FEATURE (selected_cpu_name[0] + ? selected_cpu : arm_arch_none, arm_ext_v6t2)) { narrow_noop = thumb_noop[1][target_big_endian]; noop = wide_thumb_noop[target_big_endian]; @@ -20862,7 +20863,9 @@ arm_handle_align (fragS * fragP) } else { - noop = arm_noop[ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6k) != 0] + noop = arm_noop[ARM_CPU_HAS_FEATURE (selected_cpu_name[0] + ? selected_cpu : arm_arch_none, + arm_ext_v6k) != 0] [target_big_endian]; noop_size = 4; #ifdef OBJ_ELF @@ -25109,6 +25112,8 @@ aeabi_set_public_attributes (void) if (ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_arch_any)) ARM_MERGE_FEATURE_SETS (flags, flags, arm_ext_v4t); + selected_cpu = flags; + /* Allow the user to override the reported architecture. */ if (object_arch) { diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index d0b8a9bd520..096bd4190dd 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-08-26 Jiong Wang + + * gas/arm/blx-bl-convert.d: New testcase. + * gas/arm/blx-bl-convert.l: Warning expectation. + * gas/arm/blx-bl-convert.s: Source file. + 2014-08-26 Maciej W. Rozycki * gas/mips/l_d.d: Remove ECOFF offset alternatives. diff --git a/gas/testsuite/gas/arm/blx-bl-convert.d b/gas/testsuite/gas/arm/blx-bl-convert.d new file mode 100644 index 00000000000..a30b5a2275a --- /dev/null +++ b/gas/testsuite/gas/arm/blx-bl-convert.d @@ -0,0 +1,21 @@ +#name: blx->bl convert under no -march/cpu +#error-output: blx-bl-convert.l +#objdump: -d + +.*: file format .* + +Disassembly of section \.text: + +00000000 : + 0: f000 f800 bl 4