this should work now with 05f6aa1a.
Unified · Split
| @@ -625,7 +625,11 @@ static void gcall_or_jmp(int is_jmp) · 624 unmodified lines | |||
| 625 | if ((vtop->r & (VT_VALMASK | VT_LVAL)) == VT_CONST && | 625 | if ((vtop->r & (VT_VALMASK | VT_LVAL)) == VT_CONST && |
| 626 | ((vtop->r & VT_SYM) && (vtop->c.i-4) == (int)(vtop->c.i-4))) { | 626 | ((vtop->r & VT_SYM) && (vtop->c.i-4) == (int)(vtop->c.i-4))) { |
| 627 | /* constant symbolic case -> simple relocation */ | 627 | /* constant symbolic case -> simple relocation */ |
| 628 | greloca(cur_text_section, vtop->sym, ind + 1, R_X86_64_PLT32, (int)(vtop->c.i-4)); | 628 | #ifdef TCC_TARGET_PE |
| 629 | greloca(cur_text_section, vtop->sym, ind + 1, R_X86_64_PC32, (int)(vtop->c.i-4)); | ||
| 630 | #else | ||
| 631 | greloca(cur_text_section, vtop->sym, ind + 1, R_X86_64_PLT32, (int)(vtop->c.i-4)); | ||
| 632 | #endif | ||
| 629 | oad(0xe8 + is_jmp, 0); /* call/jmp im */ | 633 | oad(0xe8 + is_jmp, 0); /* call/jmp im */ |
| 630 | } else { | 634 | } else { |
| 631 | /* otherwise, indirect call */ | 635 | /* otherwise, indirect call */ |