From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Gehrlein Date: Wed, 25 Jun 2008 07:44:02 +0200 Subject: [U-Boot-Users] How to specify the starting function of a U-boot standalone application. In-Reply-To: <48616AED.50205@ruggedcom.com> References: <48616AED.50205@ruggedcom.com> Message-ID: <4861DB22.9090201@tqs.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi all, richardretanubun schrieb: > When I go go , the execution jumps straight to > do_func_info() and the application finishes. (which is just a bunch of > printf). > > How do I ensure that when compiled, the my_test.bin places the main > function at the "go" point? > > I have tried re-ordering the function bodies around, moving main as the > last function and thus removing all the function prototypes. > I tried name matching the "main" function to the file name, none seems > to help. I have the same problem. When I modify the source code the compiler may or may not rearrange the functions. It is not guaranteed, that the main function always starts at the same address. How can this be solved? Is it possible/meaningful to put the main function into a separate linker segment? Any suggestions? My temporary solution: Because I had to patch the U-Boot code, especially the API, anyway for my purposes, I decided to implement my test function as U-Boot command instead as standalone application. Best Regards, Jens