Commit 039de852ec1640ff65db641d27caaf2a88d0a10c

Authored by bellard
1 parent 144c345d

fixed op_label computation on ppc


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@248 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 2 additions and 5 deletions
dyngen.c
... ... @@ -654,7 +654,6 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
654 654 sym_name = strtab + sym->st_name;
655 655 if (strstart(sym_name, "__op_label", &p)) {
656 656 uint8_t *ptr;
657   - int addend;
658 657 unsigned long offset;
659 658  
660 659 /* test if the variable refers to a label inside
... ... @@ -663,7 +662,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
663 662 if (!ptr)
664 663 error("__op_labelN in invalid section");
665 664 offset = sym->st_value;
666   - addend = 0;
  665 + val = *(target_ulong *)(ptr + offset);
667 666 #ifdef ELF_USES_RELOCA
668 667 {
669 668 int reloc_shndx, nb_relocs1, j;
... ... @@ -676,7 +675,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
676 675 rel = (ELF_RELOC *)sdata[reloc_shndx];
677 676 for(j = 0; j < nb_relocs1; j++) {
678 677 if (rel->r_offset == offset) {
679   - addend = rel->r_addend;
  678 + val = rel->r_addend;
680 679 break;
681 680 }
682 681 rel++;
... ... @@ -684,8 +683,6 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
684 683 }
685 684 }
686 685 #endif
687   - val = *(target_ulong *)(ptr + offset);
688   - val += addend;
689 686  
690 687 if (val >= start_offset && val < start_offset + copy_size) {
691 688 n = strtol(p, NULL, 10);
... ...