public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Sandiford <r.sandiford@redhat.com>
To: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
Cc: binutils@sources.redhat.com
Subject: Re: [PATCH] Fix distinction of 32/64bit addresses in MIPS gas
Date: Fri, 07 Sep 2001 04:10:00 -0000	[thread overview]
Message-ID: <wvng09zw91o.fsf@talisman.cambridge.redhat.com> (raw)
In-Reply-To: <20010907055315.A351@rembrandt.csv.ica.uni-stuttgart.de>

Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:

> Richard Sandiford wrote:
> [snip]
> > AFAIK, R_MIPS_64 won't be used unless you have 64-bit addresses (and
> > hence 64-bit registers), or if you have an explicit pseudo-op like
> > .8byte.  o32 binaries wouldn't be using either of those things anyway,
> > would they?
> 
> That's right, but you can't tell if it is actually o32 conformant
> by looking at the ELF header. There is no flag which says
> "Warning! This object does not conform to any established ABI".
> It would be nice to have one.

Well, there's the O32 flag, which is only set if -mabi=32 is given.
That bit does guarantee register and address size, just not the lack of
64-bit relocs generated by .8byte and the like.  Maybe GAS should warn
about that?

> > I thought the consensus some time ago was that o32 implied 32-bit
> > registers, and therefore 32-bit addresses.  The HAVE_??BIT_ macros are
> > already set up like that as long as you specify -mabi=32 on the command
> > line.
> 
> That's all fine for 32bit, but I needed a way to check if 64bit
> addresses can be used generally (e.g. for dli). Something like
> ! HAVE_32BIT_ADDRESSES won't do that, because full 64bit support
> needs a 64bit object format.

But *limited* 64-bit support is available with elf32 as things stand...

> Having a HAVE_64BIT_ADDRESSES macro which is _not_ the inverse of
> HAVE_32BIT_ADDRESSES is ugly.

...so I'm still unsure why that's necessary.

> I also found no reason why there is made use of 64bit instructions
> like daddiu for a 32bit load. It makes the code look different from
> o32 while doing the same.

But if the code was written or compiled with 64-bit addresses in mind,
it seems natural enough to use daddu in pointer arithmetic.  Does it do
any harm?  The only reason I can see for making HAVE_32BIT_ADDRESSES any
stricter is if there's a situation in which code written for 32-bit
addresses can't be assembled that way as things stand, presumably
because GAS's command-line options are too inflexible.

> This was the one part of my patch. The other was to change (d)la to
> chose it's expansion in dependency of the address model instead of
> the insn name. That's the way the SGI assembler behaves, and this
> is the useful behaviour for ABI conformance. For 64bit code in an
> 32bit object file this may have side effects (the usability of
> R_MIPS_64 is not affected).

Right.  For the record, I'm only talking about the other bit (the big
one).

Richard

  parent reply	other threads:[~2001-09-07  4:10 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-24 18:26 Thiemo Seufer
2001-08-31  8:02 ` Richard Sandiford
2001-08-31  8:28   ` H . J . Lu
2001-08-31  9:17   ` Thiemo Seufer
2001-08-31  9:53     ` Geoff Keating
2001-08-31 10:31       ` Thiemo Seufer
     [not found]         ` <mailpost.999279120.2469@postal.sibyte.com>
2001-08-31 10:37           ` cgd
2001-08-31 11:46             ` Thiemo Seufer
2001-08-31 11:49               ` Ian Lance Taylor
2001-08-31 11:50               ` Ian Lance Taylor
     [not found]               ` <mailpost.999283589.5294@postal.sibyte.com>
2001-08-31 12:41                 ` cgd
2001-08-31 14:31                   ` H . J . Lu
2001-09-03 23:07                     ` cgd
2001-09-06 10:50                       ` H . J . Lu
2001-09-06 10:59                         ` cgd
2001-09-06 11:07                           ` H . J . Lu
2001-09-06 11:35                             ` Thiemo Seufer
2001-09-06 11:39                             ` cgd
2001-09-06 11:40                               ` cgd
2001-09-08 12:03                               ` Andrew Cagney
2001-09-08 16:38                                 ` Thiemo Seufer
2001-09-08 16:56                                   ` Thiemo Seufer
2001-09-06 11:57                             ` Richard Sandiford
2001-09-06 20:53                               ` Thiemo Seufer
2001-09-06 21:09                                 ` Thiemo Seufer
2001-09-06 21:12                                 ` Thiemo Seufer
2001-09-06 22:38                                   ` H . J . Lu
2001-09-06 23:11                                     ` Thiemo Seufer
2001-09-07  4:10                                 ` Richard Sandiford [this message]
2001-09-07  6:22                                   ` Thiemo Seufer
2001-09-07  7:02                                     ` Richard Sandiford
2001-09-07  8:11                                       ` Thiemo Seufer
2001-09-07  9:20                                         ` Richard Sandiford
2001-09-07  9:49                                           ` Thiemo Seufer
2001-09-06 11:14                           ` Thiemo Seufer
2001-09-06 11:08                         ` Thiemo Seufer
2001-08-31 18:22                   ` Thiemo Seufer
2001-09-03  2:57                     ` Richard Sandiford
2001-09-03 15:00                       ` Thiemo Seufer
2001-08-31 14:49               ` Andrew Cagney
2001-08-31 15:00                 ` H . J . Lu
2001-08-31 16:30                   ` Eric Christopher
2001-08-31 16:41                     ` Andrew Cagney
2001-08-31 16:46                       ` H . J . Lu
2001-08-31 17:45                         ` matthew green
2001-09-02 19:25                         ` J Grant
2001-08-31 16:44                     ` H . J . Lu
2001-08-31 17:42                       ` matthew green
2001-08-31 19:06                         ` H . J . Lu
2001-08-31 19:11                           ` matthew green
     [not found]                             ` <mailpost.999310274.17560@postal.sibyte.com>
2001-09-03 23:18                               ` cgd
2001-09-06 11:00                                 ` H . J . Lu
2001-09-06 11:38                                   ` cgd
2001-09-06 12:09                                     ` H . J . Lu
2001-08-31 18:49                     ` Thiemo Seufer
2001-08-31 17:35                   ` matthew green
2001-08-31 19:05                     ` H . J . Lu
2001-08-31 18:25                 ` Thiemo Seufer
2001-08-31 20:46                   ` Ian Lance Taylor
2001-08-31 21:04                     ` Thiemo Seufer
2001-08-31 10:04     ` Richard Sandiford
2001-08-31 10:41       ` Thiemo Seufer

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=wvng09zw91o.fsf@talisman.cambridge.redhat.com \
    --to=r.sandiford@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=ica2_ts@csv.ica.uni-stuttgart.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).