Can't Execute m68k Programs

Aaron J. Grier aaron@frye.com
Tue Sep 25 09:25:00 GMT 2001


On Tue, Sep 25, 2001 at 11:57:37AM -0400, Larry Gray wrote:

> My hello world program that uses printf generates an f-line exception.
> It is apparently trying to use hardware floating point calls even
> though I used -msoft-float. For the puts version, I get an illegal
> opcode, which appears to be in the memchr routine.

maybe the soft-float libc isn't getting linked properly?

> 	My host is Redhat 7.1, my target is a MC68332 board 
> running CPU32BUG. I believe I have the following installed correctly: 
> binutils-2.9.1, gcc-2.95.1, and newlib-1.8.2. 
>          I'm compiling with the following command:
> 
> m68k-coff-gcc -Wall -m68332 -mshort -msoft-float -c hello.c
> 
> I've modified the specs file to use bcc.ld and libbcc.a, I link with:
> 
> m68k-coff-gcc -Wall hello.o -o hello.s19
> 
> My questions:
> 1. Are there patches available for the versions of binutils, gcc, and newlib 
> that I'm using, for m68k code generation?

there are newer versions of each...  gcc 3 has known problems with m68k,
but gcc-2.95.4 should be OK.

> 2. Am I doing something wrong? I get no warnings or errors doing
> compiling, assembling, or linking.

what you are doing should work.

> 3. Is this a gcc or newlib problem?

it would appear the multilib stuff isn't getting properly linked.  if
you use iprintf() do things work as expected?  (aside from no floating
point?)  if you pass -t to the linker (-Wl,-t to gcc) it will show which
libraries you are linking against.

> 4. Is there a way to generate a complete listing file? One that has
> absolute addresses and assembly code? I can generate absolute
> addresses with m68-coff-nm, and individual assembly code by stopping
> gcc with -S. Is there a program that combines all these?

m68k-coff-objdump -S maybe?

-- 
  Aaron J. Grier  |   Frye Electronics, Tigard, OR   |  aaron@frye.com
     "In a few thousand years people will be scratching their heads
       wondering how on earth the first computer was invented and
          bootstrapped without a prior computer to do it with."
                    --  Chris Malcolm, on comp.arch

------
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