Question: I have an embedded hardware system which contains a bootloader based on [ARMboot](http://armboot.sourceforge.net/) (which is very similar to Uboot and PPCboot).

This bootloader normally serves to load uClinux image from the flash. However, now I am trying to use this bootloader to run a standalone helloworld application, which does not require any linked library. Actually, it contains only `while(1){}` code in the main function.

My problem is that I cannot find out what GCC settings should I use in order to build a standalone properly formatted binary. 

I do use following build command:

```
cr16-elf-gcc -o helloworld helloworld.c -nostdlib

```

which produces warning message:   

**warning: cannot find entry symbol \_start; defaulting to 00000004**

Thereafter, within the bootloader, I upload a produced application and start it at some address:

```
tftpboot 0xa00000 helloworld
go 0xa00004

```

But it doesn't work :(
The system reboots. 

Normally it should just hang (because of `while(1)`).

Answer: 
I don't know that loader, but I think you should use objcopy like this to dump your executable data to a raw binary file. Don't jump to ELF headers, people :)

```
objcopy -O binary ./a.out o.bin

```

Also try to compile position independent code and to read ld and gcc manuals.
The linker is complaining about missing startup code.

You need to provide two things: startup code and a linker command file that defines the address map of your target processor.

In your case the startup code is as "bl main", but usually the startup code will initialize the stack pointer at least before branching to main.

If you know you are loading your example into RAM, you can start your program at main directly. You'll need to determine main()'s address ate use that for your "go" command.