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

Lennart Sorensen lsorense at csclub.uwaterloo.ca
Mon Apr 20 18:47:08 UTC 2009


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

-- 
Len Sorensen


More information about the uClibc mailing list