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 |
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; |
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++; |
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); |