From a235eaf0cd7ff8edd2f4faae637f7badc72bc57b Mon Sep 17 00:00:00 2001 From: Camilo Andres Vera Ruiz Date: Mon, 13 Sep 2021 00:44:30 -0500 Subject: [PATCH] Linker fix for initialized global variables I found that in some cases, initialized global variables don't work with user libraries, so a little change to the linker that I use, taken from the demo file, seems to solve the problem . I think that make more sense to put the global variables in sram and initial values in the main_ram, similar to the bios linker. --- litex/soc/software/demo/linker.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litex/soc/software/demo/linker.ld b/litex/soc/software/demo/linker.ld index d95d86286..d327ecf77 100644 --- a/litex/soc/software/demo/linker.ld +++ b/litex/soc/software/demo/linker.ld @@ -40,7 +40,7 @@ SECTIONS *(.sdata .sdata.* .gnu.linkonce.s.*) . = ALIGN(8); _edata = .; - } > main_ram + } > sram AT > main_ram .bss : {