/[qemu]/qemu/dyngen.c
ViewVC logotype

Diff of /qemu/dyngen.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by bellard, Sun Jun 15 19:44:49 2003 UTC revision 1.22 by bellard, Sun Jun 15 22:50:44 2003 UTC
# Line 654  void gen_code(const char *name, host_ulo Line 654  void gen_code(const char *name, host_ulo
654                  sym_name = strtab + sym->st_name;                  sym_name = strtab + sym->st_name;
655                  if (strstart(sym_name, "__op_label", &p)) {                  if (strstart(sym_name, "__op_label", &p)) {
656                      uint8_t *ptr;                      uint8_t *ptr;
                     int addend;  
657                      unsigned long offset;                      unsigned long offset;
658                                            
659                      /* test if the variable refers to a label inside                      /* test if the variable refers to a label inside
# Line 663  void gen_code(const char *name, host_ulo Line 662  void gen_code(const char *name, host_ulo
662                      if (!ptr)                      if (!ptr)
663                          error("__op_labelN in invalid section");                          error("__op_labelN in invalid section");
664                      offset = sym->st_value;                      offset = sym->st_value;
665                      addend = 0;                      val = *(target_ulong *)(ptr + offset);
666  #ifdef ELF_USES_RELOCA  #ifdef ELF_USES_RELOCA
667                      {                      {
668                          int reloc_shndx, nb_relocs1, j;                          int reloc_shndx, nb_relocs1, j;
# Line 676  void gen_code(const char *name, host_ulo Line 675  void gen_code(const char *name, host_ulo
675                              rel = (ELF_RELOC *)sdata[reloc_shndx];                              rel = (ELF_RELOC *)sdata[reloc_shndx];
676                              for(j = 0; j < nb_relocs1; j++) {                              for(j = 0; j < nb_relocs1; j++) {
677                                  if (rel->r_offset == offset) {                                  if (rel->r_offset == offset) {
678                                      addend = rel->r_addend;                                      val = rel->r_addend;
679                                      break;                                      break;
680                                  }                                  }
681                                  rel++;                                  rel++;
# Line 684  void gen_code(const char *name, host_ulo Line 683  void gen_code(const char *name, host_ulo
683                          }                          }
684                      }                      }
685  #endif                      #endif                    
                     val = *(target_ulong *)(ptr + offset);  
                     val += addend;  
686    
687                      if (val >= start_offset && val < start_offset + copy_size) {                      if (val >= start_offset && val < start_offset + copy_size) {
688                          n = strtol(p, NULL, 10);                          n = strtol(p, NULL, 10);

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26