aboutsummaryrefslogtreecommitdiff
path: root/lib/lpc13xx/libopencm3_lpc13xx.ld
diff options
context:
space:
mode:
authorNicolas Schodet2013-03-19 18:22:15 +0100
committerNicolas Schodet2013-03-19 18:22:15 +0100
commit00e50ff0cda40ee1736887e83465e7e5c77aaa3f (patch)
tree59f1d525f946e2f2a18a6109be81b007686f7f22 /lib/lpc13xx/libopencm3_lpc13xx.ld
parent4e4496f70d00fe24b2c5d594d6500f537eeb6478 (diff)
Add support for static constructors and destructorsinit-fini
Conflicts: lib/efm32/efm32g/libopencm3_efm32g.ld lib/efm32/efm32gg/libopencm3_efm32gg.ld lib/efm32/efm32lg/libopencm3_efm32lg.ld lib/efm32/efm32tg/libopencm3_efm32tg.ld lib/lpc17xx/vector.c lib/stm32/l1/libopencm3_stm32l1.ld
Diffstat (limited to 'lib/lpc13xx/libopencm3_lpc13xx.ld')
-rw-r--r--lib/lpc13xx/libopencm3_lpc13xx.ld23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/lpc13xx/libopencm3_lpc13xx.ld b/lib/lpc13xx/libopencm3_lpc13xx.ld
index 4e0f1df..bd0005c 100644
--- a/lib/lpc13xx/libopencm3_lpc13xx.ld
+++ b/lib/lpc13xx/libopencm3_lpc13xx.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