This is the mail archive of the
mailing list for the binutils project.
Linking soft FP and hard FP in 2.12
- From: Jan Vroonhof <jan dot vroonhof at insignia dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 10 Jul 2002 11:09:00 +0100
- Subject: Linking soft FP and hard FP in 2.12
[Please CC me, I read the list only via the archive]
I just upgraded to GNU ld version 18.104.22.168.7 20020423 built for linux-arm.
ld is now much more picky about not letting you mix binary formats.
This is nice in general as in the past I have lost quite of hair by accidently linking in
x86 and arm code.
Unfortunately it prevents us from linking one of our products (which
worked fine with older products) on arm-linux. The basic problem is that ld
now refuses to link softFP and hardFP together.
The errors look like this
/tmp> arm-linux-gcc -c -o hello.o -msoft-float helloarm.c
/tmp> arm-linux-gcc hello.o
/usr/lib/gcc-lib/arm-linux/3.1/../../../../arm-linux/bin/ld: ERROR: /usr/lib/gcc-lib/arm-linux/3.1/crtend.o uses hardware FP, whereas a.out uses software FP
File format not recognized: failed to merge target specific data of file /usr/lib/gcc-lib/arm-linux/3.1/crtend.o
/usr/lib/gcc-lib/arm-linux/3.1/../../../../arm-linux/bin/ld: ERROR: /usr/lib/gcc-lib/arm-linux/3.1/../../../../arm-linux/lib/crtn.o uses hardware FP, whereas a.out uses software FP
File format not recognized: failed to merge target specific data of file /usr/lib/gcc-lib/arm-linux/3.1/../../../../arm-linux/lib/crtn.o
collect2: ld returned 1 exit status
For various reasons (surprisingly one being speed) we compile our code
with softFP (and provide some of the gcc helper routines ourselves,
but that doesn't matter) and then link against the linux and gcc
libraries that are hardFP. In practice this works fine. This is
obvious as you can make softFP code look like code that does not use
any floating point at all, just uses a few strangely named functions.
So what I am looking for is an option to relax the checking done by ld
and do the link anyway. Thus far I haven't found any.