changeset 84:32bcc299ef55

gcc/ld-script.src: additional polish
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 20 Jul 2018 19:36:25 +0000
parents 92fde62400ef
children 4ef6808ea50e
files gcc/ld-script.src
diffstat 1 files changed, 15 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/gcc/ld-script.src	Fri Jul 20 18:21:46 2018 +0000
+++ b/gcc/ld-script.src	Fri Jul 20 19:36:25 2018 +0000
@@ -39,8 +39,11 @@
 	__romswitch_size = SIZEOF(bootrom.switch);
 ')dnl
 
+define(`INTTEXT_BASE_ADDR',
+    ifelse(Buildmem,FLASH,FLASHIMAGE_BASE_ADDR,`/* no fixed address */'))dnl
+
 	/* boot entry code, going into flash or XRAM emulating flash */
-	.inttext : {
+	.inttext INTTEXT_BASE_ADDR : {
 		*(.inttext)
 	} > Buildmem
 
@@ -118,22 +121,24 @@
 	__extbss_start = ADDR(ext.bss);
 	__extbss_size = SIZEOF(ext.bss);
 
-	.stack (NOLOAD) : {
-		/* Leave 20 32bit words for register pushes. */
-		. = ALIGN(8);
-		. += 20 * 4;
+	int.stack (NOLOAD) : ALIGN(8) {
+		/* Beginning of stacks and heap area - 2.75 kbytes (int.s) */
+		_Stack_segment_start = .;
+		. += 0xB00;
+		_Stack_segment_end = .;
 
+		_iram_end = .;
+	} > IRAM
+
+	ext.stack (NOLOAD) : ALIGN(8) {
 		/* Stack for abort and/or undefined modes. */
+		. += 512;
 		_Except_Stack_SP = .;
 
 		/* Leave 38 32bit words for state saving on exceptions. */
 		xdump_buffer = .;
 		. += 38 * 4;
-		. = ALIGN(8);
 
-		/* Beginning of stacks and heap area - 2.75 kbytes (int.s) */
-		_Stack_segment_start = .;
-		. += 0xB00;
-		_Stack_segment_end = .;
+		_xram_end = .;
 	} > XRAM
 }