From 968a8c7503a7d1aed31a4b2a42c06de51a1912c0 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 14 Sep 2026 19:28:11 +0200 Subject: [PATCH] gh-157510: Use x16 in the aarch64 JIT trampoline The AAPCS64 lets a veneer clobber only x16 and x17. The trampoline used x8, the indirect result register, and a br through x8 cannot reach a BTI C landing pad. --- Python/jit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Python/jit.c b/Python/jit.c index 50e606a7a0963f6..71c92d118654c8b 100644 --- a/Python/jit.c +++ b/Python/jit.c @@ -586,13 +586,13 @@ patch_aarch64_trampoline(unsigned char *location, int ordinal, jit_state *state) uint32_t *p = (uint32_t *)get_symbol_slot(ordinal, &state->trampolines, TRAMPOLINE_SIZE); /* Generate the trampoline - 0: 58000048 ldr x8, 8 - 4: d61f0100 br x8 + 0: 58000050 ldr x16, 8 + 4: d61f0200 br x16 8: 00000000 // The next two words contain the 64-bit address to jump to. c: 00000000 */ - p[0] = 0x58000048; - p[1] = 0xD61F0100; + p[0] = 0x58000050; + p[1] = 0xD61F0200; p[2] = value & 0xffffffff; p[3] = value >> 32;