diff --git a/bootloader_shell.ld b/bootloader_shell.ld index fcb5ffc..e012fcb 100644 --- a/bootloader_shell.ld +++ b/bootloader_shell.ld @@ -142,13 +142,15 @@ SECTIONS __binary_info_end = .; . = ALIGN(4); - /* End of .text-like segments */ - __etext = .; - - .ram_vector_table (COPY): { + .ram_vector_table (NOLOAD): { *(.ram_vector_table) } > RAM + .uninitialized_data (NOLOAD): { + . = ALIGN(4); + *(.uninitialized_data*) + } > RAM + .data : { __data_start__ = .; *(vtable) @@ -198,11 +200,8 @@ SECTIONS /* All data end */ __data_end__ = .; } > RAM AT> FLASH - - .uninitialized_data (COPY): { - . = ALIGN(4); - *(.uninitialized_data*) - } > RAM + /* __etext is (for backwards compatibility) the name of the .data init source pointer (...) */ + __etext = LOADADDR(.data); /* Start and end symbols must be word-aligned */ .scratch_x : { @@ -230,11 +229,11 @@ SECTIONS __bss_end__ = .; } > RAM - .heap (COPY): + .heap (NOLOAD): { __end__ = .; end = __end__; - *(.heap*) + KEEP(*(.heap*)) __HeapLimit = .; } > RAM @@ -247,17 +246,17 @@ SECTIONS /* by default we put core 0 stack at the end of scratch Y, so that if core 1 * stack is not used then all of SCRATCH_X is free. */ - .stack1_dummy (COPY): + .stack1_dummy (NOLOAD): { *(.stack1*) } > SCRATCH_X - .stack_dummy (COPY): + .stack_dummy (NOLOAD): { - *(.stack*) + KEEP(*(.stack*)) } > SCRATCH_Y .flash_end : { - __flash_binary_end = .; + PROVIDE(__flash_binary_end = .); } > FLASH /* stack limit is poorly named, but historically is maximum heap ptr */ diff --git a/standalone.ld b/standalone.ld index 040f6ad..cd3d924 100644 --- a/standalone.ld +++ b/standalone.ld @@ -99,13 +99,15 @@ SECTIONS __binary_info_end = .; . = ALIGN(4); - /* End of .text-like segments */ - __etext = .; - - .ram_vector_table (COPY): { + .ram_vector_table (NOLOAD): { *(.ram_vector_table) } > RAM + .uninitialized_data (NOLOAD): { + . = ALIGN(4); + *(.uninitialized_data*) + } > RAM + .data : { __data_start__ = .; *(vtable) @@ -155,11 +157,8 @@ SECTIONS /* All data end */ __data_end__ = .; } > RAM AT> FLASH - - .uninitialized_data (COPY): { - . = ALIGN(4); - *(.uninitialized_data*) - } > RAM + /* __etext is (for backwards compatibility) the name of the .data init source pointer (...) */ + __etext = LOADADDR(.data); /* Start and end symbols must be word-aligned */ .scratch_x : { @@ -187,11 +186,11 @@ SECTIONS __bss_end__ = .; } > RAM - .heap (COPY): + .heap (NOLOAD): { __end__ = .; end = __end__; - *(.heap*) + KEEP(*(.heap*)) __HeapLimit = .; } > RAM @@ -204,17 +203,17 @@ SECTIONS /* by default we put core 0 stack at the end of scratch Y, so that if core 1 * stack is not used then all of SCRATCH_X is free. */ - .stack1_dummy (COPY): + .stack1_dummy (NOLOAD): { *(.stack1*) } > SCRATCH_X - .stack_dummy (COPY): + .stack_dummy (NOLOAD): { - *(.stack*) + KEEP(*(.stack*)) } > SCRATCH_Y .flash_end : { - __flash_binary_end = .; + PROVIDE(__flash_binary_end = .); } > FLASH /* stack limit is poorly named, but historically is maximum heap ptr */