* emultempl/spu_ovl.S: Don't trash lr on tail call from one
authorAlan Modra <amodra@gmail.com>
Thu, 14 Jun 2007 08:41:41 +0000 (08:41 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 14 Jun 2007 08:41:41 +0000 (08:41 +0000)
overlay to another.
* emultempl/spu_ovl.o: Regenerate.

ld/ChangeLog
ld/emultempl/spu_ovl.S
ld/emultempl/spu_ovl.o

index d31157e88986a71bbcd1c4d038406abc09d25d6e..2d4463813bdedf9a4f6b606dfad3e5fa1939e637 100644 (file)
@@ -1,3 +1,9 @@
+2007-06-14  Alan Modra  <amodra@bigpond.net.au>
+
+       * emultempl/spu_ovl.S: Don't trash lr on tail call from one
+       overlay to another.
+       * emultempl/spu_ovl.o: Regenerate.
+
 2007-06-11  Bob Wilson  <bob.wilson@acm.org>
 
        * emulparams/elf32xtensa.sh (OTHER_READONLY_SECTIONS): Add ONLY_IF_RO
index 0f1064bdaba6d2de0a72d01a2683c9ce8f297647..adc6ab22a776e2f4b74a5338c9738cd77bc0a4ce 100644 (file)
@@ -166,7 +166,12 @@ __ovly_backchain_loop:
        shufb           rv2, retval, lnkr, rv1
        shufb           rv3, $lr, $78, rv1
        fsmbi           rv1, 0xff
-       selb            $lr, rv2, rv3, rv1
+       selb            rv2, rv2, rv3, rv1
+/* If we have a tail call from one overlay function to another overlay,
+   then lr is already set up.  Don't change it.  */
+       ceq             rv1, $lr, retval
+       fsmb            rv1, rv1
+       selb            $lr, rv2, $lr, rv1
 
 /* Branch to $79 if non-overlay */
        brz             $78, __ovly_load_restore
index 51a9bbd1121d56dabf9ac1b11a24dfb72dae6686..a68eea3970aaced86a5b5358c14636987aebaffa 100644 (file)
Binary files a/ld/emultempl/spu_ovl.o and b/ld/emultempl/spu_ovl.o differ