public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: "Maciej W. Rozycki" <macro@codesourcery.com>
Cc: Catherine Moore <clm@codesourcery.com>,  binutils@sourceware.org
Subject: Re: [PATCH 10/20] MIPS/GAS: Fail on 64-bit addresses used with LI
Date: Thu, 09 Dec 2010 17:41:00 -0000	[thread overview]
Message-ID: <g4vd32sv2t.fsf@richards-desktop-2.stglab.manchester.uk.ibm.com> (raw)
In-Reply-To: <alpine.DEB.1.10.1012090133140.5345@tp.orcam.me.uk> (Maciej	W. Rozycki's message of "Thu\, 9 Dec 2010 16\:09\:27 +0000 \(GMT\)")

"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> On Tue, 7 Dec 2010, Richard Sandiford wrote:
>> Not OK.  This trivially triggers for:
>> 
>> 	li.d	$f2,1.1
>> 
>> assembled with -mabi=64 -G0.
>
>  And rightfully so, broken code is produced:
>
> $ cat li_d.s
> 	li.d	$f2, 1.1
> $ mips-sde-elf-as -mabi=64 -G0 -o li_d.o li_d.s
> $ mips-sde-elf-ld -m elf64btsmip -e0 -o li_d li_d.o
> $ mips-sde-elf-objdump -dt li_d
>
> li_d:     file format elf64-tradbigmips
>
> SYMBOL TABLE:
> 0000000120000078 l    d  .MIPS.options	0000000000000000 .MIPS.options
> 0000000120000078 l    d  .text	0000000000000000 .text
> 0000000120000080 l    d  .rodata	0000000000000000 .rodata
> 0000000120010088 g       .rodata	0000000000000000 _fdata
> 0000000120018080 g       *ABS*	0000000000000000 _gp
> 0000000120000078 g       .text	0000000000000000 _ftext
> 0000000120010088 g       *ABS*	0000000000000000 __bss_start
> 0000000120010088 g       *ABS*	0000000000000000 _edata
> 0000000120010088 g       *ABS*	0000000000000000 _end
> 0000000120010088 g       *ABS*	0000000000000000 _fbss
>
>
>
> Disassembly of section .text:
>
> 0000000120000078 <_ftext>:
>    120000078:	3c012000 	lui	at,0x2000
>    12000007c:	d4220080 	ldc1	$f2,128(at)
> $
>
> I don't think the code above gets at .rodata, do you?

You're just repeating what the FIXME already says: that the code doesn't
work correctly with addresses whose values exceed the 32-bit range.
I wasn't disputing that.

>  With some tweaking we should be able to reuse code from M_L_DAB to handle 
> this case (i.e. jump to there with some prearrangements), but I may not 
> have the time to implement this stuff properly now.  Why do you think 
> silently making broken code is better than signalling an internal error 
> (which it is) here?

An assertion failure is also a bug.  Assertion failures are for
conditions that we think should never occur, so we shouldn't add
an assertion failure for a condition that is known to trigger.
We should either fix the FIXME or issue a proper diagnostic.

Richard

      reply	other threads:[~2010-12-09 17:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-02 19:20 Maciej W. Rozycki
2010-12-07 10:25 ` Richard Sandiford
2010-12-09 16:09   ` Maciej W. Rozycki
2010-12-09 17:41     ` Richard Sandiford [this message]

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=g4vd32sv2t.fsf@richards-desktop-2.stglab.manchester.uk.ibm.com \
    --to=rdsandiford@googlemail.com \
    --cc=binutils@sourceware.org \
    --cc=clm@codesourcery.com \
    --cc=macro@codesourcery.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).