Skip to content

Commit f69d894

Browse files
committed
fix pre-commit and fix READONLY linker keyword with clang
1 parent a75daaf commit f69d894

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

hw/bsp/stm32l4/boards/stm32l496nucleo/STM32L496XX_FLASH.ld

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
/* Entry Point */
5252
ENTRY(Reset_Handler)
5353

54-
/* Highest address of the user mode stack */
55-
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */
5654
/* Generate a link error if heap and stack don't fit into RAM */
5755
_Min_Heap_Size = 0x500; /* required amount of heap */
5856
_Min_Stack_Size = 0x1000; /* required amount of stack */
@@ -65,6 +63,9 @@ RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
6563
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
6664
}
6765

66+
/* Highest address of the user mode stack */
67+
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */
68+
6869
/* Define output sections */
6970
SECTIONS
7071
{
@@ -102,14 +103,14 @@ SECTIONS
102103
. = ALIGN(8);
103104
} >FLASH
104105

105-
.ARM.extab (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
106-
{
106+
.ARM.extab :
107+
{
107108
. = ALIGN(8);
108109
*(.ARM.extab* .gnu.linkonce.armextab.*)
109110
. = ALIGN(8);
110111
} >FLASH
111112

112-
.ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
113+
.ARM :
113114
{
114115
. = ALIGN(8);
115116
__exidx_start = .;
@@ -118,16 +119,16 @@ SECTIONS
118119
. = ALIGN(8);
119120
} >FLASH
120121

121-
.preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
122+
.preinit_array :
122123
{
123124
. = ALIGN(8);
124125
PROVIDE_HIDDEN (__preinit_array_start = .);
125126
KEEP (*(.preinit_array*))
126127
PROVIDE_HIDDEN (__preinit_array_end = .);
127128
. = ALIGN(8);
128129
} >FLASH
129-
130-
.init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
130+
131+
.init_array :
131132
{
132133
. = ALIGN(8);
133134
PROVIDE_HIDDEN (__init_array_start = .);
@@ -137,7 +138,7 @@ SECTIONS
137138
. = ALIGN(8);
138139
} >FLASH
139140

140-
.fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
141+
.fini_array :
141142

142143
{
143144
. = ALIGN(8);
@@ -152,7 +153,7 @@ SECTIONS
152153
_sidata = LOADADDR(.data);
153154

154155
/* Initialized data sections goes into RAM, load LMA copy after code */
155-
.data :
156+
.data :
156157
{
157158
. = ALIGN(8);
158159
_sdata = .; /* create a global symbol at data start */
@@ -165,12 +166,12 @@ SECTIONS
165166
_edata = .; /* define a global symbol at data end */
166167
} >RAM AT> FLASH
167168

168-
169+
169170
/* Uninitialized data section */
170171
. = ALIGN(4);
171172
.bss :
172173
{
173-
/* This is used by the startup in order to initialize the .bss secion */
174+
/* This is used by the startup in order to initialize the .bss section */
174175
_sbss = .; /* define a global symbol at bss start */
175176
__bss_start__ = _sbss;
176177
*(.bss)
@@ -193,7 +194,7 @@ SECTIONS
193194
. = ALIGN(8);
194195
} >RAM
195196

196-
197+
197198

198199
/* Remove information from the standard libraries */
199200
/DISCARD/ :
@@ -204,5 +205,3 @@ SECTIONS
204205
}
205206

206207
}
207-
208-

0 commit comments

Comments
 (0)