diff options
author | Jiong Wang <jiong.wang@arm.com> | 2014-08-26 16:18:36 +0100 |
---|---|---|
committer | Jiong Wang <jiong.wang@arm.com> | 2014-08-26 16:18:36 +0100 |
commit | 7f78eb340a4b3f46d842058cd26aad7ffa438c16 (patch) | |
tree | 03c549894993bfb986fe1fd7591112646d3d43c3 /gas | |
parent | 614b09cefb3bafa840fe5ed06c58024b0ff9c1cb (diff) | |
download | gdb-7f78eb340a4b3f46d842058cd26aad7ffa438c16.zip gdb-7f78eb340a4b3f46d842058cd26aad7ffa438c16.tar.gz gdb-7f78eb340a4b3f46d842058cd26aad7ffa438c16.tar.bz2 |
[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.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/config/tc-arm.c | 9 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/blx-bl-convert.d | 21 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/blx-bl-convert.l | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/blx-bl-convert.s | 20 |
6 files changed, 65 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 5d08734..43f8919 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2014-08-26 Jiong Wang <jiong.wang@arm.com> + + * 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 <macro@codesourcery.com> * config/tc-mips.c (macro) <M_SAA_AB>: Remove duplicate code and diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 560b4cf..0e6cb7a 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 d0b8a9b..096bd41 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-08-26 Jiong Wang <jiong.wang@arm.com> + + * 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 <macro@codesourcery.com> * 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 0000000..a30b5a2 --- /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 <entry>: + 0: f000 f800 bl 4 <label> + +00000004 <label>: + 4: 4770 bx lr + \.\.\. + +00000008 <label2>: + 8: ebffffff bl c <label3> + +0000000c <label3>: + c: e12fff1e bx lr + diff --git a/gas/testsuite/gas/arm/blx-bl-convert.l b/gas/testsuite/gas/arm/blx-bl-convert.l new file mode 100644 index 0000000..c039755 --- /dev/null +++ b/gas/testsuite/gas/arm/blx-bl-convert.l @@ -0,0 +1,4 @@ +[^:]*: Assembler messages: +[^:]*:7: Warning: blx to Thumb func 'label' from Thumb ISA state changed to bl +[^:]*:16: Warning: blx to 'label3' an ARM ISA state function changed to bl + diff --git a/gas/testsuite/gas/arm/blx-bl-convert.s b/gas/testsuite/gas/arm/blx-bl-convert.s new file mode 100644 index 0000000..d961233 --- /dev/null +++ b/gas/testsuite/gas/arm/blx-bl-convert.s @@ -0,0 +1,20 @@ +.syntax unified + +.thumb +.type entry, %function +.global entry +entry: + blx label + +.type label, %function +label: + bx lr + +.arm +.type label2, %function +label2: + blx label3 + +.type label3, %function +label3: + bx lr |