aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2020-08-09 12:27:12 +0000
committerGravatar GitHub <noreply@github.com> 2020-08-09 12:27:12 +0000
commit972f60f50e48c07fda40d2b853558c7db9b5a4ff (patch)
tree2e27f193ea39c36741e86638729107304f5444ef
parenta6b011af7fc60fcd543a9c501fe9a5764ec5e990 (diff)
parentcdd92e008f5c0778896ed79c8b476726611f9b65 (diff)
downloadcortex-m-972f60f50e48c07fda40d2b853558c7db9b5a4ff.tar.gz
cortex-m-972f60f50e48c07fda40d2b853558c7db9b5a4ff.tar.zst
cortex-m-972f60f50e48c07fda40d2b853558c7db9b5a4ff.zip
Merge #286
286: Fix possible overflow of .data region in FLASH r=jonas-schievink a=Guilucand Hi, i found a bug on the size checking of the FLASH region, that in some cases allows it to be larger than it's defined size. This happens because the .data section is placed on a FLASH address (at the end of __erodata) but it's not checked against the FLASH region size. Changing the section as shown solves the issue. Co-authored-by: Guilucand <guilucand@gmail.com>
-rw-r--r--cortex-m-rt/link.x.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/cortex-m-rt/link.x.in b/cortex-m-rt/link.x.in
index a502a03..01eb521 100644
--- a/cortex-m-rt/link.x.in
+++ b/cortex-m-rt/link.x.in
@@ -106,14 +106,14 @@ SECTIONS
/* ## Sections in RAM */
/* ### .data */
- .data : AT(__erodata) ALIGN(4)
+ .data : ALIGN(4)
{
. = ALIGN(4);
__sdata = .;
*(.data .data.*);
. = ALIGN(4); /* 4-byte align the end (VMA) of this section */
__edata = .;
- } > RAM
+ } > RAM AT>FLASH
/* LMA of .data */
__sidata = LOADADDR(.data);