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.
I operate on the ARM non-os non-lib all day every day. This is my current gcc options:

arm-whatever-gcc -Wall -O2 -nostdlib -nostartfiles -ffreestanding -c hello.c -o hello.o

then I use the linker to combine the C code with the vector tables and such, even if it is not an image that needs a vector table using a vector table makes it easy to put your entry point on the first instruction.