c - Why shared library path is hardcoded in execuatble? -
recently got test binary. when checked using objdump, observed includes hard coded library path. why needed to hardcode path that? shouldn't path taken shell environment variables or -l parameter instead ?
objdump -p testprog
the output includes hardcoded path shared libraries:
.... needed /home/test/lib/liba.so needed /home/test/lib/libb.so needed /home/test/lib/libc.so ....
this because 3 .so
files had no soname on host test program built. tell person built rebuild liba.so
-wl,soname,liba.so
, similar other two, relink main program.
Comments
Post a Comment