[patch] MIPS/gas: load/store address overflow on binutils 2.14
Maciej W. Rozycki
macro@ds2.pg.gda.pl
Tue Sep 16 14:25:00 GMT 2003
On Sun, 14 Sep 2003, Thiemo Seufer wrote:
> The appended version does so. It gets also rid of the bogus
> HAVE_64_BIT_ADDRESS_CONSTANTS define, which was effectively an alias for
> HAVE_64_BIT_GPRS, and fixes the generation of constant 64-bit addresses
> which are not 32-bit sign extended values. I guess the latter went
> unnoticed for so long because kernels are usually built in the 32-bit
> compatibility space and userland is PIC code.
I do build kernels as n64, but I haven't noticed any difference. I don't
think the difference would actually appear under any conditions -- can
HAVE_64BIT_ADDRESSES be true when HAVE_64_BIT_GPRS is not?
> + /* Sign-extending 32-bit constants makes their handling easier. */
> + if (! dbl)
> + ep->X_add_number = (((ep->X_add_number & 0xffffffff) ^ 0x80000000)
> + - 0x80000000);
> +
Do you really mean to sign-extend all constants, even if they have mixed
bits in the high 32 ones? I'd prefer to trigger an error or at least a
warning in such a case.
As Eric wrote, a test case is desireable (to assure correct operation and
to prevent possible future breakage) -- if you won't write one soon, I can
do.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
More information about the Binutils
mailing list