[llvm] [aarch64] XOR the frame pointer with the stack cookie when protecting the stack (PR #161114)

Omair Javaid via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 29 12:58:14 PDT 2025


omjavaid wrote:

> My understanding of the difference between aarch64 and x86_64 on Windows MSVC, please correct me if there are any errors.
> 
> 1. MSVC uses push pop helpers (calls __security_{push|pop}_cookie) on aarch64, while it inlines the checks on x86_64.
> 2. MSVC mixes the cookie using sub (sp - cookie) on aarch64, while it mixes the cookie using xor (cookie ^ rsp) on x86_64.

Yes. This is correct. Lets mix the cookie using sub instruction on AArch64 while keep the existing inlining logic intact.

https://github.com/llvm/llvm-project/pull/161114


More information about the llvm-commits mailing list