From cd16b20bcfce6e5bccc2c2a250763cb0eb848a20 Mon Sep 17 00:00:00 2001 From: Matt Ickstadt Date: Wed, 19 Aug 2020 15:57:49 -0500 Subject: [PATCH] Fix __ebss not being placed after all .bss symbols Additionally, include COMMON symbols (uninitialized statics from C) in bss. --- link.x.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/link.x.in b/link.x.in index 01eb521c..76da9547 100644 --- a/link.x.in +++ b/link.x.in @@ -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)