gh-136541: Fix several problems of perf trampolines in x86_64 and aarch64 (#136500)

This commit fixes the following problems:

* The x86_64 trampolines are not preserving frame pointers
* The hardcoded offsets to the code segment from the FDE only worked properly for x64_64
* The CIE data was not following conventions of aarch64
* The eh_frame for aarch64 was not fully correct
This commit is contained in:
Pablo Galindo Salgado 2025-07-11 14:32:35 +01:00 committed by GitHub
parent 7de8ea7be6
commit 236f733d8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 148 additions and 41 deletions

View file

@ -12,9 +12,10 @@ _Py_trampoline_func_start:
#if defined(__CET__) && (__CET__ & 1)
endbr64
#endif
sub $8, %rsp
call *%rcx
add $8, %rsp
push %rbp
mov %rsp, %rbp
call *%rcx
pop %rbp
ret
#endif // __x86_64__
#if defined(__aarch64__) && defined(__AARCH64EL__) && !defined(__ILP32__)