Hi,

I've been able to successfully use windres to compile, then tcc 0.9.26 to
link resources into a 32-bit program.

However, I'm kinda stuck trying to get tcc to link to a 64-bit windres
generated resource file.

1) Check for magic not yet supporting x86-64

In file tccpe.c, the pe_load_res is looking for 32-bit magic
//    if (hdr.filehdr.Machine != 0x014C
    if (hdr.filehdr.Machine != 0x8664
        || hdr.filehdr.NumberOfSections != 1
        || strcmp(hdr.sectionhdr.Name, ".rsrc") != 0) {
        printf("Machine: %lx", hdr.filehdr.Machine);
        goto quit;
    }

2) Resource files appear to be slightly different between win32 and x86-64

The reltype shows up as 3 in my compiled 64-bit resource but tcc is
expecting 7.

lower in same function...

        printf("rsrc_reloc: %x %x %x\n", rel.offset, rel.size, rel.type);
// debugging
        if (rel.type != 7) /* DIR32NB */ {
            printf("ERROR: rel.type != 7 Got: %d\n",rel.type);      //
prints a 3 for 64-bit resources
            goto quit;
        }

Has anyone pushed a bit further and managed to get tcc linking to 64-bit
resources?

Best Wishes,
Jonathan
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to