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

Richard Sandiford wrote:
> Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:
> > How could it do that? The o32 ABI does _not_ specify this flag,
> > a file without any ABI flags set is a valid o32 file. I can't
> > see what the use of the O32 header flag could be.
> 
> Ok, that hadn't twigged, sorry!
> 
> So, if I've understood you correctly, your take seems to be:
> 
> - O32 doesn't define an ABI bit for ELF, so every ELF file without
>   an ABI flag set should be compatible with O32.

Not exactly. Most tools will _regard_ it as o32, even if it isn't.

> Whereas mine is:
> 
> - O32 doesn't define an ABI bit for ELF, so users dosn't have that
>   safety net if they use the wrong options.  They need to remember
>   to use the appropriate command-line switches, like -mabi=32.

ABI header flags were invented for remembering it. It would be nice
if the linker had a chance to find out what the file actually is.

>   Fleshing that out a bit, I think:
> 
>   GAS has historically supported all sorts of wierd and wonderful
>   combinations that don't have any representation in the ELF header
>   flags.  And for which no ABI flags will be set.  I don't think that's
>   reason enough not to allow them.  GAS should generate whatever code
>   the command line tells it to, whether or not those options can be
>   determined from the output file.

One NO_ABI_FLAG as a catchall would be enough to let at least the
GNU tools know what the file is _not_.

[snip]
> > AFAICS my patch doesn't break the limited 64bit support.
> 
> Like you said in your previous mail, it means that $gp is now assumed to
> be a 32-bit rather than 64-bit value.

This is always assumed for everything loaded in 32bit address space.

> There might be dynamic loaders
> out there that handle the R_MIPS_64 extension, which could replace them
> with genuine 64-bit (as opposed to sign-extended 32-bit) addresses.

They can't, because R_MIPS_64 holds only 32bit in this case.

[snip]
> > Yes, it inflates the number of variants without need.
> 
> ...I really don't see why maintaining the old variant is a problem.  All
> the main part of your patch did was change the definition of the
> HAVE_32BIT_ADDRESSES macro, it didn't really seem to simplify the code
> as such.

It didn't increase complexity while providing all what I need
for full 64bit support. That's the advantage over a
32BIT -- HALF_64BIT -- FULL_64BIT approach.

[snip]
> I still don't see why you need to do that, sorry!  Sometimes these things
> take a while to sink in.  In what situation would the two be different?
> Like you say, they should be inverses.

Full 64bit support requires a 64bit object format to work, half
64bit support doesn't have one and has it's code in 32bit space.
This means for e.g. "dli" a expansion to

	lui	$a, %highest(sym)
	lui	$b, %hi(sym)
	daddiu	$a, %higher(sym)
	daddiu	$b, %lo(sym)
	dsll32	$a, 0
	daddu	$a, $a, $b

for 64bit addresses, while 32bit addresses should use

	lui	$a, %hi(sym)
	addiu	$a, %lo(sym)

for performance and code size. The half 64bit version currently
uses

	lui	$a, %hi(sym)
	daddiu	$a, %lo(sym)

which does exactly the same but pretends to use 64bit addresses.
I hope it got clearer now.


Thiemo

  reply	other threads:[~2001-09-07  8:11 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
2001-09-07  6:22                                   ` Thiemo Seufer
2001-09-07  7:02                                     ` Richard Sandiford
2001-09-07  8:11                                       ` Thiemo Seufer [this message]
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=20010907171141.C30834@rembrandt.csv.ica.uni-stuttgart.de \
    --to=ica2_ts@csv.ica.uni-stuttgart.de \
    --cc=binutils@sources.redhat.com \
    /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).