summaryrefslogtreecommitdiff
path: root/linker_script.ld
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-12-12 21:41:55 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-12-12 21:41:55 -0700
commit8bb2d168044213ce9bd31a19efb6bab90f5c9722 (patch)
tree737ba66cd1405fb4aa9ac5df9415b2ea5d88ab20 /linker_script.ld
parentef3a1919ce5c87179e8f1d7a3b1b835151fdf50f (diff)
downloadstm32l4-rust-8bb2d168044213ce9bd31a19efb6bab90f5c9722.tar.gz
stm32l4-rust-8bb2d168044213ce9bd31a19efb6bab90f5c9722.tar.bz2
stm32l4-rust-8bb2d168044213ce9bd31a19efb6bab90f5c9722.zip
Create an init system.
Diffstat (limited to 'linker_script.ld')
-rw-r--r--linker_script.ld10
1 files changed, 9 insertions, 1 deletions
diff --git a/linker_script.ld b/linker_script.ld
index 37b90a4..8ae98d0 100644
--- a/linker_script.ld
+++ b/linker_script.ld
@@ -18,8 +18,16 @@ SECTIONS
. = ORIGIN(flash) + 0x0dc;
} >flash
+ /** Init routines */
+ _sinits = ADDR(.vectors) + SIZEOF(.vectors);
+ .inits _sinits : ALIGN(0x04) {
+ KEEP(*(SORT_BY_NAME(.inits .inits.*)));
+ _einits = .;
+ . = ALIGN(0x04);
+ } > flash
+
/** Text data is stored after the vector table. */
- PROVIDE(_stext = ADDR(.vectors) + SIZEOF(.vectors));
+ PROVIDE(_stext = ADDR(.inits) + SIZEOF(.inits));
.text _stext : ALIGN(0x04) {
*(.text .text.*);
. = ALIGN(0x04);