summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2013-02-04 09:28:36 +0000
committerandrew <andrew@FreeBSD.org>2013-02-04 09:28:36 +0000
commit897e2fb50579aef227fdadb07059bf19f3bbf36c (patch)
treec72214dda9049bdf2f7953b44a83f0f78dea4744 /contrib/gcc
parenta191badca4be9f93dc348a040fa425d66aef3a25 (diff)
downloadFreeBSD-src-897e2fb50579aef227fdadb07059bf19f3bbf36c.zip
FreeBSD-src-897e2fb50579aef227fdadb07059bf19f3bbf36c.tar.gz
Allow the unwind functions int libgcc_s to interact correctly with libthr.
_Unwind_ForcedUnwind in libgcc_s takes as one of it's parameters a stop function to tell it when to stop unwinding. One of the stop function's parameters is a _Unwind_Exception_Class. On most architectures this is an int64_t, however on ARM EABI the gcc developers have made this a char array with 8 items. While both of these take the same space they are passed into the stop function differently, an int64_t is passed in in registers r2 and r3, while the char[8] is passed in as a pointer to the first item in register r2. Because libthr expects the value to be an int64_t we would get incorrect results when it passes a function that take an int64_t but libgcc passes in a pointer to a char array including crashing. The fix is to update libgcc_s to make it pass an int64_t to the stop function and to libstdc++ as it expects _Unwind_Exception_Class to be an array.
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/config/arm/unwind-arm.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/gcc/config/arm/unwind-arm.h b/contrib/gcc/config/arm/unwind-arm.h
index a3040d7..0811f2c 100644
--- a/contrib/gcc/config/arm/unwind-arm.h
+++ b/contrib/gcc/config/arm/unwind-arm.h
@@ -87,7 +87,7 @@ extern "C" {
struct _Unwind_Control_Block
{
- char exception_class[8];
+ unsigned exception_class __attribute__((__mode__(__DI__)));
void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
/* Unwinder cache, private fields for the unwinder's use */
struct
@@ -186,7 +186,7 @@ extern "C" {
/* Support functions for the PR. */
#define _Unwind_Exception _Unwind_Control_Block
- typedef char _Unwind_Exception_Class[8];
+ typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
void * _Unwind_GetLanguageSpecificData (_Unwind_Context *);
_Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *);
OpenPOWER on IntegriCloud