From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Sat, 9 Jul 2016 10:50:26 -0400 Subject: [U-Boot] [U-Boot,v2] SPL: tiny-printf: avoid any BSS usage In-Reply-To: <552c49ad-0be1-1bc7-2238-b42af9283902@denx.de> References: <1467987515-2794-1-git-send-email-andre.przywara@arm.com> <20160708165041.GA6425@bill-the-cat> <20160709002843.GP25382@bill-the-cat> <552c49ad-0be1-1bc7-2238-b42af9283902@denx.de> Message-ID: <20160709145026.GW25382@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sat, Jul 09, 2016 at 10:22:37AM +0200, Marek Vasut wrote: > On 07/09/2016 02:28 AM, Tom Rini wrote: > >On Fri, Jul 08, 2016 at 11:48:12PM +0200, Marek Vasut wrote: > >>On 07/08/2016 06:50 PM, Tom Rini wrote: > >>>On Fri, Jul 08, 2016 at 03:18:35PM +0100, Andre Przywara wrote: > >>> > >>>>As printf calls may be executed quite early, we should avoid using any > >>>>BSS stored variables, since some boards put BSS in DRAM, which may not > >>>>have been initialised yet. > >>>>Explicitly mark those "static global" variables as belonging to the > >>>>.data section, to keep tiny-printf clear of any BSS usage. > >>>> > >>>>Signed-off-by: Andre Przywara > >>> > >>>Applied to u-boot/master, thanks! > >>> > >>Mind you, __section(".data") would be enough, no need to spell the > >>whole attribute. > > > >True, but that's a helper that's not really utilized today. > > > That's something that should likely be changed, as it allows to > seamlessly deal with compiler quirks (if some were to ever pop up in > this area). Patches welcome for the next release ;) -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: