1 unstable release

0.2.1 Nov 14, 2023
0.2.0 Nov 14, 2023
0.1.0 Nov 13, 2023

#107 in #call

GPL-3.0-or-later

335KB
4K SLoC

C++ 2K SLoC // 0.1% comments Shell 1K SLoC // 0.1% comments M4 687 SLoC // 0.1% comments Rust 236 SLoC // 0.0% comments Automake 166 SLoC // 0.1% comments C 44 SLoC // 0.0% comments GNU Style Assembly 20 SLoC // 0.3% comments

Contains (ELF exe/lib, 230KB) overlapping-segments-after-rounding, (ELF exe/lib, 170KB) patchelf/tests/short-first-segment.gz, (ELF lib, 67KB) libtest.so, (ELF exe/lib, 67KB) patchelf/tests/endianness/ppc64/main, (ELF lib, 67KB) libtest.so, (ELF exe/lib, 67KB) patchelf/tests/endianness/ppc64le/main and 23 more.

patchelf-rs

Crates.io docs.rs

Rust FFI for patchelf that we can call patchelf directly in a dirty way.

[dependencies]
patchelf = "0.2.1"

Usage

  • set soname
PatchElf::config()
   .input("libpng.so")
   .output("libpng2.so")
   .set_soname("libpng2.so")
   .patch();
  • print soname
PatchElf::config()
   .input("libz.so")
   .print_soname()
   .patch();

Seed doc for more usages.


lib.rs:

Rust FFI for patchelf

Example for print soname.

PatchElf::config()
    .input("libpng.so")
    .print_soname()
    .patch();

Example for set soname.

PatchElf::config()
    .input("libpng.so")
    .output("libpng2.so")
    .set_soname("libpng2.so")
    .patch();

No runtime deps