Linux MIPS Architecture development
 help / color / mirror / Atom feed
* DWARF2 exception doesn't work with gcc and gas on MIPS.
@ 2001-06-14  4:29 H . J . Lu
  2001-06-14  5:50 ` Ian Lance Taylor
  2001-06-14 17:19 ` Richard Henderson
  0 siblings, 2 replies; 10+ messages in thread
From: H . J . Lu @ 2001-06-14  4:29 UTC (permalink / raw)
  To: gcc, binutils, linux-mips

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-06-14 19:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-14  4:29 DWARF2 exception doesn't work with gcc and gas on MIPS H . J . Lu
2001-06-14  5:50 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox