Relative Content

Tag Archive for linuxdynamic-linkingld-preloaddlsym

When is late enough to use dlsym to find functions in another shared library?

Say I have an application foo that is linked against bar.so. I have another library, buzz.so that the application does not directly link, but that I use when I run the application with LD_PRELOAD like so: LD_PRELOAD=buzz.so ./foo. Now I want buzz.so to be able to use dlsym to find a symbol inside bar.so. My question is: what is the earliest point in time the dlsym call can succeed and how do run a function at that time?