summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2013-08-31 14:56:09 +0000
committerandrew <andrew@FreeBSD.org>2013-08-31 14:56:09 +0000
commit6c258edb19ac9bc6e26715b6c722c13d69880bc8 (patch)
tree2fffd67105f87674493cb0caa8245d071143edbd /contrib/gcc
parent722b98a4e4c143a750543128ade3c6b2df3ffecf (diff)
downloadFreeBSD-src-6c258edb19ac9bc6e26715b6c722c13d69880bc8.zip
FreeBSD-src-6c258edb19ac9bc6e26715b6c722c13d69880bc8.tar.gz
Implement _Unwind_GetIP and _Unwind_GetIPInfo as functions as that is what
we expect on FreeBSD. The implementation is based on the existing macros.
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/config/arm/unwind-arm.c16
-rw-r--r--contrib/gcc/config/arm/unwind-arm.h5
2 files changed, 21 insertions, 0 deletions
diff --git a/contrib/gcc/config/arm/unwind-arm.c b/contrib/gcc/config/arm/unwind-arm.c
index 945dfd8..47354b4 100644
--- a/contrib/gcc/config/arm/unwind-arm.c
+++ b/contrib/gcc/config/arm/unwind-arm.c
@@ -1074,3 +1074,19 @@ _Unwind_GetTextRelBase (_Unwind_Context *context __attribute__ ((unused)))
{
abort ();
}
+
+#ifdef __FreeBSD__
+/* FreeBSD expects these to be functions */
+_Unwind_Ptr
+_Unwind_GetIP (struct _Unwind_Context *context)
+{
+ return _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1;
+}
+
+_Unwind_Ptr
+_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
+{
+ *ip_before_insn = 0;
+ return _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1;
+}
+#endif
diff --git a/contrib/gcc/config/arm/unwind-arm.h b/contrib/gcc/config/arm/unwind-arm.h
index c6404eb..8a5c5ce 100644
--- a/contrib/gcc/config/arm/unwind-arm.h
+++ b/contrib/gcc/config/arm/unwind-arm.h
@@ -253,12 +253,17 @@ extern "C" {
return val;
}
+#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_GetIPInfo(context, ip_before_insn) \
(*ip_before_insn = 0, _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
+#else
+ _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
+ _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
+#endif
static inline void
_Unwind_SetGR (_Unwind_Context *context, int regno, _Unwind_Word val)
OpenPOWER on IntegriCloud