Closed jabedude closed 5 years ago
@jabedude
Regarding 1: Yes the allocate calls you're seeing should contain the virtual base address of the program headers https://github.com/gz/rust-elfloader/blob/d5104bcc29241cc266cde6f045483b760c4744aa/src/lib.rs#L196 I never loaded a binary linked with a Linux compatible linker script, so there may be issues (let me know I'm happy to help troubleshoot).
Regarding 2: I think the functionality is not in the crate yet (I think there is for parsing the header containing the entry point, but there isn't a convenient function for retrieving it). But yes, I'm happy for any pull requests that improve the crate.
FYI I updated this crate a little so ElfLoader also gets exposed to relocation entries as well. With this I can successfully load position independent executables too. There is a test that shows how to do it.
If something should not work feel free to open a new issue.
Thank you, that sounds great! I'll check it out.
I'm having some trouble implementing an ELF loader in Linux with the ElfLoader trait. Questions: