views:

30

answers:

0

Given I have a shared lib (“dynamic_one”) which links a specific version of a static lib (say 0.9.8 of openssl). Further I have an app which links another version of this lib (say 1.0.0 of openssl) dynamically and also loads the “dynamic_one” lib.

Actually I encounter strange memory corruptions due to the incompatible ABI of the two openssl versions.

What I want is that the shared lib “dynamic_one” should use its static linked version of openssl whilst the app should use its dynamically linked version.

Is there a way to link the static openssl (0.9.8) library so that its symbols are not visible for the loader of “dynamic_one” and code in “dynamic_one” never uses methods from the dynamically linked openssl (1.0.0)?

I have tried lds --exclude-libs which did not help.

And yes, of course the problems disappear if both openssl versions match. But that's not the point of this question.