[U-Boot-Users] Setting entry point in u-boot standalone apps

David Hearn dave at swampie.org.uk
Wed Sep 19 13:57:10 CEST 2007


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





More information about the U-Boot mailing list