This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] [GAS/ARM] Fix selected_cpu with default CPU and -mcpu


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=62785b09987359ede74a98fac11343827f7181af

commit 62785b09987359ede74a98fac11343827f7181af
Author: Thomas Preud'homme <thomas.preudhomme@arm.com>
Date:   Fri Mar 24 13:22:16 2017 +0000

    [GAS/ARM] Fix selected_cpu with default CPU and -mcpu
    
    When GAS is compiled with DEFAULT_CPU set and then run with a -mcpu or
    -march option, selected_cpu will be set to the default CPU. This means
    the -mcpu is ignored which is surprising behavior. This commit instead
    sets selected_cpu from the value passed to -mcpu/-march.
    
    2017-03-24  Thomas preud'homme  <thomas.preudhomme@arm.com>
    
    gas/
    	* config/tc-arm.: (md_begin): Set selected_cpu from *mcpu_cpu_opt when
    	CPU_DEFAULT is defined.

Diff:
---
 gas/ChangeLog       | 5 +++++
 gas/config/tc-arm.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 5fda819..e74ff8e 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-24  Thomas preud'homme  <thomas.preudhomme@arm.com>
+
+	* config/tc-arm.: (md_begin): Set selected_cpu from *mcpu_cpu_opt when
+	CPU_DEFAULT is defined.
+
 2017-03-21  Palmer Dabbbelt  <palmer@dabbelt.com>
 
 	* config/tc-riscv.c (md_show_usage): Remode defuct -m32, -m64,
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index ef6b609..bbfe634 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -25040,8 +25040,8 @@ md_begin (void)
       mcpu_cpu_opt = &cpu_default;
       selected_cpu = cpu_default;
     }
-  else if (no_cpu_selected ())
-    selected_cpu = cpu_default;
+  else
+    selected_cpu = *mcpu_cpu_opt;
 #else
   if (mcpu_cpu_opt)
     selected_cpu = *mcpu_cpu_opt;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]