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

Commit

Permalink
Fix INSERT AFTER for .text and .bss
Browse files Browse the repository at this point in the history
Additionally, include COMMON symbols (uninitialized statics from C) in bss.
  • Loading branch information
mattico committed Aug 20, 2020
1 parent 2c56bfd commit 1fd84a8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions link.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1fd84a8

Please sign in to comment.