[compiler-rt] [llvm] [AArch64] Implement INIT/ADJUST_TRAMPOLINE (PR #70267)
    Slava Zakharin via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Jul 15 14:42:51 PDT 2024
    
    
  
================
@@ -41,3 +41,30 @@ COMPILER_RT_ABI void __trampoline_setup(uint32_t *trampOnStack,
   __clear_cache(trampOnStack, &trampOnStack[10]);
 }
 #endif // __powerpc__ && !defined(__powerpc64__)
+
+// The AArch64 compiler generates calls to __trampoline_setup() when creating
+// trampoline functions on the stack for use with nested functions.
+// This function creates a custom 20-byte trampoline function on the stack
+// which loads x18 with a pointer to the outer function's locals
+// and then jumps to the target nested function.
+
+#if __aarch64__
----------------
vzakhari wrote:
I would suggest adding `defined(__linux__)` guard as well.
https://github.com/llvm/llvm-project/pull/70267
    
    
More information about the llvm-commits
mailing list