.rodata* needs to be in flash; otherwise strings get left in ram.
Failing to align sections makes the initialized data get dumped into
the wrong place in memory.
Signed-off-by: Keith Packard <keithp@keithp.com>
- rom : ORIGIN = 0x08000000, LENGTH = 8K
+ rom : ORIGIN = 0x08000000, LENGTH = 4K
ram : ORIGIN = 0x20000000, LENGTH = 16K
}
ram : ORIGIN = 0x20000000, LENGTH = 16K
}
.text : {
__text_start__ = .;
*(.interrupt) /* Interrupt vectors */
.text : {
__text_start__ = .;
*(.interrupt) /* Interrupt vectors */
*(.text) /* Executable code */
*(.text) /* Executable code */
- *(.rodata) /* Constants */
-
+ . = ALIGN(4);
+ *(.rodata*) /* Constants */
+ . = ALIGN(4);
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > rom
__text_end__ = .;
} > rom
__text_end__ = .;
/* Functions placed in RAM (required for flashing) */
.textram : {
/* Functions placed in RAM (required for flashing) */
.textram : {
- __text_ram_start__ = .;
+ __text_ram_start__ = .;
/* Data -- relocated to RAM, but written to ROM
*/
.data : {
*(.data) /* initialized data */
/* Data -- relocated to RAM, but written to ROM
*/
.data : {
*(.data) /* initialized data */
.bss : {
__bss_start__ = .;
.bss : {
__bss_start__ = .;