Hi folks, I googled the web, but couldn't find anything relevant, so hoping that e-mailing the gurus on this list can help:
Running on x64 Linux box. I am trying to link the static OpenSSL library with my application .so shared library. Here are the gcc link options that I am using: --- gcc $EXTRA_C_FLAGS -shared -Bsymbolic -o ${prog}.so ${prog}.o -lc -lpthread -lssl --- This results in the following .so file: --- ldd db2auth.so libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a95677000) libdl.so.2 => /lib64/libdl.so.2 (0x0000002a9589f000) libpthread.so.0 => /lib64/tls/libpthread.so.0 (0x0000002a959a2000) libssl.so.0.9.7 => /usr/lib64/libssl.so.0.9.7 (0x0000002a95ab6000) /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000) libcrypto.so.0.9.7 => /usr/lib64/libcrypto.so.0.9.7 (0x0000002a95bed000) --- So far so good. However when my db2auth.so library is loaded by an application, the application detects the following undefined symbol: /usr/lib64/libssl.so.0.9.7: undefined symbol: X509_free As a result the application fails. I don't have a problem when the same code is compiled as part of a static executable (i.e. no "undefined symbol"), however I also need to build a workable .so as well. Does anybody have any suggestions on what to do (e.g. perhaps this issue doesn't exist with a later OpenSSL release or maybe there is some magic gcc linker directive)? Thanks in advance, Gene