Ben Schmidtke <ben@xxxxxxxxxxxxxxxxxxx> wrote: > I'm trying to build a temperature control application that uses floating > point. Since this is a 68000 based system there is no hardware > floating point support. I can build my application (using > -msoft-float), but the floating point functions being called are > junk. I've looked at the source code for them, and they're > constructed with a pile of macros. I'm trying to understand where I'm > going wrong. As an example, the following function is one that gets > called from my routines: > 000174f4 <__ltdf2>: > 174f4: 4e56 0000 linkw %fp,#0 > 174f8: 4878 0001 pea 1 <ADD> > 174fc: 2f2e 0014 movel %fp@(20),%sp@- > 17500: 2f2e 0010 movel %fp@(16),%sp@- > 17504: 2f2e 000c movel %fp@(12),%sp@- > 17508: 2f2e 0008 movel %fp@(8),%sp@- > 1750c: 61ff bsrs 1750d > <__ltdf2+0x19> > 1750e: ffff .short 0xffff > 17510: fd94 .short 0xfd94 > 17512: 4e5e unlk %fp > 17514: 4e75 rts > 17516: 4e71 nop > Obviously, the 68000 isn't going to branch to an odd address. This is not a bsr.s but a bsr.l and thats an 68020 instruction! GAS has the 68020 as default architecture for m68k binutils targets. I am not familiar with the bare-metal m68k-elf GCC target, but I think it has the same default cpu as the assembler. Thus if you don't use -mcpu or -march= the compiler driver will pass -mcpu=68020 automatically. AFAIK m68k targets do accept --with-cpu= when configuring the compiler. Either build the compiler with that option or ensure that your build uses -mcpu=68000 or -m68000 (this is an alias for the earlier given -mcpu= option) when compiling _and_ linking. Regards,