Illegal instruction on m68k nommu (solved. C and C++ now work.)

David McCullough David_Mccullough at securecomputing.com
Mon Apr 20 23:47:04 UTC 2009


Jivin Lennart Sorensen lays it down ...
> On Mon, Apr 20, 2009 at 02:39:06PM -0400, Lennart Sorensen wrote:
> > I decided to try the blackfin version of elf2flt entirely, since it also
> > seems to have a fix for c++ support (not that I have any plans to use
> > c++), and it turns out, it is missing a single line fix in order to work
> > on m68k.  So if any blackfin maintainer wants to add this fix to their
> > elf2flt, then it will probably make it the best current elf2flt around.
> > It seems to be one of the very few things upstream elf2flt has that
> > blackfin does not yet have.  Without it, you get lots of errors about
> > GOT stuff.
> > 
> > diff -ruN elf2flt-blackfin20090420/elf2flt.c elf2flt-blackfin20090420.new/elf2flt.c
> > --- elf2flt-blackfin20090420/elf2flt.c	2009-04-20 18:35:10.000000000 +0000
> > +++ elf2flt-blackfin20090420.new/elf2flt.c	2009-04-20 18:26:33.000000000 +0000
> > @@ -435,7 +435,7 @@
> >  	 *	Only relocate things in the data sections if we are PIC/GOT.
> >  	 *	otherwise do text as well
> >  	 */
> > -	if (a->flags & SEC_CODE)
> > +	if (!pic_with_got && (a->flags & SEC_CODE))
> >  		sectionp = text + (a->vma - text_vma);
> >  	else if (a->flags & SEC_DATA)
> >  		sectionp = data + (a->vma - data_vma);
> 
> So for the record for anyone that cares, I have working C and C++
> support for coldfire (5270/5271 in my case) using:
> 
> 2009/04/20 checkout of elf2flt from blackfin.uclinux.org, with the above
> oneline patch.
> uClibc 0.9.30.1 (current stable release)
> linux 2.6.29 kernel (current stable release)
> binutils 2.19.1 (current stable release)
> gcc 4.3.3 (current stable release, with a 'const' fix to psignal in
>            gcc/strerror.c)
> 
> I use m68k-uclinux-gcc -msep-data -mcpu=5271 -Wl,-elf2flt

If someone wants to work up a patch for the uclinux.org version that
fixes this (but still has a configure option or something to allow it to
be used for older toolchains with busted CTOR/DTOR support) I will gladly
add it.

Not everyone using it is running gcc-4.3, linux-2.6, m68k or blackfin,  and
this is why it's not always easy getting patches changes back in.

If a patch is relatively easy to review and fairly obviously safe or in the
right direction,  it goes in :-)

As for the elf2flt version numbers,  they were previously done as
date-stamped releases shipped with toolchains off uclinux.org.  But I
haven't done anything with toolchains for some time,  and the CVS
version would be the "ideal" starting point unless you are looking
at old toolchains.

Cheers,
Davidm

-- 
David McCullough,  david_mccullough at securecomputing.com,  Ph:+61 734352815
McAfee - SnapGear  http://www.snapgear.com                http://www.uCdot.org


More information about the uClibc mailing list