Skip to content

Commit ce1183a

Browse files
Revert "also fix x86-64"
This reverts commit 0a15b1c.
1 parent 0162735 commit ce1183a

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

Python/jit.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ void patch_got_symbol(jit_state *state, int ordinal);
556556
void patch_aarch64_trampoline(unsigned char *location, int ordinal, jit_state *state);
557557
void patch_aarch64_trampoline_addr(unsigned char *location, int ordinal, uint64_t value, jit_state *state);
558558
void patch_x86_64_trampoline(unsigned char *location, int ordinal, jit_state *state);
559-
void patch_x86_64_trampoline_addr(unsigned char *location, int ordinal, uint64_t value, jit_state *state);
560559

561560
#include "jit_stencils.h"
562561

@@ -619,13 +618,7 @@ void
619618
patch_x86_64_trampoline(unsigned char *location, int ordinal, jit_state *state)
620619
{
621620
uint64_t value = (uintptr_t)symbols_map[ordinal];
622-
patch_x86_64_trampoline_addr(location, ordinal, value, state);
623-
}
624-
625-
void
626-
patch_x86_64_trampoline_addr(unsigned char *location, int ordinal, uint64_t value, jit_state *state)
627-
{
628-
int64_t range = (int64_t)value - 4 - (int64_t)(uintptr_t)location;
621+
int64_t range = (int64_t)value - 4 - (int64_t)location;
629622

630623
// If we are in range of 32 signed bits, we can patch directly
631624
if (range >= -(1LL << 31) && range < (1LL << 31)) {

Tools/jit/_stencils.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -310,19 +310,6 @@ def process_relocations(self, known_symbols: dict[str, int]) -> None:
310310
hole.func = "patch_aarch64_trampoline_addr"
311311
hole.need_state = True
312312
hole.custom_value = f"{ordinal}, {value_expr}"
313-
# x86_64 trampolines for operand-based call targets (e.g. inlined cfunc)
314-
elif (
315-
hole.kind in {"R_X86_64_PLT32", "X86_64_RELOC_BRANCH"}
316-
and hole.value in {HoleValue.OPERAND0, HoleValue.OPERAND1}
317-
):
318-
value_expr = _HOLE_EXPRS[hole.value]
319-
ordinal = len(known_symbols)
320-
synth_name = f"_JIT_TRAMPOLINE_{hole.value.name}_{ordinal}"
321-
known_symbols[synth_name] = ordinal
322-
self._trampolines.add(ordinal)
323-
hole.func = "patch_x86_64_trampoline_addr"
324-
hole.need_state = True
325-
hole.custom_value = f"{ordinal}, {value_expr}"
326313
# x86_64 Darwin trampolines for external symbols
327314
elif (
328315
hole.kind == "X86_64_RELOC_BRANCH"

0 commit comments

Comments
 (0)