diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2010-06-10 16:38:17 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2010-06-10 16:38:17 +0000 |
commit | 78f12dd3eb06021e88367087844a64d7aee6beab (patch) | |
tree | 9a5469946926eb99043eefb43830a0f86f7f8d77 /gas | |
parent | 34017a41b36f663bf4c2ad3162315d9caf231a7e (diff) | |
download | gdb-78f12dd3eb06021e88367087844a64d7aee6beab.zip gdb-78f12dd3eb06021e88367087844a64d7aee6beab.tar.gz gdb-78f12dd3eb06021e88367087844a64d7aee6beab.tar.bz2 |
Stop if -march=XXX is invalid.
2010-06-10 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (update_code_flag): New.
(set_code_flag): Use it.
(i386_target_format): Replace set_code_flag with update_code_flag.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 29 |
2 files changed, 30 insertions, 5 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 92baff2..4b2a357 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2010-06-10 H.J. Lu <hongjiu.lu@intel.com> + + * config/tc-i386.c (update_code_flag): New. + (set_code_flag): Use it. + (i386_target_format): Replace set_code_flag with update_code_flag. + 2010-06-10 Tristan Gingold <gingold@adacore.com> * config/obj-som.h: Includes som/reloc.h diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 0f329a6..d62c3a1 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -135,6 +135,7 @@ typedef struct } arch_entry; +static void update_code_flag (int, int); static void set_code_flag (int); static void set_16bit_gcc_code_flag (int); static void set_intel_syntax (int); @@ -1922,8 +1923,10 @@ add_prefix (unsigned int prefix) } static void -set_code_flag (int value) +update_code_flag (int value, int check) { + PRINTF_LIKE ((*as_error)); + flag_code = (enum flag_code) value; if (flag_code == CODE_64BIT) { @@ -1937,16 +1940,32 @@ set_code_flag (int value) } if (value == CODE_64BIT && !cpu_arch_flags.bitfield.cpulm ) { - as_bad (_("64bit mode not supported on this CPU.")); + if (check) + as_error = as_fatal; + else + as_error = as_bad; + (*as_error) (_("64bit mode not supported on `%s'."), + cpu_arch_name ? cpu_arch_name : default_arch); } if (value == CODE_32BIT && !cpu_arch_flags.bitfield.cpui386) { - as_bad (_("32bit mode not supported on this CPU.")); + if (check) + as_error = as_fatal; + else + as_error = as_bad; + (*as_error) (_("32bit mode not supported on `%s'."), + cpu_arch_name ? cpu_arch_name : default_arch); } stackop_size = '\0'; } static void +set_code_flag (int value) +{ + update_code_flag (value, 0); +} + +static void set_16bit_gcc_code_flag (int new_code_flag) { flag_code = (enum flag_code) new_code_flag; @@ -8437,9 +8456,9 @@ const char * i386_target_format (void) { if (!strcmp (default_arch, "x86_64")) - set_code_flag (CODE_64BIT); + update_code_flag (CODE_64BIT, 1); else if (!strcmp (default_arch, "i386")) - set_code_flag (CODE_32BIT); + update_code_flag (CODE_32BIT, 1); else as_fatal (_("Unknown architecture")); |