[PATCH v2 05/21] riscv: define generic relocate_image

Sascha Hauer s.hauer at pengutronix.de
Tue Jan 6 05:11:47 PST 2026


On Tue, Jan 06, 2026 at 02:10:02PM +0100, Ahmad Fatoum wrote:
> Hi,
> 
> On 1/6/26 1:53 PM, Sascha Hauer wrote:
> > For use by the ELF loader in PBL to relocate barebox proper, export a
> > new relocate_image capable of relocating barebox and implement
> > relocate_to_current_adr() in terms of it.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
> 
> Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> 
> > -	dstart = runtime_address(__rel_dyn_start);
> > -	dend = runtime_address(__rel_dyn_end);
> > -	dynsym = runtime_address(__dynsym_start);
> 
> Interestingly dynend wasn't used here and no memset, unlike for ARM and
> also it needs dynsym even with RELA...

Yes, as said, the memset is only needed for multiple relocations of the
same image. Likely nobody trapped into this on RiscV.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list