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

Popular posts from this blog

Glib GIOChannel -

jsp - java.sql.SQLException: [Microsoft][ODBC Microsoft Access > Driver] Too few parameters. Expected 1 -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -