Commit ecd854fdb47bfaae79b1196c5229efbaf8e673d9

Authored by bellard
1 parent 513b500f

added support for direct patching on i386 host (faster emulation)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@516 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 12 additions and 0 deletions
dyngen.c
@@ -729,6 +729,18 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, @@ -729,6 +729,18 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
729 if (rel->r_offset >= start_offset && 729 if (rel->r_offset >= start_offset &&
730 rel->r_offset < start_offset + copy_size) { 730 rel->r_offset < start_offset + copy_size) {
731 sym_name = strtab + symtab[ELFW(R_SYM)(rel->r_info)].st_name; 731 sym_name = strtab + symtab[ELFW(R_SYM)(rel->r_info)].st_name;
  732 + if (strstart(sym_name, "__op_jmp", &p)) {
  733 + int n;
  734 + n = strtol(p, NULL, 10);
  735 + /* __op_jmp relocations are done at
  736 + runtime to do translated block
  737 + chaining: the offset of the instruction
  738 + needs to be stored */
  739 + fprintf(outfile, " jmp_offsets[%d] = %d + (gen_code_ptr - gen_code_buf);\n",
  740 + n, rel->r_offset - start_offset);
  741 + continue;
  742 + }
  743 +
732 if (strstart(sym_name, "__op_param", &p)) { 744 if (strstart(sym_name, "__op_param", &p)) {
733 snprintf(name, sizeof(name), "param%s", p); 745 snprintf(name, sizeof(name), "param%s", p);
734 } else { 746 } else {