| Crates.io | dynlibs |
| lib.rs | dynlibs |
| version | 0.2.1 |
| created_at | 2025-11-21 18:07:38.152954+00 |
| updated_at | 2025-11-21 20:30:57.73524+00 |
| description | A simple, cross-platform program to display dynamic libraries used by an executable |
| homepage | |
| repository | https://github.com/nu11ptr/dynlibs |
| max_upload_size | |
| id | 1943913 |
| size | 18,195 |
A simple, cross-platform program to display dynamic libraries used by an executable
I found it a pain when writing cross platform programs to figure out which dynamic libraries I was linking with. On macOS, there is otool and objdump, on linux, ldd, and on Windows, dumpbin.exe. Once I discovered the awesome goblin crate, I was surprised no one had created a simple program to just dump the dynamic libraries used by an executable, so I created one.
Additionally, I wanted a simple way in my CICD pipeline to ensure I didn't accidently add any dynamic library requirements that I wasn't expecting, so I added the --only flag to allow validating that only the expected dynamic libraries are required.
NOTE: There aren't many surprises here, but if you aren't aware,
lddlooks up transitive dependencies, but this utility does not. This means this utility lists only the direct dependencies of an executable, which is consistent with the other utilities listed above, and makes this program consistent across executable types and platforms.
cargo install --locked dynlibs
Linux:
$ dynlibs /bin/ls
Binary type: ELF
Dynamic libraries:
libselinux.so.1
libc.so.6
Windows:
PS dynlibs c:\windows\hh.exe
Binary type: PE
Dynamic libraries:
ADVAPI32.dll
KERNEL32.dll
msvcrt.dll
Mac:
% dynlibs /bin/ls
Binary type: Mach-O (Fat)
Dynamic libraries:
Index 0:
/usr/lib/libutil.dylib
/usr/lib/libncurses.5.4.dylib
/usr/lib/libSystem.B.dylib
Index 1:
/usr/lib/libutil.dylib
/usr/lib/libncurses.5.4.dylib
/usr/lib/libSystem.B.dylib
Exit code 1 (output to stderr):
% dynlibs -o libutil -o libSystem /bin/ls
Some dynamic libraries did not match the provided regexes:
Index 0:
/usr/lib/libncurses.5.4.dylib
Index 1:
/usr/lib/libncurses.5.4.dylib
Exit code 0 (no output):
% dynlibs -o libutil -o libSystem -o libncurses /bin/ls
This is a very simple program, and besides some possible slight enhancements, it is more or less complete.
Contributions are welcome as long they align with my vision for this crate.