diff options
| author | Keith Packard <keithp@keithp.com> | 2013-04-27 00:24:08 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2013-05-07 21:30:26 -0700 | 
| commit | a2e0676f476b0e2bdd5102315ebd5904b57f384a (patch) | |
| tree | f3d21754c8bee255ad6bb328501ea7a8a3b49093 | |
| parent | 2e092b383d55bcf9e2a230ccfe85052adb18b254 (diff) | |
altos: Get rodata into flash, make sure sections are aligned
.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>
| -rw-r--r-- | src/stm/altos-loader.ld | 20 | 
1 files changed, 11 insertions, 9 deletions
diff --git a/src/stm/altos-loader.ld b/src/stm/altos-loader.ld index 78649be2..5e10e5ba 100644 --- a/src/stm/altos-loader.ld +++ b/src/stm/altos-loader.ld @@ -16,7 +16,7 @@   */  MEMORY { -	rom : ORIGIN = 0x08000000, LENGTH = 8K +	rom : ORIGIN = 0x08000000, LENGTH = 4K  	ram : ORIGIN = 0x20000000, LENGTH = 16K  } @@ -32,14 +32,17 @@ SECTIONS {  	.text : {  		__text_start__ = .;  		*(.interrupt)	/* Interrupt vectors */ -		*(.romconfig) +		*(.romconfig*)  		*(.text)	/* Executable code */ -		*(.rodata)	/* Constants */ - +		. = ALIGN(4); +		*(.rodata*)	/* Constants */ +		. = ALIGN(4);  	} > rom  	.ARM.exidx : { +		. = ALIGN(4);  		*(.ARM.exidx* .gnu.linkonce.armexidx.*) +		. = ALIGN(4);  	} > rom  	__text_end__ = .; @@ -56,20 +59,19 @@ SECTIONS {  	/* Functions placed in RAM (required for flashing) */  	.textram : { -		__text_ram_start__ = .;  		__data_start__ = .; +		__text_ram_start__ = .;  		*(.text.ram) -		. = ALIGN(4); +		__text_ram_end = .;  	} >ram AT>rom -	__text_ram_end = .;  	/* Data -- relocated to RAM, but written to ROM  	 */  	.data : {  		*(.data)	/* initialized data */ -		. = ALIGN (4); +		__data_end__ = .;  	} >ram AT>rom -	__data_end__ = .; +  	.bss : {  		__bss_start__ = .;  | 
