public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] How/Where does "_start" get assigned a value ?
Date: Sat, 12 Oct 2013 22:53:40 +0200	[thread overview]
Message-ID: <20131012225340.56729304@lilith> (raw)
In-Reply-To: <CAEtk5gdn5LE_styHvpRSnpx4F-oA4ZHGV8dV_vX7yPhGLgDiJg@mail.gmail.com>

Hi Djoker,

On Wed, 9 Oct 2013 16:02:43 -0700, Djoker <thelonejoker@gmail.com>
wrote:

> On Wed, Oct 9, 2013 at 12:54 PM, Arvid Brodin <arvid.brodin@xdin.com> wrote:
> > On 2013-10-09 18:07, djoker wrote:
> >> Hi Everyone,
> >>
> >> I have a armv7 board and am looking at the "_start" symbol address, using
> >> the following command:
> >> *nm u-boot | grep -w _start*
> >>
> >> It returned the following:
> >> *67000020 T _start*
> >>
> >> I couldn't help notice that the the _start value is very "close" in vlaue to
> >> the value of CONFIG_SYS_TEXT_BASE defined in my board file:
> >> *#define CONFIG_SYS_TEXT_BASE 0x67000004*
> >>
> >> But, I have searched through the source code, but not found where _start
> >> gets assigned a value.. Could someone please help me understand this ?
> >
> > This symbol is declared in arch/<...>/start.S, as the entry point for the
> > u-boot code, if I understand things correctly.
> >
> 
> Arvid, I know that the symbol is declared under that file.
> But, how is it getting assigned a value equal to or greater than
> CONFIG_SYS_TEXT_BASE ?
> Basically, I am seeing a similar issue as below:
> 
> u-boot.10912.n7.nabble.com/U-Boot-ARM-gap-between-start-and-CONFIG-SYS-TEXT-BASE-td4134.html#none
> 
> There really was no conclusion as to why the padding of 0's happened ?

That's a 2010 issue and it contains hardly enough information to know
what happened, considering the person who asked had modified the source
code to match unusual constraints, and could just as well have caused
the padding by his own changes.

Regarding your question, it is the linker which is responsible for
assigning addresses to symbols, and it does so based on a linker script
(.lds file) and on the object files provided to it. It will align
symbols if instructed to. In most, if not all, ARM cases, _start will
be equal to CONFIG_SYS_TEXT_BASE because the .lds file specifies that
the .text section of start.o be the first section output, and _start is
the first label in that section.

HTH.

Amicalement,
-- 
Albert.

  reply	other threads:[~2013-10-12 20:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 16:07 [U-Boot] How/Where does "_start" get assigned a value ? djoker
2013-10-09 19:54 ` Arvid Brodin
2013-10-09 23:02   ` Djoker
2013-10-12 20:53     ` Albert ARIBAUD [this message]
2013-10-09 22:55 ` djoker
2013-10-10 15:37 ` Gerhard Sittig
2013-10-12  0:30   ` Djoker
2013-10-13 14:26   ` Gerhard Sittig

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=20131012225340.56729304@lilith \
    --to=albert.u.boot@aribaud.net \
    --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