Skip to content

Commit ee02e31

Browse files
committed
gh-128883: Keep the perf trampoline end marker inside its text section
1 parent 69d0f96 commit ee02e31

4 files changed

Lines changed: 5 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add a byte after the ELF perf trampoline end marker so it does not share
2+
the following function's address, which BOLT may otherwise move.

‎Python/asm_trampoline_aarch64.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ __Py_trampoline_func_end:
5757
#else
5858
.globl _Py_trampoline_func_end
5959
_Py_trampoline_func_end:
60+
.byte 0
6061
.section .note.GNU-stack,"",@progbits
6162
#endif
6263

‎Python/asm_trampoline_riscv64.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ _Py_trampoline_func_start:
99
jr ra
1010
.globl _Py_trampoline_func_end
1111
_Py_trampoline_func_end:
12+
.byte 0
1213
.section .note.GNU-stack,"",@progbits

‎Python/asm_trampoline_x86_64.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ __Py_trampoline_func_end:
2121
#else
2222
.globl _Py_trampoline_func_end
2323
_Py_trampoline_func_end:
24+
.byte 0
2425
.section .note.GNU-stack,"",@progbits
2526
#endif
2627
# Note for indicating the assembly code supports CET

0 commit comments

Comments
 (0)