Commit 2ed27bba authored by Georgia Kouveli's avatar Georgia Kouveli Committed by V8 LUCI CQ

[arm64] Fix GCC build issue for CFI

GCC doesn't accept 'lr' in inline assembly, specifically for the
list of clobbered registers. Change all uses to 'x30', for
consistency.

Bug: v8:10026
Change-Id: I5654fee4ca398dfdd99c34d09fc5294d169a9bd8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3693701Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Cr-Commit-Position: refs/heads/main@{#80980}
parent 877e7352
...@@ -47,15 +47,17 @@ V8_INLINE Address PointerAuthentication::StripPAC(Address pc) { ...@@ -47,15 +47,17 @@ V8_INLINE Address PointerAuthentication::StripPAC(Address pc) {
#ifdef USE_SIMULATOR #ifdef USE_SIMULATOR
return Simulator::StripPAC(pc, Simulator::kInstructionPointer); return Simulator::StripPAC(pc, Simulator::kInstructionPointer);
#else #else
// x30 == lr, but use 'x30' instead of 'lr' below, as GCC does not accept
// 'lr' in the clobbers list.
asm volatile( asm volatile(
" mov x16, lr\n" " mov x16, x30\n"
" mov lr, %[pc]\n" " mov x30, %[pc]\n"
" xpaclri\n" " xpaclri\n"
" mov %[pc], lr\n" " mov %[pc], x30\n"
" mov lr, x16\n" " mov x30, x16\n"
: [pc] "+r"(pc) : [pc] "+r"(pc)
: :
: "x16", "lr"); : "x16", "x30");
return pc; return pc;
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment