undefined reference to __fixdfdi

Dave Korn dave.korn@artimi.com
Wed Oct 4 12:07:00 GMT 2006

On 04 October 2006 12:04, Timur Elzhov wrote:

> I'm trying to port to Symbian OS (it runs on ARM) some C code that contains
> floating point numbers. For some mystery reason the low-level conversion
> functions like __fixdfdi do not get linked in by gcc from libgcc.a, because
> I know it's in there, I checked with `nm' (I found reports about that error
> in Internet, too).
> Ok, the question is not how to resolve that error in Symbian SDK (because
> it's surely far from the list topic), but what workaround could I provide?
> I defined the function
>   long long __fixdfdi(double),
> that converts double to int64, but got the same linkage error:
>   relocation truncated to fit: ARM_26 __fixdfdi
>   undefined reference to `__fixdfdi'

  The linkage error means your memory map is too big.

  On the ARM, there are only 26 bits in the branch instruction displacement
field.  I'm not an ARM expert, but assuming those branches are word-aligned
and the low two bits omitted, that would mean the destination has to be in a
range of plus or minus 128 megabytes from the branch instruction itself.

  The problem ld is reporting here is that the instruction that is calling
__fixdfdi is more than that distance away from __fixdfdi in the way your
memory map is laid out.  You may be able to work around this in the compiler;
for some targets, gcc knows how to load the address of a destination routine
into a register as if it were a large constant and call the function
indirectly through that register.

  Does your compiler support the "-mlong-calls" option?  If it does, compiling
your application using it should solve the problem and allow you to use the
proper libgcc version of __fixdfdi from the SDK, which would be preferable to
having to supply your own version I'm sure!

Can't think of a witty .sigline today....

For unsubscribe information see http://sourceware.org/lists.html#faq

More information about the crossgcc mailing list