From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] Trying to understand ARM926EJS/start.S
Date: Sat, 30 Oct 2010 20:54:28 +0200 [thread overview]
Message-ID: <4CCC69E4.8090103@free.fr> (raw)
In-Reply-To: <4CCC5F4D.20405@emk-elektronik.de>
Le 30/10/2010 20:09, Reinhard Meyer a ?crit :
> %%% both yield constants that are in TEXT and can be accessed
> %%% PC relative, right?
Constants, yes; in .text, yes; can be accessed pc-relative, yes, as any
other location in .text actually. But you probably meant "expected to be
accessed PC relative", in which case: yes.
> %%% adr reg, label sets reg to the address of label?
> %%% ldr reg, label sets reg to the content of mem at label?
Correct.
> ldr r2, _TEXT_BASE
> $$$ r2 is overwritten two lines below, right?
> ldr r3, _bss_start_ofs
> add r2, r0, r3 /* r2<- source end address */
Correct.
> ldr r0, _TEXT_BASE /* r0<- Text base */
> %%% why are we using _TEXT_BASE here and not _start?
Because we're accessing the relocation tables in the FLASH (or freshly
NAND-loaded) "source" copy of u-boot, not in the RAM "target" copy (in
which the relocation tables won't exist).
> ldr r3, _TEXT_BASE /* Text base */
> $$$ r3 is not used below this
If it is useless then it can be removed (but would not cause any issue).
Note that it may be used implicitly as the 3rd argument to a C function
call... But I don't think it is, no function called below uses 3
arguments I think.
> mov r4, r7 /* reloc addr */
> %%% why move it to r4? could we not add r7 in the next 2 lines?
We could indeed -- actually, we could probably otimize register usage in
other places too.
> bne clbss_l
> %%% this should better be blo, just in case _end is not aligned?
Correct. I thinought I'd sent a patch to fix all these... Seems I missed
some.
> %%% I cannot see anything here that would prevent BSS being cleared.
Neither do I -- if you think of Alexander's issue, I think it is not
related to BSS initialization.
> Best Regards,
> Reinhard
Amicalement,
--
Albert.
next prev parent reply other threads:[~2010-10-30 18:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-30 18:09 [U-Boot] Trying to understand ARM926EJS/start.S Reinhard Meyer
2010-10-30 18:54 ` Albert ARIBAUD [this message]
2010-10-30 19:21 ` Wolfgang Denk
2010-10-30 21:56 ` Albert ARIBAUD
2010-10-30 22:02 ` Albert ARIBAUD
2010-10-30 19:23 ` Reinhard Meyer
2010-10-30 19:30 ` Reinhard Meyer
2010-10-30 20:12 ` Wolfgang Denk
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=4CCC69E4.8090103@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox