Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[fw/altos] / src / stmf0 / altos.ld
index 6672c1fd5965afd769d8b412789b0fad3cddc7b6..64e1d00cf0ab5b1aadebebdd389914a1d8d63c5e 100644 (file)
@@ -3,7 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,9 +17,9 @@
  */
 
 MEMORY {
-       rom (rx) : ORIGIN = 0x08000000, LENGTH = 32K
-       ram (!w) : ORIGIN = 0x20000000, LENGTH = 5632
-       stack (!w) : ORIGIN = 0x20001600, LENGTH = 512
+       rom (rx) :   ORIGIN = 0x08001000, LENGTH = 28K
+       ram (!w) :   ORIGIN = 0x20000000, LENGTH = 6k - 128
+       stack (!w) : ORIGIN = 0x20000000 + 6k - 128, LENGTH = 128
 }
 
 INCLUDE registers.ld
@@ -30,12 +31,15 @@ SECTIONS {
         * Rom contents
         */
 
-       .text ORIGIN(rom) : {
-               __text_start__ = .;
+       .interrupt ORIGIN(ram) : AT (ORIGIN(rom)) {
+               __interrupt_start__ = .;
+               __interrupt_rom__ = ORIGIN(rom);
                *(.interrupt)   /* Interrupt vectors */
+               __interrupt_end__ = .;
+       } > ram
 
-               . = ORIGIN(rom) + 0x100;
-
+       .text ORIGIN(rom) + 0x100 : {
+               __text_start__ = .;
 
                /* Ick. What I want is to specify the
                 * addresses of some global constants so
@@ -49,14 +53,18 @@ SECTIONS {
                 */
                ao_romconfig.o(.romconfig*)
                ao_product.o(.romconfig*)
-               *(.text*)       /* Executable code */
-               *(.rodata*)     /* Constants */
 
+               *(.text*)       /* Executable code */
        } > rom
 
        .ARM.exidx : {
                *(.ARM.exidx* .gnu.linkonce.armexidx.*)
        } > rom
+
+       .rodata : {
+               *(.rodata*)     /* Constants */
+       } > rom
+
        __text_end__ = .;
 
        /* Boot data which must live at the start of ram so that
@@ -73,10 +81,10 @@ SECTIONS {
        /* Data -- relocated to RAM, but written to ROM
         */
        .data : {
-               __data_start__ = .;
+               _start__ = .;
                *(.data)        /* initialized data */
                . = ALIGN(4);
-               __data_end__ = .;
+               _end__ = .;
        } >ram AT>rom
 
        .bss : {