Illegal instruction on m68k nommu (solved. C and C++ now work.)
Lennart Sorensen
lsorense at csclub.uwaterloo.ca
Mon May 4 14:37:10 UTC 2009
On Mon, May 04, 2009 at 11:11:47AM +0100, Bernd Schmidt wrote:
> Lennart Sorensen wrote:
>> 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.
>
> Can you send me those errors? I removed this intentionally a long time
> ago, but given how much has changed since then I'm not sure we need this
> anymore.
... (line below 450 or so times)
ERROR: reloc type R_68K_GOT16O unsupported in this context
462 bad relocs
collect2: ld returned 1 exit status
And once I add in the one line change from the official elf2flt tree:
/*
* Only relocate things in the data sections if we are PIC/GOT.
* otherwise do text as well
*/
if (a->flags & SEC_CODE)
sectionp = text + (a->vma - text_vma);
else if (a->flags & SEC_DATA)
sectionp = data + (a->vma - data_vma);
else
continue;
becomes:
/*
* Only relocate things in the data sections if we are PIC/GOT.
* otherwise do text as well
*/
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);
else
continue;
And the errors go away and the code works perfectly.
--
Len Sorensen
More information about the uClibc
mailing list