Re: dynamic link of alternate library name > static /afs/apd/func/et4/binhp32/etiprack
on the link line, instead of
"/afs/apd/func/et4/binhp32/etiprack"
you can say
"-L/afs/apd/func/et4/binhp32/ -l:etiprack"
the following
----
cat > 1.c << \!
main () { hi_mom () ; }
!
cat > 2.c << \!
hi_mom () { printf ("hi mom\n"); }
!
cat > 3.c << \!
hi_mom () { printf ("hi dad\n"); }
!
cc -c +z 2.c 3.c
ld -b -o 2.sl 2.o
ld -b -o /tmp/2.sl 3.o
cc -Wl,+s 1.c -L. -l:2.sl
chatr a.out | grep 2.sl
SHLIB_PATH=/tmp ./a.out
----
gives:
----
dynamic ./2.sl
hi dad
---- |