|
From: Jeremy F. <je...@go...> - 2005-02-04 00:26:02
|
CVS commit by fitzhardinge:
Fix relocation of absolute jumps (which the code doesn't do presently,
so there was no real bug).
M +6 -9 vg_from_ucode.c 1.90
--- valgrind/coregrind/vg_from_ucode.c #1.89:1.90
@@ -2220,6 +2220,8 @@ Addr VG_(get_jmp_dest)(Addr a)
UChar *cp = (UChar *)a;
- if (*cp++ != 0xE9) /* 0xE9 == jmp */
+ if (*cp != 0xE9 && /* 0xE9 == jmp */
+ *cp != 0xE8) /* 0xE8 == call */
return 0;
+ cp++;
delta = (*cp++) << 0;
@@ -2257,5 +2259,5 @@ void VG_(reloc_abs_jump)(UChar *instr)
vg_assert(*instr == 0xE8 || /* call */
- *instr == 0xEB); /* jmp */
+ *instr == 0xE9); /* jmp */
*absaddr = delta;
@@ -2276,14 +2278,9 @@ static void emit_call_patchme( void )
if (jumpidx >= VG_MAX_JUMPS) {
/* If there too many jumps in this basic block, fall back to
- dispatch loop. We still need to keep it the same size as the
- call sequence. */
+ dispatch loop. */
VG_(emitB) ( 0xC3 ); /* ret */
- VG_(emitB) ( 0x8d ); /* 4 byte nop (lea 0x0(%esi,1),%esi) */
- VG_(emitB) ( 0x74 );
- VG_(emitB) ( 0x26 );
- VG_(emitB) ( 0x00 );
if (dis)
- VG_(printf)("\n\t\tret; nop4\n");
+ VG_(printf)("\n\t\tret\n");
if (0 && VG_(clo_verbosity))
|