From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] ARM: Incorrect ROM protection range?
Date: Thu, 24 Feb 2011 09:07:03 +0100 [thread overview]
Message-ID: <4D6611A7.5050802@free.fr> (raw)
In-Reply-To: <AANLkTina_v4ku0+B4J3R06RDRS+dMNomhYY-oE9g7fDB@mail.gmail.com>
Le 24/02/2011 08:40, Po-Yu Chuang a ?crit :
> Hi Heiko,
>
> On Thu, Feb 24, 2011 at 3:33 PM, Heiko Schocher<hs@denx.de> wrote:
>> Albert ARIBAUD wrote:
>> The bin length is calculated in arch/arm/lib/board.c, but it seems
>> to me not correct ... :-(
>>
>> in board_init_f():
>>
>> gd->mon_len = _bss_end_ofs;
>>
>> that seems correct to me, but later in board_init_r()
>>
>> monitor_flash_len = _bss_start_ofs;
>>
>> which is used for example in ./drivers/mtd/cfi_flash.c for protecting
>> the flash sectors ... so this should be fixed.
Correct.
>>> In the U-Boot image itself, knowing the image size could be achieved in
>>> ARM by using a general _end symbol that would be set after the last
>>> image output section, so _end-_start would equal the image size.
>>
>> we have such a "_end" in u-boot.lds files.
I *knew* this name did not pop up in my mind without a reason. :)
Apologies for not having checked.
> I guess we need a __dynsym_end in all u-boot.lds files.
I'd rather go for "_end", which does not tie the solution to dynsym
being the last section in the image -- imagine for some reason we move
dynsym inside the image rather than at the end, end the image size will
be wrong again. With _end, and a suitable comment in the LD file... this
will be averted where-ever dynsym ends up.
After all, the bug you uncovered was due to using the wrong symbol, a
BSS related one rather than an image-related one, in the first place; so
let's try and learn from past mistakes.
> best regards,
> Po-Yu Chuang
Amicalement,
--
Albert.
next prev parent reply other threads:[~2011-02-24 8:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-24 6:06 [U-Boot] ARM: Incorrect ROM protection range? Po-Yu Chuang
2011-02-24 6:52 ` Albert ARIBAUD
2011-02-24 7:07 ` Wolfgang Denk
2011-02-24 7:11 ` Po-Yu Chuang
2011-02-24 7:33 ` Heiko Schocher
2011-02-24 7:40 ` Po-Yu Chuang
2011-02-24 8:07 ` Albert ARIBAUD [this message]
2011-02-24 9:39 ` Wolfgang Denk
2011-02-24 11:58 ` Albert ARIBAUD
2011-02-24 12:58 ` Po-Yu Chuang
2011-02-24 13:13 ` Albert ARIBAUD
2011-02-24 13:41 ` Wolfgang Denk
2011-02-24 16:01 ` Albert ARIBAUD
2011-02-24 18:38 ` Wolfgang Denk
2011-02-24 18:47 ` Albert ARIBAUD
2011-02-24 20:17 ` Wolfgang Denk
2011-02-25 2:41 ` Po-Yu Chuang
2011-02-25 6:34 ` Albert ARIBAUD
2011-02-25 7:15 ` Wolfgang Denk
2011-02-25 8:00 ` Po-Yu Chuang
2011-03-01 8:31 ` Po-Yu Chuang
2011-03-01 12:22 ` Albert ARIBAUD
2011-03-02 2:56 ` Po-Yu Chuang
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=4D6611A7.5050802@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.