Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Workaround lld bug and ensure sections and symbols are aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
mattico committed Aug 20, 2020
1 parent 1fd84a8 commit 2c5077a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions link.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 2c5077a

Please sign in to comment.