* config/tc-mips.c (mips16_extended_frag): Don't call
S_GET_VALUE. (md_convert_frag): Call resolve_symbol_value before calling S_GET_VALUE, and don't add in the frag address.
This commit is contained in:
parent
15e69f9816
commit
f74ba7a3d9
|
@ -1,5 +1,10 @@
|
||||||
Fri Dec 6 18:48:13 1996 Ian Lance Taylor <ian@cygnus.com>
|
Fri Dec 6 18:48:13 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
|
* config/tc-mips.c (mips16_extended_frag): Don't call
|
||||||
|
S_GET_VALUE.
|
||||||
|
(md_convert_frag): Call resolve_symbol_value before calling
|
||||||
|
S_GET_VALUE, and don't add in the frag address.
|
||||||
|
|
||||||
* config/tc-mips.c (mips16_immed): Add file and line parameters,
|
* config/tc-mips.c (mips16_immed): Add file and line parameters,
|
||||||
and use them when reporting errors. Change all callers.
|
and use them when reporting errors. Change all callers.
|
||||||
|
|
||||||
|
|
|
@ -9009,6 +9009,7 @@ mips16_extended_frag (fragp, sec, stretch)
|
||||||
register const struct mips16_immed_operand *op;
|
register const struct mips16_immed_operand *op;
|
||||||
offsetT val;
|
offsetT val;
|
||||||
int mintiny, maxtiny;
|
int mintiny, maxtiny;
|
||||||
|
segT symsec;
|
||||||
|
|
||||||
type = RELAX_MIPS16_TYPE (fragp->fr_subtype);
|
type = RELAX_MIPS16_TYPE (fragp->fr_subtype);
|
||||||
op = mips16_immed_operands;
|
op = mips16_immed_operands;
|
||||||
|
@ -9037,14 +9038,26 @@ mips16_extended_frag (fragp, sec, stretch)
|
||||||
maxtiny = (1 << (op->nbits - 1)) - 1;
|
maxtiny = (1 << (op->nbits - 1)) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: If this is an expression symbol, this will fix its value.
|
/* We can't call S_GET_VALUE here, because we don't want to lock in
|
||||||
If the expression is actually a subtraction of two symbols in the
|
a particular frag address. */
|
||||||
segment being relaxed, the value will get fixed inappropriately. */
|
if (fragp->fr_symbol->sy_value.X_op == O_constant)
|
||||||
val = S_GET_VALUE (fragp->fr_symbol);
|
{
|
||||||
|
val = (fragp->fr_symbol->sy_value.X_add_number
|
||||||
/* When we are called, symbol values are offsets within a frag. The
|
+ fragp->fr_symbol->sy_frag->fr_address);
|
||||||
address of the frag has not yet been added into the value. */
|
symsec = S_GET_SEGMENT (fragp->fr_symbol);
|
||||||
val += fragp->fr_symbol->sy_frag->fr_address;
|
}
|
||||||
|
else if (fragp->fr_symbol->sy_value.X_op == O_symbol
|
||||||
|
&& (fragp->fr_symbol->sy_value.X_add_symbol->sy_value.X_op
|
||||||
|
== O_constant))
|
||||||
|
{
|
||||||
|
val = (fragp->fr_symbol->sy_value.X_add_symbol->sy_value.X_add_number
|
||||||
|
+ fragp->fr_symbol->sy_value.X_add_symbol->sy_frag->fr_address
|
||||||
|
+ fragp->fr_symbol->sy_value.X_add_number
|
||||||
|
+ fragp->fr_symbol->sy_frag->fr_address);
|
||||||
|
symsec = S_GET_SEGMENT (fragp->fr_symbol->sy_value.X_add_symbol);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
|
||||||
if (op->pcrel)
|
if (op->pcrel)
|
||||||
{
|
{
|
||||||
|
@ -9063,7 +9076,7 @@ mips16_extended_frag (fragp, sec, stretch)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (S_GET_SEGMENT (fragp->fr_symbol) != sec)
|
if (symsec != sec)
|
||||||
{
|
{
|
||||||
fragp->fr_subtype =
|
fragp->fr_subtype =
|
||||||
RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype);
|
RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype);
|
||||||
|
@ -9470,8 +9483,8 @@ md_convert_frag (abfd, asec, fragp)
|
||||||
ext = false;
|
ext = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resolve_symbol_value (fragp->fr_symbol);
|
||||||
val = S_GET_VALUE (fragp->fr_symbol);
|
val = S_GET_VALUE (fragp->fr_symbol);
|
||||||
val += fragp->fr_symbol->sy_frag->fr_address;
|
|
||||||
if (op->pcrel)
|
if (op->pcrel)
|
||||||
{
|
{
|
||||||
addressT addr;
|
addressT addr;
|
||||||
|
|
Loading…
Reference in New Issue