mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-22 19:43:42 +01:00
arm: getcontext switches back to thumb mode
The ARM Thumb implementation of unw_tdep_getcontext switches to ARM mode (".code 32"), but doesn't switch back to Thumb mode. In gcc, this is fine (it automatically switches back to Thumb mode at the end of an asm block), but in clang, this causes bad assembly output (thumb instructions generated by C/C++ code later on are interpreted as ARM mode assembly, which can't work). Switching back to Thumb mode manually fixes clang, and is a no-op for gcc.
This commit is contained in:
parent
ed90c8387b
commit
1a4b357598
1 changed files with 2 additions and 1 deletions
|
@ -277,7 +277,8 @@ unw_tdep_context_t;
|
|||
__asm__ __volatile__ ( \
|
||||
".align 2\nbx pc\nnop\n.code 32\n" \
|
||||
"stmia %[base], {r0-r15}\n" \
|
||||
"orr %[base], pc, #1\nbx %[base]" \
|
||||
"orr %[base], pc, #1\nbx %[base]\n" \
|
||||
".code 16\n" \
|
||||
: [base] "+r" (unw_base) : : "memory", "cc"); \
|
||||
}), 0)
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue