Skip to content

Commit 3255578

Browse files
[libcxxabi][ARM] Make CXX_end_cleanup compatible with Armv6-M
On Armv6-M the branch may not able to reach the _Unwind_Resume function because it's relocation(R_ARM_THM_JUMP11) is in -2048, 2047 range only. Reviewed By: chill, stuij, lenary Differential Revision: https://reviews.llvm.org/D113181
1 parent d3dc7d0 commit 3255578

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libcxxabi/src/cxa_exception.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ asm(" .pushsection .text.__cxa_end_cleanup,\"ax\",%progbits\n"
382382
" bl __cxa_end_cleanup_impl\n"
383383
" pop {r1, r2, r3, r4}\n"
384384
" mov lr, r4\n"
385-
" b _Unwind_Resume\n"
385+
" ldr r4, =_Unwind_Resume\n"
386+
" bx r4\n"
386387
" .popsection");
387388
#endif // defined(_LIBCXXABI_ARM_EHABI)
388389

0 commit comments

Comments
 (0)