From 8e75a78f36867b1454e830ef59cc31384fb7b21e Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 23 Jan 2014 17:08:24 +0000 Subject: [PATCH] Remove the display of known MCU names from the MSP430 port of GAS. New MSP430 MCU parts are being created by TI all the time and the list is basically always out of date. Instead any name will be accepted by the -mmcu= command line option. ISA selection is now based upon the -mcpu= command line option, just as is done for GCC. gas/ChangeLog * config/tc-msp430.c (show_mcu_list): Delete. (md_parse_option): Accept any MCU name. Accept several more variants for the -mcpu option. (md_show_usage): Do not call show_mcu_list. --- gas/ChangeLog | 7 ++++++ gas/config/tc-msp430.c | 52 +++++++++++++----------------------------- 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 79ab63ad5d..8177db2690 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2014-01-23 Nick Clifton + + * config/tc-msp430.c (show_mcu_list): Delete. + (md_parse_option): Accept any MCU name. Accept several more + variants for the -mcpu option. + (md_show_usage): Do not call show_mcu_list. + 2014-01-22 DJ Delorie * config/tc-msp430.c (msp430_refsym): New: ".refsym " diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c index 189319e66f..6c794f9dac 100644 --- a/gas/config/tc-msp430.c +++ b/gas/config/tc-msp430.c @@ -1,6 +1,6 @@ /* tc-msp430.c -- Assembler code for the Texas Instruments MSP430 - Copyright (C) 2002-2013 Free Software Foundation, Inc. + Copyright (C) 2002-2014 Free Software Foundation, Inc. Contributed by Dmitry Diky This file is part of GAS, the GNU Assembler. @@ -1152,23 +1152,6 @@ msp430_set_arch (int option) target_is_430x () ? bfd_mach_msp430x : bfd_mach_msp11); } -static void -show_mcu_list (FILE * stream) -{ - int i; - - fprintf (stream, _("Known MCU names:\n")); - - for (i = 0; mcu_types[i].name; i++) - { - fprintf (stream, "%14.14s", mcu_types[i].name); - if ((i % 6) == 5) - fprintf (stream, "\n"); - } - - fprintf (stream, "\n"); -} - int md_parse_option (int c, char * arg) { @@ -1184,31 +1167,30 @@ md_parse_option (int c, char * arg) if (strcasecmp (mcu_types[i].name, arg) == 0) break; - if (mcu_types[i].name == NULL) + if (mcu_types[i].name != NULL) { - show_mcu_list (stderr); - as_fatal (_("unknown MCU: %s\n"), arg); + /* Allow switching to the same or a lesser architecture. */ + if (msp430_mcu == &default_mcu || msp430_mcu->isa >= mcu_types[i].isa) + msp430_mcu = mcu_types + i; + else + as_fatal (_("redefinition of mcu type '%s' to '%s'"), + msp430_mcu->name, mcu_types[i].name); } - - /* Allow switching to the same or a lesser architecture. */ - if (msp430_mcu == &default_mcu || msp430_mcu->isa >= mcu_types[i].isa) - msp430_mcu = mcu_types + i; - else - as_fatal (_("redefinition of mcu type '%s' to '%s'"), - msp430_mcu->name, mcu_types[i].name); + /* It is not an error if we do not match the MCU name. */ return 1; - + case OPTION_MCPU: - if (strcmp (arg, "430") == 0) + if (strcmp (arg, "430") == 0 + || strcasecmp (arg, "msp430") == 0) msp430_mcu = & default_mcu; - else if (strcmp (arg, "430x") == 0 - || strcmp (arg, "430X") == 0) + else if (strcasecmp (arg, "430x") == 0 + || strcasecmp (arg, "msp430x") == 0) msp430_mcu = & msp430x_mcu; - else if (strcasecmp (arg, "430xv2") == 0) + else if (strcasecmp (arg, "430xv2") == 0 + || strcasecmp (arg, "msp430xv2") == 0) msp430_mcu = & msp430xv2_mcu; else as_fatal (_("unrecognised argument to -mcpu option '%s'"), arg); - return 1; case OPTION_RELAX: @@ -1315,8 +1297,6 @@ md_show_usage (FILE * stream) _(" -mn - enable generation of NOP after changing interrupts\n")); fprintf (stream, _(" -md - Force copying of data from ROM to RAM at startup\n")); - - show_mcu_list (stream); } symbolS *