All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H . J . Lu" <hjl@lucon.org>
To: gcc@gcc.gnu.org, binutils@sourceware.cygnus.com, linux-mips@oss.sgi.com
Subject: DWARF2 exception doesn't work with gcc and gas on MIPS.
Date: Wed, 13 Jun 2001 21:29:40 -0700	[thread overview]
Message-ID: <20010613212940.A22683@lucon.org> (raw)

In the MIPS gas, there is

    case M_JAL_A:
      if (mips_pic == NO_PIC)
	macro_build ((char *) NULL, &icnt, &offset_expr, "jal", "a");
      else if (mips_pic == SVR4_PIC)
	{
	  /* If this is a reference to an external symbol, and we are
	     using a small GOT, we want
	       lw	$25,<sym>($gp)		(BFD_RELOC_MIPS_CALL16)
	       nop
	       jalr	$25
	       nop
	       lw	$gp,cprestore($sp)
	     The cprestore value is set using the .cprestore
	     pseudo-op.  If we are using a big GOT, we want
	       lui	$25,<sym>		(BFD_RELOC_MIPS_CALL_HI16)
	       addu	$25,$25,$gp
	       lw	$25,<sym>($25)		(BFD_RELOC_MIPS_CALL_LO16)
	       nop
	       jalr	$25
	       nop
	       lw	$gp,cprestore($sp)
	     If the symbol is not external, we want
	       lw	$25,<sym>($gp)		(BFD_RELOC_MIPS_GOT16)
	       nop
	       addiu	$25,$25,<sym>		(BFD_RELOC_LO16)
	       jalr	$25
	       nop
	       lw $gp,cprestore($sp) */

When gcc emits

$LEHB5:
        la      $25,foobar
        jal     $31,$25 
$LEHE5:

It doesn't work since

        jal     $31,$25 

is expanded to

	jalr	$25
	nop
	lw	$gp,cprestore($sp)

Now we have

$LEHB5:
        la      $25,foobar
	jalr	$25
	nop
	lw	$gp,cprestore($sp)
$LEHE5:

When foobar throws an exception, GP won't get restored. What we want is

$LEHB5:
        la      $25,foobar
	jalr	$25
	nop
$LEHE5:
	lw	$gp,cprestore($sp)

Does anyone have any suggestions how to fix it?

Thanks.


H.J.

             reply	other threads:[~2001-06-14  4:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-14  4:29 H . J . Lu [this message]
2001-06-14  5:50 ` DWARF2 exception doesn't work with gcc and gas on MIPS Ian Lance Taylor
2001-06-14  5:53   ` Ian Lance Taylor
2001-06-14  6:23   ` H . J . Lu
2001-06-14 17:19 ` Richard Henderson
2001-06-14 18:41   ` H . J . Lu
2001-06-14 19:05     ` Richard Henderson
2001-06-14 19:25       ` H . J . Lu
2001-06-14 19:42         ` Richard Henderson
2001-06-14 19:55           ` H . J . Lu

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=20010613212940.A22683@lucon.org \
    --to=hjl@lucon.org \
    --cc=binutils@sourceware.cygnus.com \
    --cc=gcc@gcc.gnu.org \
    --cc=linux-mips@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.