aboutsummaryrefslogtreecommitdiff
path: root/i386-gen.c
diff options
context:
space:
mode:
authorbellard <bellard>2002-07-14 23:00:53 +0000
committerbellard <bellard>2002-07-14 23:00:53 +0000
commit82695ae971b591b6a1a8eaf3f5b63ffd32606417 (patch)
tree16c5d82294cfd4abea042d645aec63cb1f4b6bb6 /i386-gen.c
parent3cd4a7c4f98bcc195fd158a27fd987e00644d808 (diff)
downloadtinycc-82695ae971b591b6a1a8eaf3f5b63ffd32606417.tar.gz
tinycc-82695ae971b591b6a1a8eaf3f5b63ffd32606417.tar.bz2
fixed PC32 relocation
Diffstat (limited to 'i386-gen.c')
-rw-r--r--i386-gen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/i386-gen.c b/i386-gen.c
index 6631d07..46afd78 100644
--- a/i386-gen.c
+++ b/i386-gen.c
@@ -112,7 +112,7 @@ void greloc_patch(unsigned char *ptr,
*(int *)ptr += val;
break;
case R_386_PC32:
- *(int *)ptr += val - addr - 4;
+ *(int *)ptr += val - addr;
break;
}
}
@@ -355,7 +355,7 @@ void gfunc_call(GFuncContext *c)
/* relocation case */
greloc(cur_text_section, vtop->c.sym,
ind + 1 - (int)cur_text_section->data, R_386_PC32);
- oad(0xe8, 0);
+ oad(0xe8, -4);
} else {
oad(0xe8, vtop->c.ul - ind - 5);
}