[][src]Function goblin::elf::reloc::reloc32::from_raw_rel

Important traits for &'_ [u8]
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:

  1. ptr points to memory received from the kernel (i.e., it loaded the executable), or
  2. The binary has already been mmapped (i.e., it's a SharedObject), and hence it's safe to return a slice of that memory.
  3. Or if you obtained the pointer in some other lawful manner