
Martin Krause wrote:
Hi David,
u-boot-users-bounces@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