summaryrefslogtreecommitdiff
path: root/i386-link.c
diff options
context:
space:
mode:
Diffstat (limited to 'i386-link.c')
-rw-r--r--i386-link.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/i386-link.c b/i386-link.c
index b446644..aea3c21 100644
--- a/i386-link.c
+++ b/i386-link.c
@@ -226,6 +226,9 @@ void relocate(TCCState *s1, ElfW_Rel *rel, int type, unsigned char *ptr, addr_t
write16le(ptr, read16le(ptr) + val - addr);
return;
case R_386_RELATIVE:
+#ifdef TCC_TARGET_PE
+ add32le(ptr, val - s1->pe_imagebase);
+#endif
/* do nothing */
return;
case R_386_COPY: