tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Fwd: Linking with Resources on x86-64 Windows


From: Jonathan Watmough
Subject: [Tinycc-devel] Fwd: Linking with Resources on x86-64 Windows
Date: Sun, 8 Mar 2015 15:52:15 -0500

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]