aboutsummaryrefslogtreecommitdiff
path: root/lib/stm32/f2/libopencm3_stm32f2.ld
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stm32/f2/libopencm3_stm32f2.ld')
-rw-r--r--lib/stm32/f2/libopencm3_stm32f2.ld23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/stm32/f2/libopencm3_stm32f2.ld b/lib/stm32/f2/libopencm3_stm32f2.ld
index 9d165f6..3fc2ccb 100644
--- a/lib/stm32/f2/libopencm3_stm32f2.ld
+++ b/lib/stm32/f2/libopencm3_stm32f2.ld
@@ -38,6 +38,29 @@ SECTIONS
. = ALIGN(4);
} >rom
+ /* C++ Static constructors/destructors, also used for __attribute__
+ * ((constructor)) and the likes */
+ .preinit_array : {
+ . = ALIGN(4);
+ __preinit_array_start = .;
+ KEEP (*(.preinit_array))
+ __preinit_array_end = .;
+ } >rom
+ .init_array : {
+ . = ALIGN(4);
+ __init_array_start = .;
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ __init_array_end = .;
+ } >rom
+ .fini_array : {
+ . = ALIGN(4);
+ __fini_array_start = .;
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ __fini_array_end = .;
+ } >rom
+
/*
* Another section used by C++ stuff, appears when using newlib with
* 64bit (long long) printf support