diff --git a/ddi/src/arch/riscv32/mod.rs b/ddi/src/arch/riscv32/mod.rs index ceace48..d1dc0e9 100644 --- a/ddi/src/arch/riscv32/mod.rs +++ b/ddi/src/arch/riscv32/mod.rs @@ -98,6 +98,11 @@ pub fn apply_relocation(segment_buffer: &mut [u8], current_segment_base: u32, ta x if x == RiscVRelocationType::None as u16 => { // do nothing } + x if x == RiscVRelocationType::R32 as u16 => { + let ptr = relocation_header.relocation_pointer as usize; + let addr = relocation_header.target_pointer as u32 + target_segment_base; + segment_buffer[ptr..ptr+4].copy_from_slice(&addr.to_le_bytes()); + } x if x == RiscVRelocationType::CallPLT as u16 || x == RiscVRelocationType::Call as u16 => { // these are relative, do nothing for now }