m4b / goblin

An impish, cross-platform binary parsing crate, written in Rust
MIT License
1.17k stars 156 forks source link

Implementing patchelf / install_name_tool with goblin #367

Open wolfv opened 1 year ago

wolfv commented 1 year ago

Hi, thanks for the great library! We're currently using it in a new package manager to read linked libraries and rpaths from .so and .dylib files.

We need to rewrite the dylibs to use a relative rpath (using $ORIGIN or @loader_path). We currently use patchelf and install_name_tool respectively for that, but obviously would love to get rid of those dependencies.

I wanted to ask wether you think it's feasible to rewrite entire dylib/so files in this way with goblin, and if there are any examples out there?