This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: how does linker choose version of shared lib?
- From: Paul Smith <paul at mad-scientist dot net>
- To: Steve Jaffe <sjaffe at riskspan dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 28 Apr 2011 13:22:07 -0400
- Subject: Re: how does linker choose version of shared lib?
- References: <31498483.post@talk.nabble.com>
- Reply-to: paul at mad-scientist dot net
On Thu, 2011-04-28 at 09:57 -0700, Steve Jaffe wrote:
> To be specific: I have two versions of libssl in /lib: libssl.so.4 and
> libssl.so.6. What happens is that the .so.4 version is always linked --
> what determines this behavior? (and how could one therefore change it, ie
> specify which version to choose?)
Typically there's a symbolic link on the system "libssl.so" (note no
version) which points to whichever major version you want to use as the
default. This "un-versioned" .so is what's used by the compile-time
linker to determine which .so to link.
Look for libssl.so and see if it points to libssl.so.4 or libssl.so.6.