patchelf
patchelf copied to clipboard
Set interpreter only when necessary
If the value to be written with --set-intrepreter has already been set,
the operation can be skipped. Similar checks are already performed by
modifySoname() and can be implemented in setInterpreter().
This may avoid the problem that segfaults occur after multiple calls to
patchelf --set-interpreter mentioned in the link below.
https://github.com/NixOS/patchelf/issues/492#issuecomment-1610868690
It also prevents the addition of unnecessary LOAD segments each time
patchelf --set-interpreter is called.