aboutsummaryrefslogtreecommitdiff
path: root/libgcc/config
diff options
context:
space:
mode:
authorandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-19 18:39:10 +0000
committerandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-19 18:39:10 +0000
commit84362dc19df67c32118e554b18af50d1dc886f5e (patch)
treed306fcdab4ddfa72b8d863e92fc1c054b7380aac /libgcc/config
parent2102a84e028b797654a108efb7c7aa81c4b28473 (diff)
2017-05-19 Andreas Tobler <andreast@gcc.gnu.org>
Backport from mainline 2017-05-17 Andreas Tobler <andreast@gcc.gnu.org> * config/arm/unwind-arm.h: Make _Unwind_GetIP, _Unwind_GetIPInfo and _Unwind_SetIP available as functions for arm*-*-freebsd*. * config/arm/unwind-arm.c: Implement the above. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@248300 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc/config')
-rw-r--r--libgcc/config/arm/unwind-arm.c22
-rw-r--r--libgcc/config/arm/unwind-arm.h7
2 files changed, 29 insertions, 0 deletions
diff --git a/libgcc/config/arm/unwind-arm.c b/libgcc/config/arm/unwind-arm.c
index 7e2c0d575ca..6ccd8c18ab9 100644
--- a/libgcc/config/arm/unwind-arm.c
+++ b/libgcc/config/arm/unwind-arm.c
@@ -509,3 +509,25 @@ __aeabi_unwind_cpp_pr2 (_Unwind_State state,
{
return __gnu_unwind_pr_common (state, ucbp, context, 2);
}
+
+#ifdef __FreeBSD__
+/* FreeBSD expects these to be functions */
+inline _Unwind_Ptr
+_Unwind_GetIP (struct _Unwind_Context *context)
+{
+ return _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1;
+}
+
+inline _Unwind_Ptr
+_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
+{
+ *ip_before_insn = 0;
+ return _Unwind_GetIP (context);
+}
+
+inline void
+_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
+{
+ _Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1));
+}
+#endif
diff --git a/libgcc/config/arm/unwind-arm.h b/libgcc/config/arm/unwind-arm.h
index d67383fb10c..5250d0c9392 100644
--- a/libgcc/config/arm/unwind-arm.h
+++ b/libgcc/config/arm/unwind-arm.h
@@ -72,12 +72,19 @@ extern "C" {
{
return _URC_FAILURE;
}
+#ifndef __FreeBSD__
/* Return the address of the instruction, not the actual IP value. */
#define _Unwind_GetIP(context) \
(_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
#define _Unwind_SetIP(context, val) \
_Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1))
+#else
+ #undef _Unwind_GetIPInfo
+ _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
+ _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
+ void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
+#endif
#ifdef __cplusplus
} /* extern "C" */