mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
* config/tc-mips.c (load_register): Correctly handle 32 bit values
with the high bit set in 64 bit mode. PR 6381.
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
Fri Feb 24 14:41:15 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* config/tc-mips.c (load_register): Correctly handle 32 bit values
|
||||
with the high bit set in 64 bit mode.
|
||||
|
||||
Wed Feb 22 23:10:56 1995 Jeff Law (law@snake.cs.utah.edu)
|
||||
|
||||
* config/tc-hppa.c (md_apply_fix): Don't subtract the value of the
|
||||
|
@ -1634,7 +1634,7 @@ load_register (counter, reg, ep)
|
||||
expressionS *ep;
|
||||
{
|
||||
int shift;
|
||||
expressionS hi32, lo32;
|
||||
expressionS hi32, lo32, tmp;
|
||||
|
||||
if (ep->X_op != O_big)
|
||||
{
|
||||
@ -1656,9 +1656,12 @@ load_register (counter, reg, ep)
|
||||
(int) BFD_RELOC_LO16);
|
||||
return;
|
||||
}
|
||||
else if ((ep->X_add_number &~ (offsetT) 0x7fffffff) == 0
|
||||
|| ((ep->X_add_number &~ (offsetT) 0x7fffffff)
|
||||
== ~ (offsetT) 0x7fffffff))
|
||||
else if (((ep->X_add_number &~ (offsetT) 0x7fffffff) == 0
|
||||
|| ((ep->X_add_number &~ (offsetT) 0x7fffffff)
|
||||
== ~ (offsetT) 0x7fffffff))
|
||||
&& (mips_isa < 3
|
||||
|| sizeof (ep->X_add_number) > 4
|
||||
|| (ep->X_add_number & 0x80000000) == 0))
|
||||
{
|
||||
/* 32 bit values require an lui. */
|
||||
macro_build ((char *) NULL, counter, ep, "lui", "t,u", reg,
|
||||
@ -1668,6 +1671,19 @@ load_register (counter, reg, ep)
|
||||
(int) BFD_RELOC_LO16);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 32 bit value with high bit set being loaded into a 64 bit
|
||||
register. We can't use lui, because that would
|
||||
incorrectly set the 32 high bits. */
|
||||
generic_bignum[3] = 0;
|
||||
generic_bignum[2] = 0;
|
||||
generic_bignum[1] = (ep->X_add_number >> 16) & 0xffff;
|
||||
generic_bignum[0] = ep->X_add_number & 0xffff;
|
||||
tmp.X_op = O_big;
|
||||
tmp.X_add_number = 4;
|
||||
ep = &tmp;
|
||||
}
|
||||
}
|
||||
|
||||
/* The value is larger than 32 bits. */
|
||||
|
Reference in New Issue
Block a user