This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: MIPS sign extension of addresses
- From: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- To: Fred Fish <fnf at intrinsity dot com>
- Cc: binutils at sources dot redhat dot com, gdb at sources dot redhat dot com
- Date: Tue, 10 Sep 2002 18:57:49 +0200 (MET DST)
- Subject: Re: MIPS sign extension of addresses
- Organization: Technical University of Gdansk
On Tue, 10 Sep 2002, Fred Fish wrote:
> Most of the problems I fixed had to do with the fact that BFD takes
> the 32 bit unsigned addresses from object and executable files, sign
> extends them, and then stores the result as a bfd_vma, which is an
> unsigned 64 bit type (unsigned long long). For example, the unsigned
> 32 bit address 0x80020004 becomes an unsigned 64 bit bfd_vma/CORE_ADDR
> of 0xffffffff80020004. The bfd_vma type is used to define gdb's
> CORE_ADDR types.
Well, that seems the reason of the trouble -- for MIPS addresses in
object and executable files should be treated as signed and bfd_vma should
be a signed type since that's how MIPS works.
The two addresses you quote are indeed equivalent.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +