diff options
| author | grischka <grischka> | 2014-05-08 17:32:29 +0200 |
|---|---|---|
| committer | grischka <grischka> | 2014-05-08 17:32:29 +0200 |
| commit | 0f51ccd4e4152e920f01d1dcbdecfd8fb62cb57c (patch) | |
| tree | c304cd2930998017203383ebbe9a350216af3a71 /x86_64-gen.c | |
| parent | ad787abea6d4e6ee0717c4e791d10b1f6281e91d (diff) | |
| download | tinycc-0f51ccd4e4152e920f01d1dcbdecfd8fb62cb57c.tar.gz tinycc-0f51ccd4e4152e920f01d1dcbdecfd8fb62cb57c.tar.bz2 | |
win64: try to fix linkage
- revert to R_X86_64_PC32 for near calls on PE
- revert to s1->section_align set to zero by default
Untested. Compared to release_0_9_26 the pe-image looks back to
normal. There are some differences in dissassembly (r10/r11 usage)
but maybe that's ok.
Diffstat (limited to 'x86_64-gen.c')
| -rw-r--r-- | x86_64-gen.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/x86_64-gen.c b/x86_64-gen.c index 625bb4f..c9829f0 100644 --- a/x86_64-gen.c +++ b/x86_64-gen.c @@ -288,7 +288,8 @@ static void gen_gotpcrel(int r, Sym *sym, int c) rel = (ElfW(Rela) *)(sr->data + sr->data_offset - sizeof(ElfW(Rela))); rel->r_addend = -4; #else - printf("picpic: %s %x %x | %02x %02x %02x\n", get_tok_str(sym->v, NULL), c, r, + tcc_error("internal error: no GOT on PE: %s %x %x | %02x %02x %02x\n", + get_tok_str(sym->v, NULL), c, r, cur_text_section->data[ind-3], cur_text_section->data[ind-2], cur_text_section->data[ind-1] @@ -603,8 +604,11 @@ static void gcall_or_jmp(int is_jmp) /* constant case */ if (vtop->r & VT_SYM) { /* relocation case */ - greloc(cur_text_section, vtop->sym, - ind + 1, R_X86_64_PLT32); +#ifdef TCC_TARGET_PE + greloc(cur_text_section, vtop->sym, ind + 1, R_X86_64_PC32); +#else + greloc(cur_text_section, vtop->sym, ind + 1, R_X86_64_PLT32); +#endif } else { /* put an empty PC32 relocation */ put_elf_reloc(symtab_section, cur_text_section, |
