Commit e377ed7c authored by Ryan Prichard's avatar Ryan Prichard
Browse files

[ARM] __cxa_end_cleanup: avoid clobbering r4

The fix for D111703 clobbered r4 both to:
 - Save/restore the original lr.
 - Load the address of _Unwind_Resume for LIBCXXABI_BAREMETAL.

This patch saves and restores lr without clobbering any extra
registers.

For LIBCXXABI_BAREMETAL, it is still necessary to clobber one extra
register to hold the address of _Unwind_Resume, but it seems better to
use ip/r12 (intended for linker veneers/trampolines) than r4 for this
purpose.

The function also clobbers r0 for the _Unwind_Resume function's
parameter, but that is unavoidable.

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

Bug: http://b/222341313
Bug: http://b/222364496
Test: upgrade the clang prebuilt to one that uses __cxa_end_cleanup,
  then (checkbuild.py && run_tests.py)

Change-Id: I4dd6452d705b49f595c9d600d01098e5325b0571
parent 74a38736
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment