Re: [Tinycc-devel] linux/unix shared libraries?

2008-04-28 Thread Olaf Dietrich
grischka (2008-04-25T19:18:10+0200): Instead it looks like if it generates bogus relocations for sections with zero size. Thanks! With the new versions of tccelf.c (and tcc.c) from the CVS, building of shared libs works perfectly! I was also able to compile a larger (Tcl-based) project for

[Tinycc-devel] tccpe.c / resolve_sym() leaks LoadLibrary() handles

2008-04-28 Thread egodust
Heyas, When a compiled TCC binary image is memory linked, resolve_sym() is given the symbol to find, it looks for the assocated DLL (using DEF file info) and calls LoadLibrary(), using GetProcAddress() to get the function pointer. This is problematic: 1. LoadLibrary() is called, per symbol, if

[Tinycc-devel] wish: ability to override pe dynamic linker

2008-04-28 Thread egodust
Heyas, I am using multiple states to compile sources into different memory binaries (like DLLs), there have been problems and I have hit upon another one, redundant DEF file parsing. When tcc_new() is called, my code finds all DEFs and uses tcc_add_library(), like this: tcc=tcc_new() for def in

Re: [Tinycc-devel] command line parsing in scripts

2008-04-28 Thread Daniel Glöckner
On Mon, Apr 28, 2008 at 04:22:42PM +, Joshua Phillips wrote: Since when can you only pass one argument to the interpreter? Try this: #!/bin/echo -DTEST=1 -run Put it in a file, chmod +x and run it. You get -DTEST=1 -run ./filename. If you don't, then there's a problem with your

Re: [Tinycc-devel] tccpe.c / resolve_sym() leaks LoadLibrary() handles

2008-04-28 Thread grischka
Can't you just store the DLL-handle into the DLLReference structure? --- grischka From: egodust Heyas, When a compiled TCC binary image is memory linked, resolve_sym() is given the symbol to find, it looks for the assocated DLL (using DEF file info) and calls LoadLibrary(), using

Re: [Tinycc-devel] tccpe.c / resolve_sym() leaks LoadLibrary() handles

2008-04-28 Thread egodust
I don't think you can, each dll name points back to the DLL (via index) that loaded it, I haven't investigated it fully yet though. On Mon, Apr 28, 2008 at 6:27 PM, grischka [EMAIL PROTECTED] wrote: Can't you just store the DLL-handle into the DLLReference structure? --- grischka From:

Re: [Tinycc-devel] Re: macro_ptr bugfix doesn't work, preprocess_init called too late

2008-04-28 Thread egodust
Yup, that'd work.. On Mon, Apr 28, 2008 at 6:28 PM, grischka [EMAIL PROTECTED] wrote: What about moving macro_ptr = NULL into tcc_cleanup? Heyas, A follow up, preprocess_init() is probably the wrong place to put macro_ptr = NULL, it requires that a file be open (tcc_open()) and

Re: [Tinycc-devel] wish: ability to override pe dynamic linker

2008-04-28 Thread egodust
Heyas, On Mon, Apr 28, 2008 at 6:27 PM, grischka [EMAIL PROTECTED] wrote: From: egodust: I am using: advapi32.def, comdlg32.def, gdi32.def, kernel32.def, msvcrt.def, ole32.def, shell32.def, shlwapi.def, user32.def, ws2_32.def In total there are 4334 function names -- this

Re: [Tinycc-devel] tccpe.c / resolve_sym() leaks LoadLibrary() handles

2008-04-28 Thread egodust
Also, I think most people just use the tcc_run(), so it doesn't matter that LoadLibrary() is called incorrectly.. The way that importing/DLL usage on Win32 works with TCC is very limited at the moment anyway, if you want to use other DLLs you have to use LoadLibrary() from the TCC code, there