summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyke van Laethem <aykevanlaethem@gmail.com>2018-02-11 01:09:12 +0100
committerDamien George <damien.p.george@gmail.com>2018-07-18 17:12:25 +1000
commitf907139fab2bfeb9dcf42430dc61a363c2e27a97 (patch)
tree2f4008fdf4309f570d930d531bbcb8fac2c81eee
parent4c011e66b4063c27c15249a85427a14e143520b0 (diff)
nrf/boards/common.ld: Avoid overflowing the .text region.
Similar commit to this one: https://github.com/tralamazza/micropython/commit/6e56e6269f467e59316b5e4cb04ea37ab6a0dfe3 When .text + .data oveflow available flash, the linker may not show an error. This change makes sure .data is included in the size calculation.
-rw-r--r--ports/nrf/boards/common.ld6
1 files changed, 3 insertions, 3 deletions
diff --git a/ports/nrf/boards/common.ld b/ports/nrf/boards/common.ld
index 6dec17480..c8f3227af 100644
--- a/ports/nrf/boards/common.ld
+++ b/ports/nrf/boards/common.ld
@@ -32,13 +32,13 @@ SECTIONS
*/
/* used by the startup to initialize data */
- _sidata = .;
+ _sidata = LOADADDR(.data);
/* This is the initialized data section
The program executes knowing that the data is in the RAM
but the loader puts the initial values in the FLASH (inidata).
It is one task of the startup to copy the initial values from FLASH to RAM. */
- .data : AT (_sidata)
+ .data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
@@ -48,7 +48,7 @@ SECTIONS
. = ALIGN(4);
_edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
- } >RAM
+ } >RAM AT>FLASH_TEXT
/* Uninitialized data section */
.bss :