objdump -p testprog
The output includes the hard-coded path of the shared library:
....
NEEDED /home/test/lib/liba.so
NEEDED /home/test/lib/libb.so
NEEDED /home/ test/lib/libc.so
....
Recently I got a binary test. When I checked it with objdump, I found that it contains a hard-coded library path. Why do I need to hard-code such a path? Shouldn’t you get the path from the SHELL environment variable or -L parameter?
objdump -p testprog
The output includes the hard-coded path of the shared library:
....
NEEDED /home/test/lib/liba.so
NEEDED /home/test/lib/libb.so
NEEDED /home/ test/lib/libc.so
....
This may be because these three .so files are on the host where the test program is built There is no SONAME. Tell the person who built it to rebuild liba.so with -Wl, soname, liba.so and two other similar methods, and then relink the main program.