From: Nick Clifton Date: Mon, 8 Sep 1997 22:03:09 +0000 (+0000) Subject: Add command line option to specify processor type. X-Git-Tag: gdb-4_18~4829 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8816811b859e4f63d44a43f57a8c86ecde3c2f25;p=platform%2Fupstream%2Fbinutils.git Add command line option to specify processor type. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index aeece7b..4b004c3 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,7 +1,11 @@ Mon Sep 8 12:33:40 1997 Nick Clifton + * config/tc-v850.h (TARGET_MACHINE): New constant. + * config/tc-v850.c (v850_insert_operand): Add -mwarn_unsigned_overflow. + (md_begin): Set BFD machine number based on machine variable. + (md_parse_option): Add -mv850, -mv850e and -mv850eq options. Mon Sep 8 11:20:46 1997 Ian Lance Taylor diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index 6bf5c2c..cb200a5 100644 --- a/gas/config/tc-v850.c +++ b/gas/config/tc-v850.c @@ -31,9 +31,12 @@ static bfd_reloc_code_real_type hold_cons_reloc; /* Set to TRUE if we want to be pedantic about signed overflows. */ -static boolean warn_signed_overflows = FALSE; +static boolean warn_signed_overflows = FALSE; static boolean warn_unsigned_overflows = FALSE; +/* Indicates the target processor type. */ +static int machine = TARGET_MACHINE; + /* Structure to hold information about predefined registers. */ struct reg_name @@ -763,7 +766,15 @@ md_show_usage (stream) FILE *stream; { fprintf (stream, "V850 options:\n"); - fprintf (stream, "\t-wsigned_overflow Warn if signed immediate values overflow\n"); + fprintf (stream, "\t-wsigned_overflow Warn if signed immediate values overflow\n"); + fprintf (stream, "\t-wunsigned_overflow Warn if unsigned immediate values overflow\n"); + fprintf (stream, "\t-mv850 The code is targeted at the v850\n"); +/* start-sanitize-v850e */ + fprintf (stream, "\t-mv850e The code is targeted at the v850e\n"); +/* end-sanitize-v850e */ +/* start-sanitize-v850eq */ + fprintf (stream, "\t-mv850eq The code is targeted at the v850eq\n"); +/* end-sanitize-v850eq */ } int @@ -771,18 +782,44 @@ md_parse_option (c, arg) int c; char * arg; { - if (c == 'w' && strcmp (arg, "signed_overflow") == 0) + switch (c) { - warn_signed_overflows = TRUE; - return 1; - } + case 'w': + if (strcmp (arg, "signed_overflow") == 0) + { + warn_signed_overflows = TRUE; + return 1; + } + else if (strcmp (arg, "unsigned_overflow") == 0) + { + warn_unsigned_overflows = TRUE; + return 1; + } + break; - if (c == 'w' && strcmp (arg, "unsigned_overflow") == 0) - { - warn_unsigned_overflows = TRUE; - return 1; + case 'm': + if (strcmp (arg, "v850") == 0) + { + machine = 0; + return 1; + } +/* start-sanitize-v850e */ + else if (strcmp (arg, "v850e") == 0) + { + machine = bfd_mach_v850e; + return 1; + } +/* end-sanitize-v850e */ +/* start-sanitize-v850eq */ + else if (strcmp (arg, "v850eq") == 0) + { + machine = bfd_mach_v850eq; + return 1; + } +/* end-sanitize-v850eq */ + break; } - + return 0; } @@ -907,14 +944,8 @@ md_begin () } op++; } - - bfd_set_arch_mach (stdoutput, TARGET_ARCH, 0); - /* start-sanitize-v850e */ - bfd_set_arch_mach (stdoutput, TARGET_ARCH, bfd_mach_v850e); - /* end-sanitize-v850e */ - /* start-sanitize-v850eq */ - bfd_set_arch_mach (stdoutput, TARGET_ARCH, bfd_mach_v850eq); - /* end-sanitize-v850eq */ + + bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine); applicable = bfd_applicable_section_flags (stdoutput); diff --git a/gas/config/tc-v850.h b/gas/config/tc-v850.h index cfd6cfa..31baf0b 100644 --- a/gas/config/tc-v850.h +++ b/gas/config/tc-v850.h @@ -27,9 +27,19 @@ #endif /* The target BFD architecture. */ -#define TARGET_ARCH bfd_arch_v850 - -#define TARGET_FORMAT "elf32-v850" +#define TARGET_ARCH bfd_arch_v850 + +#define TARGET_FORMAT "elf32-v850" + +#define TARGET_MACHINE 0 +/* start-sanitize-v850e */ +#undef TARGET_MACHINE +#define TARGET_MACHINE bfd_mach_v850e +/* end-sanitize-v850e */ +/* start-sanitize-v850eq */ +#undef TARGET_MACHINE +#define TARGET_MACHINE bfd_mach_v850eq +/* end-sanitize-v850eq */ #define MD_APPLY_FIX3 #define md_operand(x)