From: Wolfgang Denk Date: Mon, 29 Nov 2010 20:40:45 +0100 Subject: [U-Boot] [PATCH] OMAP-common/timer: Fix bss usage In-Reply-To: <1291046912-15167-1-git-send-email-weber@corscience.de> References: <20101129124847.E1D8111D94F2@gemini.denx.de> <1291046912-15167-1-git-send-email-weber@corscience.de> Message-ID: <20101129194045.B183B11D94F2@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Thomas Weber, In message <1291046912-15167-1-git-send-email-weber@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@gadget.cscaper.com>