From 45b8b0e57d2120c193014a4886799aa4a56dceb3 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Sun, 13 Jan 2019 06:01:59 +0100 Subject: [PATCH] Revert 337dc84b (other -static fix) this should work now with 05f6aa1a. --- x86_64-gen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x86_64-gen.c b/x86_64-gen.c index e41a6e84..b95199e5 100644 --- a/x86_64-gen.c +++ b/x86_64-gen.c @@ -625,7 +625,11 @@ static void gcall_or_jmp(int is_jmp) if ((vtop->r & (VT_VALMASK | VT_LVAL)) == VT_CONST && ((vtop->r & VT_SYM) && (vtop->c.i-4) == (int)(vtop->c.i-4))) { /* constant symbolic case -> simple relocation */ - greloca(cur_text_section, vtop->sym, ind + 1, R_X86_64_PLT32, (int)(vtop->c.i-4)); +#ifdef TCC_TARGET_PE + greloca(cur_text_section, vtop->sym, ind + 1, R_X86_64_PC32, (int)(vtop->c.i-4)); +#else + greloca(cur_text_section, vtop->sym, ind + 1, R_X86_64_PLT32, (int)(vtop->c.i-4)); +#endif oad(0xe8 + is_jmp, 0); /* call/jmp im */ } else { /* otherwise, indirect call */