This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld linking behaviour
- From: Edward Peschko <horos11 at gmail dot com>
- To: binutils at sourceware dot org, gcc at gcc dot gnu dot org
- Date: Fri, 11 Jun 2010 16:35:38 -0700
- Subject: ld linking behaviour
All,
When I link with a shared library, for example:
env LD_RUN_PATH="/usr/lib" /usr/bin/gcc -shared -fPIC
-L/usr/local/lib -Wl,-rpath,/home/y/lib Libconfig.o -o
blib/arch/auto/Conf/Libconfig/Libconfig.so -L/usr/lib -L/usr/local/lib
/usr/lib/libconfig.so
the ld command follows the version, and links to the specific version
of the library, not the library itself. An ldd dump shows :
prompt% ldd blib/arch/auto/Conf/Libconfig/Libconfig.so
linux-gate.so.1 => (0xffffe000)
libconfig.so.8 => /usr/lib/libconfig.so.8 (0xf7fe2000)
libc.so.6 => /lib/tls/libc.so.6 (0xf7eb7000)
/lib/ld-linux.so.2 (0x56555000)
How can I make it so that the ld command instead links to the
libconfig.so library itself (so that if a newer, binary compatible,
version of libconfig comes out it can use it transparently)?
I can do:
env LD_PRELOAD=/usr/lib/libconfig.so ldd
blib/arch/auto/Conf/Libconfig/Libconfig.so
and get the desired result, but I'd rather not deal with extra
environment settings..
Thanks much,
Ed