software: share SDRAM linker script
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 11 Jul 2013 16:49:42 +0000 (18:49 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 11 Jul 2013 16:49:42 +0000 (18:49 +0200)
software/libbase/linker-sdram.ld [new file with mode: 0644]
software/videomixer/Makefile
software/videomixer/linker.ld [deleted file]

diff --git a/software/libbase/linker-sdram.ld b/software/libbase/linker-sdram.ld
new file mode 100644 (file)
index 0000000..fd17edb
--- /dev/null
@@ -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);
index b4e6c183d7dc087e0a2cc3a7c7809d72379ba6c4..347dccc7eebea74f88aeb7987882723e1be723e1 100644 (file)
@@ -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 (file)
index fd17edb..0000000
+++ /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);