pub fn write_relocation(
    relocation_entry: RelocationEntry,
    target_sec_slice: &mut [u8],
    target_sec_offset: usize,
    source_sec_vaddr: VirtualAddress,
    verbose_log: bool
) -> Result<(), &'static str>
Expand description

Actually write the value of a relocation entry.

Arguments

  • relocation_entry: the relocation entry from the ELF file that specifies the details of the relocation action to perform.
  • target_sec_slice: a byte slice holding the entire contents of the target section, i.e., the section where the relocation data will be written to.
  • target_sec_offset: the offset into target_sec_slice where the target section’s contents begin.
  • source_sec_vaddr: the VirtualAddress of the source section of the relocation, i.e., the section that the target_sec depends on and “points” to.
  • verbose_log: whether to output verbose logging information about this relocation action.

Notes