Function goblin::elf::reloc::reloc64::from_raw_rela [−][src]
pub unsafe fn from_raw_rela<'a>(ptr: *const Rela, size: usize) -> &'a [Rela]
Gets the rela entries given a rela pointer and the size of the rela section in the binary, in bytes. Assumes the pointer is valid and can safely return a slice of memory pointing to the relas because:
ptr
points to memory received from the kernel (i.e., it loaded the executable), or- The binary has already been mmapped (i.e., it’s a
SharedObject
), and hence it’s safe to return a slice of that memory. - Or if you obtained the pointer in some other lawful manner