-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to check if elf is statically linked? #682
Comments
There's nothing in the unified API, and even For now, you'll need to use the lower level ELF APIs to read the ELF header flags and the program headers (e.g. check for |
Thanks for the quick reply! I found that goblin supports getting program header https://docs.rs/goblin/latest/goblin/elf/struct.Elf.html and have PT_INTERP defined in the crate |
goblin is certainly the easiest way to do it, but if all you want is to check if it is statically linked then it's doing a lot of parsing that you don't need. I don't know if that matters. |
For cargo-binstall, most of the time is spent on network and the elf shouldn't be too big, so I think it should be ok |
I want to check if an elf object is statically linked.
I've found
Object::kind
, however I'm not sure which variants inObjectKind
refers to a statically linked.The text was updated successfully, but these errors were encountered: