From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11514 invoked by alias); 29 Mar 2007 19:50:22 -0000 Received: (qmail 11484 invoked by uid 22791); 29 Mar 2007 19:50:18 -0000 X-Spam-Check-By: sourceware.org Received: from w099.z064220152.sjc-ca.dsl.cnc.net (HELO bluesmobile.specifix.com) (64.220.152.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 29 Mar 2007 20:50:01 +0100 Received: from localhost.localdomain (bluesmobile.specifix.com [64.220.152.99]) by bluesmobile.specifix.com (Postfix) with ESMTP id EA9723B952; Thu, 29 Mar 2007 12:49:59 -0700 (PDT) Subject: Re: File not recognized in objdump!! From: Jim Wilson To: Aashish Gupta Cc: binutils@sourceware.org In-Reply-To: <2538a28f0703270024g632fea89s15cd614278ce0f7f@mail.gmail.com> References: <2538a28f0703252214y11a5fb55t5aab41af522580e0@mail.gmail.com> <1174939416.2811.5.camel@localhost.localdomain> <2538a28f0703270019o6033dfd9x58641e94ae68a1f@mail.gmail.com> <2538a28f0703270024g632fea89s15cd614278ce0f7f@mail.gmail.com> Content-Type: text/plain Date: Fri, 30 Mar 2007 14:51:00 -0000 Message-Id: <1175197223.2720.18.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 (2.6.3-1.fc5.5) Content-Transfer-Encoding: 7bit Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-03/txt/msg00443.txt.bz2 On Tue, 2007-03-27 at 12:54 +0530, Aashish Gupta wrote: > (gdb) run objdump > Starting program: /root/Desktop/binutils1/gas/as-new objdump > Breakpoint 6, as_perror (gripe=0x80d7638 "Selected target format '%s' unknown", > filename=0x80db2be "elf64-ia64-little") at messages.c:124 > ((Our target is elf64-ia64-big though ..?? and have made modification > accordingly..)) > 124 { > (gdb) break bfd_check_format_matches > Breakpoint 9 at 0x8088099: file format.c, line 118. > (gdb) n > 126 int saved_errno = errno; There are a lot of problems with what you are doing here. First of all, you are debugging the assembler, not objdump here. See the "starting program" line, and the fact that as_perror is an assembler routine. Also, you are running it incorrectly, as you passed the objdump binary to it. The assembler only accepts assembly source files as input. You need to be debugging the right program with the right input. You set the bfd_check_format_matches breakpoint after starting the program, and then typed next, which is not going to work. This will leave you where you are already stopped, which is in the as_perror function. This routine just prints out the error message, which is far too late to be useful. You need to set the breakpoint first, and then run the program. If you debug the right program, and the right function, you will see that it ends up calling the elf64_ia64_object_p function which Nick pointed you at. binutils is a large and complicated package. You will need to spend a lot more time learning how it works, and how to use basic tools like gdb, if you wish to be successful modifying it. -- Jim Wilson, GNU Tools Support, http://www.specifix.com