mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-28 12:24:04 +08:00
Added checking of instructions against target cpu.
This commit is contained in:
@ -1,3 +1,18 @@
|
|||||||
|
Mon Sep 15 18:33:06 1997 Nick Clifton <nickc@cygnus.com>
|
||||||
|
|
||||||
|
* config/tc-v850.c (processor_mask): New variable.
|
||||||
|
(set_machine, md_parse_option): Set processor_mask.
|
||||||
|
(md_assemble): Check that instruction is available to target
|
||||||
|
processor.
|
||||||
|
|
||||||
|
* config/tc-v850.h (TARGET_PROCESSOR): New constant.
|
||||||
|
start-sanitize-v850e
|
||||||
|
(TARGET_PROCESSOR): New constant.
|
||||||
|
end-sanitize-v850e
|
||||||
|
start-sanitize-v850eq
|
||||||
|
(TARGET_PROCESSOR): New constant.
|
||||||
|
end-sanitize-v850eq
|
||||||
|
|
||||||
start-sanitize-tx19
|
start-sanitize-tx19
|
||||||
Mon Sep 15 17:26:46 1997 Gavin Koch <gavin@cygnus.com>
|
Mon Sep 15 17:26:46 1997 Gavin Koch <gavin@cygnus.com>
|
||||||
|
|
||||||
|
@ -34,9 +34,12 @@ static bfd_reloc_code_real_type hold_cons_reloc;
|
|||||||
static boolean warn_signed_overflows = FALSE;
|
static boolean warn_signed_overflows = FALSE;
|
||||||
static boolean warn_unsigned_overflows = FALSE;
|
static boolean warn_unsigned_overflows = FALSE;
|
||||||
|
|
||||||
/* Indicates the target processor type. */
|
/* Indicates the target BFD machine number. */
|
||||||
static int machine = TARGET_MACHINE;
|
static int machine = TARGET_MACHINE;
|
||||||
|
|
||||||
|
/* Indicates the target processor(s) for the assemble. */
|
||||||
|
static unsigned int processor_mask = TARGET_PROCESSOR;
|
||||||
|
|
||||||
|
|
||||||
/* Structure to hold information about predefined registers. */
|
/* Structure to hold information about predefined registers. */
|
||||||
struct reg_name
|
struct reg_name
|
||||||
@ -211,6 +214,17 @@ set_machine (int number)
|
|||||||
{
|
{
|
||||||
machine = number;
|
machine = number;
|
||||||
bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine);
|
bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine);
|
||||||
|
|
||||||
|
switch (machine)
|
||||||
|
{
|
||||||
|
case 0: processor_mask = PROCESSOR_V850; break;
|
||||||
|
/* start-sanitize-v850e */
|
||||||
|
case bfd_mach_v850e: processor_mask = PROCESSOR_V850E; break;
|
||||||
|
/* end-sanitize-v850e */
|
||||||
|
/* start-sanitize-v850eq */
|
||||||
|
case bfd_mach_v850eq: processor_mask = PROCESSOR_V850EQ; break;
|
||||||
|
/* end-sanitize-v850eq */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The target specific pseudo-ops which we support. */
|
/* The target specific pseudo-ops which we support. */
|
||||||
@ -821,6 +835,8 @@ md_parse_option (c, arg)
|
|||||||
else if (strcmp (arg, "v850e") == 0)
|
else if (strcmp (arg, "v850e") == 0)
|
||||||
{
|
{
|
||||||
machine = bfd_mach_v850e;
|
machine = bfd_mach_v850e;
|
||||||
|
processor_mask = PROCESSOR_V850 | PROCESSOR_V850E;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* end-sanitize-v850e */
|
/* end-sanitize-v850e */
|
||||||
@ -828,6 +844,7 @@ md_parse_option (c, arg)
|
|||||||
else if (strcmp (arg, "v850eq") == 0)
|
else if (strcmp (arg, "v850eq") == 0)
|
||||||
{
|
{
|
||||||
machine = bfd_mach_v850eq;
|
machine = bfd_mach_v850eq;
|
||||||
|
processor_mask = PROCESSOR_V850EQ;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* end-sanitize-v850eq */
|
/* end-sanitize-v850eq */
|
||||||
@ -1133,9 +1150,16 @@ md_assemble (str)
|
|||||||
{
|
{
|
||||||
const char * errmsg = NULL;
|
const char * errmsg = NULL;
|
||||||
|
|
||||||
|
match = 0;
|
||||||
|
|
||||||
|
if ((opcode->processors & processor_mask) == 0)
|
||||||
|
{
|
||||||
|
errmsg = "Target processor doe snot support this instruction.";
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
relaxable = 0;
|
relaxable = 0;
|
||||||
fc = 0;
|
fc = 0;
|
||||||
match = 0;
|
|
||||||
next_opindex = 0;
|
next_opindex = 0;
|
||||||
insn = opcode->opcode;
|
insn = opcode->opcode;
|
||||||
extra_data_after_insn = false;
|
extra_data_after_insn = false;
|
||||||
|
@ -29,8 +29,10 @@
|
|||||||
/* The target BFD architecture. */
|
/* The target BFD architecture. */
|
||||||
#define TARGET_ARCH bfd_arch_v850
|
#define TARGET_ARCH bfd_arch_v850
|
||||||
|
|
||||||
|
/* The target BFD format. */
|
||||||
#define TARGET_FORMAT "elf32-v850"
|
#define TARGET_FORMAT "elf32-v850"
|
||||||
|
|
||||||
|
/* The target BFD machine number. */
|
||||||
#define TARGET_MACHINE 0
|
#define TARGET_MACHINE 0
|
||||||
/* start-sanitize-v850e */
|
/* start-sanitize-v850e */
|
||||||
#undef TARGET_MACHINE
|
#undef TARGET_MACHINE
|
||||||
@ -41,6 +43,18 @@
|
|||||||
#define TARGET_MACHINE bfd_mach_v850eq
|
#define TARGET_MACHINE bfd_mach_v850eq
|
||||||
/* end-sanitize-v850eq */
|
/* end-sanitize-v850eq */
|
||||||
|
|
||||||
|
/* The target processor mask. */
|
||||||
|
#define TARGET_PROCESSOR PROCESSOR_V850
|
||||||
|
/* start-sanitize-v850e */
|
||||||
|
#undef TARGET_PROCESSOR
|
||||||
|
#define TARGET_PROCESSOR PROCESSOR_V850E
|
||||||
|
/* end-sanitize-v850e */
|
||||||
|
/* start-sanitize-v850eq */
|
||||||
|
#undef TARGET_PROCESSOR
|
||||||
|
#define TARGET_PROCESSOR PROCESSOR_V850EQ
|
||||||
|
/* end-sanitize-v850eq */
|
||||||
|
|
||||||
|
|
||||||
#define MD_APPLY_FIX3
|
#define MD_APPLY_FIX3
|
||||||
#define md_operand(x)
|
#define md_operand(x)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user