Skip to content

Commit 09e2dcb

Browse files
author
Mikaël BRIDAY
committed
[STM32L432] link pb (RWX segment, _exit function)
1 parent ff28702 commit 09e2dcb

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

‎goil/templates/build/cmakelists_txt.goilTemplate‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#to compile the project:
2-
# mkdir _build
3-
# cd _build
2+
# mkdir build
3+
# cd build
44
# cmake -D CMAKE_TOOLCHAIN_FILE=../% !PROJECT %/compiler.cmake ..
55
# make
66
# make flash
7-
cmake_minimum_required(VERSION 3.5)
7+
cmake_minimum_required(VERSION 3.10)
88

99
# with this option, cmake will not try to compile a
1010
# simple test program (that may fail for an embedded target)

‎goil/templates/linker/gnu_ld/cortex-m/armv7em/stm32l432/script.goilTemplate‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ SECTIONS {
185185
}
186186

187187
SECTIONS {
188-
.preinit_array :
188+
.preinit_array (READONLY) :
189189
{
190190
PROVIDE_HIDDEN (__preinit_array_start = .);
191191
KEEP (*(.preinit_array*))
@@ -194,7 +194,7 @@ SECTIONS {
194194
}
195195

196196
SECTIONS {
197-
.init_array :
197+
.init_array (READONLY) :
198198
{
199199
PROVIDE_HIDDEN (__init_array_start = .);
200200
KEEP (*(SORT(.init_array.*)))
@@ -204,7 +204,7 @@ SECTIONS {
204204
}
205205

206206
SECTIONS {
207-
.fini_array :
207+
.fini_array (READONLY) :
208208
{
209209
PROVIDE_HIDDEN (__fini_array_start = .);
210210
KEEP (*(.fini_array*))

‎machines/cortex-m/armv7em/stm32l432/startup_stm32l432.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extern int main(void);
3838

3939
// The implementation for the exit routine, where for embedded
4040
// applications, a system reset is performed.
41-
extern void _exit(int);
41+
// extern void _exit(int);
4242

4343
//*****************************************************************************
4444

@@ -147,7 +147,8 @@ void __attribute__ ((section(".after_vectors"))) tpl_continue_reset_handler(void
147147
// On test platforms, like semihosting, this can be used to inform
148148
// the host on the test result.
149149
// On embedded platforms, usually reset the processor.
150-
_exit(r);
150+
// _exit(r);
151+
while(1);
151152

152153
}
153154

0 commit comments

Comments
 (0)