Memory relocation
tcc_relocate
Performs all relocations needed to run the compiled code in memory. This must be called before usingtcc_get_symbol().
TCCState*
required
The compilation context.
int
Returns 0 on success, negative value on error.
Running code directly
tcc_run
Compiles, links, and runs themain() function directly. Do not call tcc_relocate() before this.
TCCState*
required
The compilation context.
int
required
Number of command-line arguments to pass to
main().char**
required
Array of command-line arguments.
int
Returns the value returned by the compiled
main() function.Getting compiled symbols
tcc_get_symbol
Returns a pointer to a symbol (function or variable) from the compiled code. You must calltcc_relocate() first.
TCCState*
required
The compilation context.
const char*
required
Name of the symbol to retrieve.
void*
Pointer to the symbol, or
NULL if not found.tcc_list_symbols
Lists all global symbols and their values via a callback function.TCCState*
required
The compilation context.
void*
User data pointer passed to the callback.
void (*)(void*, const char*, const void*)
required
Callback function called for each symbol.