📅 2017-Nov-01 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ chrpath, rpath, runpath, shared library ⬩ 📚 Archive
RPATH or RUNPATH is a colon-separated list of directories embedded in an executable. This list of directories play an important role when shared library file locations are determined at the time when the executable is loaded for running. This process is described in this post. Note that RPATH has highest priority in the shared library search, compared to RUNPATH. We can change RPATH or RUNPATH of a binary file by using the chrpath tool.
$ sudo apt install chrpath
$ chrpath ./some_binary
$ chrpath -d ./some_binary
$ chrpath -c ./some_binary
Note that you cannot convert a RUNPATH back to RPATH.
$ chrpath -r /home/joe:/home/foobar/lib64 ./some_binary
Note that the string of the new set of paths should be smaller or equal to the length of what was stored earlier in the binary.
Tried with: chrpath 0.14 and Ubuntu 16.04