[libunwind][ARM] Add support for Thumb1 targets
authorOliver Stannard <oliver.stannard@arm.com>
Mon, 25 Jul 2016 09:21:56 +0000 (09:21 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Mon, 25 Jul 2016 09:21:56 +0000 (09:21 +0000)
commit1224c809f195e3278fb5d4ac3da33720edcfeffc
tree6ecc38d4f26e08ed0d85ec51bc419d898906e8de
parent68c71cd1e4a35baabb39c7b8bc77d0fbdd4bdb15
[libunwind][ARM] Add support for Thumb1 targets

The Thumb1 version of the code for saving and restoring the unwind
context has a few bugs which prevent it from working:
* It uses the STM instruction without writeback, which is not valid for Thumb1
  (It was introduced in Thumb2).
* It only saves/restores the low 8 registers, the sp and the lr, so if a
  program uses r8-r12 they will not be correctly restored when throwing an
  exception.

There aren't currently any Thumb1 build-bots to test this, but we have
been successfully running the libc++abi and libc++ test suites on
Cortex-M0 models, as well as some other test suites that use C++
exceptions on a downstream version of libunwind with this patch applied.

Differential Revision: https://reviews.llvm.org/D22292

llvm-svn: 276625
libunwind/src/UnwindRegistersRestore.S
libunwind/src/UnwindRegistersSave.S