patchelf icon indicating copy to clipboard operation
patchelf copied to clipboard

Patching hard-coded paths within the text segment.

Open liarokapisv opened this issue 1 year ago • 0 comments

It is often the case that closed-source binaries hard-code paths to global FHS locations. Currently, patchelf works for the very common case of ELF dependencies through shared linking but doesn't do much for other hard-coded paths like manual configuration lookup and even hard-coded dlopen calls.

It could perhaps be useful to be able to provide a "hard-coded path map" that would replace hard-coded paths from the text segment as well. This could allow changing such paths to relative-paths and then symlink the dependencies to the packaged nix packages directly. This is much more flexible than wrapping executables using buildFHSEnv since it should work for MacOS as well (for which bwrap does not work) and would be leaner than running through namespacing.

liarokapisv avatar May 22 '24 22:05 liarokapisv