diff --git a/litex/soc/software/bios/linker.ld b/litex/soc/software/bios/linker.ld index 13b4bcaec..4cbe0bec2 100644 --- a/litex/soc/software/bios/linker.ld +++ b/litex/soc/software/bios/linker.ld @@ -26,6 +26,21 @@ SECTIONS _erodata = .; } > rom + .data : + { + . = ALIGN(4); + _fdata = .; + *(.data .data.* .gnu.linkonce.d.*) + *(.data1) + *(.sdata .sdata.* .gnu.linkonce.s.*) + + /* Make sure the file is aligned on disk as well + as in memory; CRC calculation requires that. */ + FILL(0); + . = ALIGN(4); + _edata = .; + } > rom + .bss : { . = ALIGN(4); @@ -45,9 +60,6 @@ SECTIONS { *(.eh_frame) *(.comment) - *(.data .data.* .gnu.linkonce.d.*) - *(.data1) - *(.sdata .sdata.* .gnu.linkonce.s.*) } }