I isn't able to compile a simple hello_world with Cygwin (email fixed)

Till Straumann strauman at SLAC.Stanford.EDU
Tue Apr 15 16:12:14 UTC 2003

silverio.di at qem.it wrote:

-- snip --

> - launched compilator with:
>   $ m68k-rtems-gcc.exe hello_word.c
>   /opt/rtems/lib/gcc-lib/m68k-rtems/3.2.1/../../../../m68k-rtems/bin/ld:
> warning:cannot find entry symbol _start; defaulting to 80000074
> What I mistake ? Because I can't compile a so simple program ?

You obviously could compile the program. If you look at the warning message,
you'll see that it was 'ld', i.e. the linker which complained.

The reason being that the linker usually implicitely adds a couple of
extra object files when generating an executable. These extra objects
take care of starting up and initializing a 'program'. Ever wondered
how 'main' gets called? Or how C++ static constructors are invoked?
Well, that's the job of these highly platform dependent 'extra'
or 'startup' objects.

In the case of an embedded system like RTEMS, every BSP possibly
has a different way of initialization and hence the 'startup' objects
and the way they are linked together can be different.

Usually, every BSP comes with its own compiler 'spec' file and linker
script which must be used for a final link.

Furthermore, some boards may not be able to directly load and execute
an ELF executable but they require it to be converted to some other
format, to be compressed and packed with a small decompresser/loader

Consider that starting up an RTEMS application on an embedded system
is very different from starting an executable on a running general
purpose operating system. It's more like booting an OS.

Most BSPs (all?) define a canned command sequence 'make-exe' listing
all the necessary steps which you can find under


To ensure you use the correct 'spec' file, compiler flags and 'make-exe'
commands, you should consider using the RTEMS Makefile system rather
than directly invoking the compiler (<rtems_install_dir>/make/README)


-- Till

> Thank you very much

More information about the users mailing list