public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Bridge Wu" <mingqiao.wu@gmail.com>
To: binutils@sourceware.org
Subject: why gcc/objdump not recognize binary object file format
Date: Wed, 07 Jun 2006 09:59:00 -0000	[thread overview]
Message-ID: <246188420606070036r49498b50i2476567ca76250c@mail.gmail.com> (raw)

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
[successful]

objdump in toolchain-3.4.4 also cannot recognize the file format built
by toolchain-4.1.0.

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?
Thanks.

-- 
best regards,
-Bridge

             reply	other threads:[~2006-06-07  7:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-07  9:59 Bridge Wu [this message]
2006-06-07 11:29 ` Nick Clifton
2006-06-07 14:07   ` Daniel Jacobowitz
2006-06-07 14:34     ` Bridge Wu
2006-06-07 14:27   ` Bridge Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=246188420606070036r49498b50i2476567ca76250c@mail.gmail.com \
    --to=mingqiao.wu@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).