Linking soft FP and hard FP in 2.12

Jan Vroonhof jan.vroonhof@insignia.com
Wed Jul 10 03:28:00 GMT 2002


[Please CC me, I read the list only via the archive]

I just upgraded to GNU ld version 2.12.90.0.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.

Any suggestions,

Thanks

Jan



More information about the Binutils mailing list