diff options
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106777.patch')
-rw-r--r-- | toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106777.patch | 192 |
1 files changed, 0 insertions, 192 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106777.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106777.patch deleted file mode 100644 index 68b682b3c6..0000000000 --- a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106777.patch +++ /dev/null | |||
@@ -1,192 +0,0 @@ | |||
1 | 2011-07-15 Michael Hope <michael.hope@linaro.org> | ||
2 | |||
3 | gcc/ | ||
4 | Backport from mainline: | ||
5 | 2011-06-29 Nathan Sidwell <nathan@codesourcery.com> | ||
6 | |||
7 | * config/arm/unwind-arm.c (enum __cxa_type_match_result): New. | ||
8 | (cxa_type_match): Correct declaration. | ||
9 | (__gnu_unwind_pr_common): Reconstruct | ||
10 | additional indirection when __cxa_type_match returns | ||
11 | succeeded_with_ptr_to_base. | ||
12 | |||
13 | libstdc++-v3/ | ||
14 | Backport from mainline: | ||
15 | |||
16 | 2011-06-29 Nathan Sidwell <nathan@codesourcery.com> | ||
17 | |||
18 | * libsupc++/eh_arm.c (__cxa_type_match): Construct address of | ||
19 | thrown object here. Return succeded_with_ptr_to_base for all | ||
20 | pointer cases. | ||
21 | |||
22 | === modified file 'gcc/config/arm/unwind-arm.c' | ||
23 | --- old/gcc/config/arm/unwind-arm.c 2011-03-22 10:59:10 +0000 | ||
24 | +++ new/gcc/config/arm/unwind-arm.c 2011-07-11 03:35:44 +0000 | ||
25 | @@ -32,13 +32,18 @@ | ||
26 | typedef unsigned char bool; | ||
27 | |||
28 | typedef struct _ZSt9type_info type_info; /* This names C++ type_info type */ | ||
29 | +enum __cxa_type_match_result | ||
30 | + { | ||
31 | + ctm_failed = 0, | ||
32 | + ctm_succeeded = 1, | ||
33 | + ctm_succeeded_with_ptr_to_base = 2 | ||
34 | + }; | ||
35 | |||
36 | void __attribute__((weak)) __cxa_call_unexpected(_Unwind_Control_Block *ucbp); | ||
37 | bool __attribute__((weak)) __cxa_begin_cleanup(_Unwind_Control_Block *ucbp); | ||
38 | -bool __attribute__((weak)) __cxa_type_match(_Unwind_Control_Block *ucbp, | ||
39 | - const type_info *rttip, | ||
40 | - bool is_reference, | ||
41 | - void **matched_object); | ||
42 | +enum __cxa_type_match_result __attribute__((weak)) __cxa_type_match | ||
43 | + (_Unwind_Control_Block *ucbp, const type_info *rttip, | ||
44 | + bool is_reference, void **matched_object); | ||
45 | |||
46 | _Unwind_Ptr __attribute__((weak)) | ||
47 | __gnu_Unwind_Find_exidx (_Unwind_Ptr, int *); | ||
48 | @@ -1107,6 +1112,7 @@ | ||
49 | _uw rtti; | ||
50 | bool is_reference = (data[0] & uint32_highbit) != 0; | ||
51 | void *matched; | ||
52 | + enum __cxa_type_match_result match_type; | ||
53 | |||
54 | /* Check for no-throw areas. */ | ||
55 | if (data[1] == (_uw) -2) | ||
56 | @@ -1118,17 +1124,31 @@ | ||
57 | { | ||
58 | /* Match a catch specification. */ | ||
59 | rtti = _Unwind_decode_target2 ((_uw) &data[1]); | ||
60 | - if (!__cxa_type_match (ucbp, (type_info *) rtti, | ||
61 | - is_reference, | ||
62 | - &matched)) | ||
63 | - matched = (void *)0; | ||
64 | + match_type = __cxa_type_match (ucbp, | ||
65 | + (type_info *) rtti, | ||
66 | + is_reference, | ||
67 | + &matched); | ||
68 | } | ||
69 | + else | ||
70 | + match_type = ctm_succeeded; | ||
71 | |||
72 | - if (matched) | ||
73 | + if (match_type) | ||
74 | { | ||
75 | ucbp->barrier_cache.sp = | ||
76 | _Unwind_GetGR (context, R_SP); | ||
77 | - ucbp->barrier_cache.bitpattern[0] = (_uw) matched; | ||
78 | + // ctm_succeeded_with_ptr_to_base really | ||
79 | + // means _c_t_m indirected the pointer | ||
80 | + // object. We have to reconstruct the | ||
81 | + // additional pointer layer by using a temporary. | ||
82 | + if (match_type == ctm_succeeded_with_ptr_to_base) | ||
83 | + { | ||
84 | + ucbp->barrier_cache.bitpattern[2] | ||
85 | + = (_uw) matched; | ||
86 | + ucbp->barrier_cache.bitpattern[0] | ||
87 | + = (_uw) &ucbp->barrier_cache.bitpattern[2]; | ||
88 | + } | ||
89 | + else | ||
90 | + ucbp->barrier_cache.bitpattern[0] = (_uw) matched; | ||
91 | ucbp->barrier_cache.bitpattern[1] = (_uw) data; | ||
92 | return _URC_HANDLER_FOUND; | ||
93 | } | ||
94 | |||
95 | === modified file 'libstdc++-v3/libsupc++/eh_arm.cc' | ||
96 | --- old/libstdc++-v3/libsupc++/eh_arm.cc 2011-01-03 20:52:22 +0000 | ||
97 | +++ new/libstdc++-v3/libsupc++/eh_arm.cc 2011-07-11 03:35:44 +0000 | ||
98 | @@ -30,10 +30,11 @@ | ||
99 | using namespace __cxxabiv1; | ||
100 | |||
101 | |||
102 | -// Given the thrown type THROW_TYPE, pointer to a variable containing a | ||
103 | -// pointer to the exception object THROWN_PTR_P and a type CATCH_TYPE to | ||
104 | -// compare against, return whether or not there is a match and if so, | ||
105 | -// update *THROWN_PTR_P. | ||
106 | +// Given the thrown type THROW_TYPE, exception object UE_HEADER and a | ||
107 | +// type CATCH_TYPE to compare against, return whether or not there is | ||
108 | +// a match and if so, update *THROWN_PTR_P to point to either the | ||
109 | +// type-matched object, or in the case of a pointer type, the object | ||
110 | +// pointed to by the pointer. | ||
111 | |||
112 | extern "C" __cxa_type_match_result | ||
113 | __cxa_type_match(_Unwind_Exception* ue_header, | ||
114 | @@ -41,51 +42,51 @@ | ||
115 | bool is_reference __attribute__((__unused__)), | ||
116 | void** thrown_ptr_p) | ||
117 | { | ||
118 | - bool forced_unwind = __is_gxx_forced_unwind_class(ue_header->exception_class); | ||
119 | - bool foreign_exception = !forced_unwind && !__is_gxx_exception_class(ue_header->exception_class); | ||
120 | - bool dependent_exception = | ||
121 | - __is_dependent_exception(ue_header->exception_class); | ||
122 | + bool forced_unwind | ||
123 | + = __is_gxx_forced_unwind_class(ue_header->exception_class); | ||
124 | + bool foreign_exception | ||
125 | + = !forced_unwind && !__is_gxx_exception_class(ue_header->exception_class); | ||
126 | + bool dependent_exception | ||
127 | + = __is_dependent_exception(ue_header->exception_class); | ||
128 | __cxa_exception* xh = __get_exception_header_from_ue(ue_header); | ||
129 | __cxa_dependent_exception *dx = __get_dependent_exception_from_ue(ue_header); | ||
130 | const std::type_info* throw_type; | ||
131 | + void *thrown_ptr = 0; | ||
132 | |||
133 | if (forced_unwind) | ||
134 | throw_type = &typeid(abi::__forced_unwind); | ||
135 | else if (foreign_exception) | ||
136 | throw_type = &typeid(abi::__foreign_exception); | ||
137 | - else if (dependent_exception) | ||
138 | - throw_type = __get_exception_header_from_obj | ||
139 | - (dx->primaryException)->exceptionType; | ||
140 | else | ||
141 | - throw_type = xh->exceptionType; | ||
142 | - | ||
143 | - void* thrown_ptr = *thrown_ptr_p; | ||
144 | + { | ||
145 | + if (dependent_exception) | ||
146 | + xh = __get_exception_header_from_obj (dx->primaryException); | ||
147 | + throw_type = xh->exceptionType; | ||
148 | + // We used to require the caller set the target of thrown_ptr_p, | ||
149 | + // but that's incorrect -- the EHABI makes no such requirement | ||
150 | + // -- and not all callers will set it. Fortunately callers that | ||
151 | + // do initialize will always pass us the value we calculate | ||
152 | + // here, so there's no backwards compatibility problem. | ||
153 | + thrown_ptr = __get_object_from_ue (ue_header); | ||
154 | + } | ||
155 | + | ||
156 | + __cxa_type_match_result result = ctm_succeeded; | ||
157 | |||
158 | // Pointer types need to adjust the actual pointer, not | ||
159 | // the pointer to pointer that is the exception object. | ||
160 | // This also has the effect of passing pointer types | ||
161 | // "by value" through the __cxa_begin_catch return value. | ||
162 | if (throw_type->__is_pointer_p()) | ||
163 | - thrown_ptr = *(void**) thrown_ptr; | ||
164 | + { | ||
165 | + thrown_ptr = *(void**) thrown_ptr; | ||
166 | + // We need to indicate the indirection to our caller. | ||
167 | + result = ctm_succeeded_with_ptr_to_base; | ||
168 | + } | ||
169 | |||
170 | if (catch_type->__do_catch(throw_type, &thrown_ptr, 1)) | ||
171 | { | ||
172 | *thrown_ptr_p = thrown_ptr; | ||
173 | - | ||
174 | - if (typeid(*catch_type) == typeid (typeid(void*))) | ||
175 | - { | ||
176 | - const __pointer_type_info *catch_pointer_type = | ||
177 | - static_cast<const __pointer_type_info *> (catch_type); | ||
178 | - const __pointer_type_info *throw_pointer_type = | ||
179 | - static_cast<const __pointer_type_info *> (throw_type); | ||
180 | - | ||
181 | - if (typeid (*catch_pointer_type->__pointee) != typeid (void) | ||
182 | - && (*catch_pointer_type->__pointee != | ||
183 | - *throw_pointer_type->__pointee)) | ||
184 | - return ctm_succeeded_with_ptr_to_base; | ||
185 | - } | ||
186 | - | ||
187 | - return ctm_succeeded; | ||
188 | + return result; | ||
189 | } | ||
190 | |||
191 | return ctm_failed; | ||
192 | |||