Embedded PowerPC

Hans - Dulimarta dulimart@egr.msu.edu
Thu Dec 2 13:27:00 GMT 1999

On Tue, 30 Nov 1999, Brendan Simon wrote:

> Date: Tue, 30 Nov 1999 10:39:56 +1100
> From: Brendan Simon <bsimon@ctam.com.au>
> To: Hans - Dulimarta <dulimart@egr.msu.edu>
> Cc: Cross GCC <crossgcc@sourceware.cygnus.com>
> Subject: Re: Embedded PowerPC
> Hans - Dulimarta wrote:
> > After successfully cross-compiling binutils-2.9.1, gcc-2.95.2, and
> > newlib-1.8.2 on my Linux RedHat 6.1, I tried to cross compile a very
> > simple C code [main() { int a; }].
> >
> > Without giving any '-m' option, the linker complained about 'missing
> > _start' and several unknown references from eabi.o. [My target of
> > cross compilation is powerpc-eabi].
> >
> > If I put one of '-msim, -mads, -myellowknife' options, the errors were
> > gone. However, when I tried to download the code to my PowerPC embedded
> > target (MPC555), the code did not seem to run.
> >
> > Could someone please tell me what is the use of the above '-m....'
> > options. I could not find any reference to the ADS, YellowKnife, etc in
> > the GCC info page.
> >
> > Also, how do I write a proper crt0.o for a new embedded target (i.e. what
> > instructions are supposed to be written inside crt0.o)?
> Check out newlib sources (I think in the libgloss directory).  Copy an existing
> crt0.S file and modify it to your liking.  You will not need to modify much as
> they are all pretty much standard with only a few board specific setups.
> You can create your own -m command eg. -mmyembeddedsystem by altering the specs
> file in $prefix/gcc/lib/gcc-lib/$target/$version/specs.  Alternatively you can
> just change the defaults for the specs file to be similar to the -mads
> specifications.  That is what I did.  Warning!! The specs file is very picky
> about extra newlines.  Make sure there is only one empty line between each
> statement in the specs file.
> Brendan Simon.

I am following your suggestion with a slight diversion. For the moment, I
ignore the startup code in crt0.S and try to tweak the ld script using
ENTRY(main). Also, to access some memory-mapped control registers on the
embedded target I declare an extern variable for each CR and later resolve
its address using the 'PROVIDE(symbol = addr)' option in the ld script.

I hope my diversion is not leading me to a dead end.

Hans Dulimarta, Ph.D.        dulimart@[egr.msu.edu, computer.org]
Visiting Research Associate,  Electrical & Computer Engineering
Michigan State University, East Lansing, MI 48824, (517) 432-7589

Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

More information about the crossgcc mailing list