[PPC64][libunwind] Fix r2 not properly restored
authorMartin Storsjo <martin@martin.st>
Thu, 16 May 2019 06:49:13 +0000 (06:49 +0000)
committerMartin Storsjo <martin@martin.st>
Thu, 16 May 2019 06:49:13 +0000 (06:49 +0000)
commit44266b9e115ad172b1f6a88d15d4e7579812c0fc
tree9306d2af9f6e8c6bc84980971d635234005e16f3
parentec895f11cee1e261289cb5320e366d39b9cf806d
[PPC64][libunwind] Fix r2 not properly restored

This change makes each unwind step inspect the instruction at the
return address and, if needed, read r2 from its saved location and
modify the context appropriately.

The unwind logic is able to handle both ELFv1 and ELFv2 stacks.

Reported by Bug 41050

Patch by Leandro Lupori!

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

llvm-svn: 360861
libunwind/src/DwarfInstructions.hpp
libunwind/src/assembly.h
libunwind/test/lit.cfg