PatchELF: Simple utility for modifying existing ELF executables and libraries
Patchelf is almost always broken, and when they merge fixes they don&#x27;t release a new version right away. Between 2014-2019 running patchelf+strip would corrupt binaries, after the fix running patchelf twice on the same binary would corrupt it. And now patchelf doesn&#x27;t work on all binaries, there&#x27;s a bugfix merged <a href="https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;patchelf&#x2F;pull&#x2F;230" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;patchelf&#x2F;pull&#x2F;230</a> merged Nov 19, 2020, but no release since then.<p>Also patchelf exposed a bug in ldconfig noted 11 years ago and only fixed in glibc 2.31: <a href="https:&#x2F;&#x2F;nix-dev.science.uu.narkive.com&#x2F;q6Ww5fyO&#x2F;ldconfig-problem-with-patchelf-and-64-bit-libs" rel="nofollow">https:&#x2F;&#x2F;nix-dev.science.uu.narkive.com&#x2F;q6Ww5fyO&#x2F;ldconfig-pro...</a><p>And currently patchelf still has a bug: <a href="https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;patchelf&#x2F;pull&#x2F;275" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;patchelf&#x2F;pull&#x2F;275</a><p>Apparently elf files are hard.