On 22.09.2023 21:17, Detlef Riekenberg wrote:
Obviously when loading a .so library,
tcc additionally is loads its dependencies too.
That would be correct, when the target is TCC_OUTPUT_MEMORY
but i think, in all other cases, tcc should not do that.
I'd suggest to use "grep -nrw tcc_load_dll ." for example. There is
only one place from where tcc_load_dll() is called:
in libtcc.c:tcc_add_file_internal():
case AFF_BINTYPE_DYN:
if (s1->output_type == TCC_OUTPUT_MEMORY) {
#ifdef TCC_IS_NATIVE
void* dl = dlopen(filename, RTLD_GLOBAL | RTLD_LAZY);
if (dl)
tcc_add_dllref(s1, filename, 0)->handle = dl, ret = 0;
#endif
} else
ret = tcc_load_dll(s1, fd, filename, (flags &
AFF_REFERENCED_DLL) != 0);
break;
So, for TCC_OUTPUT_MEMORY, tcc does not use tcc_load_dll(), It calls
"dlopen()" instead. Where dlopen() would invoke the dynamic linker
(ld.so) and that one then would take care to load any dependencies
(DT_NEEDED tags).
-- gr
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel