Usage of rtld_active() in dlfcn functions
Florian Weimer
fweimer@redhat.com
Thu Sep 3 08:08:51 GMT 2020
* Fengkai Sun via Libc-help:
> My question is, why can dlfcn functions be called before ld.so is
> initialized? Obviously a program written by the user cannot do that, and I
> can't find the reference to dlfcn functions in rtld.c.
> So what is rtld_active() used for?
>
> Additionally, what does "static dlopen" mean?
It means dlopen called from a statically linked application. The
application does not use ld.so in this case. It gets still loaded after
dlopen, but this version is not functional. It cannot be initialized
because that would conflict with the process initialization the
statically linked program has already performed.
This is just how things are today. Other approaches might be possible,
some of which could well eliminate this problem and use ld.so directly
even from statically linked programs.
Thanks,
Florian
More information about the Libc-help
mailing list