This is the mail archive of the
mailing list for the binutils project.
why gcc/objdump not recognize binary object file format
- From: "Bridge Wu" <mingqiao dot wu at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 7 Jun 2006 15:36:58 +0800
- Subject: why gcc/objdump not recognize binary object file format
I got two ARM EABI toolchain and want to test their compatibility. One
is 3.4.4 (GCC version), the other is 4.1.0. The result is 4.1.0 can
link the binary code built by 3.4.4, but on the contrary, 3.4.4 cannot
recognize binary file format built by 4.1.0. Here is the result.
% arm-linux-gcc-3.4.4 -c t1.c
% arm-linux-gcc-4.1.0 -c t2.c
% arm-linux-gcc-3.4.4 t1.o t2.o
t2.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
% arm-linux-gcc-4.1.0 t1.o t2.o
objdump in toolchain-3.4.4 also cannot recognize the file format built
I took a look at the binutils source code. I found it's
bfd_check_format_matches that check the file format. If target type
is not explicitly speicifed, bfd_target_vector list will be traversed
to check which target is matched. It seems this check was failed, so
the "File format not recognized" error appeared. I found below macro
do the checking.
temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd));
But I didn't find abfd->xvec->_bfd_check_format for ARM. I cannot
know what happened in the bfd_check_format function. Any hints?