altos/stm: arm-none-eabi-binutils now puts 'main' into .text.startup
authorKeith Packard <keithp@keithp.com>
Mon, 9 Dec 2013 03:05:01 +0000 (19:05 -0800)
committerKeith Packard <keithp@keithp.com>
Mon, 9 Dec 2013 03:37:53 +0000 (19:37 -0800)
Change name of .text.ram to .ramtext, then load .text* into flash and
.ramtext into ram. This ensures that 'main' and anything else in a
random .text.* segment will get loaded into flash as appropriate.

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

index 2be964f2a7bad6bc5598ac9a249085273ace66c5..0753f5f7288d45ae9805a7a625d23688b8d46a02 100644 (file)
@@ -37,11 +37,11 @@ SECTIONS {
 
                ao_romconfig.o(.romconfig*)
                ao_product.o(.romconfig*)
-               *(.text       /* Executable code */
+               *(.text*)       /* Executable code */
                *(.ARM.exidx* .gnu.linkonce.armexidx.*)
                *(.rodata*)     /* Constants */
-               __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.
@@ -66,7 +66,7 @@ SECTIONS {
        .textram BLOCK(8): {
                __data_start__ = .;
                __text_ram_start__ = .;
-               *(.text.ram)
+               *(.ramtext)
                __text_ram_end = .;
        } >ram AT>rom
 
index d7a855827723cbee2ce3bc226e99860bca9ac74d..38b1c2d8b585c154b8d6a24cfca28cbeaddb0e36 100644 (file)
@@ -69,7 +69,7 @@ ao_flash_wait_bsy(void)
                ;
 }
 
-static void __attribute__ ((section(".text.ram"),noinline))
+static void __attribute__ ((section(".ramtext"),noinline))
 _ao_flash_erase_page(uint32_t *page)
 {
        stm_flash.pecr |= (1 << STM_FLASH_PECR_ERASE) | (1 << STM_FLASH_PECR_PROG);
@@ -91,7 +91,7 @@ ao_flash_erase_page(uint32_t *page)
        ao_flash_lock();
 }
 
-static void __attribute__ ((section(".text.ram"), noinline))
+static void __attribute__ ((section(".ramtext"), noinline))
 _ao_flash_half_page(uint32_t *dst, uint32_t *src)
 {
        uint8_t         i;