Skip to content

Commit 49a68f1

Browse files
committed
Use same method for __edata and __erodata
1 parent fe77514 commit 49a68f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cortex-m-rt/link.x.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ SECTIONS
102102
This is required by LLD to ensure the LMA of the following .data
103103
section will have the correct alignment. */
104104
. = ALIGN(4);
105-
__erodata = .;
106105
} > FLASH
106+
. = ALIGN(4); /* Ensure __erodata is aligned if something unaligned is inserted after .rodata */
107+
__erodata = .;
107108

108109
/* ## Sections in RAM */
109110
/* ### .data */
@@ -113,8 +114,9 @@ SECTIONS
113114
__sdata = .;
114115
*(.data .data.*);
115116
. = ALIGN(4); /* 4-byte align the end (VMA) of this section */
116-
__edata = .;
117117
} > RAM AT>FLASH
118+
. = ALIGN(4); /* Ensure __edata is aligned if something unaligned is inserted after .data */
119+
__edata = .;
118120

119121
/* LMA of .data */
120122
__sidata = LOADADDR(.data);

0 commit comments

Comments
 (0)