fixed PC32 relocation
This commit is contained in:
@ -112,7 +112,7 @@ void greloc_patch(unsigned char *ptr,
|
|||||||
*(int *)ptr += val;
|
*(int *)ptr += val;
|
||||||
break;
|
break;
|
||||||
case R_386_PC32:
|
case R_386_PC32:
|
||||||
*(int *)ptr += val - addr - 4;
|
*(int *)ptr += val - addr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -355,7 +355,7 @@ void gfunc_call(GFuncContext *c)
|
|||||||
/* relocation case */
|
/* relocation case */
|
||||||
greloc(cur_text_section, vtop->c.sym,
|
greloc(cur_text_section, vtop->c.sym,
|
||||||
ind + 1 - (int)cur_text_section->data, R_386_PC32);
|
ind + 1 - (int)cur_text_section->data, R_386_PC32);
|
||||||
oad(0xe8, 0);
|
oad(0xe8, -4);
|
||||||
} else {
|
} else {
|
||||||
oad(0xe8, vtop->c.ul - ind - 5);
|
oad(0xe8, vtop->c.ul - ind - 5);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user