This is the mail archive of the
mailing list for the GDB project.
RE: How to build application to run under the ppc simulator?
- From: Vermeulen Jan <Jan dot Vermeulen at siemens dot com>
- To: 'Peter Barada' <peter at baradas dot org>, gdb at sources dot redhat dot com
- Cc: Peter dot Barada at motorola dot com
- Date: Wed, 9 Apr 2003 08:21:41 +0200
- Subject: RE: How to build application to run under the ppc simulator?
> and it bombs with:
> >Program terminated with signal SIGSEGV, Segmentation fault.
> >The program no longer exists.
> >[Switching to process 0]
This is quite normal, because your program is executed correctly and
executes an 'blr' instruction at the end of the main routine. This makes the
simulated CPU jump to what's currently in the link register, which can be
anything. There it will do crazy things untill it finally segfaults :)
If in doubt, just 'stepi' the program, watching the assembly be executed.
We use the ppc-sim for testing some algorithms to see if they spit out right
At the end of our main routine, we always put a 'while(1);' so it never
returns out of there (because where would it return to?? (unless you are
also simulating an operating system under which your test program is running
You could also write something to the simulated serial port to indicate that
your program is finished and then do the while(1).
This is what I know about the simulator. It works pretty good for us.
> I'm confused as to how I build/link a program to run under the
> simulator. My real goal is to extract from the ppc simulator what I
> need to build a coldfire simulator.
The way you build the powerpc program might be ok. You should check what
linker script is that's used as default.
(do 'ppc-eabi-ld --verbose' to display the default linkerscript)
If in doubt, use one of the linkerscript of the
I hope this helps you a bit further,