diff options
author | 2020-08-19 15:57:49 -0500 | |
---|---|---|
committer | 2020-08-20 11:00:21 -0500 | |
commit | c4aa52cb222e5bdbc93c147c5234416454c5e79e (patch) | |
tree | 89d642528c1a11dd2258d80365218778deb133e1 | |
parent | 972f60f50e48c07fda40d2b853558c7db9b5a4ff (diff) | |
download | cortex-m-c4aa52cb222e5bdbc93c147c5234416454c5e79e.tar.gz cortex-m-c4aa52cb222e5bdbc93c147c5234416454c5e79e.tar.zst cortex-m-c4aa52cb222e5bdbc93c147c5234416454c5e79e.zip |
Fix INSERT AFTER for .text and .bss
Additionally, include COMMON symbols (uninitialized statics from C) in bss.
-rw-r--r-- | cortex-m-rt/link.x.in | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cortex-m-rt/link.x.in b/cortex-m-rt/link.x.in index 01eb521..f69884c 100644 --- a/cortex-m-rt/link.x.in +++ b/cortex-m-rt/link.x.in @@ -88,9 +88,9 @@ SECTIONS *(.text .text.*); *(.HardFaultTrampoline); *(.HardFault.*); - . = ALIGN(4); - __etext = .; } > FLASH + . = ALIGN(4); + __etext = .; /* Define outside of .text to allow using INSERT AFTER .text */ /* ### .rodata */ .rodata __etext : ALIGN(4) @@ -119,14 +119,15 @@ SECTIONS __sidata = LOADADDR(.data); /* ### .bss */ + . = ALIGN(4); + __sbss = .; /* Define outside of section to include INSERT BEFORE/AFTER symbols */ .bss (NOLOAD) : ALIGN(4) { - . = ALIGN(4); - __sbss = .; *(.bss .bss.*); - . = ALIGN(4); /* 4-byte align the end (VMA) of this section */ - __ebss = .; + *(COMMON); /* Uninitialized C statics */ } > RAM + . = ALIGN(4); /* 4-byte align the end (VMA) of this section */ + __ebss = .; /* ### .uninit */ .uninit (NOLOAD) : ALIGN(4) |