aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-rx.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-04-09 12:48:37 +0100
committerNick Clifton <nickc@redhat.com>2015-04-09 12:48:37 +0100
commit3525236c57a64fdbb534671fd2b16f9f846d36f3 (patch)
tree9b1b9e0a444216011509526254fccedcf34ca1c5 /gas/config/tc-rx.c
parent5a2d4533e2b9cc9c069d47071013cb30f1e0fc7e (diff)
downloadgdb-3525236c57a64fdbb534671fd2b16f9f846d36f3.zip
gdb-3525236c57a64fdbb534671fd2b16f9f846d36f3.tar.gz
gdb-3525236c57a64fdbb534671fd2b16f9f846d36f3.tar.bz2
Add support to the RX toolchain to restrict the use of string instructions.
bfd * elf32-rx.c (describe_flags): Report the settings of the string insn using bits. (rx_elf_merge_private_bfd_data): Handle merging of the string insn using bits. bin * readelf.c (get_machine_flags): Report the setting of the string insn using bits. gas * config/tc-rx.c (enum options): Add OPTION_DISALLOW_STRING_INSNS. (md_longopts): Add -mno-allow-string-insns. (md_parse_option): Handle -mno-allow-string-insns. (md_show_usage): Mention -mno-allow-string-insns. (rx_note_string_insn_use): New function. Produces an error message if a string insn is used when it is not allowed. * config/rx-parse.y (SCMPU): Call rx_note_string_insn_use. (SMOVU, SMOVB, SMOVF, SUNTIL, SWHILE, RMPA): Likewise. * config/rx-defs.h (rx_note_string_insn_use): Prototype. * doc/c-rx.texi: Document -mno-allow-string-insns. elf * rx.h (E_FLAG_RX_SINSNS_SET): New bit in e_flags field. (E_FLAG_RX_SINSNS_YES): Likewise. (E_FLAG_RX_SINSNS_MASK): New define.
Diffstat (limited to 'gas/config/tc-rx.c')
-rw-r--r--gas/config/tc-rx.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gas/config/tc-rx.c b/gas/config/tc-rx.c
index 2dec69f..4e58f88 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