I am working on an update application that must be able to run on an existing system and is also started by another application on this existing system.
I am using a shared library that itself uses OpenSSL, but didn't link against it. Previously my update application linked against OpenSSL to work around this. But now I cannot link against OpenSSL any longer due to binary incompatibilities. Now when my application is started on the existing system, I get an undefined symbol
error, because OpenSSL is not loaded. Note that I don't have the option to load it through LD_PRELOAD
, because I cannot change the application that starts my update application.
I thought about loading OpenSSL through dlopen
hoping that the shared library would be able to use it. But the shared library uses OpenSSL in a C constructor (__attribute__((constructor (101))) void myConstructor()
) and even if I call dlopen
inside another constructor with higher priority, the dynamic loader already seems to have searched (and failed) for OpenSSL. My constructor is not even being executed.
LD_BIND_NOW
is not set, so I wonder why the undefined symbol
error occurs before my constructor is being called.