diff options
author | 2020-08-20 12:02:48 -0500 | |
---|---|---|
committer | 2020-08-20 12:02:48 -0500 | |
commit | fe7751417163dc4e54b8c920afe9b1596cc735e8 (patch) | |
tree | 70f26b4908cf14041d213ea5036529647e1cd12e | |
parent | c4aa52cb222e5bdbc93c147c5234416454c5e79e (diff) | |
download | cortex-m-fe7751417163dc4e54b8c920afe9b1596cc735e8.tar.gz cortex-m-fe7751417163dc4e54b8c920afe9b1596cc735e8.tar.zst cortex-m-fe7751417163dc4e54b8c920afe9b1596cc735e8.zip |
Workaround lld bug and ensure sections and symbols are aligned
-rw-r--r-- | cortex-m-rt/link.x.in | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cortex-m-rt/link.x.in b/cortex-m-rt/link.x.in index f69884c..9a4c458 100644 --- a/cortex-m-rt/link.x.in +++ b/cortex-m-rt/link.x.in @@ -88,8 +88,9 @@ SECTIONS *(.text .text.*); *(.HardFaultTrampoline); *(.HardFault.*); + . = ALIGN(4); /* Pad .text to the alignment to workaround overlapping load section bug in old lld */ } > FLASH - . = ALIGN(4); + . = ALIGN(4); /* Ensure __etext is aligned if something unaligned is inserted after .text */ __etext = .; /* Define outside of .text to allow using INSERT AFTER .text */ /* ### .rodata */ @@ -125,8 +126,9 @@ SECTIONS { *(.bss .bss.*); *(COMMON); /* Uninitialized C statics */ + . = ALIGN(4); /* 4-byte align the end (VMA) of this section */ } > RAM - . = ALIGN(4); /* 4-byte align the end (VMA) of this section */ + . = ALIGN(4); /* Ensure __ebss is aligned if something unaligned is inserted after .bss */ __ebss = .; /* ### .uninit */ |