pub struct ElfRelocator { /* private fields */ }Available on crate feature
relocate only.Expand description
Relocates ELF together with its dependencies.
Implementations§
Source§impl ElfRelocator
impl ElfRelocator
Sourcepub fn new(loader: DynamicLoader) -> Self
pub fn new(loader: DynamicLoader) -> Self
Create new relocator that uses the specified dynamic loader.
Sourcepub fn relocate<P1: Into<PathBuf>, P2: AsRef<Path>>(
&self,
file: P1,
directory: P2,
) -> Result<PathBuf, Error>
pub fn relocate<P1: Into<PathBuf>, P2: AsRef<Path>>( &self, file: P1, directory: P2, ) -> Result<PathBuf, Error>
Relocates ELF file to directory together with its dependencies.
Each ELF is copied to the subdirectory which name is BASE32-encoded hash of the file. The
dependencies are then symlinked into this directory. Each ELF’s RUNPATH is
set to the containing directory. Each ELF’s interpreter is changed to point to the interpreter from that
directory. All executables are symlinked into directory/bin.
Auto Trait Implementations§
impl Freeze for ElfRelocator
impl RefUnwindSafe for ElfRelocator
impl Send for ElfRelocator
impl Sync for ElfRelocator
impl Unpin for ElfRelocator
impl UnwindSafe for ElfRelocator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more