From: Sebastien Bourdeauducq Date: Thu, 11 Jul 2013 16:49:42 +0000 (+0200) Subject: software: share SDRAM linker script X-Git-Tag: 24jan2021_ls180~2874 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c2ec077d8f7ad1d229d0d27420ada5e61f61bf31;p=litex.git software: share SDRAM linker script --- diff --git a/software/libbase/linker-sdram.ld b/software/libbase/linker-sdram.ld new file mode 100644 index 00000000..fd17edbf --- /dev/null +++ b/software/libbase/linker-sdram.ld @@ -0,0 +1,56 @@ +OUTPUT_FORMAT("elf32-lm32") +ENTRY(_start) + +__DYNAMIC = 0; + +MEMORY { + sdram : ORIGIN = 0x40000000, LENGTH = 0x08000000 /* 128M */ +} + +SECTIONS +{ + .text : + { + _ftext = .; + *(.text .stub .text.* .gnu.linkonce.t.*) + _etext = .; + } > sdram + + .rodata : + { + . = ALIGN(4); + _frodata = .; + *(.rodata .rodata.* .gnu.linkonce.r.*) + *(.rodata1) + _erodata = .; + } > sdram + + .data : + { + . = ALIGN(4); + _fdata = .; + *(.data .data.* .gnu.linkonce.d.*) + *(.data1) + _gp = ALIGN(16); + *(.sdata .sdata.* .gnu.linkonce.s.*) + _edata = .; + } > sdram + + .bss : + { + . = ALIGN(4); + _fbss = .; + *(.dynsbss) + *(.sbss .sbss.* .gnu.linkonce.sb.*) + *(.scommon) + *(.dynbss) + *(.bss .bss.* .gnu.linkonce.b.*) + *(COMMON) + . = ALIGN(4); + _ebss = .; + . = ALIGN(8); + _heapstart = .; + } > sdram +} + +PROVIDE(_fstack = ORIGIN(sdram) + LENGTH(sdram) - 4); diff --git a/software/videomixer/Makefile b/software/videomixer/Makefile index b4e6c183..347dccc7 100644 --- a/software/videomixer/Makefile +++ b/software/videomixer/Makefile @@ -15,10 +15,12 @@ all: videomixer.bin videomixer.fbi %.fbi: %.bin $(M2DIR)/tools/mkmmimg $< write $@ -videomixer.elf: linker.ld $(OBJECTS) libs +videomixer.elf: $(OBJECTS) libs %.elf: - $(LD) $(LDFLAGS) -T $< -N -o $@ \ + $(LD) $(LDFLAGS) \ + -T $(M2DIR)/software/libbase/linker-sdram.ld \ + -N -o $@ \ $(M2DIR)/software/libbase/crt0.o \ $(OBJECTS) \ -L$(M2DIR)/software/libbase \ diff --git a/software/videomixer/linker.ld b/software/videomixer/linker.ld deleted file mode 100644 index fd17edbf..00000000 --- a/software/videomixer/linker.ld +++ /dev/null @@ -1,56 +0,0 @@ -OUTPUT_FORMAT("elf32-lm32") -ENTRY(_start) - -__DYNAMIC = 0; - -MEMORY { - sdram : ORIGIN = 0x40000000, LENGTH = 0x08000000 /* 128M */ -} - -SECTIONS -{ - .text : - { - _ftext = .; - *(.text .stub .text.* .gnu.linkonce.t.*) - _etext = .; - } > sdram - - .rodata : - { - . = ALIGN(4); - _frodata = .; - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - _erodata = .; - } > sdram - - .data : - { - . = ALIGN(4); - _fdata = .; - *(.data .data.* .gnu.linkonce.d.*) - *(.data1) - _gp = ALIGN(16); - *(.sdata .sdata.* .gnu.linkonce.s.*) - _edata = .; - } > sdram - - .bss : - { - . = ALIGN(4); - _fbss = .; - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.scommon) - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = .; - . = ALIGN(8); - _heapstart = .; - } > sdram -} - -PROVIDE(_fstack = ORIGIN(sdram) + LENGTH(sdram) - 4);