Re: [arm-gnu] zeroing out the .bss area
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] zeroing out the .bss area



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Paul Brook wrote:
> On Tuesday 03 November 2009, JJ wrote:
>> So as long as I don't expect unintialized global and statically
>> allocated variables to be 0, I'm fine?
>
> Maybe.
>
> However given the amount of effort required to clear .bss (a few
> lines of assembly), and the potential consequences of failing to do
> so (subtle, hard to trace failures on a production system), I
> strongly recommend that you implement this properly.  Current or
> future versions of the compiler and/or runtime libraries may assume
> that zero initialized variables work correctly. If your startup
> code fails to ensure a clear .bss then you're entirely on your own.
>
>
>
> Paul
Paul,

I don't recall what the specifics were but, in my case, re-implementing

void __cs3_start_c (void)

and

void _init()

shaved ~350 bytes off of my boot loader, which allowed me to fit
x-modem with a serial console.  My size constraint was set by the
minimum flash page size on my micro.  However, I am not using any of
the runtime libraries.

Best Regards,
Mark Deneen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
 
iD8DBQFK8Y3Jtf95hArmCUURAu/sAKCOqf/s2yA4TxBM+knDC0DAM9Z2owCeL9PM
RDtxyxuFhPdYffQWFGDML4c=
=Qnv8
-----END PGP SIGNATURE-----