Illegal instruction on m68k nommu

Lennart Sorensen lsorense at csclub.uwaterloo.ca
Mon Apr 20 18:39:06 UTC 2009


On Mon, Apr 20, 2009 at 01:46:50PM -0400, Lennart Sorensen wrote:
> Actually I find it interesting to look at blackfin's version of elf2flt.
> This particular CTOR/DTOR bug was fixed 2007-08-30, then reintroduced
> 2008-11-06 because someone grabbed changes from upstream, and then fixed
> again 2008-11-27.
> 
> This is exactly one of those things where locally kept patches would
> have saved a lot of trouble, since the difference between local and
> upstream would have clearly shown that removing the lines was a fix,
> and adding them back in on a future upstream merge would not happen
> since the patch would do a remove against a known base from upstream.
> 
> Possibly the use of a better version control system would take care of
> it too I suppose.
> 
> Either way this change ought to go upstream since it does fix m68k with
> gcc 4.3.

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

-- 
Len Sorensen


More information about the uClibc mailing list