* Compiled for big endian target is little endian ld error
@ 2006-03-13 0:45 DSP
2006-03-13 10:11 ` Nick Clifton
0 siblings, 1 reply; 5+ messages in thread
From: DSP @ 2006-03-13 0:45 UTC (permalink / raw)
To: binutils
Hello,
I am having the same problem that Josh Fryman from this group had earlier.
http://sourceware.org/ml/binutils/2003-03/msg00092.html
I have a target that has Intel IXP425 on it. I am trying to port some code
developed using the commercial Timesys tools to be compiled using arm-linux
tools and was getting the same error that Josh mentioned in the above
thread.
[root@localhost phy_ctrl]# arm-linux-gcc arm_obj/main.o
arm_obj/dm256_reg_defs.o -o dm256_ctrl
/usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
arm_obj/main.o:
compiled for a big endian system and target is little endian
File in wrong format: failed to merge target specific data of file
arm_obj/main.o
When I used the -mbig-endian, I get a different error saying:
[root@localhost phy_ctrl]# arm-linux-gcc arm_obj/main.o
arm_obj/dm256_reg_defs.o -mbig-endian -o dm256_ctrl
/usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
ERROR: /usr /local/arm-linux/lib/be/libc.so.6 uses FPA instructions,
whereas dm256_ctrl does not
/usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
ERROR: /usr /local/arm-linux/lib/be/libc.so.6 uses hardware FP, whereas
dm256_ctrl uses soft ware FP
File in wrong format: failed to merge target specific data of
file /usr/local/ar m-linux/lib/be/libc.so.6
Can anyone lead me where the error is?
I installed arm-linux tools from arm-linux-tools-20031127.tar.gz
Thanks for your help.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Compiled for big endian target is little endian ld error
2006-03-13 0:45 Compiled for big endian target is little endian ld error DSP
@ 2006-03-13 10:11 ` Nick Clifton
2006-03-13 14:26 ` DSP
0 siblings, 1 reply; 5+ messages in thread
From: Nick Clifton @ 2006-03-13 10:11 UTC (permalink / raw)
To: DSP; +Cc: binutils
Hi DSP,
> When I used the -mbig-endian, I get a different error saying:
>
> [root@localhost phy_ctrl]# arm-linux-gcc arm_obj/main.o
> arm_obj/dm256_reg_defs.o -mbig-endian -o dm256_ctrl
> /usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
> ERROR: /usr /local/arm-linux/lib/be/libc.so.6 uses FPA instructions,
> whereas dm256_ctrl does not
> /usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
> ERROR: /usr /local/arm-linux/lib/be/libc.so.6 uses hardware FP, whereas
> dm256_ctrl uses software FP
Try compiling with both -mbig-endian and -mhard-float.
Cheers
Nick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Compiled for big endian target is little endian ld error
2006-03-13 10:11 ` Nick Clifton
@ 2006-03-13 14:26 ` DSP
2006-03-14 11:10 ` Nick Clifton
0 siblings, 1 reply; 5+ messages in thread
From: DSP @ 2006-03-13 14:26 UTC (permalink / raw)
To: Nick Clifton; +Cc: binutils
Thank you Nick for getting back to me.
I tried that option and it complains about some FPA and FP.
Here is the output:
[root@localhost phy_ctrl]# arm-linux-gcc arm_obj/main.o
arm_obj/dm256_reg_defs.o -mbig-endian -mhard-float -o dm256_ctrll
/usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
ERROR: /usr/local/arm-linux/lib/be/libc. so.6 uses FPA instructions,
whereas dm256_ctrl does not
/usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
ERROR: /usr/local/arm-linux/lib/be/libc. so.6 uses hardware FP,
whereas dm256_ctrl uses software FP
File in wrong format: failed to merge target specific data of file
/usr/local/arm-linux/lib/be/libc.so.6
/usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
ERROR: /usr/local/lib/gcc-lib/arm-linux/ 3.3.2/be/crtend.o uses FPA
instructions, whereas dm256_ctrl does not
/usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
ERROR: /usr/local/lib/gcc-lib/arm-linux/ 3.3.2/be/crtend.o uses
hardware FP, whereas dm256_ctrl uses software FP
File in wrong format: failed to merge target specific data of file
/usr/local/lib/gcc-lib/arm-linux/3.3.2/be/ crtend.o
/usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
ERROR: /usr/local/lib/gcc-lib/arm-linux/ 3.3.2/be/crtn.o uses FPA
instructions, whereas dm256_ctrl does not
/usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
ERROR: /usr/local/lib/gcc-lib/arm-linux/ 3.3.2/be/crtn.o uses hardware
FP, whereas dm256_ctrl uses software FP
File in wrong format: failed to merge target specific data of file
/usr/local/lib/gcc-lib/arm-linux/3.3.2/be/ crtn.o
collect2: ld returned 1 exit status
Thank you.
On 3/13/06, Nick Clifton <nickc@redhat.com> wrote:
> Hi DSP,
>
> > When I used the -mbig-endian, I get a different error saying:
> >
> > [root@localhost phy_ctrl]# arm-linux-gcc arm_obj/main.o
> > arm_obj/dm256_reg_defs.o -mbig-endian -o dm256_ctrl
> > /usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
> > ERROR: /usr /local/arm-linux/lib/be/libc.so.6 uses FPA instructions,
> > whereas dm256_ctrl does not
>
> > /usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
> > ERROR: /usr /local/arm-linux/lib/be/libc.so.6 uses hardware FP, whereas
> > dm256_ctrl uses software FP
>
> Try compiling with both -mbig-endian and -mhard-float.
>
> Cheers
> Nick
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Compiled for big endian target is little endian ld error
2006-03-13 14:26 ` DSP
@ 2006-03-14 11:10 ` Nick Clifton
2006-03-14 13:40 ` Paul Brook
0 siblings, 1 reply; 5+ messages in thread
From: Nick Clifton @ 2006-03-14 11:10 UTC (permalink / raw)
To: DSP; +Cc: binutils
Hi DSP,
> [root@localhost phy_ctrl]# arm-linux-gcc arm_obj/main.o
> arm_obj/dm256_reg_defs.o -mbig-endian -mhard-float -o dm256_ctrll
> /usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
> ERROR: /usr/local/arm-linux/lib/be/libc. so.6 uses FPA instructions,
> whereas dm256_ctrl does not
Ah - this is probably because the very first object file on the linker's
command line has not been compiled with -mhard-float. This file is
usually the crt0.o file - you can add the "-v" to the gcc command line
to find out.
The implication is that the toolchain you are using has not been built
with a set of hard-float multilibs, or that there is a bug in the linker
and it is choosing the wrong set of flags to set in the private header
of the dm256_ctrl output file. The latter seems more likely since you
have other error messages which imply that there are hard-float binaries
in the toolchain:
/usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
ERROR: /usr/local/lib/gcc-lib/arm-linux/ 3.3.2/be/crtn.o uses hardware
FP, whereas dm256_ctrl uses software FP
So - what to do ? First find out which file is the first object file on
the linker's command line and then check to see what private flags have
been set on this file (use "objdump -p"). If this file does have the
hard-float and FPA flags set then the problem must be the linker. Try
downloading the latest binutils sources (either the 2.16 release or from
the CVS mainline) ans building yourself a new linker. If the first file
has not been compiled with FPA support, then you could try finding the
sources for it and recompiling it.
Cheers
Nick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Compiled for big endian target is little endian ld error
2006-03-14 11:10 ` Nick Clifton
@ 2006-03-14 13:40 ` Paul Brook
0 siblings, 0 replies; 5+ messages in thread
From: Paul Brook @ 2006-03-14 13:40 UTC (permalink / raw)
To: binutils; +Cc: Nick Clifton, DSP
> The implication is that the toolchain you are using has not been built
> with a set of hard-float multilibs, or that there is a bug in the linker
> and it is choosing the wrong set of flags to set in the private header
> of the dm256_ctrl output file. The latter seems more likely since you
> have other error messages which imply that there are hard-float binaries
> in the toolchain:
>
> /usr/local/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
> ERROR: /usr/local/lib/gcc-lib/arm-linux/ 3.3.2/be/crtn.o uses hardware
> FP, whereas dm256_ctrl uses software FP
We saw this quite a bit before we switched to EABI based toolchains. It's
relatively easy to build a toolchain where gcc and gas have different
defaults. In particular the gas default FPU depends on the selected cpu. This
means that under normal circumstances things work, but objects are marked
incorrectly. If the user then explicitly specifies the default options (eg.
-mhard-float) this overrides the gas defaults, and makes it "incompatible"
with the existing objects.
The EABI toolchains don't suffer from this because the object attributes are
explicitly encoded in the assembly file.
Paul
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-03-14 13:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-13 0:45 Compiled for big endian target is little endian ld error DSP
2006-03-13 10:11 ` Nick Clifton
2006-03-13 14:26 ` DSP
2006-03-14 11:10 ` Nick Clifton
2006-03-14 13:40 ` Paul Brook
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).