Skip to content

Commit 972f60f

Browse files
bors[bot]Guilucand
andauthored
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 <[email protected]>
2 parents a6b011a + cdd92e0 commit 972f60f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cortex-m-rt/link.x.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ SECTIONS
106106

107107
/* ## Sections in RAM */
108108
/* ### .data */
109-
.data : AT(__erodata) ALIGN(4)
109+
.data : ALIGN(4)
110110
{
111111
. = ALIGN(4);
112112
__sdata = .;
113113
*(.data .data.*);
114114
. = ALIGN(4); /* 4-byte align the end (VMA) of this section */
115115
__edata = .;
116-
} > RAM
116+
} > RAM AT>FLASH
117117

118118
/* LMA of .data */
119119
__sidata = LOADADDR(.data);

0 commit comments

Comments
 (0)