From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Holler Date: Sun, 31 Oct 2010 11:59:40 +0100 Subject: [U-Boot] arm: wrong Relocation and not cleared BSS In-Reply-To: <20101030143624.E6C701522C0@gemini.denx.de> References: <4CCC18E7.8080708@ahsoftware.de> <4CCC1F6C.7040603@free.fr> <20101030143624.E6C701522C0@gemini.denx.de> Message-ID: <4CCD4C1C.2050603@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 16:36, schrieb Wolfgang Denk: > Dear Albert ARIBAUD, > > In message<4CCC1F6C.7040603@free.fr> you wrote: >> >> 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". > > BSS _is_ zeroed data. This is a very basic assumption of the C > runtime. > >> BSS is not *required* to be zero. It is zeroed out as a courtesy, but> > > No, you are wrong here. > > Zeroing of the BSS is a mandatory requirement. Beeing curious, I've looked up that part in the C99 standard. Just to refresh our memories: ------------------------------------- 6.7.8 10 If an object that has automatic storage duration is not initialized explicitly, its value is indeterminate. If an object that has static storage duration is not initialized explicitly, then: ? if it has pointer type, it is initialized to a null pointer; ? if it has arithmetic type, it is initialized to (positive or unsigned) zero; ? if it is an aggregate, every member is initialized (recursively) according to these rules; ? if it is a union, the ?rst named member is initialized (recursively) according to these rules. ------------------------------------- Regards, Alexander