[Top][All Lists]

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

Re: [Tinycc-devel] TCC 0.9.25 is out

From: Jerome Vuarand
Subject: Re: [Tinycc-devel] TCC 0.9.25 is out
Date: Fri, 10 Jul 2009 18:18:12 +0200

2009/5/20 grischka <address@hidden>:
> Changes:
> - [...]
> - tcc_relocate now copies code into user buffer
> - [...]

I'm in the process of updating a program that links to libtcc, and
this change is quite annoying. It would have been nice to keep the old
tcc_relocate as-is (put the code in a buffer related to the TCCState),
and add another API to copy code in the user buffer.

On the other hand, assuming that's the way tcc is going to stay, it
feels weird to pass the TCCState to tcc_get_symbol, while the returned
address is in fact dependent on the buffer passed to tcc_relocate.
Instead, it would feel more natural to copy the metadata in the user
buffer, and pass it (without the TCCState) to tcc_get_symbol.

Finally the lifetime of the memory block passed to tcc_relocate is not
clear to me. Can I delete the TCCState and still use symbols created
by it as long as the memory block is valid ? Is freeing the block
enough to free any resource (OS handles, temporary files, etc.) that
is needed to support the relocated code ?

And last, but not the least, since tcc_relocate API changed, is there
a define in the libtcc headers to detect which version is exposed ?

reply via email to

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