[U-Boot] [PATCH] OMAP-common/timer: Fix bss usage

Wolfgang Denk wd at denx.de
Mon Nov 29 20:40:45 CET 2010


Dear Thomas Weber,

In message <1291046912-15167-1-git-send-email-weber at corscience.de> you wrote:
> This patch fixes the bss usage in ARMv7/omap-common/timer.c
> 
> The .bss section cannot be used before the relocation, because this
> section is overlayed with .rel.dyn section.

No, this is not correct. It cannot be used because it simply has not
been created at all.  The overlay thing is just an optimization to
shring the image size, but otherwise it has no influence here.  The
thing is that before relocation we simply do not have a full standard
conforming C runtime environment: we havce only a very small stack, we
have a read-only data segment and no bss at all.

> -static ulong timestamp;
> -static ulong lastinc;
> +static ulong timestamp = 0;
> +static ulong lastinc = 0;

This does not change anything. The compiler still generates exactly
the same code.

> -	reset_timer_masked();	/* init the timestamp and lastinc value */
> -

And this is most probably wrong.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I usually tell my classes "if you are using @ and [] together in this
class, you will almost certainly NOT get what you want. That's  going
down  the wrong tunnel. There's no cheese at the end of that tunnel."
         -- Randal L. Schwartz in <8czptuomey.fsf at gadget.cscaper.com>


More information about the U-Boot mailing list