* config/tc-tic80.c (build_insn): Handle instructions that have
long (32 bit) PC relative offsets. Fix places that previously misused R_MPPCR for 15 bit offsets to use the new R_MPPCR15W type. (md_apply_fix): Add case to handle long PC relative offsets. PR 12927
This commit is contained in:
parent
c2a45746f8
commit
599ef811c3
@ -1,3 +1,12 @@
|
||||
start-sanitize-tic80
|
||||
Fri Dec 12 11:44:20 1997 Fred Fish <fnf@cygnus.com>
|
||||
|
||||
* config/tc-tic80.c (build_insn): Handle instructions that have
|
||||
long (32 bit) PC relative offsets. Fix places that previously
|
||||
misused R_MPPCR for 15 bit offsets to use the new R_MPPCR15W type.
|
||||
(md_apply_fix): Add case to handle long PC relative offsets.
|
||||
|
||||
end-sanitize-tic80
|
||||
Fri Dec 12 10:35:01 1997 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* doc/c-arm.texi (ARM Options): Document support for new ARM
|
||||
|
@ -635,26 +635,38 @@ build_insn (opcode, opers)
|
||||
}
|
||||
break;
|
||||
case O_symbol:
|
||||
if (flags & TIC80_OPERAND_PCREL)
|
||||
if (bits == 32)
|
||||
{
|
||||
fx = frag_more (4);
|
||||
fxfrag = frag_now;
|
||||
insn[1] = 0;
|
||||
if (flags & TIC80_OPERAND_PCREL)
|
||||
{
|
||||
fix_new_exp (fxfrag,
|
||||
fx - (fxfrag -> fr_literal),
|
||||
4,
|
||||
&opers[expi],
|
||||
1,
|
||||
R_MPPCR);
|
||||
}
|
||||
else
|
||||
{
|
||||
fix_new_exp (fxfrag,
|
||||
fx - (fxfrag -> fr_literal),
|
||||
4,
|
||||
&opers[expi],
|
||||
0,
|
||||
R_RELLONGX);
|
||||
}
|
||||
}
|
||||
else if (flags & TIC80_OPERAND_PCREL)
|
||||
{
|
||||
fix_new_exp (ffrag,
|
||||
f - (ffrag -> fr_literal),
|
||||
4, /* FIXME! how is this used? */
|
||||
&opers[expi],
|
||||
1,
|
||||
R_MPPCR);
|
||||
}
|
||||
else if (bits == 32) /* was (flags & TIC80_OPERAND_BASEREL) */
|
||||
{
|
||||
fx = frag_more (4);
|
||||
fxfrag = frag_now;
|
||||
insn[1] = 0;
|
||||
fix_new_exp (fxfrag,
|
||||
fx - (fxfrag -> fr_literal),
|
||||
4,
|
||||
&opers[expi],
|
||||
0,
|
||||
R_RELLONGX);
|
||||
R_MPPCR15W);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -931,10 +943,17 @@ md_apply_fix (fixP, val)
|
||||
md_number_to_chars (dest, (valueT) val, 4);
|
||||
break;
|
||||
case R_MPPCR:
|
||||
overflow = (val < -65536) || (val > 65532);
|
||||
val >>= 2;
|
||||
val += 1; /* Target address computed from inst start */
|
||||
md_number_to_chars (dest, (valueT) val, 4);
|
||||
break;
|
||||
case R_MPPCR15W:
|
||||
overflow = (val < -65536L) || (val > 65532L);
|
||||
if (overflow)
|
||||
{
|
||||
as_bad_where (fixP -> fx_file, fixP -> fx_line, "PC relative target out of range");
|
||||
as_bad_where (fixP -> fx_file, fixP -> fx_line,
|
||||
"PC offset 0x%lx outside range 0x%lx-0x%lx",
|
||||
val, -65536L, 65532L);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user