https://github.com/NixOS/patchelf Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} NixOS / patchelf * Sponsor Sponsor NixOS/patchelf * Notifications * Star 1.5k * Fork 269 A small utility to modify the dynamic linker and RPATH of ELF executables GPL-3.0 License 1.5k stars 269 forks Star Notifications * Code * Issues 62 * Pull requests 25 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights master Switch branches/tags [ ] Branches Tags Nothing to show {{ refName }} default View all branches Nothing to show {{ refName }} default View all tags 9 branches 12 tags Code Clone HTTPS GitHub CLI [https://github.com/N] Use Git or checkout with SVN using the web URL. [gh repo clone NixOS/] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio If nothing happens, download the GitHub extension for Visual Studio and try again. Go back Latest commit @edolstra edolstra Merge pull request #266 from neheb/int ... f376fe6 Feb 26, 2021 Merge pull request #266 from neheb/int fix wrong cast f376fe6 Git stats * 452 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github Fix CI Dec 7, 2020 src fix wrong cast Feb 25, 2021 tests Add test case with invalid phdr offset Nov 15, 2020 .gitignore Update .gitignore Apr 24, 2014 BUGS * Document other people's bugs ;-) Sep 29, 2005 COPYING * Updated the license to GPLv3. Oct 14, 2009 Makefile.am Update Makefile.am May 28, 2020 README.md Update README.md Aug 27, 2020 bootstrap.sh Use autoreconf to bootstrap the project Jul 10, 2012 configure.ac Improve the default section alignment choice Jun 19, 2020 default.nix Add default.nix for compatibility Nov 26, 2020 flake.lock flake.lock: Update Dec 1, 2020 flake.nix flake.lock: Update Dec 1, 2020 patchelf.1 Added --output flag Jun 1, 2020 patchelf.spec.in fix README -> README.me in some more places Jun 3, 2020 version Bump version Aug 27, 2020 View code Compiling and Testing Author License Release History README.md PatchELF is a simple utility for modifying existing ELF executables and libraries. In particular, it can do the following: * Change the dynamic loader ("ELF interpreter") of executables: $ patchelf --set-interpreter /lib/my-ld-linux.so.2 my-program * Change the RPATH of executables and libraries: $ patchelf --set-rpath /opt/my-libs/lib:/other-libs my-program * Shrink the RPATH of executables and libraries: $ patchelf --shrink-rpath my-program This removes from the 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 /lib:/usr/lib:/foo/lib, and libfoo.so can only be found in /foo/lib, then the new RPATH will be /foo/lib. In addition, the --allowed-rpath-prefixes option can be used for further rpath tuning. For instance, if an executable has an RPATH /tmp/build-foo/.libs:/foo/lib, it is probably desirable to keep the /foo/lib reference instead of the /tmp entry. To accomplish that, use: $ patchelf --shrink-rpath --allowed-rpath-prefixes /usr/lib:/foo/lib my-program * Remove declared dependencies on dynamic libraries (DT_NEEDED entries): $ patchelf --remove-needed libfoo.so.1 my-program This option can be given multiple times. * Add a declared dependency on a dynamic library (DT_NEEDED): $ patchelf --add-needed libfoo.so.1 my-program This option can be give multiple times. * Replace a declared dependency on a dynamic library with another one (DT_NEEDED): $ patchelf --replace-needed liboriginal.so.1 libreplacement.so.1 my-program This option can be give multiple times. * Change SONAME of a dynamic library: $ patchelf --set-soname libnewname.so.3.4.5 path/to/libmylibrary.so.1.2.3 Compiling and Testing ./bootstrap.sh ./configure make make check sudo make install Author Copyright 2004-2019 Eelco Dolstra edolstra@gmail.com. License This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. Release History 0.12 (August 27, 2020): * New --clear-symbol-version flag. * Better support for relocating NOTE sections/segments. * Improved the default section alignment choice. * Bug fixes. 0.11 (June 9, 2020): * New --output flag. * Some bug fixes. 0.10 (March 28, 2019): * Many bug fixes. Please refer to the Git commit log: https://github.com/NixOS/patchelf/commits/master This release has contributions from Adam Trhon, Benjamin Hipple, Bernardo Ramos, Bjorn Forsman, Domen Kozar, Eelco Dolstra, Ezra Cooper, Felipe Sateler, Jakub Wilk, James Le Cuirot, Karl Millar, Linus Heckemann, Nathaniel J. Smith, Richard Purdie, Stanislav Markevich and Tuomas Tynkkynen. 0.9 (February 29, 2016): * Lots of new features. Please refer to the Git commit log: https://github.com/NixOS/patchelf/commits/master This release has contributions from Aaron D. Marasco, Adrien Devresse, Alexandre Pretyman, Changli Gao, Chingis Dugarzhapov, darealshinji, David Sveningsson, Eelco Dolstra, Felipe Sateler, Jeremy Sanders, Jonas Kuemmerlin, Thomas Tuegel, Tuomas Tynkkynen, Vincent Danjean and Vladimir Cunat. 0.8 (January 15, 2014): * Fix a segfault caused by certain illegal entries in symbol tables. 0.7 (January 7, 2014): * Rewrite section indices in symbol tables. This for instance allows gdb to show proper backtraces. * Added `--remove-needed' option. 0.6 (November 7, 2011): * Hacky support for executables created by the Gold linker. * Support segments with an alignment of 0 (contributed by Zack Weinberg). * Added a manual page (contributed by Jeremy Sanders jeremy@jeremysanders.net). 0.5 (November 4, 2009): * Various bugfixes. * `--force-rpath' now deletes the DT_RUNPATH if it is present. 0.4 (June 4, 2008): * Support for growing the RPATH on dynamic libraries. * IA-64 support (not tested) and related 64-bit fixes. * FreeBSD support. * --set-rpath', --shrink-rpath' and --print-rpath' now prefer DT_RUNPATH over DT_RPATH, which is obsolete. When updating, if both are present, both are updated. If only DT_RPATH is present, it is converted to DT_RUNPATH unless --force-rpath' is specified. If neither is present, a DT_RUNPATH is added unless `--force-rpath' is specified, in which case a DT_RPATH is added. 0.3 (May 24, 2007): * Support for 64-bit ELF binaries (such as on x86_64-linux). * Support for big-endian ELF binaries (such as on powerpc-linux). * Various bugfixes. 0.2 (January 15, 2007): * Provides a hack to get certain programs (such as the Belastingaangifte 2005) to work. 0.1 (October 11, 2005): * Initial release. About A small utility to modify the dynamic linker and RPATH of ELF executables Resources Readme License GPL-3.0 License Releases 12 PatchELF 0.12 Latest Aug 27, 2020 + 11 releases Sponsor this project * open_collective opencollective.com/nixos Packages 0 No packages published Contributors 44 * * * * * * * * * * * + 33 contributors Languages * C 62.0% * C++ 27.9% * Shell 6.2% * Makefile 1.4% * Roff 1.2% * Nix 1.0% * M4 0.3% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.