From: William D. Jones Date: Wed, 21 Nov 2018 05:13:13 +0000 (-0500) Subject: libbase/crt0-picorv32: Add support for .data sections. X-Git-Tag: 24jan2021_ls180~1476^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=89c702187a3010a76e374e295ff0022e97bb4b51;p=litex.git libbase/crt0-picorv32: Add support for .data sections. --- diff --git a/litex/soc/software/libbase/crt0-picorv32.S b/litex/soc/software/libbase/crt0-picorv32.S index 7e4c712b..3f7a4f5c 100644 --- a/litex/soc/software/libbase/crt0-picorv32.S +++ b/litex/soc/software/libbase/crt0-picorv32.S @@ -194,6 +194,20 @@ _crt0: la t1, _irq_mask sw t0, 0(t1) +#ifdef EXECUTE_IN_PLACE + /* Load DATA */ + la t0, _erodata + la t1, _fdata + la t2, _edata +3: + lw t3, 0(t0) + sw t3, 0(t1) + /* _edata is aligned to 16 bytes. Use word-xfers. */ + addi t0, t0, 4 + addi t1, t1, 4 + bltu t1, t2, 3b +#endif + /* Clear BSS */ la t0, _fbss la t1, _ebss