summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%google.com <devnull@localhost>2008-11-08 01:27:43 +0000
committerwtc%google.com <devnull@localhost>2008-11-08 01:27:43 +0000
commite758dcaafb83505acea29e50e705dd710163b4ea (patch)
treec7699d479e1399921a08f62dd1db01d661c57ad8
parent8955c3f403993ed3d29f3545b0bf657adb70ed52 (diff)
downloadnspr-hg-e758dcaafb83505acea29e50e705dd710163b4ea.tar.gz
Bug 385583: Fixed incorrect jmp_buf assumptions on ARM EABI systems. The
patch is contributed by Lennert Buytenhek <buytenh@wantstofly.org>. r=wtc
-rw-r--r--pr/include/md/_linux.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/pr/include/md/_linux.h b/pr/include/md/_linux.h
index 33fc1325..aa9d33bb 100644
--- a/pr/include/md/_linux.h
+++ b/pr/include/md/_linux.h
@@ -417,11 +417,21 @@ extern void _MD_CleanupBeforeExit(void);
#elif defined(__arm__)
/* ARM/Linux */
#if defined(__GLIBC__) && __GLIBC__ >= 2
+#ifdef __ARM_EABI__
+/* EABI */
+#define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[8]
+#define _MD_SET_FP(_t, val) ((_t)->md.context[0].__jmpbuf[7] = (val))
+#define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
+#define _MD_GET_FP_PTR(_t) (&(_t)->md.context[0].__jmpbuf[7])
+#define _MD_SP_TYPE __ptr_t
+#else /* __ARM_EABI__ */
+/* old ABI */
#define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[20]
#define _MD_SET_FP(_t, val) ((_t)->md.context[0].__jmpbuf[19] = (val))
#define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
#define _MD_GET_FP_PTR(_t) (&(_t)->md.context[0].__jmpbuf[19])
#define _MD_SP_TYPE __ptr_t
+#endif /* __ARM_EABI__ */
#else
#error "ARM/Linux pre-glibc2 not supported yet"
#endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */