tinycc-devel
[Top][All Lists]
Advanced

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

RE: [Tinycc-devel] libtcc not working properly on x86-64 targets


From: Michael Kuklinski
Subject: RE: [Tinycc-devel] libtcc not working properly on x86-64 targets
Date: Thu, 24 Dec 2009 01:17:54 -0600

That's also an interesting idea - one which I did not think of.

If you'd like, I can compile my fixes for you so you can patch them into your 
repository.

--Michael

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of grischka
Sent: Wednesday, December 23, 2009 8:29 AM
To: address@hidden
Subject: Re: [Tinycc-devel] libtcc not working properly on x86-64 targets

Michael Kuklinski wrote:
> Hmmm.... as a second addition to my last note (I am bad at mailing lists, 
> sorry), if you allow the jump table in PE mode, by removing all #ifndef
> relating to PE mode with the jump table and associated variables, it works
> perfectly.

Glad you got it working.

Btw here is another idea.  You could actually just declare the
function(s) as dllexport and then add the program itself using
tcc_add_file.  It would then use it's own IAT (import address
table) as jump table.

--- grischka


#include <stdio.h>
#include "libtcc.h"

__declspec(dllexport) void print (const char *msg)
{
     printf("Say %s!\n", msg);
}

int main (int argc, char **argv)
{
     TCCState *s = tcc_new();
     tcc_set_output_type(s, TCC_OUTPUT_MEMORY);
     tcc_add_file(s, "this-prog.exe");

     if (tcc_compile_string(s, "main() { print(\"hello\"); }"))
         fprintf(stderr, "compile error\n");
     else
         tcc_run(s, 0, 0);

     tcc_delete(s);
     return 0;
}


_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel





reply via email to

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