[U-Boot] [U-Boot,v2] SPL: tiny-printf: avoid any BSS usage

Marek Vasut marex at denx.de
Sat Jul 9 10:22:37 CEST 2016


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 <andre.przywara at arm.com>
>>>
>>> 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).

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list