mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:02:44 +00:00 
			
		
		
		
	LibELF: Add riscv64 PLT trampoline
This code is based on the aarch64 implementation.
This commit is contained in:
		
							parent
							
								
									bf9240c7a9
								
							
						
					
					
						commit
						525555181e
					
				
					 2 changed files with 82 additions and 3 deletions
				
			
		|  | @ -790,8 +790,16 @@ void DynamicLoader::setup_plt_trampoline() | |||
|     VirtualAddress got_address = m_dynamic_object->plt_got_base_address(); | ||||
| 
 | ||||
|     auto* got_ptr = (FlatPtr*)got_address.as_ptr(); | ||||
| 
 | ||||
| #if ARCH(AARCH64) || ARCH(X86_64) | ||||
|     got_ptr[1] = (FlatPtr)m_dynamic_object.ptr(); | ||||
|     got_ptr[2] = (FlatPtr)&_plt_trampoline; | ||||
| #elif ARCH(RISCV64) | ||||
|     got_ptr[0] = (FlatPtr)&_plt_trampoline; | ||||
|     got_ptr[1] = (FlatPtr)m_dynamic_object.ptr(); | ||||
| #else | ||||
| #    error Unknown architecture | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| // Called from our ASM routine _plt_trampoline.
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Sönke Holz
						Sönke Holz