All of lore.kernel.org
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] arm: wrong Relocation and not cleared BSS
Date: Sat, 30 Oct 2010 15:57:00 +0200	[thread overview]
Message-ID: <4CCC242C.8070303@free.fr> (raw)
In-Reply-To: <4CCC218E.706@ahsoftware.de>

Le 30/10/2010 15:45, Alexander Holler a ?crit :
> 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.

You mean the rule is not respected for u-boot? then you should point out 
(or better yet, submit a patch to fix) parts of code which assume BSS is 
zero. Besides... U-boot *is* normal C (apart from the part before 
relocation where constraints prevent the use of any variable other than GD).

> 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.

As I said, out of courtesy.

Still, BSS zeroing does not seem to relate to what you witness. You're 
not reading a variable that you think should be zero; you're writing 
then reading a BSS variable, and find that you read something different 
from what you read.

BTW, can you add printfs() with the nand init functions to see where it 
writes? As it uses a pointer, if this pointer is not passed correctly 
for some reason, we'll be able to see.

> Regards,
>
> Alexander

Amicalement,
-- 
Albert.

  reply	other threads:[~2010-10-30 13:57 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-30 13:08 [U-Boot] arm: wrong Relocation and not cleared BSS Alexander Holler
2010-10-30 13:36 ` Albert ARIBAUD
2010-10-30 13:45   ` Alexander Holler
2010-10-30 13:57     ` Albert ARIBAUD [this message]
2010-10-30 14:07       ` Alexander Holler
2010-10-30 14:39       ` Wolfgang Denk
2010-10-30 16:01         ` Albert ARIBAUD
2010-10-30 16:10           ` Wolfgang Denk
2010-10-30 14:37     ` Wolfgang Denk
2010-10-30 14:36   ` Wolfgang Denk
2010-10-31 10:59     ` Alexander Holler
2010-10-31 11:58       ` Wolfgang Denk
2010-10-31 12:21         ` Albert ARIBAUD
2010-10-31 16:18         ` Alexander Holler
2010-10-30 15:00   ` Wolfgang Denk
2010-10-30 17:21     ` Albert ARIBAUD
2010-10-30 18:01       ` Wolfgang Denk
2010-10-31  7:44     ` Heiko Schocher
2010-10-30 15:15   ` Darius Augulis
2010-10-30 16:44     ` Albert ARIBAUD
2010-10-30 20:03     ` Alexander Holler
2010-10-30 20:51       ` Alexander Holler
2010-10-31  7:47         ` Heiko Schocher
2010-11-02  5:39           ` V, Aneesh
2010-11-02  5:58             ` V, Aneesh
2010-11-02  6:32               ` Albert ARIBAUD
2010-11-02  7:18                 ` V, Aneesh
2010-11-02  7:37                   ` [U-Boot] Bad page state in process 'swapper' sywang
2010-11-02  7:44                     ` Albert ARIBAUD
2010-11-02  8:13                       ` sywang
2010-11-02  8:44                         ` Wolfgang Denk
2010-11-02  8:40                     ` Wolfgang Denk
2010-11-03  2:29                       ` sywang
2010-11-02  7:41                   ` [U-Boot] arm: wrong Relocation and not cleared BSS Albert ARIBAUD
2010-11-02  8:53                     ` V, Aneesh
2010-11-02  9:04                       ` Albert ARIBAUD
2010-10-31  7:43 ` Heiko Schocher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CCC242C.8070303@free.fr \
    --to=albert.aribaud@free.fr \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.