Use stack-def.h.
[gnuk/neug.git] / src / neug.ld.in
index aa34050..e486c7b 100644 (file)
@@ -1,12 +1,6 @@
 /*
  * ST32F103 memory setup.
  */
-__main_stack_size__      = 0x0100;      /* Exception handlers     */
-__process0_stack_size__  = 0x0200;      /* main */
-__process1_stack_size__  = 0x0100;      /* led */
-__process2_stack_size__  = 0x0180;      /* rng */
-__process3_stack_size__  = 0x0100;      /* intr: usb */
-
 MEMORY
 {
     flash0 : org = @ORIGIN@, len = 4k
@@ -14,10 +8,6 @@ MEMORY
     ram : org = 0x20000000, len = @MEMORY_SIZE@k
 }
 
-/* __flash_start__: flash ROM start address regardless of DFU_SUPPORT */
-__flash_start__         = 0x08001000;
-__flash_end__           = ORIGIN(flash) + LENGTH(flash);
-
 __ram_start__           = ORIGIN(ram);
 __ram_size__            = LENGTH(ram);
 __ram_end__             = __ram_start__ + __ram_size__;
@@ -28,18 +18,20 @@ SECTIONS
 
     .sys : ALIGN(4) SUBALIGN(4)
     {
-        _sys = .;
-        KEEP(*(.vectors))
-        . = ALIGN(16);
-        *(.sys.version)
-        build/sys.o(.text)
-        build/sys.o(.text.*)
-        build/sys.o(.rodata)
-        build/sys.o(.rodata.*)
-        . = ALIGN(1024);
-        *(.sys.0)
-        *(.sys.1)
-        *(.sys.2)
+       _sys = .;
+       KEEP(*(.vectors))
+       . = ALIGN(16);
+       KEEP(*(.sys.version))
+       KEEP(*(.sys.board_id))
+       KEEP(*(.sys.board_name))
+       build/sys-*.o(.text)
+       build/sys-*.o(.text.*)
+       build/sys-*.o(.rodata)
+       build/sys-*.o(.rodata.*)
+       . = ALIGN(1024);
+       *(.sys.0)
+       *(.sys.1)
+       *(.sys.2)
     } > flash0
 
     _text = .;
@@ -83,26 +75,12 @@ SECTIONS
     .stacks :
     {
         . = ALIGN(8);
-        __main_stack_base__ = .;
-        . += __main_stack_size__;
-        . = ALIGN(8);
-        __main_stack_end__ = .;
-        __process0_stack_base__ = .;
-        . += __process0_stack_size__;
-        . = ALIGN(8);
-        __process0_stack_end__ = .;
-        __process1_stack_base__ = .;
-        . += __process1_stack_size__;
+        *(.main_stack)
+        *(.process_stack.0)
+        *(.process_stack.1)
+        *(.process_stack.2)
+        *(.process_stack.3)
         . = ALIGN(8);
-        __process1_stack_end__ = .;
-        __process2_stack_base__ = .;
-        . += __process2_stack_size__;
-        . = ALIGN(8);
-        __process2_stack_end__ = .;
-        __process3_stack_base__ = .;
-        . += __process3_stack_size__;
-        . = ALIGN(8);
-        __process3_stack_end__ = .;
     } > ram
 
     .data :
@@ -131,6 +109,7 @@ SECTIONS
         PROVIDE(_bss_end = .);
     } > ram
 
+    . = ALIGN(16);
     PROVIDE(end = .);
     _end            = .;
     . = ALIGN(512);
@@ -141,6 +120,7 @@ SECTIONS
     {
         . = ALIGN (@FLASH_PAGE_SIZE@);
        *(.passwd)
+        . = ALIGN(4);
     } > flash =0xffffffff
 }