From 5d3975ab89e623af16573345ec0d6d665612fd1b Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Tue, 19 Mar 2013 17:53:07 +0100 Subject: Add support for static constructors and destructors --- lib/stm32/f1/libopencm3_stm32f1.ld | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'lib/stm32/f1/libopencm3_stm32f1.ld') diff --git a/lib/stm32/f1/libopencm3_stm32f1.ld b/lib/stm32/f1/libopencm3_stm32f1.ld index 9d165f6..3fc2ccb 100644 --- a/lib/stm32/f1/libopencm3_stm32f1.ld +++ b/lib/stm32/f1/libopencm3_stm32f1.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 -- cgit v1.2.3