diff -urN binutils-2.17.orig/gas/ChangeLog binutils-2.17/gas/ChangeLog --- binutils-2.17.orig/gas/ChangeLog 2006-06-12 15:05:03.000000000 +0200 +++ binutils-2.17/gas/ChangeLog 2006-07-05 09:57:10.000000000 +0200 @@ -1,3 +1,7 @@ +2006-07-04 Thomas Fleischmann + + * config/tc-m68k.c: overwrite cpu selection + 2006-06-07 Joseph S. Myers * po/Make-in (pdf, ps): New dummy targets. diff -urN binutils-2.17.orig/gas/config/tc-m68k.c binutils-2.17/gas/config/tc-m68k.c --- binutils-2.17.orig/gas/config/tc-m68k.c 2006-06-02 04:16:34.000000000 +0200 +++ binutils-2.17/gas/config/tc-m68k.c 2006-07-05 09:54:00.000000000 +0200 @@ -558,7 +558,7 @@ static const struct m68k_cpu *m68k_lookup_cpu (const char *, const struct m68k_cpu *, int, int *); static int m68k_set_arch (const char *, int, int); -static int m68k_set_cpu (const char *, int, int); +static int m68k_set_cpu (const char *, int, int, int); static int m68k_set_extension (const char *, int, int); static void m68k_init_arch (void); @@ -3915,7 +3915,7 @@ /* We've not selected an architecture yet. Set the default now. We do this lazily so that an initial .cpu or .arch directive can specify. */ - if (!m68k_set_cpu (TARGET_CPU, 1, 1)) + if (!m68k_set_cpu (TARGET_CPU, 1, 1, 0)) as_bad (_("unrecognized default cpu `%s'"), TARGET_CPU); } if (!initialized) @@ -6901,7 +6901,7 @@ saved_char = *input_line_pointer; *input_line_pointer = 0; - m68k_set_cpu (name, 1, 0); + m68k_set_cpu (name, 1, 0, 0); *input_line_pointer = saved_char; demand_empty_rest_of_line (); @@ -7005,7 +7005,7 @@ /* Set the cpu, issuing errors if it is unrecognized, or invalid */ static int -m68k_set_cpu (char const *name, int allow_m, int silent) +m68k_set_cpu (char const *name, int allow_m, int silent, int force) { const struct m68k_cpu *cpu; @@ -7020,9 +7020,15 @@ if (selected_cpu && selected_cpu != cpu) { - as_bad (_("already selected `%s' processor"), - selected_cpu->name); - return 0; + if(!force) + { + as_bad (_("already selected `%s' processor"), + selected_cpu->name); + return 0; + } + else + as_warn (_("override selected `%s' processor with `%s'"), + selected_cpu->name, cpu->name); } selected_cpu = cpu; return 1; @@ -7195,12 +7201,12 @@ if (!strncmp (arg, "arch=", 5)) m68k_set_arch (arg + 5, 1, 0); else if (!strncmp (arg, "cpu=", 4)) - m68k_set_cpu (arg + 4, 1, 0); + m68k_set_cpu (arg + 4, 1, 0, 1); else if (m68k_set_extension (arg, 0, 1)) ; else if (m68k_set_arch (arg, 0, 1)) ; - else if (m68k_set_cpu (arg, 0, 1)) + else if (m68k_set_cpu (arg, 0, 1, 0)) ; else return 0;