altos/stmf0: Fix linker scripts to make ao_boot work
authorKeith Packard <keithp@keithp.com>
Tue, 27 Jan 2015 06:10:47 +0000 (22:10 -0800)
committerKeith Packard <keithp@keithp.com>
Tue, 27 Jan 2015 06:10:47 +0000 (22:10 -0800)
The flash loader ended up assuming ao_boot was at the start of ram,
while the application stuck it after the interrupt table (where it
needs to go).

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stmf0/altos-loader.ld
src/stmf0/altos.ld

index 2feb515df19382a6902b480ec02a369ea43e4327..86cf18384bb2105e114babc82d81424e4e2cb1d2 100644 (file)
@@ -29,14 +29,15 @@ SECTIONS {
         * Rom contents
         */
 
-       .text : {
+       .interrupt : {
                __text_start__ = .;
                *(.interrupt)   /* Interrupt vectors */
+       } > rom
 
-               . = ORIGIN(rom) + 0x100;
-
+       .text ORIGIN(rom) + 0x100 : {
                ao_romconfig.o(.romconfig*)
                ao_product.o(.romconfig*)
+
                *(.text*)       /* Executable code */
                *(.ARM.exidx* .gnu.linkonce.armexidx.*)
                *(.rodata*)     /* Constants */
@@ -47,7 +48,7 @@ SECTIONS {
         * the application and bootloader share the same addresses.
         * This must be all uninitialized data
         */
-       .boot (NOLOAD) : {
+       .boot ORIGIN(ram) + SIZEOF(.interrupt) (NOLOAD) : {
                __boot_start__ = .;
                *(.boot)
                __boot_end__ = .;
index 742d8419e9a01c818bceb6dd967d9aa297f808fe..9dbc83d0b6967116faa6ffe1ce4c57cd305e7a5f 100644 (file)
@@ -54,13 +54,10 @@ SECTIONS {
                ao_product.o(.romconfig*)
 
                *(.text*)       /* Executable code */
+               *(.ARM.exidx* .gnu.linkonce.armexidx.*)
                *(.rodata*)     /* Constants */
 
        } > rom
-
-       .ARM.exidx : {
-               *(.ARM.exidx* .gnu.linkonce.armexidx.*)
-       } > rom
        __text_end__ = .;
 
        /* Boot data which must live at the start of ram so that