public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: David Hearn <dave@swampie.org.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Setting entry point in u-boot standalone apps
Date: Wed, 19 Sep 2007 12:57:10 +0100	[thread overview]
Message-ID: <46F10E96.4050400@swampie.org.uk> (raw)
In-Reply-To: <47F3F98010FF784EBEE6526EAAB078D1024F86F9@tq-mailsrv.tq-net.de>

Martin Krause wrote:
> Hi David,
>
> u-boot-users-bounces at lists.sourceforge.net wrote on :
>   
>> I have a U-boot standalone app which runs on the Gumstix boards. 
>> It's based on the /u-boot-1.2.0/examples/ folder.  The problem I have
>> is that my entry 
>> function - lets call it app_entry() - isn't at the load address, it's
>> somewhere in the middle.  I'm using the output from objdump -d <elf
>>     
>
> This is a known issue, please look at:
> http://www.denx.de/wiki/view/DULG/MyStandaloneProgramDoesNotWork
>   

Very helpful - thanks for pointing that out.

>> Has anyone else experienced this problem, and can give any advice as
>> to 
>> how to solve it?
>>     
>
> You have to change your linker script. Tell the linker where it should
> place your entry point function (I'm no linker expert, so I couldn't 
> give you advice at this ...)
>
> Regards,
>
> Martin Krause
I've now started using a linker script which does the job.  The way I 
did it was to create a separate object file which just contained a 
single wrapper function which called my 'main' function.  This function 
would always be at the start of the resulting .o file, and this .o file 
was then specified as the first entry in the .text section.  
Consequently this wrapper function is now always at the start of my 
final binary file.

Thanks for the pointers, and the explanations regarding entry points and 
link locations.

David

  reply	other threads:[~2007-09-19 11:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18  8:56 [U-Boot-Users] Setting entry point in u-boot standalone apps David Hearn
2007-09-18  9:22 ` Martin Krause
2007-09-19 11:57   ` David Hearn [this message]
2007-09-18 19:07 ` Wolfgang Denk
2007-09-19 11:57   ` David Hearn

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=46F10E96.4050400@swampie.org.uk \
    --to=dave@swampie.org.uk \
    --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