Skip to main content
This page covers additional symbol management functions and advanced features of the libtcc API.

Symbol lookup and enumeration

After relocating your compiled code, you can retrieve and enumerate symbols.

tcc_get_symbol

Retrieves a pointer to a compiled symbol. See Execution for detailed documentation.

tcc_list_symbols

Enumerates all global symbols. See Execution for detailed documentation.

Symbol introspection

Finding all functions

Symbol filtering

Debugging support

elf_output_obj

Outputs an object file after relocation for debugging purposes. The file is only generated if debugging is enabled.
TCCState*
required
The compilation context (must be after tcc_relocate()).
const char*
required
Output filename for the object file.
int
Returns 0 on success, -1 on error.
Example:

tcc_set_backtrace_func

Sets a custom backtrace function for runtime exceptions when using -bt option.
TCCState*
required
The compilation context.
void*
User data pointer passed to the backtrace callback.
TCCBtFunc*
required
Callback function for backtrace entries. Return 0 to stop backtrace.
Example:

Advanced symbol patterns

Function registry

Type-safe symbol access

Symbol validation

Runtime exception handling

_tcc_setjmp (experimental)

Catches runtime exceptions when using backtrace support. This is an experimental/advanced feature.
This is an experimental feature. See libtcc_test_mt.c in the TCC source for usage examples.
Example:

Complete example: Dynamic module system