[Pkg-mono-svn-commits] [mono] 02/05: [ppc] use proper calling convention when coming from a signal handler
Jo Shields
directhex at moszumanska.debian.org
Thu Nov 10 12:54:18 UTC 2016
This is an automated email from the git hooks/post-receive script.
directhex pushed a commit to branch master-patches/fix-ppc
in repository mono.
commit 3cf6e41a2496847f470580c2097ce74add736c60
Author: Bernhard Urban <bernhard.urban at xamarin.com>
Date: Wed Nov 9 12:38:01 2016 +0100
[ppc] use proper calling convention when coming from a signal handler
ELF v2 ABI (aka. ppc64le) defines two entry points per function.
The global entry point (offset 0) sets up the TOC (r2) itself, while the
local entry point (offset 8) is a fast entry point if the TOC is
already set up properly.
When the global entry point is used, the address of the global entry
point is required in r12 according to the ABI.
(cherry picked from commit c330b2cb1d6df6d4456f7d3b99d502da6d1fd1c5)
---
mono/mini/exceptions-ppc.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/mono/mini/exceptions-ppc.c b/mono/mini/exceptions-ppc.c
index 80a579b..684d2d9 100644
--- a/mono/mini/exceptions-ppc.c
+++ b/mono/mini/exceptions-ppc.c
@@ -697,6 +697,11 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s
}
#else
UCONTEXT_REG_NIP(uc) = (unsigned long)altstack_handle_and_restore;
+#if _CALL_ELF == 2
+ /* ELF v2 ABI calling convention requires to put the target address into
+ * r12 if we use the global entry point of a function. */
+ UCONTEXT_REG_Rn(uc, 12) = (unsigned long) altstack_handle_and_restore;
+#endif
#endif
UCONTEXT_REG_Rn(uc, 1) = (unsigned long)sp;
UCONTEXT_REG_Rn(uc, PPC_FIRST_ARG_REG) = (unsigned long)(sp + 16);
@@ -739,6 +744,11 @@ setup_ucontext_return (void *uc, gpointer func)
}
#else
UCONTEXT_REG_NIP(uc) = (unsigned long)func;
+#if _CALL_ELF == 2
+ /* ELF v2 ABI calling convention requires to put the target address into
+ * r12 if we use the global entry point of a function. */
+ UCONTEXT_REG_Rn(uc, 12) = (unsigned long) func;
+#endif
#endif
#endif
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mono/packages/mono.git
More information about the Pkg-mono-svn-commits
mailing list