From: Vermeulen Jan <Jan.Vermeulen@siemens.com>
To: 'Peter Barada' <peter@baradas.org>, gdb@sources.redhat.com
Cc: Peter.Barada@motorola.com
Subject: RE: How to build application to run under the ppc simulator?
Date: Wed, 09 Apr 2003 06:21:00 -0000 [thread overview]
Message-ID: <57FD2C3A246F76438CA6FDAD8FE9F19597E9D2@hrtades7.atea.be> (raw)
Peter,
> and it bombs with:
>
> >Program terminated with signal SIGSEGV, Segmentation fault.
> >The program no longer exists.
> >[Switching to process 0]
> >(gdb)
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
reference values.
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
${PREFIX}/${TARGET}/lib/ldscripts/elf32ppcsim.* files.
I hope this helps you a bit further,
Best regards,
Jan
next reply other threads:[~2003-04-09 6:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-09 6:21 Vermeulen Jan [this message]
2003-04-09 16:14 ` Peter Barada
-- strict thread matches above, loose matches on Subject: below --
2003-04-10 7:12 Vermeulen Jan
2003-04-10 6:02 Vermeulen Jan
2003-04-10 6:08 ` Peter Barada
2003-04-09 6:33 Vermeulen Jan
2003-04-09 4:40 Peter Barada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57FD2C3A246F76438CA6FDAD8FE9F19597E9D2@hrtades7.atea.be \
--to=jan.vermeulen@siemens.com \
--cc=Peter.Barada@motorola.com \
--cc=gdb@sources.redhat.com \
--cc=peter@baradas.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox