Line 184... |
Line 184... |
src_indx = sym_tab->st_shndx;
|
src_indx = sym_tab->st_shndx;
|
/* Location in physical memory to which this relocation
|
/* Location in physical memory to which this relocation
|
is refering to */
|
is refering to */
|
rel_loc = (void *)(rel_ptr->r_offset + sec[dst_indx].pm_add);
|
rel_loc = (void *)(rel_ptr->r_offset + sec[dst_indx].pm_add);
|
if((rel_ptr->r_info & 0x000000ff) == R_OR32_32) {
|
if((rel_ptr->r_info & 0x000000ff) == R_OR32_32) {
|
|
_print("R_OR32_32: rel_loc %.8lx vm_add = %.8lx pm_add = %.8lx val = %.8lx\n", rel_loc, sec[src_indx].vm_add, sec[src_indx].pm_add, sym_tab->st_value);
|
*(unsigned long *)rel_loc = *(unsigned long *)rel_loc
|
*(unsigned long *)rel_loc = *(unsigned long *)rel_loc
|
- sec[src_indx].vm_add
|
- sec[src_indx].vm_add
|
+ sec[src_indx].pm_add;
|
+ sec[src_indx].pm_add
|
|
+ sym_tab->st_value;
|
}
|
}
|
else if((rel_ptr->r_info & 0x000000ff) == R_OR32_16) {
|
else if((rel_ptr->r_info & 0x000000ff) == R_OR32_16) {
|
|
_print("R_OR32_16: rel_loc %.8lx vm_add = %.8lx pm_add = %.8lx\n", rel_loc, sec[src_indx].vm_add, sec[src_indx].pm_add);
|
*(unsigned short *)rel_loc = *(unsigned short *)rel_loc
|
*(unsigned short *)rel_loc = *(unsigned short *)rel_loc
|
- sec[src_indx].vm_add
|
- sec[src_indx].vm_add
|
+ sec[src_indx].pm_add;
|
+ sec[src_indx].pm_add
|
|
+ sym_tab->st_value;
|
}
|
}
|
else if((rel_ptr->r_info & 0x000000ff) == R_OR32_8) {
|
else if((rel_ptr->r_info & 0x000000ff) == R_OR32_8) {
|
|
_print("R_OR32_8: rel_loc %.8lx vm_add = %.8lx pm_add = %.8lx\n", rel_loc, sec[src_indx].vm_add, sec[src_indx].pm_add);
|
*(unsigned char *)rel_loc = *(unsigned char *)rel_loc
|
*(unsigned char *)rel_loc = *(unsigned char *)rel_loc
|
- sec[src_indx].vm_add
|
- sec[src_indx].vm_add
|
+ sec[src_indx].pm_add;
|
+ sec[src_indx].pm_add
|
|
+ sym_tab->st_value;
|
}
|
}
|
else if((rel_ptr->r_info & 0x000000ff) == R_OR32_CONSTH) {
|
else if((rel_ptr->r_info & 0x000000ff) == R_OR32_CONSTH) {
|
|
_print("R_OR32_CONSTH: rel_loc %.8lx *rel_loc %.8lx\n", rel_loc, *(((unsigned short *)rel_loc) + 1));
|
|
_print(" vm_add %.8lx pm_add %.8lx\n", sec[src_indx].vm_add, sec[src_indx].pm_add);
|
or32_consth_add = (((unsigned short *)rel_loc) + 1);
|
or32_consth_add = (((unsigned short *)rel_loc) + 1);
|
or32_consth_rel = *or32_consth_add << 16;
|
or32_consth_rel = *or32_consth_add << 16;
|
}
|
}
|
else if((rel_ptr->r_info & 0x000000ff) == R_OR32_CONST) {
|
else if((rel_ptr->r_info & 0x000000ff) == R_OR32_CONST) {
|
|
_print("R_OR32_CONST: rel_loc %.8lx *rel_loc %.8lx\n", rel_loc, *(((unsigned short *)rel_loc) + 1));
|
|
_print(" vm_add %.8lx pm_add %.8lx\n", sec[src_indx].vm_add, sec[src_indx].pm_add);
|
|
_print(" consth %.8lx st_value %.8lx\n", or32_consth_rel, sym_tab->st_value);
|
|
|
tmp = or32_consth_rel | *(((unsigned short *)rel_loc) + 1);
|
tmp = or32_consth_rel | *(((unsigned short *)rel_loc) + 1);
|
tmp = tmp /*+ sym_tab->st_value */ - sec[src_indx].vm_add +
|
tmp = tmp + sym_tab->st_value - sec[src_indx].vm_add +
|
sec[src_indx].pm_add;
|
sec[src_indx].pm_add;
|
*(((unsigned short *)rel_loc) + 1) = tmp & 0x0000ffff;
|
*(((unsigned short *)rel_loc) + 1) = tmp & 0x0000ffff;
|
if(or32_consth_add != (unsigned short *)NULL) {
|
if(or32_consth_add != (unsigned short *)NULL) {
|
*or32_consth_add = tmp >> 16;
|
*or32_consth_add = tmp >> 16;
|
or32_consth_add = (unsigned short *)NULL;
|
or32_consth_add = (unsigned short *)NULL;
|
or32_consth_rel = 0;
|
or32_consth_rel = 0;
|
}
|
}
|
}
|
}
|
else if((rel_ptr->r_info & 0x000000ff) == R_OR32_JUMPTARG) {
|
else if((rel_ptr->r_info & 0x000000ff) == R_OR32_JUMPTARG) {
|
|
_print("R_OR32_JUMPTARG: rel_loc %.8lx vm_add = %.8lx pm_add = %.8lx\n", rel_loc, sec[src_indx].vm_add, sec[src_indx].pm_add);
|
|
_print(" pm_add %.8lx\n", sec[dst_indx].pm_add);
|
tmp = ((*(unsigned long *)rel_loc) & 0x03ffffff);
|
tmp = ((*(unsigned long *)rel_loc) & 0x03ffffff);
|
tmp = (tmp & 0x02000000) ? (tmp | 0xfc000000) : tmp;
|
tmp = (tmp & 0x02000000) ? (tmp | 0xfc000000) : tmp;
|
tmp = tmp + ((sym_tab->st_value -
|
tmp = tmp + ((sym_tab->st_value -
|
sec[src_indx].vm_add +
|
sec[src_indx].vm_add +
|
sec[src_indx].pm_add -
|
sec[src_indx].pm_add -
|