From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Holler Date: Sat, 30 Oct 2010 15:45:50 +0200 Subject: [U-Boot] arm: wrong Relocation and not cleared BSS In-Reply-To: <4CCC1F6C.7040603@free.fr> References: <4CCC18E7.8080708@ahsoftware.de> <4CCC1F6C.7040603@free.fr> Message-ID: <4CCC218E.706@ahsoftware.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, Am 30.10.2010 15:36, schrieb Albert ARIBAUD: >> The code is moved upwards, but that code still uses the data at d. >> This results another problem: Some parts in the code are assuming that d >> is cleared (set to zero in start.S). But what start.S does it to clear >> the new location (z in the picture below). > > Wait a minute. No parts of the code assume BSS is *cleared*, or at least > no pat of the should *should ever* assume that. BSS is not "zeroed > data", it is "uninitialized data". Thats true for normal C, but I assume that is not true for u-boot. This reminds me on some problems I've had long long time ago, with switching from debug to optimized code using vc++. I don't know if it is still true (>10a ago), but in those days, vc++ had preset all not initialized data with zero when optimization was turned off. If the code in u-boot would not assume that bss is zero, I don't understand why clear_bss in start.S exists. Regards, Alexander