Merge pull request 'handle relocation 0x01' (#9) from feature/nikocs/relocation_0x01 into develop
Reviewed-on: #9
This commit is contained in:
		
						commit
						897deba6c8
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -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
 | ||||
|         } | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue