Function goblin::elf::reloc::reloc32::from_raw_rel [−][src]
pub unsafe fn from_raw_rel<'a>(ptr: *const Rel, size: usize) -> &'a [Rel]
Gets the rel entries given a rel pointer and the size of the rel section in the binary, in bytes. Assumes the pointer is valid and can safely return a slice of memory pointing to the rels 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