[PATCH] D22292: [libunwind] Fix unw_getcontext for ARMv6-m

Ben Craig via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 18 12:25:48 PDT 2016


bcraig added a subscriber: bcraig.

================
Comment at: src/UnwindRegistersRestore.S:325
@@ -324,4 +324,3 @@
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm20restoreCoreAndJumpToEv)
-#if !defined(__ARM_ARCH_ISA_ARM)
-  ldr r2, [r0, #52]
-  ldr r3, [r0, #60]
+#if !defined(__ARM_ARCH_ISA_ARM) && __ARM_ARCH_ISA_THUMB == 1
+  @ r8-r12: ldr into r1-r5, then mov to r8-r12
----------------
weimingz wrote:
> originally, r8-r12 were not restored. Was that some existing bug?
I'm not sure why r12 is getting messed with here.  It is intended as a GOT/PLT scratch register.  r8+ isn't ubiquitously available in Thumb state according to the ATPCS.  The AAPCS says that r4-r8, r10, r11, and SP must be preserved.  r9 can optionally be preserved.


https://reviews.llvm.org/D22292





More information about the cfe-commits mailing list