diff options
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/rx-defs.h | 1 | ||||
-rw-r--r-- | gas/config/rx-parse.y | 14 | ||||
-rw-r--r-- | gas/config/tc-rx.c | 17 |
3 files changed, 24 insertions, 8 deletions
diff --git a/gas/config/rx-defs.h b/gas/config/rx-defs.h index 2a15b6c1863..15c447df0a7 100644 --- a/gas/config/rx-defs.h +++ b/gas/config/rx-defs.h @@ -62,6 +62,7 @@ extern void rx_linkrelax_imm (int); extern void rx_linkrelax_branch (void); extern int rx_parse (void); extern int rx_wrap (void); +extern void rx_note_string_insn_use (void); extern char * rx_lex_start; extern char * rx_lex_end; diff --git a/gas/config/rx-parse.y b/gas/config/rx-parse.y index 645ec99f538..5269d6641b6 100644 --- a/gas/config/rx-parse.y +++ b/gas/config/rx-parse.y @@ -500,27 +500,27 @@ statement : /* ---------------------------------------------------------------------- */ | SCMPU - { B2 (0x7f, 0x83); } + { B2 (0x7f, 0x83); rx_note_string_insn_use (); } | SMOVU - { B2 (0x7f, 0x87); } + { B2 (0x7f, 0x87); rx_note_string_insn_use (); } | SMOVB - { B2 (0x7f, 0x8b); } + { B2 (0x7f, 0x8b); rx_note_string_insn_use (); } | SMOVF - { B2 (0x7f, 0x8f); } + { B2 (0x7f, 0x8f); rx_note_string_insn_use (); } /* ---------------------------------------------------------------------- */ | SUNTIL bwl - { B2 (0x7f, 0x80); F ($2, 14, 2); } + { B2 (0x7f, 0x80); F ($2, 14, 2); rx_note_string_insn_use (); } | SWHILE bwl - { B2 (0x7f, 0x84); F ($2, 14, 2); } + { B2 (0x7f, 0x84); F ($2, 14, 2); rx_note_string_insn_use (); } | SSTR bwl { B2 (0x7f, 0x88); F ($2, 14, 2); } /* ---------------------------------------------------------------------- */ | RMPA bwl - { B2 (0x7f, 0x8c); F ($2, 14, 2); } + { B2 (0x7f, 0x8c); F ($2, 14, 2); rx_note_string_insn_use (); } /* ---------------------------------------------------------------------- */ diff --git a/gas/config/tc-rx.c b/gas/config/tc-rx.c index 2dec69fce44..4e58f883cff 100644 --- a/gas/config/tc-rx.c +++ b/gas/config/tc-rx.c @@ -73,6 +73,7 @@ enum options OPTION_USES_GCC_ABI, OPTION_USES_RX_ABI, OPTION_CPU, + OPTION_DISALLOW_STRING_INSNS, }; #define RX_SHORTOPTS "" @@ -99,7 +100,8 @@ struct option md_longopts[] = {"mint-register", required_argument, NULL, OPTION_INT_REGS}, {"mgcc-abi", no_argument, NULL, OPTION_USES_GCC_ABI}, {"mrx-abi", no_argument, NULL, OPTION_USES_RX_ABI}, - {"mcpu",required_argument,NULL,OPTION_CPU}, + {"mcpu", required_argument, NULL, OPTION_CPU}, + {"mno-allow-string-insns", no_argument, NULL, OPTION_DISALLOW_STRING_INSNS}, {NULL, no_argument, NULL, 0} }; size_t md_longopts_size = sizeof (md_longopts); @@ -173,6 +175,10 @@ md_parse_option (int c ATTRIBUTE_UNUSED, char * arg ATTRIBUTE_UNUSED) break; } return 1; + + case OPTION_DISALLOW_STRING_INSNS: + elf_flags |= E_FLAG_RX_SINSNS_SET | E_FLAG_RX_SINSNS_NO; + return 1; } return 0; } @@ -192,6 +198,7 @@ md_show_usage (FILE * stream) fprintf (stream, _(" --mpid\n")); fprintf (stream, _(" --mint-register=<value>\n")); fprintf (stream, _(" --mcpu=<rx100|rx200|rx600|rx610>\n")); + fprintf (stream, _(" --mno-allow-string-insns")); } static void @@ -2623,6 +2630,14 @@ tc_gen_reloc (asection * sec ATTRIBUTE_UNUSED, fixS * fixp) return reloc; } +void +rx_note_string_insn_use (void) +{ + if ((elf_flags & E_FLAG_RX_SINSNS_MASK) == (E_FLAG_RX_SINSNS_SET | E_FLAG_RX_SINSNS_NO)) + as_bad (_("Use of an RX string instruction detected in a file being assembled without string instruction support")); + elf_flags |= E_FLAG_RX_SINSNS_SET | E_FLAG_RX_SINSNS_YES; +} + /* Set the ELF specific flags. */ void |