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,7 +654,6 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
654 sym_name = strtab + sym->st_name; 654 sym_name = strtab + sym->st_name;
655 if (strstart(sym_name, "__op_label", &p)) { 655 if (strstart(sym_name, "__op_label", &p)) {
656 uint8_t *ptr; 656 uint8_t *ptr;
657 - int addend;  
658 unsigned long offset; 657 unsigned long offset;
659 658
660 /* test if the variable refers to a label inside 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,7 +662,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
663 if (!ptr) 662 if (!ptr)
664 error("__op_labelN in invalid section"); 663 error("__op_labelN in invalid section");
665 offset = sym->st_value; 664 offset = sym->st_value;
666 - addend = 0; 665 + val = *(target_ulong *)(ptr + offset);
667 #ifdef ELF_USES_RELOCA 666 #ifdef ELF_USES_RELOCA
668 { 667 {
669 int reloc_shndx, nb_relocs1, j; 668 int reloc_shndx, nb_relocs1, j;
@@ -676,7 +675,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, @@ -676,7 +675,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
676 rel = (ELF_RELOC *)sdata[reloc_shndx]; 675 rel = (ELF_RELOC *)sdata[reloc_shndx];
677 for(j = 0; j < nb_relocs1; j++) { 676 for(j = 0; j < nb_relocs1; j++) {
678 if (rel->r_offset == offset) { 677 if (rel->r_offset == offset) {
679 - addend = rel->r_addend; 678 + val = rel->r_addend;
680 break; 679 break;
681 } 680 }
682 rel++; 681 rel++;
@@ -684,8 +683,6 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, @@ -684,8 +683,6 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
684 } 683 }
685 } 684 }
686 #endif 685 #endif
687 - val = *(target_ulong *)(ptr + offset);  
688 - val += addend;  
689 686
690 if (val >= start_offset && val < start_offset + copy_size) { 687 if (val >= start_offset && val < start_offset + copy_size) {
691 n = strtol(p, NULL, 10); 688 n = strtol(p, NULL, 10);