Skip to content

Commit 1adf827

Browse files
Revert "Only patch x86_64 GOT relocations when relaxation succeeds"
This reverts commit e6450de.
1 parent e6450de commit 1adf827

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Python/jit.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,21 +400,22 @@ patch_x86_64_32rx(unsigned char *location, uint64_t value)
400400
if (loc8[-2] == 0x8B) {
401401
// mov reg, dword ptr [rip + AAA] -> lea reg, [rip + XXX]
402402
loc8[-2] = 0x8D;
403-
patch_32r(location, relaxed);
403+
value = relaxed;
404404
}
405405
else if (loc8[-2] == 0xFF && loc8[-1] == 0x15) {
406406
// call qword ptr [rip + AAA] -> nop; call XXX
407407
loc8[-2] = 0x90;
408408
loc8[-1] = 0xE8;
409-
patch_32r(location, relaxed);
409+
value = relaxed;
410410
}
411411
else if (loc8[-2] == 0xFF && loc8[-1] == 0x25) {
412412
// jmp qword ptr [rip + AAA] -> nop; jmp XXX
413413
loc8[-2] = 0x90;
414414
loc8[-1] = 0xE9;
415-
patch_32r(location, relaxed);
415+
value = relaxed;
416416
}
417417
}
418+
patch_32r(location, value);
418419
}
419420

420421
void patch_aarch64_trampoline(unsigned char *location, int ordinal, jit_state *state);

0 commit comments

Comments
 (0)