Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions llvm/lib/Support/ProgramStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ __asm__ (
".p2align 2\n\t"
"_ZN4llvm17runOnNewStackImplEPvPFvS0_ES0_:\n\t"
".cfi_startproc\n\t"
#if __arm64e__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps:
__has_feature(ptrauth_returns)
here and around the retab

"pacibsp\n\t" // sign x30 using sp
#endif
"mov x16, sp\n\t"
"sub x0, x0, #0x20\n\t" // subtract space from stack
"stp xzr, x16, [x0, #0x00]\n\t" // save old sp
Expand All @@ -81,12 +84,20 @@ __asm__ (
".cfi_offset w29, -16\n\t" // fp

"mov x0, x2\n\t" // Ctx is the only argument
#if __arm64e__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here:
__has_feature(ptrauth_calls)

"blraaz x1\n\t" // authenticate x1 then call Fn
#else
"blr x1\n\t" // call Fn
#endif

"ldp x29, x30, [sp, #0x10]\n\t" // restore fp, lr
"ldp xzr, x16, [sp, #0x00]\n\t" // load old sp
"mov sp, x16\n\t"
#if __arm64e__
"retab\n\t" // authenticate x30 then return
#else
"ret\n\t"
#endif
".cfi_endproc"
);
#endif
Expand Down
Loading