Index: libunwind/src/DwarfInstructions.hpp =================================================================== --- libunwind/src/DwarfInstructions.hpp +++ libunwind/src/DwarfInstructions.hpp @@ -67,7 +67,7 @@ return (pint_t)((sint_t)registers.getRegister((int)prolog.cfaRegister) + prolog.cfaRegisterOffset); if (prolog.cfaExpression != 0) - return evaluateExpression((pint_t)prolog.cfaExpression, addressSpace, + return evaluateExpression((pint_t)prolog.cfaExpression, addressSpace, registers, 0); assert(0 && "getCFA(): unknown location"); __builtin_unreachable(); @@ -259,16 +259,28 @@ #if !defined(_LIBUNWIND_IS_NATIVE_ONLY) return UNW_ECROSSRASIGNING; #else - register unsigned long long x17 __asm("x17") = returnAddress; - register unsigned long long x16 __asm("x16") = cfa; // These are the autia1716/autib1716 instructions. The hint instructions // are used here as gcc does not assemble autia1716/autib1716 for pre // armv8.3a targets. - if (cieInfo.addressesSignedWithBKey) - asm("hint 0xe" : "+r"(x17) : "r"(x16)); // autib1716 - else - asm("hint 0xc" : "+r"(x17) : "r"(x16)); // autia1716 + if (cieInfo.addressesSignedWithBKey) { + asm volatile("mov x17, %x0\n\t" + "mov x16, %x1\n\t" + "hint 0xe\n\t" // autib1716 + "mov %0, x17\n\t" + : "+r"(returnAddress) + : "r"(cfa) + : "x16", "x17"); + } else { + asm volatile("mov x17, %x0\n\t" + "mov x16, %x1\n\t" + "hint 0xc\n\t" // autia1716 + "mov %0, x17\n\t" + : "+r"(returnAddress) + : "r"(cfa) + : "x16", "x17"); + } + returnAddress = x17; #endif }