[rfc] For mips, sign-extended ecoff offsets

Ian Lance Taylor ian@zembu.com
Mon Jun 19 20:39:00 GMT 2000

   Date: Tue, 20 Jun 2000 11:50:26 +1000 (EST)
   From: Alan Modra <alan@linuxcare.com.au>

   > > I'm worried about what happens if things like PDR.adr get changed from
   > > 0xa0000000 to 0xffffffffa0000000.
   > Thats why I'm asking :-) Remember though, on the MIPS platform, if
   > ``PDR.adr'' is an address then, the canonical form of the value
   > ``0xa0000000'' obtained from an elf32 binary is 0xffffffffa00000000. 
   > GDB and BFD have, for too many years, been bribed and cajoled into
   > perpetuated the lie that MIPS doesn't sign extend addresses.   GDB's now
   > decided to come clean on this matter (and purge an amazing amount of
   > bogus code :-).

   > I guess the question for BFD people is, is this the correct approach to
   > fixing this bug?

   I'd like to hear Ian's comments on this before you check it in.

This is all due to a long-ago decision to ship support for a 64-bit
MIPS chip using a 32-bit MIPS target.  I think that sign extending
pdr.ADR is probably right, since that is how 32 bit addresses are
treated by the relocation routines.  But the real fix is to use a
64-bit MIPS target.


More information about the Binutils mailing list