* config/tc-v850.h (TC_PARSE_CONS_EXPRESSION): Define.
(TC_CONS_FIX_NEW): Likewise. * config/tc-v850.c (parse_cons_expression_v850): New function. (cons_fix_new_v850): Likewise. So we can handle ".hword lo(_foo)".
This commit is contained in:
parent
4f6d7c2c30
commit
10fba7f14e
2 changed files with 52 additions and 0 deletions
|
@ -1,6 +1,11 @@
|
|||
start-sanitize-v850
|
||||
Thu Oct 24 14:31:04 1996 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* config/tc-v850.h (TC_PARSE_CONS_EXPRESSION): Define.
|
||||
(TC_CONS_FIX_NEW): Likewise.
|
||||
* config/tc-v850.c (parse_cons_expression_v850): New function.
|
||||
(cons_fix_new_v850): Likewise.
|
||||
|
||||
* config/tc-v850.h (tc_fix_adjustable): Don't adjust TDA relocs.
|
||||
|
||||
end-sanitize-v850
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
#include "as.h"
|
||||
#include "subsegs.h"
|
||||
#include "opcode/v850.h"
|
||||
|
||||
/* Temporarily holds the reloc in a cons expression. */
|
||||
static bfd_reloc_code_real_type hold_cons_reloc;
|
||||
|
||||
/* Structure to hold information about predefined registers. */
|
||||
struct reg_name
|
||||
|
@ -1004,3 +1007,47 @@ v850_insert_operand (insn, operand, val, file, line)
|
|||
insn |= (((long) val & ((1 << operand->bits) - 1)) << operand->shift);
|
||||
return insn;
|
||||
}
|
||||
|
||||
/* Parse a cons expression. We have to handle hi(), lo(), etc
|
||||
on the v850. */
|
||||
void
|
||||
parse_cons_expression_v850 (exp)
|
||||
expressionS *exp;
|
||||
{
|
||||
/* See if there's a reloc prefix like hi() we have to handle. */
|
||||
hold_cons_reloc = v850_reloc_prefix ();
|
||||
|
||||
/* Do normal expression parsing. */
|
||||
expression (exp);
|
||||
|
||||
/* If we had to handle a reloc prefix, then eat the trailing
|
||||
close paren. */
|
||||
if (hold_cons_reloc != BFD_RELOC_UNUSED)
|
||||
input_line_pointer++;
|
||||
}
|
||||
|
||||
/* Create a fixup for a cons expression. If parse_cons_expression_v850
|
||||
found a reloc prefix, then we use that reloc, else we choose an
|
||||
appropriate one based on the size of the expression. */
|
||||
void
|
||||
cons_fix_new_v850 (frag, where, size, exp)
|
||||
fragS *frag;
|
||||
int where;
|
||||
int size;
|
||||
expressionS *exp;
|
||||
{
|
||||
if (hold_cons_reloc == BFD_RELOC_UNUSED)
|
||||
{
|
||||
if (size == 4)
|
||||
hold_cons_reloc = BFD_RELOC_32;
|
||||
if (size == 2)
|
||||
hold_cons_reloc = BFD_RELOC_16;
|
||||
if (size == 1)
|
||||
hold_cons_reloc = BFD_RELOC_8;
|
||||
}
|
||||
|
||||
if (exp != NULL)
|
||||
fix_new_exp (frag, where, size, exp, 0, hold_cons_reloc);
|
||||
else
|
||||
fix_new (frag, where, size, NULL, 0, 0, hold_cons_reloc);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue