.github
Change the dynamic loader ( ELF interpreter ) of executables:
$ patchelf set-interpreter /lib/my-ld-linux.so.2 my-program
Change the
$ patchelf set-rpath /opt/my-libs/lib:/other-libs my-program
Shrink the
$ patchelf shrink-rpath my-program
RPATH all directories that do not contain a
library referenced by
DT NEEDED fields of the executable or library.
For instance, if an executable references one library
libfoo.so, has
an RPATH
libfoo.so can only be found
in
/foo/lib, then the new
RPATH will be
In addition, the
RPATH
/foo/lib reference instead of the
/tmp entry. To accomplish
that, use:
$ patchelf shrink-rpath allowed-rpath-prefixes /usr/lib:/foo/lib my-program