From: Andrew Cagney <ac131313@ges.redhat.com>
To: Fred Fish <fnf@intrinsity.com>
Cc: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>,
binutils@sources.redhat.com, gdb@sources.redhat.com
Subject: Re: MIPS sign extension of addresses
Date: Thu, 12 Sep 2002 08:19:00 -0000 [thread overview]
Message-ID: <3D80B08E.6050001@ges.redhat.com> (raw)
In-Reply-To: <200209121449.g8CEnmL09055@beeville.vert.intrinsity.com>
>> 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.
>
>
> So does that mean that it would be more desirable if the MIPS ports used
> signed long long for bfd_vma/CORE_ADDR instead of unsigned long long?
>
> I'm willing to work on making that happen if that is the consensus for
> making MIPS support more consistent with how the hardware works.
>
> I've not yet checked, but are there fundamental reasons why bfd_vma
> or CORE_ADDR have to be unsigned?
I don't think it will help. I think it will also hinder the situtation
where BFD/GDB are supporting multiple architectures - one signed and one
unsigned.
``signed long long'' and ``unsigned long long'' would only show their
true colours if there was a ``signed/unsigned long long long'' type.
Anyway, several problems occure:
- code extracts a small value and gets its sign extension wrong
Here, I think all we can do is continue tracking down cases.
- code does boundary arrithmetic (0x7fffffff+1 == 0xffffffff80000000)
Here, it happens so rarely that it isn't worth worrying about.
Eventually someone will implement a CORE_ADDR object and that will
really fix the problem.
- code doesn't use CORE_ADDR and {U]LONGEST correctly (occures when
sizeof (CORE_ADDR) < sizeof ([U]LONGEST) --- i386.
A CORE_ADDR object would fix this to. However, being more careful
wouldn't hurt.
Andrew
next prev parent reply other threads:[~2002-09-12 15:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-10 8:49 Fred Fish
2002-09-10 9:25 ` Paul Koning
2002-09-10 10:00 ` Maciej W. Rozycki
2002-09-10 9:57 ` Maciej W. Rozycki
2002-09-12 7:49 ` Fred Fish
2002-09-12 8:19 ` Andrew Cagney [this message]
2002-09-12 8:30 ` Daniel Jacobowitz
2002-09-13 0:36 ` Maciej W. Rozycki
2002-09-13 11:26 ` Andrew Cagney
2002-09-10 12:07 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D80B08E.6050001@ges.redhat.com \
--to=ac131313@ges.redhat.com \
--cc=binutils@sources.redhat.com \
--cc=fnf@intrinsity.com \
--cc=gdb@sources.redhat.com \
--cc=macro@ds2.pg.gda.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox