summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Zankel <chris@zankel.net>2008-09-13 20:26:06 +0000
committerChris Zankel <chris@zankel.net>2008-09-13 20:26:06 +0000
commitc9db9e50e6d86816d3304aba958d426aace90443 (patch)
tree23a6a1f6cb64cdc61f30244a879b64cfb2a34eba
parent5de7a21d7139e71ca6307ed4e2837d69b2f06d56 (diff)
xtensa: Stack unwinding on Xtensa requires that the return address register always be valid. This patch fixes a part of ldso that had been using an Xtensa CALL0 instruction to get the current PC value, which temporarily clobbered the return address register. The revised code just loads the address of a label in the code. See my change to GCC from 2007-12-20 for more info (http://gcc.gnu.org/ml/gcc-patches/2007-12/msg01023.html).
-rw-r--r--ldso/ldso/xtensa/resolve.S12
1 files changed, 4 insertions, 8 deletions
diff --git a/ldso/ldso/xtensa/resolve.S b/ldso/ldso/xtensa/resolve.S
index fb298391c..902cd8238 100644
--- a/ldso/ldso/xtensa/resolve.S
+++ b/ldso/ldso/xtensa/resolve.S
@@ -32,15 +32,11 @@
.type _dl_linux_resolve, @function
_dl_linux_resolve:
/* Fix up the high 2 bits of the return address. */
- mov a14, a0 // save a0 temporarily
- _call0 0f
- .align 4
-0: extui a13, a0, 30, 2
- slli a13, a13, 30
- mov a0, a14 // restore a0
+ movi a13, 0f
slli a12, a0, 2
- srli a12, a12, 2
- or a12, a12, a13
+0: extui a13, a13, 30, 2
+ ssai 2
+ src a12, a13, a12
/* Call the fixup function. */
movi a8, _dl_linux_resolver