altos: Mark .boot section as (NOLOAD)
authorKeith Packard <keithp@keithp.com>
Sat, 23 Mar 2013 09:17:04 +0000 (02:17 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 8 May 2013 03:16:52 +0000 (20:16 -0700)
For some reason, the silly linker marks things in section .boot as
data rather than bss, so they'd end up initialized by default. Force
them to be NOLOAD so they preserve values across reboot so that boot
chaining works properly.

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

index 5110da845dd4f21afc323db3ac8ca5b2d55dbb56..5bdfcd05cfbacb891a485f69451b6b5b14b41e50 100644 (file)
@@ -45,14 +45,14 @@ SECTIONS {
 
        .ARM.exidx : {
                *(.ARM.exidx* .gnu.linkonce.armexidx.*)
-               __text_end__ = .;
        } > rom
+       __text_end__ = .;
 
        /* Boot data which must live at the start of ram so that
         * the application and bootloader share the same addresses.
         * This must be all uninitialized data
         */
-       .boot : {
+       .boot (NOLOAD) : {
                __boot_start__ = .;
                *(.boot)
                . = ALIGN(4);
@@ -64,6 +64,7 @@ SECTIONS {
        .data : {
                __data_start__ = .;
                *(.data)        /* initialized data */
+               . = ALIGN(4);
                __data_end__ = .;
        } >ram AT>rom
 
@@ -71,6 +72,7 @@ SECTIONS {
                __bss_start__ = .;
                *(.bss)
                *(COMMON)
+               . = ALIGN(4);
                __bss_end__ = .;
        } >ram
 
index 2e36dce9cab630792fa6dcf01ed9eb721c8016b5..7184b96cfb24b8502510ab3d15b49d511ac1bc11 100644 (file)
@@ -52,7 +52,7 @@ SECTIONS {
         * the application and bootloader share the same addresses.
         * This must be all uninitialized data
         */
-       .boot : {
+       .boot (NOLOAD) : {
                __boot_start__ = .;
                *(.boot)
                . = ALIGN(4);